nmrium 0.42.0 → 0.43.1-pre.1692874523
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/ApodizationLine.js +1 -1
- package/lib/component/1d/Chart1D.js +3 -2
- package/lib/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib/component/1d/Line.js +1 -1
- package/lib/component/1d/Viewer1D.js +15 -3
- package/lib/component/1d/integral/IntegralResizable.js +4 -3
- package/lib/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib/component/1d/peaks/PeakAnnotations.js +20 -25
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts +2 -0
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +59 -0
- package/lib/component/1d/peaks/PeakEditionManager.d.ts +18 -0
- package/lib/component/1d/peaks/PeakEditionManager.js +98 -0
- package/lib/component/1d/peaks/Peaks.d.ts +1 -0
- package/lib/component/1d/peaks/Peaks.js +22 -0
- package/lib/component/1d/ranges/Range.js +3 -1
- package/lib/component/1d/tool/BaseLineZones.d.ts +1 -1
- package/lib/component/1d/tool/BaseLineZones.js +11 -31
- package/lib/component/1d/utilities/intersectionResolver.d.ts +25 -0
- package/lib/component/1d/utilities/intersectionResolver.js +71 -0
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -2
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib/component/1d-2d/components/FloatMoleculeStructures/index.d.ts +2 -2
- package/lib/component/2d/SlicingView.js +1 -1
- package/lib/component/2d/Viewer2D.js +1 -3
- package/lib/component/2d/ft/Contours.js +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +5 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +48 -8
- package/lib/component/assignment/index.d.ts +6 -1
- package/lib/component/assignment/index.js +5 -1
- package/lib/component/context/DispatchContext.d.ts +3 -2
- package/lib/component/context/KeyModifierContext.d.ts +13 -0
- package/lib/component/context/KeyModifierContext.js +39 -0
- package/lib/component/context/PreferencesContext.d.ts +39 -39
- package/lib/component/elements/Button.js +2 -0
- package/lib/component/elements/CounterLabel.d.ts +7 -0
- package/lib/component/elements/CounterLabel.js +12 -0
- package/lib/component/elements/EditableColumn.js +12 -6
- package/lib/component/elements/Input.d.ts +3 -12
- package/lib/component/elements/Input.js +24 -76
- package/lib/component/elements/Message.js +0 -1
- package/lib/component/elements/NumberInput.d.ts +1 -0
- package/lib/component/elements/NumberInput.js +10 -3
- package/lib/component/elements/PreferencesButton.d.ts +4 -0
- package/lib/component/elements/PreferencesButton.js +6 -0
- package/lib/component/elements/formik/FormikInput.d.ts +2 -2
- package/lib/component/elements/formik/FormikInput.js +3 -6
- package/lib/component/elements/formik/FormikOnChange.js +1 -1
- package/lib/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib/component/header/BaseLineCorrectionPanel.js +31 -10
- package/lib/component/header/Header.d.ts +10 -3
- package/lib/component/header/Header.js +6 -6
- package/lib/component/header/ZeroFillingOptionsPanel.js +37 -31
- package/lib/component/highlight/index.d.ts +1 -0
- package/lib/component/highlight/index.js +1 -0
- package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib/component/hooks/useResizerStatus.d.ts +2 -0
- package/lib/component/hooks/useResizerStatus.js +7 -0
- package/lib/component/hooks/useSpectrum.js +1 -1
- package/lib/component/main/ErrorOverlay.js +20 -0
- package/lib/component/main/InnerNMRium.d.ts +7 -0
- package/lib/component/main/InnerNMRium.js +52 -0
- package/lib/component/main/InnerNMRiumContents.d.ts +14 -0
- package/lib/component/main/InnerNMRiumContents.js +88 -0
- package/lib/component/main/NMRium.d.ts +23 -0
- package/lib/component/main/NMRium.js +13 -0
- package/lib/component/main/NMRiumStateProvider.d.ts +9 -0
- package/lib/component/main/NMRiumStateProvider.js +74 -0
- package/lib/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib/component/main/StateError.d.ts +4 -0
- package/lib/component/main/StateError.js +16 -0
- package/lib/component/main/index.d.ts +3 -0
- package/lib/component/main/index.js +3 -0
- package/lib/component/main/types.d.ts +18 -0
- package/lib/component/main/types.js +2 -0
- package/lib/component/modal/AlignSpectraModal.js +78 -29
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts +5 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +12 -15
- package/lib/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib/component/modal/PredictSpectraModal.js +1 -1
- package/lib/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib/component/modal/aboutUs/AboutUsZakodium.d.ts +1 -0
- package/lib/component/modal/aboutUs/AboutUsZakodium.js +33 -0
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts +5 -16
- package/lib/component/modal/changeSum/ChangeSumModal.js +6 -115
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +18 -0
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +94 -0
- package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib/component/modal/setting/GeneralSettings.js +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +1 -1
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib/component/modal/setting/settingsValidation.js +5 -1
- package/lib/component/panels/InformationPanel.js +9 -100
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -11
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +3 -9
- package/lib/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts +13 -9
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +5 -5
- package/lib/component/panels/Panels.js +6 -7
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +11 -5
- package/lib/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +6 -10
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +6 -6
- package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -3
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -3
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +8 -9
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts +18 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +18 -0
- package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +53 -0
- package/lib/component/panels/header/DefaultPanelHeader.d.ts +3 -4
- package/lib/component/panels/header/DefaultPanelHeader.js +11 -13
- package/lib/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib/component/reducer/IgnoreActions.js +1 -1
- package/lib/component/reducer/Reducer.d.ts +3 -8
- package/lib/component/reducer/Reducer.js +34 -8
- package/lib/component/reducer/actions/DomainActions.js +2 -3
- package/lib/component/reducer/actions/FiltersActions.d.ts +32 -11
- package/lib/component/reducer/actions/FiltersActions.js +96 -28
- package/lib/component/reducer/actions/IntegralsActions.d.ts +6 -2
- package/lib/component/reducer/actions/IntegralsActions.js +44 -20
- package/lib/component/reducer/actions/MoleculeActions.js +4 -4
- package/lib/component/reducer/actions/PeaksActions.d.ts +6 -4
- package/lib/component/reducer/actions/PeaksActions.js +19 -1
- package/lib/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib/component/reducer/actions/RangesActions.d.ts +6 -2
- package/lib/component/reducer/actions/RangesActions.js +31 -3
- package/lib/component/reducer/actions/ToolsActions.js +10 -10
- package/lib/component/reducer/core/Constants.d.ts +0 -4
- package/lib/component/reducer/core/Constants.js +0 -5
- package/lib/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +1 -1
- package/lib/component/reducer/preferences/utilities/getPreferencesByWorkspace.d.ts +1 -1
- package/lib/component/toolbar/FunctionToolBar.js +13 -3
- package/lib/component/toolbar/ToolTypes.d.ts +3 -2
- package/lib/component/toolbar/ToolTypes.js +57 -22
- package/lib/component/utility/export.js +7 -4
- package/lib/component/utility/filterType.d.ts +3 -0
- package/lib/component/utility/filterType.js +1 -0
- package/lib/component/workspaces/basic.js +2 -0
- package/lib/component/workspaces/embedded.js +2 -0
- package/lib/component/workspaces/exercise.js +2 -0
- package/lib/component/workspaces/prediction.js +9 -0
- package/lib/component/workspaces/process1D.js +2 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib/data/PredictionManager.d.ts +3 -3
- package/lib/data/PredictionManager.js +10 -10
- package/lib/data/constants/References.d.ts +5 -3
- package/lib/data/data1d/Spectrum1D/getReferenceShift.d.ts +10 -1
- package/lib/data/data1d/Spectrum1D/ranges/addRange.d.ts +1 -2
- package/lib/data/data1d/Spectrum1D/ranges/addRange.js +2 -8
- package/lib/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib/data/molecules/Molecule.js +2 -2
- package/lib/data/utilities/checkModifierKeyActivated.d.ts +1 -1
- package/lib/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib/versionInfo.js +1 -1
- package/lib-cjs/component/1d/ApodizationLine.js +1 -1
- package/lib-cjs/component/1d/Chart1D.js +3 -2
- package/lib-cjs/component/1d/ExclusionZonesAnnotations.js +1 -2
- package/lib-cjs/component/1d/Line.js +1 -1
- package/lib-cjs/component/1d/Viewer1D.js +15 -3
- package/lib-cjs/component/1d/integral/IntegralResizable.js +4 -3
- package/lib-cjs/component/1d/multiAnalysis/AnalysisRange.js +3 -1
- package/lib-cjs/component/1d/peaks/PeakAnnotations.js +19 -24
- package/lib-cjs/component/1d/peaks/PeakAnnotationsSpreadMode.js +64 -0
- package/lib-cjs/component/1d/peaks/PeakEditionManager.js +129 -0
- package/lib-cjs/component/1d/peaks/Peaks.js +29 -0
- package/lib-cjs/component/1d/ranges/Range.js +3 -1
- package/lib-cjs/component/1d/tool/BaseLineZones.js +11 -34
- package/lib-cjs/component/1d/utilities/intersectionResolver.js +75 -0
- package/lib-cjs/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +17 -16
- package/lib-cjs/component/2d/SlicingView.js +1 -1
- package/lib-cjs/component/2d/Viewer2D.js +1 -3
- package/lib-cjs/component/2d/ft/Contours.js +1 -1
- package/lib-cjs/component/EventsTrackers/KeysListenerTracker.js +47 -7
- package/lib-cjs/component/assignment/index.js +5 -1
- package/lib-cjs/component/context/KeyModifierContext.js +44 -0
- package/lib-cjs/component/elements/Button.js +2 -0
- package/lib-cjs/component/elements/CounterLabel.js +16 -0
- package/lib-cjs/component/elements/EditableColumn.js +12 -6
- package/lib-cjs/component/elements/Input.js +23 -75
- package/lib-cjs/component/elements/Message.js +0 -1
- package/lib-cjs/component/elements/NumberInput.js +12 -2
- package/lib-cjs/component/elements/PreferencesButton.js +13 -0
- package/lib-cjs/component/elements/formik/FormikInput.js +3 -6
- package/lib-cjs/component/elements/formik/FormikOnChange.js +1 -1
- package/lib-cjs/component/elements/popup/Modal/ConfirmDialog.js +1 -1
- package/lib-cjs/component/header/ApodizationOptionsPanel.js +23 -14
- package/lib-cjs/component/header/BaseLineCorrectionPanel.js +30 -9
- package/lib-cjs/component/header/Header.js +6 -6
- package/lib-cjs/component/header/ZeroFillingOptionsPanel.js +35 -29
- package/lib-cjs/component/highlight/index.js +1 -0
- package/lib-cjs/component/hooks/useActiveSpectrumPeaksViewState.js +1 -0
- package/lib-cjs/component/hooks/useCheckToolsVisibility.js +7 -3
- package/lib-cjs/component/hooks/useResizerStatus.js +11 -0
- package/lib-cjs/component/hooks/useSpectrum.js +1 -1
- package/lib-cjs/component/main/ErrorOverlay.js +26 -0
- package/lib-cjs/component/main/InnerNMRium.js +82 -0
- package/lib-cjs/component/main/InnerNMRiumContents.js +95 -0
- package/lib-cjs/component/main/NMRium.js +19 -0
- package/lib-cjs/component/main/NMRiumStateProvider.js +80 -0
- package/lib-cjs/component/{SplitPaneWrapper.js → main/SplitPaneWrapper.js} +1 -1
- package/lib-cjs/component/main/StateError.js +20 -0
- package/lib-cjs/component/main/index.js +21 -0
- package/lib-cjs/component/main/types.js +3 -0
- package/lib-cjs/component/modal/AlignSpectraModal.js +100 -28
- package/lib-cjs/component/modal/MoleculeStructureEditorModal.js +11 -17
- package/lib-cjs/component/modal/MultipletAnalysisModal.js +1 -1
- package/lib-cjs/component/modal/PredictSpectraModal.js +1 -1
- package/lib-cjs/component/modal/{AboutUsModal.js → aboutUs/AboutUsModal.js} +4 -3
- package/lib-cjs/component/modal/aboutUs/AboutUsZakodium.js +39 -0
- package/lib-cjs/component/modal/changeSum/ChangeSumModal.js +6 -141
- package/lib-cjs/component/modal/changeSum/ChangeSumModalContents.js +124 -0
- package/lib-cjs/component/modal/metaImportation/MetaImportationModal.js +1 -1
- package/lib-cjs/component/modal/setting/GeneralSettings.js +2 -2
- package/lib-cjs/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settings-tabs/ImportationFiltersTabContent.js +1 -1
- package/lib-cjs/component/modal/setting/settingsValidation.js +4 -0
- package/lib-cjs/component/panels/InformationPanel.js +7 -98
- package/lib-cjs/component/panels/IntegralsPanel/IntegralPanel.js +29 -11
- package/lib-cjs/component/panels/IntegralsPanel/IntegralTable.js +1 -1
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- package/lib-cjs/component/panels/MoleculesPanel/MoleculePanelHeader.js +2 -4
- package/lib-cjs/component/panels/MoleculesPanel/Utilities.js +14 -10
- package/lib-cjs/component/panels/MoleculesPanel/useAtomAssignment.js +8 -9
- package/lib-cjs/component/panels/MultipleSpectraAnalysisPanel/MultipleSpectraAnalysisPanel.js +4 -4
- package/lib-cjs/component/panels/Panels.js +6 -7
- package/lib-cjs/component/panels/PeaksPanel/PeaksPanel.js +32 -3
- package/lib-cjs/component/panels/PeaksPanel/PeaksTable.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/RangesHeader.js +29 -10
- package/lib-cjs/component/panels/RangesPanel/TableColumns/RelativeColumn.js +1 -1
- package/lib-cjs/component/panels/RangesPanel/TableColumns/SignalDeltaColumn.js +1 -1
- package/lib-cjs/component/panels/SpectrumsPanel/SpectraPanelHeader.js +1 -2
- package/lib-cjs/component/panels/SpectrumsPanel/base/ShowHideSpectrumButton.js +1 -1
- package/lib-cjs/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +2 -2
- package/lib-cjs/component/panels/SummaryPanel/SummaryPanel.js +29 -6
- package/lib-cjs/component/panels/SummaryPanel/utilities/Utilities.js +4 -5
- package/lib-cjs/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +7 -8
- package/lib-cjs/component/panels/ZonesPanel/ZonesPanel.js +26 -2
- package/lib-cjs/component/panels/ZonesPanel/ZonesPreferences.js +1 -1
- package/lib-cjs/component/panels/databasePanel/DatabasePanel.js +3 -40
- package/lib-cjs/component/panels/databasePanel/DatabaseSearchOptions.js +60 -0
- package/lib-cjs/component/panels/header/DefaultPanelHeader.js +12 -12
- package/lib-cjs/component/panels/predictionPanel/PredictionPanel.js +3 -3
- package/lib-cjs/component/panels/predictionPanel/PredictionSimpleOptions.js +0 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulation.js +1 -1
- package/lib-cjs/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +1 -2
- package/lib-cjs/component/reducer/IgnoreActions.js +1 -1
- package/lib-cjs/component/reducer/Reducer.js +33 -7
- package/lib-cjs/component/reducer/actions/DomainActions.js +2 -3
- package/lib-cjs/component/reducer/actions/FiltersActions.js +98 -28
- package/lib-cjs/component/reducer/actions/IntegralsActions.js +45 -20
- package/lib-cjs/component/reducer/actions/MoleculeActions.js +3 -3
- package/lib-cjs/component/reducer/actions/PeaksActions.js +20 -1
- package/lib-cjs/component/reducer/actions/PreferencesActions.js +1 -2
- package/lib-cjs/component/reducer/actions/RangesActions.js +31 -2
- package/lib-cjs/component/reducer/actions/ToolsActions.js +9 -9
- package/lib-cjs/component/reducer/core/Constants.js +1 -6
- package/lib-cjs/component/reducer/helper/ZoomHistoryManager.js +1 -2
- package/lib-cjs/component/toolbar/FunctionToolBar.js +13 -3
- package/lib-cjs/component/toolbar/ToolTypes.js +57 -22
- package/lib-cjs/component/utility/export.js +7 -4
- package/lib-cjs/component/utility/filterType.js +2 -0
- package/lib-cjs/component/workspaces/basic.js +2 -0
- package/lib-cjs/component/workspaces/embedded.js +2 -0
- package/lib-cjs/component/workspaces/exercise.js +2 -0
- package/lib-cjs/component/workspaces/prediction.js +9 -0
- package/lib-cjs/component/workspaces/process1D.js +2 -0
- package/lib-cjs/component/workspaces/workspaceDefaultProperties.js +2 -0
- package/lib-cjs/data/PredictionManager.js +9 -9
- package/lib-cjs/data/data1d/Spectrum1D/ranges/addRange.js +1 -7
- package/lib-cjs/data/data1d/Spectrum1D/ranges/detectSignal.js +1 -1
- package/lib-cjs/data/molecules/Molecule.js +2 -2
- package/lib-cjs/data/utilities/checkModifierKeyActivated.js +8 -13
- package/lib-cjs/versionInfo.js +1 -1
- package/package.json +26 -25
- package/lib/component/1d/peaks/PeakAnnotation.d.ts +0 -12
- package/lib/component/1d/peaks/PeakAnnotation.js +0 -116
- package/lib/component/ErrorOverlay.js +0 -27
- package/lib/component/NMRium.d.ts +0 -42
- package/lib/component/NMRium.js +0 -237
- package/lib/component/reducer/actions/GlobalActions.d.ts +0 -9
- package/lib/component/reducer/actions/GlobalActions.js +0 -4
- package/lib-cjs/component/1d/peaks/PeakAnnotation.js +0 -118
- package/lib-cjs/component/ErrorOverlay.js +0 -30
- package/lib-cjs/component/NMRium.js +0 -267
- package/lib-cjs/component/reducer/actions/GlobalActions.js +0 -7
- /package/lib/component/{ErrorOverlay.d.ts → main/ErrorOverlay.d.ts} +0 -0
- /package/lib/component/{SplitPaneWrapper.d.ts → main/SplitPaneWrapper.d.ts} +0 -0
- /package/lib/component/modal/{AboutUsModal.d.ts → aboutUs/AboutUsModal.d.ts} +0 -0
|
@@ -10,6 +10,7 @@ import { useGlobal } from '../../../context/GlobalContext';
|
|
|
10
10
|
import { useMoleculeEditor } from '../../../modal/MoleculeStructureEditorModal';
|
|
11
11
|
import useAtomAssignment from '../../../panels/MoleculesPanel/useAtomAssignment';
|
|
12
12
|
import ActionsButton from './ActionsButton';
|
|
13
|
+
const AUTO_CROP_MARGIN = 30;
|
|
13
14
|
const style = css `
|
|
14
15
|
border: 1px solid transparent;
|
|
15
16
|
|
|
@@ -35,7 +36,7 @@ export function DraggableStructure(props) {
|
|
|
35
36
|
const { zones, ranges, molecule, activeTab, displayerMode, index, moleculeView, } = props;
|
|
36
37
|
const { viewerRef } = useGlobal();
|
|
37
38
|
const dispatch = useDispatch();
|
|
38
|
-
const openMoleculeEditor = useMoleculeEditor();
|
|
39
|
+
const { modal, openMoleculeEditor } = useMoleculeEditor();
|
|
39
40
|
const { currentDiaIDsToHighlight, handleOnAtomHover, handleOnClickAtom, assignedDiaIDsMerged, } = useAtomAssignment({ zones, ranges, activeTab, displayerMode });
|
|
40
41
|
function floatMoleculeHandler() {
|
|
41
42
|
dispatch({
|
|
@@ -57,20 +58,20 @@ export function DraggableStructure(props) {
|
|
|
57
58
|
}
|
|
58
59
|
if (!viewerRef)
|
|
59
60
|
return null;
|
|
60
|
-
return (
|
|
61
|
+
return (_jsxs(Rnd, { default: moleculeView.floating.bounding, minWidth: 90 + AUTO_CROP_MARGIN * 2, minHeight: 100 + AUTO_CROP_MARGIN * 2, dragHandleClassName: "handle", enableUserSelectHack: false, bounds: viewerRef, style: { zIndex: 1 }, className: "draggable-molecule", onResizeStop: (e, dir, eRef, { width, height }) => dragFloatMoleculeHandler({ width, height }), onDragStop: (e, { x, y }) => {
|
|
61
62
|
dragFloatMoleculeHandler({ x, y });
|
|
62
|
-
}, resizeHandleWrapperStyle: { backgroundColor: 'white' }, css: style, children: _jsxs("div", { className: "content", onDoubleClick: () => openMoleculeEditor(molecule), children: [_jsx(ActionsButton, { onFloatBtnClick: floatMoleculeHandler }), _jsx(ResponsiveChart, { children: ({ width, height }) => {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
63
|
+
}, resizeHandleWrapperStyle: { backgroundColor: 'white' }, css: style, children: [_jsxs("div", { className: "content", onDoubleClick: () => openMoleculeEditor(molecule), children: [_jsx(ActionsButton, { onFloatBtnClick: floatMoleculeHandler }), _jsx(ResponsiveChart, { children: ({ width, height }) => {
|
|
64
|
+
return (_jsx(OCLnmr, { OCL: OCL, id: `molSVG${index || ''}`, autoCrop: true, autoCropMargin: AUTO_CROP_MARGIN, height: height - AUTO_CROP_MARGIN * 2, width: width - AUTO_CROP_MARGIN * 2, label: molecule.label, labelFontSize: 15, labelColor: "rgb(0,0,0)", molfile: molecule.molfile, setSelectedAtom: handleOnClickAtom, atomHighlightColor: currentDiaIDsToHighlight?.length > 0 ? 'red' : '#FFD700', atomHighlightOpacity: 0.35, highlights: currentDiaIDsToHighlight?.length > 0
|
|
65
|
+
? currentDiaIDsToHighlight
|
|
66
|
+
: assignedDiaIDsMerged, setHoverAtom: handleOnAtomHover, setMolfile: (molfile) => {
|
|
67
|
+
dispatch({
|
|
68
|
+
type: 'SET_MOLECULE',
|
|
69
|
+
payload: {
|
|
70
|
+
molfile,
|
|
71
|
+
id: molecule.id,
|
|
72
|
+
label: molecule.label,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}, showAtomNumber: moleculeView.showAtomNumber }));
|
|
76
|
+
} })] }), modal] }));
|
|
76
77
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Zones, Ranges } from 'nmr-processing';
|
|
2
2
|
import { MoleculesView, StateMoleculeExtended } from '../../../../data/molecules/Molecule';
|
|
3
|
-
import {
|
|
3
|
+
import { DisplayerMode } from '../../../reducer/Reducer';
|
|
4
4
|
interface FloatMoleculeStructuresProps {
|
|
5
5
|
zones: Zones;
|
|
6
6
|
ranges: Ranges;
|
|
7
7
|
molecules: StateMoleculeExtended[];
|
|
8
8
|
moleculesView: MoleculesView;
|
|
9
9
|
activeTab: string;
|
|
10
|
-
displayerMode:
|
|
10
|
+
displayerMode: DisplayerMode;
|
|
11
11
|
}
|
|
12
12
|
export declare function FloatMoleculeStructuresInner(props: FloatMoleculeStructuresProps): import("react/jsx-runtime").JSX.Element | null;
|
|
13
13
|
export default function FloatMoleculeStructures(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,7 +12,7 @@ function SlicingView() {
|
|
|
12
12
|
const position = useMouseTracker();
|
|
13
13
|
const activeSpectrum = useActiveSpectrum();
|
|
14
14
|
const chart2d = useMemo(() => {
|
|
15
|
-
if (position && activeSpectrum
|
|
15
|
+
if (position && activeSpectrum?.id) {
|
|
16
16
|
const { x, y } = position;
|
|
17
17
|
const scale2dX = get2DXScale({ margin, width, xDomain });
|
|
18
18
|
const scale2dY = get2DYScale({ margin, height, yDomain });
|
|
@@ -9,7 +9,6 @@ import { useChartData } from '../context/ChartContext';
|
|
|
9
9
|
import { useDispatch } from '../context/DispatchContext';
|
|
10
10
|
import Spinner from '../loader/Spinner';
|
|
11
11
|
import { options } from '../toolbar/ToolTypes';
|
|
12
|
-
import { assert } from '../utility/assert';
|
|
13
12
|
import Chart2D from './Chart2D';
|
|
14
13
|
import FooterBanner from './FooterBanner';
|
|
15
14
|
import SlicingView from './SlicingView';
|
|
@@ -28,7 +27,6 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
28
27
|
if (spectra?.length === 1) {
|
|
29
28
|
const id = spectra[0].id;
|
|
30
29
|
const spectrum = data.find((datum) => datum.id === id && !datum.info.isFid);
|
|
31
|
-
assert(spectrum, `Spectrum with id ${id} not found`);
|
|
32
30
|
return spectrum;
|
|
33
31
|
}
|
|
34
32
|
return null;
|
|
@@ -122,7 +120,7 @@ function Viewer2D({ emptyText = undefined }) {
|
|
|
122
120
|
margin: 'auto',
|
|
123
121
|
position: 'relative',
|
|
124
122
|
overflow: 'hidden',
|
|
125
|
-
}, children: _jsxs(MouseTracker, { style: { width: '100%', height: `100%`, position: 'absolute' }, children: [selectedTool && selectedTool === options.slicing.id && (_jsx(SlicingView, {})), _jsx(CrossLinePointer, {}),
|
|
123
|
+
}, children: _jsxs(MouseTracker, { style: { width: '100%', height: `100%`, position: 'absolute' }, children: [selectedTool && selectedTool === options.slicing.id && (_jsx(SlicingView, {})), _jsx(CrossLinePointer, {}), _jsx(XYLabelPointer, { data1D: spectrumData, layout: DIMENSION }), _jsx(BrushXY, { brushType: BRUSH_TYPE.XY, dimensionBorder: DIMENSION.CENTER_2D }), _jsxs(_Fragment, { children: [spectrumData[0] && (_jsx(BrushXY, { brushType: BRUSH_TYPE.X, dimensionBorder: DIMENSION.TOP_1D, height: margin.top })), spectrumData[1] && (_jsx(BrushXY, { brushType: BRUSH_TYPE.Y, dimensionBorder: DIMENSION.LEFT_1D, width: margin.left }))] }), _jsx(FooterBanner, { data1D: spectrumData, layout: DIMENSION }), _jsx(Chart2D, { spectra: spectrumData })] }) }))] })) }));
|
|
126
124
|
}
|
|
127
125
|
export function ViewerResponsiveWrapper(props) {
|
|
128
126
|
const dispatch = useDispatch();
|
|
@@ -53,7 +53,7 @@ function ContoursPaths({ id: spectrumID, sign, color, spectrum, onTimeout, }) {
|
|
|
53
53
|
const opacity = activeSpectrum === null || spectrumID === activeSpectrum.id
|
|
54
54
|
? '1'
|
|
55
55
|
: get(preferences.current, 'general.dimmedSpectraOpacity', 0.1);
|
|
56
|
-
return (_jsx("path", { fill: "none", "data-
|
|
56
|
+
return (_jsx("path", { fill: "none", "data-testid": "spectrum-line", stroke: color, strokeWidth: "1", opacity: opacity, d: path }));
|
|
57
57
|
}
|
|
58
58
|
function ContoursInner({ spectra, displayerKey }) {
|
|
59
59
|
const alert = useAlert();
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
interface KeysListenerTrackerProps {
|
|
3
|
+
mainDivRef: RefObject<HTMLDivElement>;
|
|
4
|
+
}
|
|
5
|
+
declare function KeysListenerTracker(props: KeysListenerTrackerProps): null;
|
|
2
6
|
export default KeysListenerTracker;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCallback, useEffect, useMemo } from 'react';
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import checkModifierKeyActivated from '../../data/utilities/checkModifierKeyActivated';
|
|
3
3
|
import { useAssignmentData } from '../assignment/AssignmentsContext';
|
|
4
4
|
import { useChartData } from '../context/ChartContext';
|
|
@@ -11,10 +11,10 @@ import { HighlightEventSource, useHighlightData } from '../highlight/index';
|
|
|
11
11
|
import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
|
|
12
12
|
import useExport from '../hooks/useExport';
|
|
13
13
|
import useToolsFunctions from '../hooks/useToolsFunctions';
|
|
14
|
-
import { DISPLAYER_MODE } from '../reducer/core/Constants';
|
|
15
14
|
import { options } from '../toolbar/ToolTypes';
|
|
16
|
-
function KeysListenerTracker() {
|
|
17
|
-
const {
|
|
15
|
+
function KeysListenerTracker(props) {
|
|
16
|
+
const { mainDivRef } = props;
|
|
17
|
+
const { keysPreferences, displayerMode, data, view: { spectra: { activeTab }, }, } = useChartData();
|
|
18
18
|
const dispatch = useDispatch();
|
|
19
19
|
const { dispatch: dispatchPreferences } = usePreferences();
|
|
20
20
|
const alert = useAlert();
|
|
@@ -24,9 +24,28 @@ function KeysListenerTracker() {
|
|
|
24
24
|
const { saveToClipboardHandler, saveAsJSONHandler, saveAsHandler } = useExport();
|
|
25
25
|
const isToolVisible = useCheckToolsVisibility();
|
|
26
26
|
const { highlight, remove } = useHighlightData();
|
|
27
|
+
const mouseIsOverDisplayer = useRef(false);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const div = mainDivRef.current;
|
|
30
|
+
if (!div) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
function mouseEnterHandler() {
|
|
34
|
+
mouseIsOverDisplayer.current = true;
|
|
35
|
+
}
|
|
36
|
+
function mouseLeaveHandler() {
|
|
37
|
+
mouseIsOverDisplayer.current = false;
|
|
38
|
+
}
|
|
39
|
+
div.addEventListener('mouseenter', mouseEnterHandler);
|
|
40
|
+
div.addEventListener('mouseleave', mouseLeaveHandler);
|
|
41
|
+
return () => {
|
|
42
|
+
div.removeEventListener('mouseenter', mouseEnterHandler);
|
|
43
|
+
div.removeEventListener('mouseleave', mouseLeaveHandler);
|
|
44
|
+
};
|
|
45
|
+
}, [mainDivRef]);
|
|
27
46
|
const assignmentData = useAssignmentData();
|
|
28
47
|
const allow1DTool = useMemo(() => {
|
|
29
|
-
return displayerMode ===
|
|
48
|
+
return displayerMode === '1D' && data && data.length > 0;
|
|
30
49
|
}, [data, displayerMode]);
|
|
31
50
|
const deleteHandler = useCallback(async (sourceData) => {
|
|
32
51
|
const { type, extra } = sourceData;
|
|
@@ -170,6 +189,15 @@ function KeysListenerTracker() {
|
|
|
170
189
|
}
|
|
171
190
|
break;
|
|
172
191
|
}
|
|
192
|
+
case HighlightEventSource.BASELINE_ZONE: {
|
|
193
|
+
const { id } = extra || {};
|
|
194
|
+
if (id) {
|
|
195
|
+
dispatch({ type: 'DELETE_BASE_LINE_ZONE', payload: { id } });
|
|
196
|
+
// remove keys from the highlighted list after delete
|
|
197
|
+
remove();
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
173
201
|
default:
|
|
174
202
|
break;
|
|
175
203
|
}
|
|
@@ -223,7 +251,6 @@ function KeysListenerTracker() {
|
|
|
223
251
|
handleFullZoomOut();
|
|
224
252
|
}
|
|
225
253
|
break;
|
|
226
|
-
case 'z':
|
|
227
254
|
case 'Escape':
|
|
228
255
|
if (isToolVisible('zoom')) {
|
|
229
256
|
handleChangeOption(options.zoom.id);
|
|
@@ -238,6 +265,12 @@ function KeysListenerTracker() {
|
|
|
238
265
|
}
|
|
239
266
|
break;
|
|
240
267
|
}
|
|
268
|
+
case 'z': {
|
|
269
|
+
if (isToolVisible('zeroFilling')) {
|
|
270
|
+
handleChangeOption(options.zeroFilling.id);
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
241
274
|
case 'a': {
|
|
242
275
|
if (isToolVisible('apodization')) {
|
|
243
276
|
handleChangeOption(options.apodization.id);
|
|
@@ -247,6 +280,14 @@ function KeysListenerTracker() {
|
|
|
247
280
|
}
|
|
248
281
|
break;
|
|
249
282
|
}
|
|
283
|
+
case 't': {
|
|
284
|
+
if (isToolVisible('fft')) {
|
|
285
|
+
dispatch({
|
|
286
|
+
type: 'APPLY_FFT_FILTER',
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
break;
|
|
290
|
+
}
|
|
250
291
|
case 'b': {
|
|
251
292
|
if (isToolVisible('baselineCorrection')) {
|
|
252
293
|
handleChangeOption(options.baselineCorrection.id);
|
|
@@ -343,7 +384,7 @@ function KeysListenerTracker() {
|
|
|
343
384
|
saveToClipboardHandler,
|
|
344
385
|
]);
|
|
345
386
|
const handleOnKeyDown = useCallback((e) => {
|
|
346
|
-
if (checkNotInputField(e) &&
|
|
387
|
+
if (checkNotInputField(e) && mouseIsOverDisplayer.current) {
|
|
347
388
|
const num = Number(e.code.slice(-1)) || 0;
|
|
348
389
|
if (num > 0) {
|
|
349
390
|
keysPreferencesListenerHandler(e, num);
|
|
@@ -361,7 +402,6 @@ function KeysListenerTracker() {
|
|
|
361
402
|
deleteHandler,
|
|
362
403
|
highlight,
|
|
363
404
|
keysPreferencesListenerHandler,
|
|
364
|
-
overDisplayer,
|
|
365
405
|
toolsListenerHandler,
|
|
366
406
|
]);
|
|
367
407
|
useEffect(() => {
|
|
@@ -1 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface AssignmentProviderProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function AssignmentProvider(props: AssignmentProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useReducer, useMemo, useEffect } from 'react';
|
|
3
|
+
import { useChartData } from '../context/ChartContext';
|
|
3
4
|
import { assignmentState, assignmentContext, } from './AssignmentsContext';
|
|
4
5
|
import assignmentReducer from './AssignmentsReducer';
|
|
5
6
|
export function AssignmentProvider(props) {
|
|
6
|
-
const {
|
|
7
|
+
const { children } = props;
|
|
8
|
+
const { data: spectra } = useChartData();
|
|
7
9
|
const [data, dispatch] = useReducer(assignmentReducer, assignmentState);
|
|
8
10
|
const state = useMemo(() => ({ data, dispatch }), [data]);
|
|
9
11
|
useEffect(() => {
|
|
10
12
|
if (spectra) {
|
|
11
13
|
dispatch({
|
|
12
14
|
type: 'INITIATE_ASSIGNMENTS',
|
|
15
|
+
// TODO: Fix this type error. It's been here for a long time because this component wasn't typed.
|
|
16
|
+
// @ts-expect-error This should be fixed.
|
|
13
17
|
payload: { spectra },
|
|
14
18
|
});
|
|
15
19
|
}
|
|
@@ -5,7 +5,6 @@ import { DatabaseActions } from '../reducer/actions/DatabaseActions';
|
|
|
5
5
|
import { DimensionsActions } from '../reducer/actions/DimensionsActions';
|
|
6
6
|
import { DomainActions } from '../reducer/actions/DomainActions';
|
|
7
7
|
import { FiltersActions } from '../reducer/actions/FiltersActions';
|
|
8
|
-
import { GlobalActions } from '../reducer/actions/GlobalActions';
|
|
9
8
|
import { IntegralsActions } from '../reducer/actions/IntegralsActions';
|
|
10
9
|
import { LoadActions } from '../reducer/actions/LoadActions';
|
|
11
10
|
import { MoleculeActions } from '../reducer/actions/MoleculeActions';
|
|
@@ -17,7 +16,9 @@ import { SpectrumActions } from '../reducer/actions/SpectrumsActions';
|
|
|
17
16
|
import { ToolsActions } from '../reducer/actions/ToolsActions';
|
|
18
17
|
import { ZonesActions } from '../reducer/actions/ZonesActions';
|
|
19
18
|
import { ActionType } from '../reducer/types/ActionType';
|
|
20
|
-
export type Action = ToolsActions | SpectrumActions | SpectraAnalysisActions |
|
|
19
|
+
export type Action = ToolsActions | SpectrumActions | SpectraAnalysisActions | LoadActions | IntegralsActions | RangesActions | DatabaseActions | DimensionsActions | AssignmentsActions | DomainActions | PreferencesActions | PeaksActions | MoleculeActions | ZonesActions | FiltersActions | CorrelationsActions | ActionType<'INITIALIZE_NMRIUM'> | ActionType<'SECRET_THROW_ERROR', {
|
|
20
|
+
randomNumber: number;
|
|
21
|
+
}>;
|
|
21
22
|
export type Dispatch = (action: Action) => void;
|
|
22
23
|
export declare const dispatchContext: import("react").Context<Dispatch>;
|
|
23
24
|
export declare const DispatchProvider: import("react").Provider<Dispatch>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface KeyModifiers {
|
|
3
|
+
ctrlKey: boolean;
|
|
4
|
+
shiftKey: boolean;
|
|
5
|
+
altKey: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const KeyModifierContext: import("react").Context<KeyModifiers>;
|
|
8
|
+
export declare function useKeyModifiers(): KeyModifiers;
|
|
9
|
+
interface KeyModifierProviderProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function KeyModifiersProvider({ children }: KeyModifierProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useState, } from 'react';
|
|
3
|
+
const defaultKeyModifiersState = {
|
|
4
|
+
ctrlKey: false,
|
|
5
|
+
shiftKey: false,
|
|
6
|
+
altKey: false,
|
|
7
|
+
};
|
|
8
|
+
export const KeyModifierContext = createContext(defaultKeyModifiersState);
|
|
9
|
+
export function useKeyModifiers() {
|
|
10
|
+
const context = useContext(KeyModifierContext);
|
|
11
|
+
if (!context) {
|
|
12
|
+
throw new Error('key modifiers context was not found');
|
|
13
|
+
}
|
|
14
|
+
return context;
|
|
15
|
+
}
|
|
16
|
+
const isMac = navigator !== undefined && navigator.userAgent.toLowerCase().includes('mac');
|
|
17
|
+
function getModifiers(event) {
|
|
18
|
+
const { shiftKey, altKey, metaKey } = event;
|
|
19
|
+
const ctrlKey = isMac ? metaKey : event.ctrlKey;
|
|
20
|
+
return { ctrlKey, shiftKey, altKey };
|
|
21
|
+
}
|
|
22
|
+
export function KeyModifiersProvider({ children }) {
|
|
23
|
+
const [modifiers, setModifiers] = useState(defaultKeyModifiersState);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
function handleKeyDown(event) {
|
|
26
|
+
setModifiers(getModifiers(event));
|
|
27
|
+
}
|
|
28
|
+
function handleKeyUp(event) {
|
|
29
|
+
setModifiers(getModifiers(event));
|
|
30
|
+
}
|
|
31
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
32
|
+
document.addEventListener('keyup', handleKeyUp);
|
|
33
|
+
return () => {
|
|
34
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
35
|
+
document.removeEventListener('keyup', handleKeyUp);
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return (_jsx(KeyModifierContext.Provider, { value: modifiers, children: children }));
|
|
39
|
+
}
|
|
@@ -13,11 +13,40 @@ export declare function usePreferences(): {
|
|
|
13
13
|
workspaces: import("../reducer/preferences/preferencesReducer").WorkspacesWithSource;
|
|
14
14
|
originalWorkspaces: import("../reducer/preferences/preferencesReducer").WorkspacesWithSource;
|
|
15
15
|
dispatch: (action?: ({
|
|
16
|
+
type: "INIT_PREFERENCES";
|
|
17
|
+
payload: {
|
|
18
|
+
display: import("nmr-load-save").WorkspacePreferences;
|
|
19
|
+
workspace: import("../main/types").NMRiumWorkspace;
|
|
20
|
+
customWorkspaces: Record<string, import("nmr-load-save").Workspace>;
|
|
21
|
+
dispatch: any;
|
|
22
|
+
};
|
|
23
|
+
} | ({
|
|
24
|
+
type: "SET_PREFERENCES";
|
|
25
|
+
payload: Partial<import("nmr-load-save").Workspace>;
|
|
26
|
+
} | {
|
|
27
|
+
type: "SET_PREFERENCES";
|
|
28
|
+
}) | {
|
|
29
|
+
type: "SET_PANELS_PREFERENCES";
|
|
30
|
+
payload: {
|
|
31
|
+
key: string;
|
|
32
|
+
value: string;
|
|
33
|
+
};
|
|
34
|
+
} | import("../reducer/preferences/preferencesReducer").SetWorkspaceAction | {
|
|
35
|
+
type: "REMOVE_WORKSPACE" | "SET_ACTIVE_WORKSPACE";
|
|
36
|
+
payload: {
|
|
37
|
+
workspace: string;
|
|
38
|
+
};
|
|
39
|
+
} | {
|
|
16
40
|
type: "ADD_WORKSPACE";
|
|
17
41
|
payload: {
|
|
18
42
|
workspaceKey: string;
|
|
19
43
|
data?: Omit<import("nmr-load-save").Workspace, "label" | "version"> | undefined;
|
|
20
44
|
};
|
|
45
|
+
} | {
|
|
46
|
+
type: "APPLY_General_PREFERENCES";
|
|
47
|
+
payload: {
|
|
48
|
+
data: Omit<import("nmr-load-save").Workspace, "label" | "version">;
|
|
49
|
+
};
|
|
21
50
|
} | {
|
|
22
51
|
type: "ANALYZE_SPECTRA";
|
|
23
52
|
payload: {
|
|
@@ -46,9 +75,10 @@ export declare function usePreferences(): {
|
|
|
46
75
|
data: import("nmr-load-save").MultipleSpectraAnalysisPreferences;
|
|
47
76
|
};
|
|
48
77
|
} | {
|
|
49
|
-
type: "
|
|
78
|
+
type: "SET_MATRIX_GENERATION_OPTIONS";
|
|
50
79
|
payload: {
|
|
51
|
-
|
|
80
|
+
nucleus: string;
|
|
81
|
+
options: import("../../data/types/data1d/MatrixOptions").MatrixOptions;
|
|
52
82
|
};
|
|
53
83
|
} | {
|
|
54
84
|
type: "ADD_MATRIX_GENERATION_EXCLUSION_ZONE";
|
|
@@ -63,41 +93,6 @@ export declare function usePreferences(): {
|
|
|
63
93
|
};
|
|
64
94
|
nucleus: string;
|
|
65
95
|
};
|
|
66
|
-
} | {
|
|
67
|
-
type: "REMOVE_WORKSPACE" | "SET_ACTIVE_WORKSPACE";
|
|
68
|
-
payload: {
|
|
69
|
-
workspace: string;
|
|
70
|
-
};
|
|
71
|
-
} | {
|
|
72
|
-
type: "SET_VERTICAL_SPLITTER_POSITION";
|
|
73
|
-
payload: {
|
|
74
|
-
value: import("react-science/ui").SplitPaneSize;
|
|
75
|
-
};
|
|
76
|
-
} | import("../reducer/preferences/preferencesReducer").SetWorkspaceAction | {
|
|
77
|
-
type: "INIT_PREFERENCES";
|
|
78
|
-
payload: {
|
|
79
|
-
display: import("nmr-load-save").WorkspacePreferences;
|
|
80
|
-
workspace: import("../NMRium").NMRiumWorkspace;
|
|
81
|
-
customWorkspaces: Record<string, import("nmr-load-save").Workspace>;
|
|
82
|
-
dispatch: any;
|
|
83
|
-
};
|
|
84
|
-
} | ({
|
|
85
|
-
type: "SET_PREFERENCES";
|
|
86
|
-
payload: Partial<import("nmr-load-save").Workspace>;
|
|
87
|
-
} | {
|
|
88
|
-
type: "SET_PREFERENCES";
|
|
89
|
-
}) | {
|
|
90
|
-
type: "SET_PANELS_PREFERENCES";
|
|
91
|
-
payload: {
|
|
92
|
-
key: string;
|
|
93
|
-
value: string;
|
|
94
|
-
};
|
|
95
|
-
} | {
|
|
96
|
-
type: "SET_MATRIX_GENERATION_OPTIONS";
|
|
97
|
-
payload: {
|
|
98
|
-
nucleus: string;
|
|
99
|
-
options: import("../../data/types/data1d/MatrixOptions").MatrixOptions;
|
|
100
|
-
};
|
|
101
96
|
} | {
|
|
102
97
|
type: "DELETE_MATRIX_GENERATION_EXCLUSION_ZONE";
|
|
103
98
|
payload: {
|
|
@@ -108,10 +103,15 @@ export declare function usePreferences(): {
|
|
|
108
103
|
};
|
|
109
104
|
nucleus: string;
|
|
110
105
|
};
|
|
106
|
+
} | {
|
|
107
|
+
type: "SET_VERTICAL_SPLITTER_POSITION";
|
|
108
|
+
payload: {
|
|
109
|
+
value: import("react-science/ui").SplitPaneSize;
|
|
110
|
+
};
|
|
111
111
|
}) | undefined) => void;
|
|
112
112
|
workspace: {
|
|
113
|
-
current: import("../
|
|
114
|
-
base: import("../
|
|
113
|
+
current: import("../main/types").NMRiumWorkspace;
|
|
114
|
+
base: import("../main/types").NMRiumWorkspace | null;
|
|
115
115
|
};
|
|
116
116
|
};
|
|
117
117
|
export declare function useWorkspacesList(): any[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
//TODO resolve the eslint rules
|
|
3
|
+
/* eslint-disable react/no-unused-prop-types */
|
|
2
4
|
/** @jsxImportSource @emotion/react */
|
|
3
5
|
import { css } from '@emotion/react';
|
|
4
6
|
import { FaInfoCircle } from 'react-icons/fa';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
const labelStyle = {
|
|
3
|
+
margin: 0,
|
|
4
|
+
textAlign: 'right',
|
|
5
|
+
lineHeight: '22px',
|
|
6
|
+
padding: '0 5px',
|
|
7
|
+
whiteSpace: 'nowrap',
|
|
8
|
+
};
|
|
9
|
+
export function CounterLabel(props) {
|
|
10
|
+
const { children, style = {} } = props;
|
|
11
|
+
return _jsx("p", { style: { ...labelStyle, ...style }, children: children });
|
|
12
|
+
}
|
|
@@ -5,6 +5,7 @@ const EditableColumn = forwardRef(function EditableColumn(props, ref) {
|
|
|
5
5
|
const { onSave = () => null, value, type = 'text', style, onEditStart = () => null, editStatus = false, validate = () => true, textOverFlowEllipses = false, ...InputProps } = props;
|
|
6
6
|
const [enabled, enableEdit] = useState();
|
|
7
7
|
const [isValid, setValid] = useState(true);
|
|
8
|
+
const [val, setVal] = useState(value);
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
enableEdit(editStatus);
|
|
10
11
|
}, [editStatus]);
|
|
@@ -22,13 +23,13 @@ const EditableColumn = forwardRef(function EditableColumn(props, ref) {
|
|
|
22
23
|
window.removeEventListener('mousedown', mouseClickCallback);
|
|
23
24
|
}
|
|
24
25
|
}, []);
|
|
25
|
-
|
|
26
|
+
function startEditHandler() {
|
|
26
27
|
window.addEventListener('mousedown', mouseClickCallback);
|
|
27
28
|
onEditStart(true);
|
|
28
29
|
enableEdit(true);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const valid = validate(
|
|
30
|
+
}
|
|
31
|
+
function editHandler(event) {
|
|
32
|
+
const valid = validate(val);
|
|
32
33
|
setValid(valid);
|
|
33
34
|
// when press Enter or Tab
|
|
34
35
|
if (valid && ['Enter', 'Tab'].includes(event.key)) {
|
|
@@ -40,7 +41,10 @@ const EditableColumn = forwardRef(function EditableColumn(props, ref) {
|
|
|
40
41
|
enableEdit(false);
|
|
41
42
|
window.removeEventListener('mousedown', mouseClickCallback);
|
|
42
43
|
}
|
|
43
|
-
}
|
|
44
|
+
}
|
|
45
|
+
function handleChange(e) {
|
|
46
|
+
setVal(e.target.value);
|
|
47
|
+
}
|
|
44
48
|
return (_jsxs("div", { style: {
|
|
45
49
|
display: 'table',
|
|
46
50
|
width: '100%',
|
|
@@ -62,8 +66,10 @@ const EditableColumn = forwardRef(function EditableColumn(props, ref) {
|
|
|
62
66
|
width: '100%',
|
|
63
67
|
},
|
|
64
68
|
input: {
|
|
69
|
+
padding: '5px',
|
|
65
70
|
width: '100%',
|
|
71
|
+
minWidth: '60px',
|
|
66
72
|
},
|
|
67
|
-
},
|
|
73
|
+
}, autoSelect: true, className: "editable-column", value: val, type: type, onChange: handleChange, onKeyUp: editHandler, onMouseDown: (e) => e.stopPropagation(), ...InputProps }) }))] }));
|
|
68
74
|
});
|
|
69
75
|
export default EditableColumn;
|
|
@@ -1,27 +1,18 @@
|
|
|
1
1
|
import { CSSProperties, ReactElement } from 'react';
|
|
2
|
-
export type InputKeyboardEvent = React.KeyboardEvent & {
|
|
3
|
-
target: {
|
|
4
|
-
name: string;
|
|
5
|
-
value: string | number;
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
2
|
export interface InputStyle {
|
|
9
3
|
input?: CSSProperties;
|
|
10
4
|
inputWrapper?: CSSProperties;
|
|
11
5
|
}
|
|
12
|
-
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'style'
|
|
6
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'style'> {
|
|
13
7
|
style?: InputStyle;
|
|
14
|
-
|
|
15
|
-
debounceTime?: number;
|
|
8
|
+
autoSelect?: boolean;
|
|
16
9
|
checkValue?: (element: number | string) => boolean;
|
|
17
10
|
format?: () => (element: string) => number | string;
|
|
18
11
|
renderIcon?: (() => ReactElement) | null;
|
|
19
12
|
canClear?: boolean;
|
|
20
13
|
onClear?: () => void;
|
|
21
|
-
onKeyDown?: (event: InputKeyboardEvent) => void;
|
|
22
|
-
onKeyUp?: (event: InputKeyboardEvent) => void;
|
|
23
|
-
nullable?: boolean;
|
|
24
14
|
datalist?: string[];
|
|
15
|
+
debounceTime?: number;
|
|
25
16
|
}
|
|
26
17
|
declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
27
18
|
export default Input;
|