nmrium 2.2.0 → 2.3.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/PredictionErrorsNotations.js +3 -3
- package/lib/component/1d/PredictionErrorsNotations.js.map +1 -1
- package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
- package/lib/component/1d/peaks/Peaks.js +2 -1
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts.map +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js.map +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js +1 -1
- package/lib/component/1d/ranges/AssignmentLabel.js.map +1 -1
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.d.ts +9 -0
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.d.ts.map +1 -0
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.js +138 -0
- package/lib/component/1d/ranges/FloatingRangeTablePreferencesModal.js.map +1 -0
- package/lib/component/1d/ranges/FloatingRanges.d.ts.map +1 -0
- package/lib/component/1d/ranges/FloatingRanges.js +362 -0
- package/lib/component/1d/ranges/FloatingRanges.js.map +1 -0
- package/lib/component/1d/ranges/Ranges.js +2 -2
- package/lib/component/1d/ranges/Ranges.js.map +1 -1
- package/lib/component/1d-2d/FieldEdition.d.ts +2 -2
- package/lib/component/1d-2d/FieldEdition.d.ts.map +1 -1
- package/lib/component/1d-2d/FieldEdition.js +2 -2
- package/lib/component/1d-2d/FieldEdition.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +7 -7
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/SVGTable.d.ts +5 -3
- package/lib/component/SVGTable.d.ts.map +1 -1
- package/lib/component/SVGTable.js +16 -16
- package/lib/component/SVGTable.js.map +1 -1
- package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
- package/lib/component/context/KeyModifierContext.js.map +1 -1
- package/lib/component/context/LoggerContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.js.map +1 -1
- package/lib/component/context/SortSpectraContext.d.ts.map +1 -1
- package/lib/component/context/SortSpectraContext.js.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.d.ts +2 -2
- package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +6 -9
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/elements/Button.d.ts.map +1 -1
- package/lib/component/elements/Button.js.map +1 -1
- package/lib/component/elements/Sections.d.ts.map +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/elements/TabTitle.d.ts.map +1 -1
- package/lib/component/elements/TabTitle.js +2 -2
- package/lib/component/elements/TabTitle.js.map +1 -1
- package/lib/component/elements/ToolbarPopoverItem.d.ts +1 -0
- package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
- package/lib/component/elements/ToolbarPopoverItem.js +10 -3
- package/lib/component/elements/ToolbarPopoverItem.js.map +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.d.ts.map +1 -1
- package/lib/component/elements/dropDownButton/DropDownButton.js +2 -2
- package/lib/component/elements/dropDownButton/DropDownButton.js.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.d.ts +1 -1
- package/lib/component/elements/export/ExportOptionsModal.d.ts.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.js +31 -110
- package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
- package/lib/component/elements/export/units.d.ts +0 -28
- package/lib/component/elements/export/units.d.ts.map +1 -1
- package/lib/component/elements/export/units.js +0 -5
- package/lib/component/elements/export/units.js.map +1 -1
- package/lib/component/elements/export/utilities/getExportOptions.d.ts.map +1 -1
- package/lib/component/elements/export/utilities/getExportOptions.js.map +1 -1
- package/lib/component/elements/print/pageSize.d.ts +1 -1
- package/lib/component/elements/print/pageSize.d.ts.map +1 -1
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/hooks/usePanelPreferences.d.ts +3 -3
- package/lib/component/hooks/usePanelPreferences.d.ts.map +1 -1
- package/lib/component/hooks/useTextMetrics.d.ts.map +1 -1
- package/lib/component/hooks/useTextMetrics.js +1 -0
- package/lib/component/hooks/useTextMetrics.js.map +1 -1
- package/lib/component/main/NMRiumViewer.js +1 -1
- package/lib/component/main/NMRiumViewer.js.map +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +2 -2
- package/lib/component/modal/EditPeakShapeModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.d.ts +2 -2
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +43 -35
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +4 -3
- package/lib/component/modal/editRange/EditRangeModal.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +2 -2
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +5 -5
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.js +3 -3
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +5 -5
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +5 -5
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +5 -5
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +5 -5
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts +14 -14
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.js +3 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js +3 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +30 -3
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +18 -18
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +11 -11
- package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesPreferences.js +22 -22
- package/lib/component/panels/RangesPanel/RangesPreferences.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +5 -4
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
- package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js +5 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/RenderAsHTML.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/RenderAsHTML.js +7 -4
- package/lib/component/panels/SpectraPanel/base/RenderAsHTML.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectrumName.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/SpectrumName.js +5 -1
- package/lib/component/panels/SpectraPanel/base/SpectrumName.js.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js +2 -2
- package/lib/component/panels/SpectraPanel/base/setting/SpectrumSetting.js.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts +3 -2
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts.map +1 -1
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +14 -8
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -1
- package/lib/component/panels/informationPanel/MixedValuesBadge.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/MixedValuesBadge.js +2 -2
- package/lib/component/panels/informationPanel/MixedValuesBadge.js.map +1 -1
- package/lib/component/panels/informationPanel/SpectraPicker.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/SpectraPicker.js +2 -2
- package/lib/component/panels/informationPanel/SpectraPicker.js.map +1 -1
- package/lib/component/reducer/actions/DomainActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DomainActions.js.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/FiltersActions.js.map +1 -1
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
- package/lib/component/reducer/actions/LoadAction.js.map +1 -1
- package/lib/component/reducer/helper/setRangesViewProperty.d.ts.map +1 -1
- package/lib/component/reducer/helper/setRangesViewProperty.js.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +35 -26
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +2 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/utilities/initWorkspace.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts +2 -2
- package/lib/component/reducer/preferences/utilities/mapWorkspaces.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts +2 -2
- package/lib/component/utility/export.d.ts.map +1 -1
- package/lib/component/utility/export.js +1 -0
- package/lib/component/utility/export.js.map +1 -1
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/constants/signalsKinds.d.ts +1 -2
- package/lib/data/constants/signalsKinds.d.ts.map +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +2 -2
- package/lib/data/matrixGeneration.d.ts.map +1 -1
- package/lib/data/matrixGeneration.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +30 -31
- package/src/component/1d/PredictionErrorsNotations.tsx +5 -4
- package/src/component/1d/peaks/Peaks.tsx +5 -2
- package/src/component/1d/peaks/usePeakShapesPath.ts +0 -1
- package/src/component/1d/ranges/AssignmentLabel.tsx +1 -1
- package/src/component/1d/ranges/FloatingRangeTablePreferencesModal.tsx +238 -0
- package/src/component/1d/ranges/FloatingRanges.tsx +529 -0
- package/src/component/1d/ranges/Ranges.tsx +2 -2
- package/src/component/1d-2d/FieldEdition.tsx +4 -4
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +8 -8
- package/src/component/2d/zones/SignalsGuideLines.tsx +1 -1
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +1 -1
- package/src/component/EventsTrackers/BrushTracker.tsx +1 -2
- package/src/component/SVGTable.tsx +35 -33
- package/src/component/context/KeyModifierContext.tsx +1 -2
- package/src/component/context/LoggerContext.tsx +1 -7
- package/src/component/context/SortSpectraContext.tsx +1 -3
- package/src/component/elements/ActionsButtonsPopover.tsx +12 -14
- package/src/component/elements/Button.tsx +1 -6
- package/src/component/elements/Sections.tsx +5 -3
- package/src/component/elements/TabTitle.tsx +7 -5
- package/src/component/elements/ToolbarPopoverItem.tsx +13 -2
- package/src/component/elements/dropDownButton/DropDownButton.tsx +7 -5
- package/src/component/elements/export/ExportOptionsModal.tsx +56 -276
- package/src/component/elements/export/units.ts +0 -6
- package/src/component/elements/export/utilities/getExportOptions.ts +1 -0
- package/src/component/elements/print/pageSize.ts +1 -1
- package/src/component/hooks/useExport.tsx +1 -3
- package/src/component/hooks/usePanelPreferences.ts +4 -4
- package/src/component/hooks/useTextMetrics.ts +1 -0
- package/src/component/main/NMRiumViewer.tsx +1 -1
- package/src/component/modal/EditPeakShapeModal.tsx +2 -2
- package/src/component/modal/SaveAsModal.tsx +89 -82
- package/src/component/modal/editRange/EditRangeModal.tsx +6 -4
- package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +3 -3
- package/src/component/modal/setting/WorkspaceItem.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/errors/context.tsx +3 -3
- package/src/component/modal/setting/tanstack_general_settings/errors/renderer.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +2 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.tsx +3 -2
- package/src/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.tsx +3 -2
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +41 -8
- package/src/component/panels/PeaksPanel/PeaksPreferences.tsx +18 -18
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +11 -11
- package/src/component/panels/RangesPanel/RangesHeader.tsx +1 -2
- package/src/component/panels/RangesPanel/RangesPanel.tsx +2 -2
- package/src/component/panels/RangesPanel/RangesPreferences.tsx +22 -22
- package/src/component/panels/RangesPanel/RangesTable.tsx +19 -17
- package/src/component/panels/RangesPanel/RangesTableRow.tsx +25 -25
- package/src/component/panels/SpectraPanel/SpectraTable.tsx +12 -1
- package/src/component/panels/SpectraPanel/base/RenderAsHTML.tsx +22 -4
- package/src/component/panels/SpectraPanel/base/SpectrumName.tsx +15 -6
- package/src/component/panels/SpectraPanel/base/setting/SpectrumSetting.tsx +3 -2
- package/src/component/panels/SummaryPanel/SummaryPanel.tsx +1 -5
- package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +17 -9
- package/src/component/panels/informationPanel/MixedValuesBadge.tsx +3 -2
- package/src/component/panels/informationPanel/SpectraPicker.tsx +12 -4
- package/src/component/panels/multipleAnalysisPanel/AnalysisChart.tsx +2 -2
- package/src/component/reducer/actions/DomainActions.ts +1 -4
- package/src/component/reducer/actions/FiltersActions.ts +1 -2
- package/src/component/reducer/actions/LoadAction.ts +1 -3
- package/src/component/reducer/helper/setRangesViewProperty.ts +1 -2
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +32 -19
- package/src/component/reducer/preferences/preferencesReducer.ts +2 -2
- package/src/component/reducer/preferences/utilities/initWorkspace.ts +2 -2
- package/src/component/reducer/preferences/utilities/mapWorkspaces.ts +2 -2
- package/src/component/toolbar/ToolTypes.ts +2 -2
- package/src/component/utility/export.ts +1 -0
- package/src/data/PredictionManager.ts +4 -6
- package/src/data/constants/signalsKinds.ts +1 -1
- package/src/data/data1d/multipleSpectraAnalysis.ts +2 -2
- package/src/data/matrixGeneration.ts +1 -5
- package/src/versionInfo.ts +1 -1
- package/lib/component/1d/FloatingRanges.d.ts.map +0 -1
- package/lib/component/1d/FloatingRanges.js +0 -263
- package/lib/component/1d/FloatingRanges.js.map +0 -1
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts +0 -17
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts.map +0 -1
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.js +0 -79
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.js.map +0 -1
- package/lib/component/elements/export/utilities/getModes.d.ts +0 -4
- package/lib/component/elements/export/utilities/getModes.d.ts.map +0 -1
- package/lib/component/elements/export/utilities/getModes.js +0 -11
- package/lib/component/elements/export/utilities/getModes.js.map +0 -1
- package/src/component/1d/FloatingRanges.tsx +0 -378
- package/src/component/elements/export/utilities/exportOptionValidationSchema.ts +0 -106
- package/src/component/elements/export/utilities/getModes.ts +0 -14
- /package/lib/component/1d/{FloatingRanges.d.ts → ranges/FloatingRanges.d.ts} +0 -0
|
@@ -1,45 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
RadioGroup,
|
|
6
|
-
SegmentedControl,
|
|
7
|
-
Tag,
|
|
8
|
-
} from '@blueprintjs/core';
|
|
9
|
-
import { yupResolver } from '@hookform/resolvers/yup';
|
|
10
|
-
import type {
|
|
11
|
-
AdvanceExportSettings,
|
|
12
|
-
BasicExportSettings,
|
|
13
|
-
ExportSettings,
|
|
14
|
-
} from '@zakodium/nmrium-core';
|
|
15
|
-
import { useEffect, useState } from 'react';
|
|
16
|
-
import { Controller, useForm } from 'react-hook-form';
|
|
1
|
+
import { DialogFooter } from '@blueprintjs/core';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { Button, Form, useForm } from 'react-science/ui';
|
|
4
|
+
import { z } from 'zod/v4';
|
|
17
5
|
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import type { LabelStyle } from '../Label.js';
|
|
21
|
-
import Label from '../Label.js';
|
|
22
|
-
import { NumberInput2Controller } from '../NumberInput2Controller.js';
|
|
23
|
-
import { Select2Controller } from '../Select2Controller.js';
|
|
6
|
+
import { ExportFields } from '../../modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx';
|
|
7
|
+
import { exportSettingsValidation } from '../../modal/setting/tanstack_general_settings/validation/export_tab_validation.ts';
|
|
24
8
|
import { StandardDialog } from '../StandardDialog.tsx';
|
|
25
|
-
import { StyledDialogBody } from '../StyledDialogBody.
|
|
26
|
-
import type { SizeItem } from '../print/pageSize.js';
|
|
27
|
-
import { getSizesList } from '../print/pageSize.js';
|
|
9
|
+
import { StyledDialogBody } from '../StyledDialogBody.tsx';
|
|
28
10
|
|
|
29
11
|
import type { BaseExportProps } from './ExportContent.js';
|
|
30
|
-
import {
|
|
31
|
-
import { useExportConfigurer } from './useExportConfigurer.js';
|
|
32
|
-
import { exportOptionValidationSchema } from './utilities/exportOptionValidationSchema.js';
|
|
33
|
-
import {
|
|
34
|
-
getExportDefaultOptions,
|
|
35
|
-
getExportDefaultOptionsByMode,
|
|
36
|
-
} from './utilities/getExportOptions.js';
|
|
37
|
-
import type { Mode } from './utilities/getModes.js';
|
|
38
|
-
import { MODES } from './utilities/getModes.js';
|
|
12
|
+
import { getExportDefaultOptions } from './utilities/getExportOptions.ts';
|
|
39
13
|
|
|
40
14
|
interface InnerExportOptionsModalProps extends BaseExportProps {
|
|
41
15
|
onCloseDialog: () => void;
|
|
42
|
-
confirmButtonText
|
|
16
|
+
confirmButtonText: string;
|
|
43
17
|
}
|
|
44
18
|
interface ExportOptionsModalProps extends InnerExportOptionsModalProps {
|
|
45
19
|
isOpen: boolean;
|
|
@@ -53,101 +27,36 @@ export function ExportOptionsModal(props: ExportOptionsModalProps) {
|
|
|
53
27
|
return <InnerExportOptionsModal {...otherProps} />;
|
|
54
28
|
}
|
|
55
29
|
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
width: '80px',
|
|
60
|
-
},
|
|
61
|
-
wrapper: {
|
|
62
|
-
display: 'flex',
|
|
63
|
-
justifyContent: 'flex-start',
|
|
64
|
-
},
|
|
65
|
-
container: { margin: '5px 0' },
|
|
66
|
-
};
|
|
30
|
+
const validator = z.object({
|
|
31
|
+
values: exportSettingsValidation,
|
|
32
|
+
});
|
|
67
33
|
|
|
68
34
|
function InnerExportOptionsModal(props: InnerExportOptionsModalProps) {
|
|
69
35
|
const {
|
|
70
36
|
onCloseDialog,
|
|
71
|
-
onExportOptionsChange,
|
|
72
37
|
confirmButtonText,
|
|
73
38
|
defaultExportOptions,
|
|
39
|
+
onExportOptionsChange,
|
|
74
40
|
} = props;
|
|
75
|
-
const defaultValues = getExportDefaultOptions(defaultExportOptions);
|
|
76
|
-
|
|
77
|
-
const [mode, setMode] = useState<Mode>(defaultValues.mode);
|
|
78
41
|
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
42
|
+
const values = useMemo(() => {
|
|
43
|
+
return exportSettingsValidation.encode(
|
|
44
|
+
getExportDefaultOptions(defaultExportOptions),
|
|
45
|
+
);
|
|
46
|
+
}, [defaultExportOptions]);
|
|
47
|
+
|
|
48
|
+
const form = useForm({
|
|
49
|
+
defaultValues: {
|
|
50
|
+
values,
|
|
51
|
+
},
|
|
52
|
+
validators: {
|
|
53
|
+
onDynamic: validator,
|
|
54
|
+
},
|
|
55
|
+
onSubmit: ({ value: { values } }) => {
|
|
56
|
+
const parsedValues = exportSettingsValidation.parse(values);
|
|
57
|
+
onExportOptionsChange(parsedValues);
|
|
58
|
+
},
|
|
82
59
|
});
|
|
83
|
-
const {
|
|
84
|
-
handleSubmit,
|
|
85
|
-
control,
|
|
86
|
-
watch,
|
|
87
|
-
setValue,
|
|
88
|
-
formState: { isValid, errors },
|
|
89
|
-
reset,
|
|
90
|
-
setFocus,
|
|
91
|
-
} = methods;
|
|
92
|
-
|
|
93
|
-
const watchSettings = watch();
|
|
94
|
-
const {
|
|
95
|
-
unit,
|
|
96
|
-
dpi = 0,
|
|
97
|
-
layout,
|
|
98
|
-
} = watchSettings as AdvanceExportSettings & BasicExportSettings;
|
|
99
|
-
const {
|
|
100
|
-
widthInPixel,
|
|
101
|
-
heightInPixel,
|
|
102
|
-
isAspectRatioEnabled,
|
|
103
|
-
changeDPI,
|
|
104
|
-
enableAspectRatio,
|
|
105
|
-
changeSize,
|
|
106
|
-
changeUnit,
|
|
107
|
-
} = useExportConfigurer(watchSettings);
|
|
108
|
-
|
|
109
|
-
let sizesList: SizeItem[] = [];
|
|
110
|
-
|
|
111
|
-
if (layout) {
|
|
112
|
-
sizesList = getSizesList(layout);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function handleChangeMode(mode: any) {
|
|
116
|
-
const options = defaultValues;
|
|
117
|
-
setMode(mode);
|
|
118
|
-
if (options.mode === mode) {
|
|
119
|
-
reset(defaultValues);
|
|
120
|
-
} else {
|
|
121
|
-
reset(getExportDefaultOptionsByMode(mode));
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
useEffect(() => {
|
|
126
|
-
const handleRenderComplete = () => {
|
|
127
|
-
setTimeout(() => {
|
|
128
|
-
if (mode === 'advance') {
|
|
129
|
-
setFocus('width');
|
|
130
|
-
} else {
|
|
131
|
-
setFocus('dpi');
|
|
132
|
-
}
|
|
133
|
-
}, 0);
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const handleKeyDown = (event: globalThis.KeyboardEvent) => {
|
|
137
|
-
if (event.key === 'Enter') {
|
|
138
|
-
void handleSubmit(onExportOptionsChange)();
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
globalThis.addEventListener('keydown', handleKeyDown);
|
|
143
|
-
|
|
144
|
-
const animationFrameId = requestAnimationFrame(handleRenderComplete);
|
|
145
|
-
|
|
146
|
-
return () => {
|
|
147
|
-
cancelAnimationFrame(animationFrameId);
|
|
148
|
-
globalThis.removeEventListener('keydown', handleKeyDown);
|
|
149
|
-
};
|
|
150
|
-
}, [handleSubmit, mode, onExportOptionsChange, setFocus]);
|
|
151
60
|
|
|
152
61
|
return (
|
|
153
62
|
<StandardDialog
|
|
@@ -158,165 +67,36 @@ function InnerExportOptionsModal(props: InnerExportOptionsModalProps) {
|
|
|
158
67
|
canEscapeKeyClose
|
|
159
68
|
autoFocus
|
|
160
69
|
>
|
|
161
|
-
<
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
70
|
+
<form.AppForm>
|
|
71
|
+
<Form
|
|
72
|
+
layout="inline"
|
|
73
|
+
noValidate
|
|
74
|
+
onSubmit={(event) => {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
void form.handleSubmit();
|
|
167
77
|
}}
|
|
168
78
|
>
|
|
169
|
-
<
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
79
|
+
<StyledDialogBody>
|
|
80
|
+
<ExportFields form={form} fields="values" />
|
|
81
|
+
</StyledDialogBody>
|
|
82
|
+
<DialogFooter
|
|
83
|
+
actions={
|
|
84
|
+
<>
|
|
85
|
+
<Button
|
|
86
|
+
variant="outlined"
|
|
87
|
+
intent="danger"
|
|
88
|
+
onClick={() => onCloseDialog?.()}
|
|
89
|
+
>
|
|
90
|
+
Cancel
|
|
91
|
+
</Button>
|
|
92
|
+
<form.SubmitButton intent="success">
|
|
93
|
+
{confirmButtonText}
|
|
94
|
+
</form.SubmitButton>
|
|
95
|
+
</>
|
|
182
96
|
}
|
|
183
|
-
>{`${widthInPixel} px x ${heightInPixel} px @ ${dpi}DPI`}</Tag>
|
|
184
|
-
</Label>
|
|
185
|
-
{mode === 'basic' && (
|
|
186
|
-
<>
|
|
187
|
-
<Label style={labelStyle} title="Size">
|
|
188
|
-
<Select2Controller
|
|
189
|
-
control={control}
|
|
190
|
-
name="size"
|
|
191
|
-
items={sizesList}
|
|
192
|
-
/>
|
|
193
|
-
</Label>
|
|
194
|
-
<Label style={labelStyle} title="Layout">
|
|
195
|
-
<Controller
|
|
196
|
-
name="layout"
|
|
197
|
-
control={control}
|
|
198
|
-
render={({ field }) => {
|
|
199
|
-
const { value, ref, ...otherFieldProps } = field;
|
|
200
|
-
return (
|
|
201
|
-
<RadioGroup
|
|
202
|
-
inline
|
|
203
|
-
selectedValue={value}
|
|
204
|
-
{...otherFieldProps}
|
|
205
|
-
>
|
|
206
|
-
<Radio label="Portrait" value="portrait" />
|
|
207
|
-
<Radio label="Landscape" value="landscape" />
|
|
208
|
-
</RadioGroup>
|
|
209
|
-
);
|
|
210
|
-
}}
|
|
211
|
-
/>
|
|
212
|
-
</Label>
|
|
213
|
-
</>
|
|
214
|
-
)}
|
|
215
|
-
{mode === 'advance' && (
|
|
216
|
-
<>
|
|
217
|
-
<Label style={labelStyle} title="Size">
|
|
218
|
-
<div style={{ display: 'flex', flexDirection: 'row' }}>
|
|
219
|
-
<NumberInput2Controller
|
|
220
|
-
name="width"
|
|
221
|
-
control={control}
|
|
222
|
-
style={{ width: 100 }}
|
|
223
|
-
rightElement={<Tag>{unit}</Tag>}
|
|
224
|
-
controllerProps={{ rules: { required: true } }}
|
|
225
|
-
transformValue={(value) => {
|
|
226
|
-
const newHeight = changeSize(value, 'height', 'width');
|
|
227
|
-
setValue('height', newHeight);
|
|
228
|
-
return value;
|
|
229
|
-
}}
|
|
230
|
-
debounceTime={250}
|
|
231
|
-
placeholder="width"
|
|
232
|
-
/>
|
|
233
|
-
<div style={{ padding: '0px 5px' }}>
|
|
234
|
-
<Button
|
|
235
|
-
icon="link"
|
|
236
|
-
variant="minimal"
|
|
237
|
-
active={isAspectRatioEnabled}
|
|
238
|
-
onClick={() => {
|
|
239
|
-
enableAspectRatio((prevFlag) => !prevFlag);
|
|
240
|
-
}}
|
|
241
|
-
/>
|
|
242
|
-
</div>
|
|
243
|
-
<NumberInput2Controller
|
|
244
|
-
name="height"
|
|
245
|
-
control={control}
|
|
246
|
-
style={{ width: 100 }}
|
|
247
|
-
rightElement={<Tag>{unit}</Tag>}
|
|
248
|
-
controllerProps={{ rules: { required: true } }}
|
|
249
|
-
transformValue={(value) => {
|
|
250
|
-
const newWidth = changeSize(value, 'width', 'height');
|
|
251
|
-
setValue('width', newWidth);
|
|
252
|
-
return value;
|
|
253
|
-
}}
|
|
254
|
-
debounceTime={250}
|
|
255
|
-
placeholder="height"
|
|
256
|
-
/>
|
|
257
|
-
</div>
|
|
258
|
-
</Label>
|
|
259
|
-
<Label style={labelStyle} title="Units">
|
|
260
|
-
<Select2Controller
|
|
261
|
-
control={control}
|
|
262
|
-
name="unit"
|
|
263
|
-
itemTextKey="name"
|
|
264
|
-
itemValueKey="unit"
|
|
265
|
-
items={units}
|
|
266
|
-
onItemSelect={({ unit }) => {
|
|
267
|
-
const newSize = changeUnit({ unit });
|
|
268
|
-
setValue('width', newSize.width);
|
|
269
|
-
setValue('height', newSize.height);
|
|
270
|
-
}}
|
|
271
|
-
/>
|
|
272
|
-
</Label>
|
|
273
|
-
</>
|
|
274
|
-
)}
|
|
275
|
-
<Label style={labelStyle} title="DPI">
|
|
276
|
-
<NumberInput2Controller
|
|
277
|
-
name="dpi"
|
|
278
|
-
control={control}
|
|
279
|
-
style={{ width: 100 }}
|
|
280
|
-
controllerProps={{ rules: { required: true } }}
|
|
281
|
-
transformValue={(value) => {
|
|
282
|
-
if (unit === 'px') {
|
|
283
|
-
const convertedValue = changeDPI(value);
|
|
284
|
-
setValue('width', convertedValue.width);
|
|
285
|
-
setValue('height', convertedValue.height);
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
return value;
|
|
289
|
-
}}
|
|
290
|
-
debounceTime={250}
|
|
291
|
-
placeholder="DPI"
|
|
292
|
-
/>
|
|
293
|
-
</Label>
|
|
294
|
-
</StyledDialogBody>
|
|
295
|
-
<DialogFooter>
|
|
296
|
-
<div
|
|
297
|
-
style={{
|
|
298
|
-
display: 'flex',
|
|
299
|
-
justifyContent: 'space-between',
|
|
300
|
-
alignItems: 'baseline',
|
|
301
|
-
}}
|
|
302
|
-
>
|
|
303
|
-
<CheckController
|
|
304
|
-
control={control}
|
|
305
|
-
name="useDefaultSettings"
|
|
306
|
-
style={{ fontSize: '12px' }}
|
|
307
|
-
label="Don't show options dialog next time and use those settings"
|
|
308
|
-
/>
|
|
309
|
-
|
|
310
|
-
<ActionButtons
|
|
311
|
-
style={{ flexDirection: 'row-reverse', margin: 0 }}
|
|
312
|
-
onDone={() => {
|
|
313
|
-
void handleSubmit(onExportOptionsChange)();
|
|
314
|
-
}}
|
|
315
|
-
doneLabel={confirmButtonText}
|
|
316
|
-
onCancel={() => onCloseDialog?.()}
|
|
317
97
|
/>
|
|
318
|
-
</
|
|
319
|
-
</
|
|
98
|
+
</Form>
|
|
99
|
+
</form.AppForm>
|
|
320
100
|
</StandardDialog>
|
|
321
101
|
);
|
|
322
102
|
}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
import type { Unit } from '@zakodium/nmrium-core';
|
|
2
|
-
import { units as baseUnits } from '@zakodium/nmrium-core';
|
|
3
2
|
|
|
4
3
|
import { roundNumber } from '../../utility/roundNumber.js';
|
|
5
4
|
|
|
6
|
-
export const units = baseUnits.map((unit) => ({
|
|
7
|
-
...unit,
|
|
8
|
-
name: unit.name[0].toUpperCase() + unit.name.slice(1),
|
|
9
|
-
}));
|
|
10
|
-
|
|
11
5
|
const conversionFactors: Record<Unit, number> = {
|
|
12
6
|
in: 1, // inches
|
|
13
7
|
ft: 12, // 1 foot = 12 inches
|
|
@@ -50,6 +50,7 @@ export function getExportDefaultOptions(options?: ExportSettings) {
|
|
|
50
50
|
|
|
51
51
|
return options || INITIAL_ADVANCE_EXPORT_OPTIONS;
|
|
52
52
|
}
|
|
53
|
+
|
|
53
54
|
export function getExportDefaultOptionsByMode(mode: 'basic' | 'advance') {
|
|
54
55
|
if (mode === 'basic') {
|
|
55
56
|
return INITIAL_BASIC_EXPORT_OPTIONS;
|
|
@@ -13,9 +13,7 @@ import { saveAs } from '../utility/save_as.js';
|
|
|
13
13
|
import { useCreateNmriumZip } from './useCreateNmriumZip.ts';
|
|
14
14
|
|
|
15
15
|
type DataType =
|
|
16
|
-
| '
|
|
17
|
-
| 'SELF_CONTAINED'
|
|
18
|
-
| 'SELF_CONTAINED_EXTERNAL_DATASOURCE';
|
|
16
|
+
'NO_DATA' | 'SELF_CONTAINED' | 'SELF_CONTAINED_EXTERNAL_DATASOURCE';
|
|
19
17
|
|
|
20
18
|
export interface SaveIncludeOptions {
|
|
21
19
|
settings: boolean;
|
|
@@ -2,8 +2,8 @@ import type {
|
|
|
2
2
|
MatrixGenerationOptions,
|
|
3
3
|
MultipleSpectraAnalysisPreferences,
|
|
4
4
|
PanelsPreferences,
|
|
5
|
-
WorkSpacePanelPreferences,
|
|
6
5
|
Workspace,
|
|
6
|
+
WorkspacePanelPreferences,
|
|
7
7
|
} from '@zakodium/nmrium-core';
|
|
8
8
|
import has from 'lodash/has.js';
|
|
9
9
|
import { useMemo } from 'react';
|
|
@@ -128,15 +128,15 @@ export function usePanelPreferences<T extends Panel>(
|
|
|
128
128
|
? MatrixGenerationOptions
|
|
129
129
|
: T extends 'multipleSpectraAnalysis'
|
|
130
130
|
? MultipleSpectraAnalysisPreferences
|
|
131
|
-
:
|
|
131
|
+
: WorkspacePanelPreferences[T];
|
|
132
132
|
export function usePanelPreferences<T extends 'database' | 'prediction'>(
|
|
133
133
|
panelKey: T,
|
|
134
|
-
):
|
|
134
|
+
): WorkspacePanelPreferences[T];
|
|
135
135
|
|
|
136
136
|
export function usePanelPreferences<T extends Panel>(
|
|
137
137
|
panelKey: T,
|
|
138
138
|
nucleus?: string,
|
|
139
|
-
):
|
|
139
|
+
): WorkspacePanelPreferences[T] {
|
|
140
140
|
const { current } = usePreferences();
|
|
141
141
|
return useMemo(() => {
|
|
142
142
|
return getPanelPreferences(current, panelKey, nucleus);
|
|
@@ -2,9 +2,9 @@ import type { CSSProperties, RefObject } from 'react';
|
|
|
2
2
|
import { useDeferredValue, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
import { FloatPublicationString } from '../1d/FloatPublicationString.js';
|
|
5
|
-
import { FloatingRanges } from '../1d/FloatingRanges.js';
|
|
6
5
|
import { Viewer1D } from '../1d/Viewer1D.js';
|
|
7
6
|
import { SpectraInsets } from '../1d/inset/SpectraInsets.js';
|
|
7
|
+
import { FloatingRanges } from '../1d/ranges/FloatingRanges.tsx';
|
|
8
8
|
import { FloatMolecules } from '../1d-2d/components/FloatMoleculeStructures/FloatMolecules.js';
|
|
9
9
|
import { SVGRootContainer } from '../1d-2d/components/SVGRootContainer.js';
|
|
10
10
|
import Viewer2D from '../2d/Viewer2D.js';
|
|
@@ -97,7 +97,7 @@ function InnerEditPeakShapeModal(props: Required<EditPeakShapeModalProps>) {
|
|
|
97
97
|
const { peak, onCloseDialog } = props;
|
|
98
98
|
const dispatch = useDispatch();
|
|
99
99
|
const activeTab = useActiveNucleusTab();
|
|
100
|
-
const
|
|
100
|
+
const { tablePreferences } = usePanelPreferences('peaks', activeTab);
|
|
101
101
|
|
|
102
102
|
const [kind, setKind] = useState<Kind>(peak.shape?.kind || 'gaussian');
|
|
103
103
|
const { handleSubmit, control, reset } = useForm<Shape>({
|
|
@@ -125,7 +125,7 @@ function InnerEditPeakShapeModal(props: Required<EditPeakShapeModalProps>) {
|
|
|
125
125
|
setKind(value);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
const valuePPM = formatNumber(peak.x,
|
|
128
|
+
const valuePPM = formatNumber(peak.x, tablePreferences.deltaPPM.format);
|
|
129
129
|
|
|
130
130
|
return (
|
|
131
131
|
<StandardDialog
|