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
|
@@ -17,8 +17,8 @@ const Button_1 = __importDefault(require("../elements/Button"));
|
|
|
17
17
|
const Header_1 = require("../elements/Header");
|
|
18
18
|
const DropDownButton_1 = __importDefault(require("../elements/dropDownButton/DropDownButton"));
|
|
19
19
|
const useSaveSettings_1 = require("../hooks/useSaveSettings");
|
|
20
|
-
const AboutUsModal_1 = __importDefault(require("../modal/AboutUsModal"));
|
|
21
20
|
const LogsHistoryModal_1 = require("../modal/LogsHistoryModal");
|
|
21
|
+
const AboutUsModal_1 = __importDefault(require("../modal/aboutUs/AboutUsModal"));
|
|
22
22
|
const GeneralSettings_1 = __importDefault(require("../modal/setting/GeneralSettings"));
|
|
23
23
|
const WorkspaceItem_1 = __importDefault(require("../modal/setting/WorkspaceItem"));
|
|
24
24
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
@@ -67,7 +67,7 @@ const styles = (0, react_1.css) `
|
|
|
67
67
|
}
|
|
68
68
|
`;
|
|
69
69
|
function HeaderInner(props) {
|
|
70
|
-
const {
|
|
70
|
+
const { isFullscreenEnabled, onEnableFullscreen, selectedOptionPanel, height, } = props;
|
|
71
71
|
const { current: { display: { general }, }, workspace, dispatch, } = (0, PreferencesContext_1.usePreferences)();
|
|
72
72
|
const workspacesList = (0, PreferencesContext_1.useWorkspacesList)();
|
|
73
73
|
const hideGeneralSettings = !!(general?.hideGeneralSettings && workspace.base);
|
|
@@ -106,7 +106,7 @@ function HeaderInner(props) {
|
|
|
106
106
|
alignItems: 'center',
|
|
107
107
|
}, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ui_1.Toolbar, { orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(AboutUsModal_1.default, {}) }) }), (0, jsx_runtime_1.jsx)("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), (0, jsx_runtime_1.jsxs)(HeaderContainer_1.HeaderContainer, { style: {
|
|
108
108
|
alignItems: 'center',
|
|
109
|
-
}, children: [!hideGeneralSettings && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), (0, jsx_runtime_1.jsx)(SaveButton, {})] })), !general?.hideLogs && (0, jsx_runtime_1.jsx)(LogsHistoryModal_1.LogsHistoryModal, {}), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(ui_1.Toolbar, { orientation: "horizontal", children: [(0, jsx_runtime_1.jsx)(ui_1.Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(constants_1.docsBaseUrl, '_blank'), children: (0, jsx_runtime_1.jsx)(fa_1.FaQuestionCircle, {}) }), !hideGeneralSettings && ((0, jsx_runtime_1.jsx)(GeneralSettings_1.default, { height: height / 2 })), !
|
|
109
|
+
}, children: [!hideGeneralSettings && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(DropDownButton_1.default, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem }), (0, jsx_runtime_1.jsx)(SaveButton, {})] })), !general?.hideLogs && (0, jsx_runtime_1.jsx)(LogsHistoryModal_1.LogsHistoryModal, {}), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsxs)(ui_1.Toolbar, { orientation: "horizontal", children: [(0, jsx_runtime_1.jsx)(ui_1.Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(constants_1.docsBaseUrl, '_blank'), children: (0, jsx_runtime_1.jsx)(fa_1.FaQuestionCircle, {}) }), !hideGeneralSettings && ((0, jsx_runtime_1.jsx)(GeneralSettings_1.default, { height: height / 2 })), !isFullscreenEnabled && ((0, jsx_runtime_1.jsx)(ui_1.Toolbar.Item, { id: "full-screen", onClick: onEnableFullscreen, title: "Full Screen", className: "windowButton", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegWindowMaximize, {}) }))] }) })] })] }) }));
|
|
110
110
|
}
|
|
111
111
|
function SaveButton() {
|
|
112
112
|
const { workspace, workspaces, originalWorkspaces } = (0, PreferencesContext_1.usePreferences)();
|
|
@@ -123,11 +123,11 @@ function SaveButton() {
|
|
|
123
123
|
}), toolTip: "Save workspace locally in the browser", children: (0, jsx_runtime_1.jsx)(fa_1.FaRegSave, {}) }), (0, jsx_runtime_1.jsx)(SaveSettingsModal, {})] }));
|
|
124
124
|
}
|
|
125
125
|
const MemoizedHeader = (0, react_2.memo)(HeaderInner);
|
|
126
|
-
function HeaderWrapper({
|
|
126
|
+
function HeaderWrapper({ isFullscreenEnabled, onEnableFullscreen, }) {
|
|
127
127
|
const { toolOptions: { selectedOptionPanel }, height, } = (0, ChartContext_1.useChartData)();
|
|
128
128
|
return ((0, jsx_runtime_1.jsx)(MemoizedHeader, { selectedOptionPanel,
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
isFullscreenEnabled,
|
|
130
|
+
onEnableFullscreen,
|
|
131
131
|
height }));
|
|
132
132
|
}
|
|
133
133
|
exports.default = HeaderWrapper;
|
|
@@ -4,14 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const formik_1 = require("formik");
|
|
7
8
|
const nmr_processing_1 = require("nmr-processing");
|
|
8
9
|
const react_1 = require("react");
|
|
9
|
-
const ui_1 = require("react-science/ui");
|
|
10
10
|
const generateNumbersPowerOfX_1 = __importDefault(require("../../data/utilities/generateNumbersPowerOfX"));
|
|
11
11
|
const DispatchContext_1 = require("../context/DispatchContext");
|
|
12
12
|
const ActionButtons_1 = __importDefault(require("../elements/ActionButtons"));
|
|
13
13
|
const Label_1 = __importDefault(require("../elements/Label"));
|
|
14
|
-
const
|
|
14
|
+
const FormikCheckBox_1 = __importDefault(require("../elements/formik/FormikCheckBox"));
|
|
15
|
+
const FormikOnChange_1 = __importDefault(require("../elements/formik/FormikOnChange"));
|
|
16
|
+
const FormikSelect_1 = __importDefault(require("../elements/formik/FormikSelect"));
|
|
15
17
|
const useFilter_1 = require("../hooks/useFilter");
|
|
16
18
|
const useSpectrum_1 = __importDefault(require("../hooks/useSpectrum"));
|
|
17
19
|
const Header_1 = require("./Header");
|
|
@@ -29,40 +31,44 @@ function useInitZeroFillingSize() {
|
|
|
29
31
|
return 0;
|
|
30
32
|
}
|
|
31
33
|
function ZeroFillingOptionsInnerPanel(props) {
|
|
34
|
+
const { size } = props;
|
|
32
35
|
const dispatch = (0, DispatchContext_1.useDispatch)();
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const previousPreviewRef = (0, react_1.useRef)(true);
|
|
37
|
+
function handleApplyFilter(values, triggerSource = 'apply') {
|
|
38
|
+
const { livePreview, ...options } = values;
|
|
39
|
+
switch (triggerSource) {
|
|
40
|
+
case 'onChange': {
|
|
41
|
+
if (livePreview || previousPreviewRef !== livePreview) {
|
|
42
|
+
dispatch({
|
|
43
|
+
type: 'CALCULATE_ZERO_FILLING_FILTER',
|
|
44
|
+
payload: {
|
|
45
|
+
options,
|
|
46
|
+
livePreview,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
case 'apply': {
|
|
53
|
+
dispatch({
|
|
54
|
+
type: 'APPLY_ZERO_FILLING_FILTER',
|
|
55
|
+
payload: {
|
|
56
|
+
options,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
61
|
+
default:
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
previousPreviewRef.current = livePreview;
|
|
42
65
|
}
|
|
43
66
|
function handleCancelFilter() {
|
|
44
67
|
dispatch({
|
|
45
68
|
type: 'RESET_SELECTED_TOOL',
|
|
46
69
|
});
|
|
47
70
|
}
|
|
48
|
-
|
|
49
|
-
dispatch({
|
|
50
|
-
type: 'CALCULATE_ZERO_FILLING_FILTER',
|
|
51
|
-
payload: {
|
|
52
|
-
nbPoints,
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function handleChangeSizeHandler(value) {
|
|
57
|
-
setSize(value);
|
|
58
|
-
}
|
|
59
|
-
(0, react_1.useEffect)(() => {
|
|
60
|
-
if (livePreview && size) {
|
|
61
|
-
dispatchLiveChanges(size);
|
|
62
|
-
}
|
|
63
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
64
|
-
}, [size, livePreview]);
|
|
65
|
-
return ((0, jsx_runtime_1.jsxs)(HeaderContainer_1.HeaderContainer, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Size: ", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(Select_1.default, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, value: size, onChange: handleChangeSizeHandler }) }), (0, jsx_runtime_1.jsx)(ui_1.Checkbox, { label: "Live preview", checked: livePreview, onChange: setLivePreview }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: handleApplyFilter, onCancel: handleCancelFilter })] }));
|
|
71
|
+
return ((0, jsx_runtime_1.jsx)(HeaderContainer_1.HeaderContainer, { children: (0, jsx_runtime_1.jsx)(formik_1.Formik, { onSubmit: (values) => handleApplyFilter(values), initialValues: { nbPoints: size, livePreview: true }, children: ({ submitForm }) => ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Label_1.default, { title: "Size: ", style: Header_1.headerLabelStyle, children: (0, jsx_runtime_1.jsx)(FormikSelect_1.default, { items: Sizes, style: { marginLeft: 10, marginRight: 10 }, name: "nbPoints" }) }), (0, jsx_runtime_1.jsx)(Label_1.default, { title: "Live preview ", htmlFor: "livePreview", style: { label: { padding: '0 5px' } }, children: (0, jsx_runtime_1.jsx)(FormikCheckBox_1.default, { name: "livePreview" }) }), (0, jsx_runtime_1.jsx)(FormikOnChange_1.default, { onChange: (values) => handleApplyFilter(values, 'onChange'), enableOnload: true }), (0, jsx_runtime_1.jsx)(ActionButtons_1.default, { onDone: submitForm, onCancel: handleCancelFilter })] })) }) }));
|
|
66
72
|
}
|
|
67
73
|
const MemoizedZeroFillingOptionsPanel = (0, react_1.memo)(ZeroFillingOptionsInnerPanel);
|
|
68
74
|
function ZeroFillingOptionsPanel() {
|
|
@@ -10,6 +10,7 @@ var HighlightEventSource;
|
|
|
10
10
|
HighlightEventSource["SIGNAL"] = "SIGNAL";
|
|
11
11
|
HighlightEventSource["RANGE"] = "RANGE";
|
|
12
12
|
HighlightEventSource["ZONE"] = "ZONE";
|
|
13
|
+
HighlightEventSource["BASELINE_ZONE"] = "BASELINE_ZONE";
|
|
13
14
|
HighlightEventSource["EXCLUSION_ZONE"] = "EXCLUSION_ZONE";
|
|
14
15
|
HighlightEventSource["MATRIX_GENERATION_EXCLUSION_ZONE"] = "MATRIX_GENERATION_EXCLUSION_ZONE";
|
|
15
16
|
HighlightEventSource["MULTIPLE_ANALYSIS_ZONE"] = "MULTIPLE_ANALYSIS_ZONE";
|
|
@@ -9,24 +9,28 @@ const react_1 = require("react");
|
|
|
9
9
|
const ChartContext_1 = require("../context/ChartContext");
|
|
10
10
|
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
11
11
|
const ToolTypes_1 = require("../toolbar/ToolTypes");
|
|
12
|
+
const useCheckExperimentalFeature_1 = __importDefault(require("./useCheckExperimentalFeature"));
|
|
12
13
|
const useSpectrum_1 = __importDefault(require("./useSpectrum"));
|
|
13
14
|
function useCheckToolsVisibility() {
|
|
14
15
|
const { displayerMode } = (0, ChartContext_1.useChartData)();
|
|
15
16
|
const preferences = (0, PreferencesContext_1.usePreferences)();
|
|
16
17
|
const spectrum = (0, useSpectrum_1.default)(null);
|
|
18
|
+
const isExperimentalFeatureActivated = (0, useCheckExperimentalFeature_1.default)();
|
|
17
19
|
return (0, react_1.useCallback)((toolKey, checkOptions = {}) => {
|
|
18
20
|
const { checkMode = true, checkSpectrumType = true, extraInfoCheckParameters, } = checkOptions;
|
|
21
|
+
const { spectraOptions, mode, isExperimental } = ToolTypes_1.options[toolKey];
|
|
19
22
|
const flag = (0, get_1.default)(preferences.current, `display.toolBarButtons.${toolKey}`, false);
|
|
20
|
-
const { spectraOptions, mode } = ToolTypes_1.options[toolKey];
|
|
21
23
|
const modeFlag = !checkMode || (checkMode && (!mode || displayerMode === mode));
|
|
22
24
|
const spectrumCheckFlag = !checkSpectrumType ||
|
|
23
25
|
(checkSpectrumType && checkSpectrum(spectrum, spectraOptions));
|
|
24
|
-
|
|
26
|
+
const isToolActivated = (flag && !isExperimental) ||
|
|
27
|
+
(isExperimental && isExperimentalFeatureActivated);
|
|
28
|
+
return (isToolActivated &&
|
|
25
29
|
modeFlag &&
|
|
26
30
|
spectrumCheckFlag &&
|
|
27
31
|
(!extraInfoCheckParameters ||
|
|
28
32
|
checkInfo(extraInfoCheckParameters, spectrum?.info)));
|
|
29
|
-
}, [displayerMode, preferences, spectrum]);
|
|
33
|
+
}, [displayerMode, isExperimentalFeatureActivated, preferences, spectrum]);
|
|
30
34
|
}
|
|
31
35
|
exports.useCheckToolsVisibility = useCheckToolsVisibility;
|
|
32
36
|
function checkSpectrum(spectrum, options) {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useResizerStatus = void 0;
|
|
4
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
5
|
+
const KeyModifierContext_1 = require("../context/KeyModifierContext");
|
|
6
|
+
function useResizerStatus(toolKey) {
|
|
7
|
+
const { toolOptions: { selectedTool }, } = (0, ChartContext_1.useChartData)();
|
|
8
|
+
const { shiftKey } = (0, KeyModifierContext_1.useKeyModifiers)();
|
|
9
|
+
return !shiftKey && selectedTool === toolKey;
|
|
10
|
+
}
|
|
11
|
+
exports.useResizerStatus = useResizerStatus;
|
|
@@ -7,7 +7,7 @@ function useSpectrum(defaultValue = null) {
|
|
|
7
7
|
const { data } = (0, ChartContext_1.useChartData)();
|
|
8
8
|
const activeSpectrum = (0, useActiveSpectrum_1.useActiveSpectrum)();
|
|
9
9
|
return (0, react_1.useMemo)(() => {
|
|
10
|
-
if (data && activeSpectrum
|
|
10
|
+
if (data && activeSpectrum?.id) {
|
|
11
11
|
const datum = data.find((datum) => datum.id === activeSpectrum.id) || defaultValue;
|
|
12
12
|
return datum;
|
|
13
13
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const styled_1 = __importDefault(require("@emotion/styled"));
|
|
8
|
+
const WrongP = styled_1.default.p `
|
|
9
|
+
background-color: white;
|
|
10
|
+
padding: 20px;
|
|
11
|
+
border-radius: 10px;
|
|
12
|
+
font-size: 30px;
|
|
13
|
+
text-align: center;
|
|
14
|
+
`;
|
|
15
|
+
const Details = styled_1.default.details `
|
|
16
|
+
margin-top: 10px;
|
|
17
|
+
white-space: pre-wrap;
|
|
18
|
+
background-color: white;
|
|
19
|
+
padding: 20px;
|
|
20
|
+
border-radius: 10px;
|
|
21
|
+
color: red;
|
|
22
|
+
`;
|
|
23
|
+
function ErrorOverlay(props) {
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { margin: 25 }, children: [(0, jsx_runtime_1.jsx)(WrongP, { children: "Something went wrong." }), (0, jsx_runtime_1.jsxs)(Details, { children: [(0, jsx_runtime_1.jsx)("p", { style: { textDecoration: 'underline' }, children: props.error.message }), props.error.stack] })] }));
|
|
25
|
+
}
|
|
26
|
+
exports.default = ErrorOverlay;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.InnerNMRium = void 0;
|
|
30
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
const react_1 = require("react");
|
|
32
|
+
const ui_1 = require("react-science/ui");
|
|
33
|
+
const react_use_1 = require("react-use");
|
|
34
|
+
const assignment_1 = require("../assignment");
|
|
35
|
+
const GlobalContext_1 = require("../context/GlobalContext");
|
|
36
|
+
const KeyModifierContext_1 = require("../context/KeyModifierContext");
|
|
37
|
+
const LoggerContext_1 = require("../context/LoggerContext");
|
|
38
|
+
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
39
|
+
const Alert_1 = require("../elements/popup/Alert");
|
|
40
|
+
const Modal_1 = require("../elements/popup/Modal");
|
|
41
|
+
const highlight_1 = require("../highlight");
|
|
42
|
+
const SpinnerContext_1 = require("../loader/SpinnerContext");
|
|
43
|
+
const preferencesReducer_1 = __importStar(require("../reducer/preferences/preferencesReducer"));
|
|
44
|
+
const export_1 = require("../utility/export");
|
|
45
|
+
const InnerNMRiumContents_1 = require("./InnerNMRiumContents");
|
|
46
|
+
const NMRiumStateProvider_1 = __importDefault(require("./NMRiumStateProvider"));
|
|
47
|
+
function InnerNMRium({ data: nmriumData, workspace, customWorkspaces, preferences, getSpinner = SpinnerContext_1.defaultGetSpinner, onChange, emptyText, innerRef, }) {
|
|
48
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
49
|
+
const elementsWrapperRef = (0, react_1.useRef)(null);
|
|
50
|
+
const viewerRef = (0, react_1.useRef)(null);
|
|
51
|
+
const [enableFullscreen, , disableFullscreen, toggleFullscreen] = (0, ui_1.useOnOff)(false);
|
|
52
|
+
const mainDivRef = (0, react_1.useRef)(null);
|
|
53
|
+
const isFullscreenEnabled = (0, react_use_1.useFullscreen)(rootRef, enableFullscreen, {
|
|
54
|
+
onClose: disableFullscreen,
|
|
55
|
+
});
|
|
56
|
+
const [preferencesState, dispatchPreferences] = (0, react_1.useReducer)(preferencesReducer_1.default, preferencesReducer_1.preferencesInitialState, preferencesReducer_1.initPreferencesState);
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
rootRef.current?.focus();
|
|
59
|
+
}, [isFullscreenEnabled]);
|
|
60
|
+
(0, react_1.useEffect)(() => {
|
|
61
|
+
dispatchPreferences({
|
|
62
|
+
type: 'INIT_PREFERENCES',
|
|
63
|
+
payload: {
|
|
64
|
+
preferences,
|
|
65
|
+
workspace,
|
|
66
|
+
customWorkspaces,
|
|
67
|
+
dispatch: dispatchPreferences,
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
}, [customWorkspaces, preferences, workspace]);
|
|
71
|
+
(0, react_1.useImperativeHandle)(innerRef, () => ({
|
|
72
|
+
getSpectraViewerAsBlob: () => {
|
|
73
|
+
return rootRef?.current ? (0, export_1.getBlob)(rootRef.current, 'nmrSVG') : null;
|
|
74
|
+
},
|
|
75
|
+
}), []);
|
|
76
|
+
return ((0, jsx_runtime_1.jsx)("div", { ref: mainDivRef, style: { height: '100%', position: 'relative' }, children: (0, jsx_runtime_1.jsx)(GlobalContext_1.GlobalProvider, { value: {
|
|
77
|
+
rootRef: rootRef.current,
|
|
78
|
+
elementsWrapperRef: elementsWrapperRef.current,
|
|
79
|
+
viewerRef: viewerRef.current,
|
|
80
|
+
}, children: (0, jsx_runtime_1.jsx)(PreferencesContext_1.PreferencesProvider, { value: preferencesState, children: (0, jsx_runtime_1.jsx)(LoggerContext_1.LoggerProvider, { children: (0, jsx_runtime_1.jsx)(KeyModifierContext_1.KeyModifiersProvider, { children: (0, jsx_runtime_1.jsx)(Alert_1.AlertProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(NMRiumStateProvider_1.default, { onChange: onChange, nmriumData: nmriumData, children: (0, jsx_runtime_1.jsx)(Modal_1.ModalProvider, { wrapperRef: elementsWrapperRef.current, children: (0, jsx_runtime_1.jsx)(highlight_1.HighlightProvider, { children: (0, jsx_runtime_1.jsx)(assignment_1.AssignmentProvider, { children: (0, jsx_runtime_1.jsx)(SpinnerContext_1.SpinnerProvider, { value: getSpinner, children: (0, jsx_runtime_1.jsx)(InnerNMRiumContents_1.InnerNMRiumContents, { isFullscreenEnabled: isFullscreenEnabled, toggleFullscreen: toggleFullscreen, emptyText: emptyText, mainDivRef: mainDivRef, elementsWrapperRef: elementsWrapperRef, rootRef: rootRef, viewerRef: viewerRef }) }) }) }) }) }) }) }) }) }) }) }));
|
|
81
|
+
}
|
|
82
|
+
exports.InnerNMRium = InnerNMRium;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InnerNMRiumContents = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("@emotion/react/jsx-runtime");
|
|
8
|
+
/** @jsxImportSource @emotion/react */
|
|
9
|
+
const react_1 = require("@emotion/react");
|
|
10
|
+
const react_2 = require("react");
|
|
11
|
+
const checkModifierKeyActivated_1 = __importDefault(require("../../data/utilities/checkModifierKeyActivated"));
|
|
12
|
+
const Viewer1D_1 = __importDefault(require("../1d/Viewer1D"));
|
|
13
|
+
const FloatMoleculeStructures_1 = __importDefault(require("../1d-2d/components/FloatMoleculeStructures"));
|
|
14
|
+
const Viewer2D_1 = __importDefault(require("../2d/Viewer2D"));
|
|
15
|
+
const KeysListenerTracker_1 = __importDefault(require("../EventsTrackers/KeysListenerTracker"));
|
|
16
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
17
|
+
const Header_1 = __importDefault(require("../header/Header"));
|
|
18
|
+
const DropZone_1 = __importDefault(require("../loader/DropZone"));
|
|
19
|
+
const Panels_1 = __importDefault(require("../panels/Panels"));
|
|
20
|
+
const ToolBar_1 = __importDefault(require("../toolbar/ToolBar"));
|
|
21
|
+
const SplitPaneWrapper_1 = require("./SplitPaneWrapper");
|
|
22
|
+
const StateError_1 = require("./StateError");
|
|
23
|
+
const viewerContainerStyle = (0, react_1.css) `
|
|
24
|
+
border: 0.55px #e6e6e6 solid;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex: 1;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
height: 100%;
|
|
29
|
+
margin-left: -1px;
|
|
30
|
+
`;
|
|
31
|
+
const containerStyles = (0, react_1.css) `
|
|
32
|
+
background-color: white;
|
|
33
|
+
width: 100%;
|
|
34
|
+
display: block;
|
|
35
|
+
height: 100%;
|
|
36
|
+
|
|
37
|
+
div:focus {
|
|
38
|
+
outline: none !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
button {
|
|
42
|
+
cursor: pointer;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
button,
|
|
46
|
+
button:active,
|
|
47
|
+
button:hover,
|
|
48
|
+
button:focus,
|
|
49
|
+
[type='button']:focus {
|
|
50
|
+
outline: none !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
button:disabled {
|
|
54
|
+
cursor: default;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
* {
|
|
58
|
+
-webkit-user-drag: none;
|
|
59
|
+
-moz-user-drag: none;
|
|
60
|
+
-o-user-drag: none;
|
|
61
|
+
user-select: none;
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
function InnerNMRiumContents(props) {
|
|
65
|
+
const { isFullscreenEnabled, toggleFullscreen, emptyText, mainDivRef, elementsWrapperRef, rootRef, viewerRef, } = props;
|
|
66
|
+
const { displayerMode } = (0, ChartContext_1.useChartData)();
|
|
67
|
+
const preventContextMenuHandler = (0, react_2.useCallback)((e) => {
|
|
68
|
+
if (!(0, checkModifierKeyActivated_1.default)(e)) {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
}
|
|
71
|
+
}, []);
|
|
72
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(StateError_1.StateError, {}), (0, jsx_runtime_1.jsx)("div", { className: "nmrium-container", ref: rootRef, css: containerStyles, onContextMenu: preventContextMenuHandler, style: { height: '100%', width: '100%' }, children: (0, jsx_runtime_1.jsx)(DropZone_1.default, { children: (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
73
|
+
display: 'flex',
|
|
74
|
+
flexDirection: 'column',
|
|
75
|
+
backgroundColor: 'white',
|
|
76
|
+
width: '100%',
|
|
77
|
+
}, children: [(0, jsx_runtime_1.jsx)(Header_1.default, { isFullscreenEnabled: isFullscreenEnabled, onEnableFullscreen: toggleFullscreen }), (0, jsx_runtime_1.jsxs)("div", { style: {
|
|
78
|
+
display: 'flex',
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
height: '100%',
|
|
81
|
+
}, children: [(0, jsx_runtime_1.jsx)(ToolBar_1.default, {}), (0, jsx_runtime_1.jsxs)(SplitPaneWrapper_1.SplitPaneWrapper, { children: [(0, jsx_runtime_1.jsxs)("div", { css: viewerContainerStyle, children: [(0, jsx_runtime_1.jsx)(KeysListenerTracker_1.default, { mainDivRef: mainDivRef }), (0, jsx_runtime_1.jsxs)("div", { id: "nmrium-viewer", "data-testid": "viewer", ref: viewerRef, style: {
|
|
82
|
+
width: '100%',
|
|
83
|
+
height: '100%',
|
|
84
|
+
position: 'relative',
|
|
85
|
+
}, children: [(0, jsx_runtime_1.jsx)(FloatMoleculeStructures_1.default, {}), displayerMode === '1D' ? ((0, jsx_runtime_1.jsx)(Viewer1D_1.default, { emptyText: emptyText })) : ((0, jsx_runtime_1.jsx)(Viewer2D_1.default, { emptyText: emptyText }))] })] }), (0, jsx_runtime_1.jsx)(Panels_1.default, {})] }), (0, jsx_runtime_1.jsx)("div", { ref: elementsWrapperRef, id: "main-wrapper", style: {
|
|
86
|
+
position: 'absolute',
|
|
87
|
+
pointerEvents: 'none',
|
|
88
|
+
zIndex: 2,
|
|
89
|
+
left: 0,
|
|
90
|
+
right: 0,
|
|
91
|
+
top: 0,
|
|
92
|
+
bottom: 0,
|
|
93
|
+
} }, String(isFullscreenEnabled))] })] }) }) })] }));
|
|
94
|
+
}
|
|
95
|
+
exports.InnerNMRiumContents = InnerNMRiumContents;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NMRium = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const react_error_boundary_1 = require("react-error-boundary");
|
|
10
|
+
const ui_1 = require("react-science/ui");
|
|
11
|
+
const ErrorOverlay_1 = __importDefault(require("./ErrorOverlay"));
|
|
12
|
+
const InnerNMRium_1 = require("./InnerNMRium");
|
|
13
|
+
const NMRiumBase = (0, react_1.forwardRef)(function NMRium(props, ref) {
|
|
14
|
+
const { noErrorBoundary = false, onError, ...otherProps } = props;
|
|
15
|
+
const innerNmrium = (0, jsx_runtime_1.jsx)(InnerNMRium_1.InnerNMRium, { ...otherProps, innerRef: ref });
|
|
16
|
+
const children = noErrorBoundary ? (innerNmrium) : ((0, jsx_runtime_1.jsx)(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ErrorOverlay_1.default, onError: onError, children: innerNmrium }));
|
|
17
|
+
return (0, jsx_runtime_1.jsx)(ui_1.RootLayout, { style: { width: '100%' }, children: children });
|
|
18
|
+
});
|
|
19
|
+
exports.NMRium = (0, react_1.memo)(NMRiumBase);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const nmr_load_save_1 = require("nmr-load-save");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const SpectraManager_1 = require("../../data/SpectraManager");
|
|
10
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
11
|
+
const DispatchContext_1 = require("../context/DispatchContext");
|
|
12
|
+
const LoggerContext_1 = require("../context/LoggerContext");
|
|
13
|
+
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
14
|
+
const IgnoreActions_1 = __importDefault(require("../reducer/IgnoreActions"));
|
|
15
|
+
const Reducer_1 = require("../reducer/Reducer");
|
|
16
|
+
const defaultData = {
|
|
17
|
+
spectra: [],
|
|
18
|
+
};
|
|
19
|
+
function NMRiumStateProvider(props) {
|
|
20
|
+
const { children, onChange, nmriumData = defaultData } = props;
|
|
21
|
+
const { logger } = (0, LoggerContext_1.useLogger)();
|
|
22
|
+
const preferencesState = (0, PreferencesContext_1.usePreferences)();
|
|
23
|
+
const [state, dispatchRaw] = (0, react_1.useReducer)(Reducer_1.spectrumReducer, Reducer_1.initialState, Reducer_1.initState);
|
|
24
|
+
const dispatch = (0, react_1.useCallback)((action) => {
|
|
25
|
+
logger.trace({ action }, `Dispatch main reducer action: ${action.type}`);
|
|
26
|
+
dispatchRaw(action);
|
|
27
|
+
}, [logger]);
|
|
28
|
+
const { source, data: spectraData, molecules, correlations, actionType, view, } = state;
|
|
29
|
+
const stateRef = (0, react_1.useRef)();
|
|
30
|
+
const handleChange = (0, react_1.useRef)(onChange);
|
|
31
|
+
(0, react_1.useEffect)(() => {
|
|
32
|
+
handleChange.current = onChange;
|
|
33
|
+
}, [onChange]);
|
|
34
|
+
(0, react_1.useEffect)(() => {
|
|
35
|
+
const { workspace, workspaces = {} } = preferencesState;
|
|
36
|
+
stateRef.current = (0, SpectraManager_1.toJSON)({ data: spectraData, molecules, correlations, source, view, actionType }, { current: workspaces[workspace.current] }, { serialize: false, exportTarget: 'onChange' });
|
|
37
|
+
}, [
|
|
38
|
+
actionType,
|
|
39
|
+
correlations,
|
|
40
|
+
molecules,
|
|
41
|
+
preferencesState,
|
|
42
|
+
source,
|
|
43
|
+
spectraData,
|
|
44
|
+
view,
|
|
45
|
+
]);
|
|
46
|
+
(0, react_1.useEffect)(() => {
|
|
47
|
+
// trigger onChange callback if data object changed
|
|
48
|
+
if ((0, IgnoreActions_1.default)(actionType)) {
|
|
49
|
+
handleChange.current?.(stateRef.current, 'data');
|
|
50
|
+
}
|
|
51
|
+
}, [actionType, correlations, molecules, source, spectraData]);
|
|
52
|
+
(0, react_1.useEffect)(() => {
|
|
53
|
+
// trigger onChange callback if view object changed
|
|
54
|
+
handleChange.current?.(stateRef.current, 'view');
|
|
55
|
+
}, [view]);
|
|
56
|
+
(0, react_1.useEffect)(() => {
|
|
57
|
+
// trigger onChange callback if settings changed
|
|
58
|
+
handleChange.current?.(stateRef.current, 'settings');
|
|
59
|
+
}, [preferencesState]);
|
|
60
|
+
(0, react_1.useEffect)(() => {
|
|
61
|
+
dispatch({
|
|
62
|
+
type: 'SET_LOADING_FLAG',
|
|
63
|
+
payload: { isLoading: true },
|
|
64
|
+
});
|
|
65
|
+
if (nmriumData) {
|
|
66
|
+
void (0, nmr_load_save_1.readNMRiumObject)(nmriumData)
|
|
67
|
+
.then((nmriumState) => {
|
|
68
|
+
dispatch({ type: 'INITIATE', payload: { nmriumState } });
|
|
69
|
+
})
|
|
70
|
+
.catch((error) => {
|
|
71
|
+
dispatch({ type: 'SET_LOADING_FLAG', payload: { isLoading: false } });
|
|
72
|
+
// eslint-disable-next-line no-alert
|
|
73
|
+
alert(error.message);
|
|
74
|
+
reportError(error);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}, [nmriumData, dispatch]);
|
|
78
|
+
return ((0, jsx_runtime_1.jsx)(DispatchContext_1.DispatchProvider, { value: dispatch, children: (0, jsx_runtime_1.jsx)(ChartContext_1.ChartDataProvider, { value: state, children: children }) }));
|
|
79
|
+
}
|
|
80
|
+
exports.default = NMRiumStateProvider;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SplitPaneWrapper = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const ui_1 = require("react-science/ui");
|
|
6
|
-
const PreferencesContext_1 = require("
|
|
6
|
+
const PreferencesContext_1 = require("../context/PreferencesContext");
|
|
7
7
|
function SplitPaneWrapper({ children }) {
|
|
8
8
|
const { current, dispatch } = (0, PreferencesContext_1.usePreferences)();
|
|
9
9
|
const { general: { verticalSplitterPosition, verticalSplitterCloseThreshold }, display: { general = {} }, } = current;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StateError = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const ChartContext_1 = require("../context/ChartContext");
|
|
6
|
+
const LoggerContext_1 = require("../context/LoggerContext");
|
|
7
|
+
/**
|
|
8
|
+
* Alert user in UI when state have errorAction (error from reducer)
|
|
9
|
+
*/
|
|
10
|
+
function StateError() {
|
|
11
|
+
const { errorAction } = (0, ChartContext_1.useChartData)();
|
|
12
|
+
const { logger } = (0, LoggerContext_1.useLogger)();
|
|
13
|
+
(0, react_1.useEffect)(() => {
|
|
14
|
+
if (!errorAction)
|
|
15
|
+
return;
|
|
16
|
+
logger.error(errorAction);
|
|
17
|
+
}, [errorAction, logger]);
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
exports.StateError = StateError;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.serializeNMRiumState = void 0;
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
var nmr_load_save_1 = require("nmr-load-save");
|
|
20
|
+
Object.defineProperty(exports, "serializeNMRiumState", { enumerable: true, get: function () { return nmr_load_save_1.serializeNmriumState; } });
|
|
21
|
+
__exportStar(require("./NMRium"), exports);
|