nmrium 1.6.1 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/FloatingRanges.js +4 -4
- package/lib/component/1d/FloatingRanges.js.map +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js +1 -1
- package/lib/component/1d/database/DatabaseSpectrum.js.map +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js +1 -1
- package/lib/component/1d/multiAnalysis/MultiAnalysisRanges.js.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts.map +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +4 -2
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotations.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotations.js +2 -2
- package/lib/component/1d/peaks/PeakAnnotations.js.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js +4 -4
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
- package/lib/component/1d/peaks/Peaks.d.ts +4 -1
- package/lib/component/1d/peaks/Peaks.d.ts.map +1 -1
- package/lib/component/1d/peaks/Peaks.js +5 -2
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/ranges/Atoms.d.ts.map +1 -1
- package/lib/component/1d/ranges/Atoms.js +24 -9
- package/lib/component/1d/ranges/Atoms.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts.map +1 -1
- package/lib/component/1d/ranges/Range.js +3 -3
- package/lib/component/1d/ranges/Range.js.map +1 -1
- package/lib/component/1d/ranges/RangesIntegrals.d.ts.map +1 -1
- package/lib/component/1d/ranges/RangesIntegrals.js +5 -3
- package/lib/component/1d/ranges/RangesIntegrals.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts +2 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +32 -41
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.d.ts.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.js.map +1 -1
- package/lib/component/2d/FooterBanner.js +2 -2
- package/lib/component/2d/FooterBanner.js.map +1 -1
- package/lib/component/2d/YAxis.d.ts +0 -1
- package/lib/component/2d/YAxis.d.ts.map +1 -1
- package/lib/component/2d/YAxis.js +11 -4
- package/lib/component/2d/YAxis.js.map +1 -1
- package/lib/component/2d/useTracesSpectra.d.ts.map +1 -1
- package/lib/component/2d/useTracesSpectra.js +2 -0
- package/lib/component/2d/useTracesSpectra.js.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts +2 -9
- package/lib/component/2d/utilities/extractSpectrumSignals.d.ts.map +1 -1
- package/lib/component/2d/utilities/extractSpectrumSignals.js +4 -5
- package/lib/component/2d/utilities/extractSpectrumSignals.js.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.d.ts.map +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +7 -10
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.d.ts.map +1 -1
- package/lib/component/2d/zones/ZonesAssignmentsLabels.js.map +1 -1
- package/lib/component/context/DispatchContext.d.ts +2 -2
- package/lib/component/context/DispatchContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.js +8 -9
- package/lib/component/context/LoggerContext.js.map +1 -1
- package/lib/component/context/PreferencesContext.d.ts +7 -3
- package/lib/component/context/PreferencesContext.d.ts.map +1 -1
- package/lib/component/context/PreferencesContext.js +1 -2
- package/lib/component/context/PreferencesContext.js.map +1 -1
- package/lib/component/elements/D3Axis.d.ts.map +1 -1
- package/lib/component/elements/D3Axis.js +1 -1
- package/lib/component/elements/D3Axis.js.map +1 -1
- package/lib/component/elements/Sections.js +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.d.ts.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +2 -2
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js.map +1 -1
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +24 -6
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/loader/Spinner.js +1 -1
- package/lib/component/loader/Spinner.js.map +1 -1
- package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
- package/lib/component/loader/useLoadFiles.js +60 -25
- package/lib/component/loader/useLoadFiles.js.map +1 -1
- package/lib/component/main/InnerNMRium.d.ts.map +1 -1
- package/lib/component/main/InnerNMRium.js +4 -2
- package/lib/component/main/InnerNMRium.js.map +1 -1
- package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
- package/lib/component/main/NMRiumStateProvider.js +17 -6
- package/lib/component/main/NMRiumStateProvider.js.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.d.ts.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -3
- package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts.map +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +7 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js.map +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +0 -2
- package/lib/component/modal/MultipletAnalysisModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +10 -3
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModalContents.js +0 -2
- package/lib/component/modal/changeSum/ChangeSumModalContents.js.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.d.ts.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.js +0 -2
- package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts +2 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.d.ts.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +1 -2
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.d.ts.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js +16 -0
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.js.map +1 -1
- package/lib/component/modal/setting/settingsValidation.js +2 -2
- package/lib/component/modal/setting/settingsValidation.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js +2 -1
- package/lib/component/panels/IntegralsPanel/IntegralPanel.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralTable.js +4 -3
- package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts +6 -0
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js +87 -0
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculePanel.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +18 -28
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +32 -25
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts +13 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +66 -0
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/{useAtomAssignment.d.ts → hooks/useAtomAssignment.d.ts} +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/{useAtomAssignment.js → hooks/useAtomAssignment.js} +50 -19
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts +12 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js +58 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts +5 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.js +2 -0
- package/lib/component/panels/MoleculesPanel/utilities/AtomData.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts +16 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js +47 -0
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts +18 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +31 -0
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts +3 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js +12 -0
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts +4 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js +25 -0
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts +6 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts.map +1 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js +18 -0
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.js.map +1 -0
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +24 -26
- package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +3 -2
- package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +3 -2
- package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTable.js +2 -1
- package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/RelativeColumn.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js +3 -2
- package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js +2 -2
- package/lib/component/panels/SummaryPanel/utilities/Utilities.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js +0 -4
- package/lib/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.js.map +1 -1
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js +8 -8
- package/lib/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js +6 -1
- package/lib/component/panels/ZonesPanel/ZonesPanel.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts +8 -9
- package/lib/component/panels/ZonesPanel/ZonesTable.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTable.js +3 -2
- package/lib/component/panels/ZonesPanel/ZonesTable.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js +0 -2
- package/lib/component/panels/ZonesPanel/ZonesTableRow.js.map +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts +7 -7
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.d.ts.map +1 -1
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js +3 -3
- package/lib/component/panels/ZonesPanel/hooks/useMapZones.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +13 -10
- package/lib/component/panels/databasePanel/DatabasePanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js +0 -2
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js.map +1 -1
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts +9 -0
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.d.ts.map +1 -0
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +27 -0
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -0
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.d.ts.map +1 -1
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js +0 -2
- package/lib/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.js.map +1 -1
- package/lib/component/reducer/IgnoreActions.d.ts.map +1 -1
- package/lib/component/reducer/IgnoreActions.js +2 -1
- package/lib/component/reducer/IgnoreActions.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts +13 -1
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +10 -3
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/DatabaseActions.js +2 -1
- package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
- package/lib/component/reducer/actions/IntegralsActions.js.map +1 -1
- package/lib/component/reducer/actions/{LoadActions.d.ts → LoadAction.d.ts} +16 -5
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -0
- package/lib/component/reducer/actions/{LoadActions.js → LoadAction.js} +60 -16
- package/lib/component/reducer/actions/LoadAction.js.map +1 -0
- package/lib/component/reducer/actions/MoleculeActions.d.ts +22 -6
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +43 -29
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +12 -6
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +37 -16
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts +3 -3
- package/lib/component/reducer/actions/ZonesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +9 -4
- package/lib/component/reducer/actions/ZonesActions.js.map +1 -1
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts +4 -0
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.d.ts.map +1 -0
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js +7 -0
- package/lib/component/reducer/preferences/actions/changeDefaultMoleculeSettings.js.map +1 -0
- package/lib/component/reducer/preferences/actions/initPreferences.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/initPreferences.js +1 -2
- package/lib/component/reducer/preferences/actions/initPreferences.js.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.d.ts.map +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +2 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +9 -8
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +3 -1
- package/lib/component/reducer/preferences/preferencesReducer.js.map +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.js +1 -0
- package/lib/component/toolbar/ToolTypes.js.map +1 -1
- package/lib/component/utility/export.d.ts +3 -3
- package/lib/component/utility/export.d.ts.map +1 -1
- package/lib/component/utility/export.js +13 -21
- package/lib/component/utility/export.js.map +1 -1
- package/lib/component/utility/getClosePeak.js +1 -1
- package/lib/component/utility/getClosePeak.js.map +1 -1
- package/lib/component/utility/save_as.d.ts +9 -0
- package/lib/component/utility/save_as.d.ts.map +1 -0
- package/lib/component/utility/save_as.js +7 -0
- package/lib/component/utility/save_as.js.map +1 -0
- package/lib/component/workspaces/assignment.d.ts.map +1 -1
- package/lib/component/workspaces/assignment.js +7 -0
- package/lib/component/workspaces/assignment.js.map +1 -1
- package/lib/component/workspaces/basic.d.ts.map +1 -1
- package/lib/component/workspaces/basic.js +5 -0
- package/lib/component/workspaces/basic.js.map +1 -1
- package/lib/component/workspaces/embedded.d.ts.map +1 -1
- package/lib/component/workspaces/embedded.js +5 -0
- package/lib/component/workspaces/embedded.js.map +1 -1
- package/lib/component/workspaces/exercise.d.ts.map +1 -1
- package/lib/component/workspaces/exercise.js +5 -0
- package/lib/component/workspaces/exercise.js.map +1 -1
- package/lib/component/workspaces/prediction.d.ts.map +1 -1
- package/lib/component/workspaces/prediction.js +5 -0
- package/lib/component/workspaces/prediction.js.map +1 -1
- package/lib/component/workspaces/process1D.d.ts.map +1 -1
- package/lib/component/workspaces/process1D.js +6 -0
- package/lib/component/workspaces/process1D.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +18 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/PredictionManager.d.ts.map +1 -1
- package/lib/data/PredictionManager.js +13 -9
- package/lib/data/PredictionManager.js.map +1 -1
- package/lib/data/SpectraManager.d.ts +45 -4
- package/lib/data/SpectraManager.d.ts.map +1 -1
- package/lib/data/SpectraManager.js +69 -12
- package/lib/data/SpectraManager.js.map +1 -1
- package/lib/data/constants/signalsKinds.d.ts +1 -6
- package/lib/data/constants/signalsKinds.d.ts.map +1 -1
- package/lib/data/constants/signalsKinds.js +2 -17
- package/lib/data/constants/signalsKinds.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js +1 -1
- package/lib/data/data1d/Spectrum1D/generateJGraphData.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +16 -14
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts +1 -10
- package/lib/data/data1d/Spectrum1D/integrals/initiateIntegrals.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/isRangeAssigned.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +6 -4
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +5 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +1 -1
- package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +6 -4
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts +2 -2
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.d.ts +2 -22
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js +3 -1
- package/lib/data/molecules/Molecule.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +3 -2
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +4 -2
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/data/utilities/RangeUtilities.d.ts +3 -2
- package/lib/data/utilities/RangeUtilities.d.ts.map +1 -1
- package/lib/data/utilities/RangeUtilities.js +9 -3
- package/lib/data/utilities/RangeUtilities.js.map +1 -1
- package/lib/data/utilities/ZoneUtilities.d.ts.map +1 -1
- package/lib/data/utilities/ZoneUtilities.js +1 -2
- package/lib/data/utilities/ZoneUtilities.js.map +1 -1
- package/lib/data/utilities/isProton.d.ts +2 -0
- package/lib/data/utilities/isProton.d.ts.map +1 -0
- package/lib/data/utilities/isProton.js +4 -0
- package/lib/data/utilities/isProton.js.map +1 -0
- package/lib/versionInfo.js +1 -1
- package/package.json +32 -32
- package/src/component/1d/FloatingRanges.tsx +5 -5
- package/src/component/1d/database/DatabaseSpectrum.tsx +1 -1
- package/src/component/1d/multiAnalysis/MultiAnalysisRanges.tsx +1 -1
- package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +4 -2
- package/src/component/1d/peaks/PeakAnnotations.tsx +2 -1
- package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +11 -1
- package/src/component/1d/peaks/Peaks.tsx +9 -3
- package/src/component/1d/ranges/Atoms.tsx +36 -13
- package/src/component/1d/ranges/Range.tsx +4 -3
- package/src/component/1d/ranges/RangesIntegrals.tsx +6 -2
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +38 -78
- package/src/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.tsx +5 -2
- package/src/component/2d/FooterBanner.tsx +2 -2
- package/src/component/2d/YAxis.tsx +31 -13
- package/src/component/2d/useTracesSpectra.ts +3 -0
- package/src/component/2d/utilities/extractSpectrumSignals.ts +6 -16
- package/src/component/2d/zones/SignalsGuideLines.tsx +11 -9
- package/src/component/2d/zones/ZonesAssignmentsLabels.tsx +2 -3
- package/src/component/context/DispatchContext.tsx +2 -2
- package/src/component/context/LoggerContext.tsx +8 -11
- package/src/component/context/PreferencesContext.tsx +8 -5
- package/src/component/elements/D3Axis.tsx +1 -2
- package/src/component/elements/Sections.tsx +1 -1
- package/src/component/hooks/useActiveSpectrumRangesViewState.ts +2 -2
- package/src/component/hooks/useExport.tsx +38 -6
- package/src/component/loader/Spinner.tsx +1 -1
- package/src/component/loader/useLoadFiles.ts +79 -30
- package/src/component/main/InnerNMRium.tsx +6 -2
- package/src/component/main/NMRiumStateProvider.tsx +18 -7
- package/src/component/modal/LoadJCAMPModal.tsx +10 -5
- package/src/component/modal/MoleculeStructureEditorModal.tsx +11 -3
- package/src/component/modal/MultipletAnalysisModal.tsx +0 -2
- package/src/component/modal/SaveAsModal.tsx +35 -6
- package/src/component/modal/changeSum/ChangeSumModalContents.tsx +0 -2
- package/src/component/modal/changeSum/SelectMolecule.tsx +0 -2
- package/src/component/modal/setting/settings-tabs/DatabasesTabContent.tsx +1 -3
- package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +16 -0
- package/src/component/modal/setting/settingsValidation.ts +2 -2
- package/src/component/panels/IntegralsPanel/IntegralPanel.tsx +2 -6
- package/src/component/panels/IntegralsPanel/IntegralTable.tsx +4 -3
- package/src/component/panels/MoleculesPanel/MoleculeOptionsPanel.tsx +160 -0
- package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +77 -102
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +54 -35
- package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +117 -0
- package/src/component/panels/MoleculesPanel/{useAtomAssignment.tsx → hooks/useAtomAssignment.tsx} +71 -30
- package/src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts +74 -0
- package/src/component/panels/MoleculesPanel/utilities/AtomData.ts +4 -0
- package/src/component/panels/MoleculesPanel/utilities/extractFromAtom.ts +63 -0
- package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +59 -0
- package/src/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.ts +12 -0
- package/src/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.ts +36 -0
- package/src/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.ts +20 -0
- package/src/component/panels/PeaksPanel/PeaksPanel.tsx +25 -35
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +3 -2
- package/src/component/panels/RangesPanel/RangesHeader.tsx +3 -2
- package/src/component/panels/RangesPanel/RangesTable.tsx +10 -8
- package/src/component/panels/RangesPanel/TableColumns/RangeAssignmentsColumn.tsx +3 -3
- package/src/component/panels/RangesPanel/TableColumns/RelativeColumn.tsx +2 -2
- package/src/component/panels/SpectraPanel/SpectraTable.tsx +3 -2
- package/src/component/panels/SummaryPanel/utilities/Utilities.ts +2 -2
- package/src/component/panels/ZonesPanel/TableColumns/SignalAssignmentsColumns.tsx +1 -1
- package/src/component/panels/ZonesPanel/TableColumns/SignalDeltaColumn.tsx +0 -4
- package/src/component/panels/ZonesPanel/TableColumns/ZoneAssignmentsColumn.tsx +9 -9
- package/src/component/panels/ZonesPanel/ZonesPanel.tsx +15 -5
- package/src/component/panels/ZonesPanel/ZonesTable.tsx +9 -10
- package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +0 -2
- package/src/component/panels/ZonesPanel/hooks/useMapZones.ts +11 -11
- package/src/component/panels/databasePanel/DatabasePanel.tsx +18 -14
- package/src/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.tsx +0 -2
- package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +36 -0
- package/src/component/panels/multipleAnalysisPanel/preferences/MultipleAnalysisCodeEditor.tsx +0 -2
- package/src/component/reducer/IgnoreActions.ts +2 -1
- package/src/component/reducer/Reducer.ts +28 -4
- package/src/component/reducer/actions/DatabaseActions.ts +3 -0
- package/src/component/reducer/actions/IntegralsActions.ts +1 -1
- package/src/component/reducer/actions/{LoadActions.ts → LoadAction.ts} +87 -25
- package/src/component/reducer/actions/MoleculeActions.ts +91 -44
- package/src/component/reducer/actions/RangesActions.ts +66 -30
- package/src/component/reducer/actions/ZonesActions.ts +18 -10
- package/src/component/reducer/preferences/actions/changeDefaultMoleculeSettings.ts +16 -0
- package/src/component/reducer/preferences/actions/initPreferences.ts +0 -3
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +2 -1
- package/src/component/reducer/preferences/preferencesReducer.ts +20 -11
- package/src/component/toolbar/ToolTypes.ts +1 -0
- package/src/component/utility/export.ts +15 -20
- package/src/component/utility/getClosePeak.ts +1 -1
- package/src/component/utility/save_as.ts +16 -0
- package/src/component/workspaces/assignment.ts +7 -0
- package/src/component/workspaces/basic.ts +5 -0
- package/src/component/workspaces/embedded.ts +5 -0
- package/src/component/workspaces/exercise.ts +5 -0
- package/src/component/workspaces/prediction.ts +5 -0
- package/src/component/workspaces/process1D.ts +6 -0
- package/src/component/workspaces/workspaceDefaultProperties.ts +18 -0
- package/src/data/PredictionManager.ts +21 -14
- package/src/data/SpectraManager.ts +90 -19
- package/src/data/constants/signalsKinds.ts +5 -20
- package/src/data/data1d/Spectrum1D/generateJGraphData.ts +1 -1
- package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +16 -16
- package/src/data/data1d/Spectrum1D/isRangeAssigned.ts +1 -0
- package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +7 -4
- package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +8 -1
- package/src/data/data1d/Spectrum1D/ranges/detectSignals.ts +1 -1
- package/src/data/data2d/Spectrum2D/contours.ts +2 -3
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +6 -7
- package/src/data/molecules/Molecule.ts +9 -23
- package/src/data/molecules/MoleculeManager.ts +10 -8
- package/src/data/utilities/RangeUtilities.ts +12 -4
- package/src/data/utilities/ZoneUtilities.ts +1 -3
- package/src/data/utilities/isProton.ts +3 -0
- package/src/index.tsx +0 -3
- package/src/versionInfo.ts +1 -1
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts +0 -43
- package/lib/component/panels/MoleculesPanel/Utilities.d.ts.map +0 -1
- package/lib/component/panels/MoleculesPanel/Utilities.js +0 -126
- package/lib/component/panels/MoleculesPanel/Utilities.js.map +0 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.d.ts.map +0 -1
- package/lib/component/panels/MoleculesPanel/useAtomAssignment.js.map +0 -1
- package/lib/component/reducer/actions/LoadActions.d.ts.map +0 -1
- package/lib/component/reducer/actions/LoadActions.js.map +0 -1
- package/lib/component/utility/isHomoNuclear.d.ts +0 -2
- package/lib/component/utility/isHomoNuclear.d.ts.map +0 -1
- package/lib/component/utility/isHomoNuclear.js +0 -11
- package/lib/component/utility/isHomoNuclear.js.map +0 -1
- package/lib/data/types/common/SignalKind.d.ts +0 -2
- package/lib/data/types/common/SignalKind.d.ts.map +0 -1
- package/lib/data/types/common/SignalKind.js +0 -2
- package/lib/data/types/common/SignalKind.js.map +0 -1
- package/lib/utils/stringCapitalize.d.ts +0 -2
- package/lib/utils/stringCapitalize.d.ts.map +0 -1
- package/lib/utils/stringCapitalize.js +0 -4
- package/lib/utils/stringCapitalize.js.map +0 -1
- package/src/component/panels/MoleculesPanel/Utilities.ts +0 -186
- package/src/component/utility/isHomoNuclear.ts +0 -11
- package/src/data/types/common/SignalKind.ts +0 -10
- package/src/utils/stringCapitalize.ts +0 -3
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
|
2
2
|
import type { SerializedStyles } from '@emotion/react';
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { memo, useEffect, useState } from 'react';
|
|
4
|
+
import { memo, useCallback, useEffect, useState } from 'react';
|
|
5
5
|
import { ResponsiveChart } from 'react-d3-utils';
|
|
6
|
-
import OCLnmr from 'react-ocl-nmr';
|
|
7
6
|
|
|
8
7
|
import type {
|
|
9
8
|
MoleculesView,
|
|
10
9
|
StateMoleculeExtended,
|
|
11
10
|
} from '../../../data/molecules/Molecule.js';
|
|
12
11
|
import { useChartData } from '../../context/ChartContext.js';
|
|
13
|
-
import { useDispatch } from '../../context/DispatchContext.js';
|
|
14
12
|
import { NextPrev } from '../../elements/NextPrev.js';
|
|
15
|
-
import { useHighlightColor } from '../../hooks/useHighlightColor.js';
|
|
16
13
|
import { useMoleculeEditor } from '../../modal/MoleculeStructureEditorModal.js';
|
|
17
14
|
|
|
18
15
|
import MoleculeHeader from './MoleculeHeader.js';
|
|
16
|
+
import { MoleculeOptionsPanel } from './MoleculeOptionsPanel.tsx';
|
|
19
17
|
import MoleculePanelHeader from './MoleculePanelHeader.js';
|
|
20
|
-
import
|
|
18
|
+
import { MoleculeStructure } from './MoleculeStructure.tsx';
|
|
21
19
|
|
|
22
20
|
const styles: Record<
|
|
23
21
|
'panel' | 'innerPanel' | 'molecule' | 'slider' | 'items',
|
|
@@ -61,22 +59,13 @@ function MoleculePanelInner(props: MoleculePanelInnerProps) {
|
|
|
61
59
|
const { molecules: moleculesProp, moleculesView } = props;
|
|
62
60
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
63
61
|
const [molecules, setMolecules] = useState<StateMoleculeExtended[]>([]);
|
|
62
|
+
const [isFlipped, setFlipStatus] = useState(false);
|
|
64
63
|
|
|
65
|
-
const dispatch = useDispatch();
|
|
66
64
|
const { modal, openMoleculeEditor } = useMoleculeEditor();
|
|
67
|
-
const highlightColor = useHighlightColor();
|
|
68
|
-
|
|
69
|
-
const {
|
|
70
|
-
currentDiaIDsToHighlight,
|
|
71
|
-
handleOnAtomHover,
|
|
72
|
-
handleOnClickAtom,
|
|
73
|
-
assignedDiaIDsMerged,
|
|
74
|
-
} = useAtomAssignment();
|
|
75
65
|
|
|
76
66
|
useEffect(() => {
|
|
77
67
|
if (moleculesProp) {
|
|
78
|
-
//
|
|
79
|
-
// eslint-disable-next-line react-hooks/set-state-in-effect
|
|
68
|
+
// eslint-disable-next-line react-you-might-not-need-an-effect/no-derived-state
|
|
80
69
|
setMolecules((prevMolecules) => {
|
|
81
70
|
if (moleculesProp.length > prevMolecules.length) {
|
|
82
71
|
setCurrentIndex(molecules.length);
|
|
@@ -86,14 +75,6 @@ function MoleculePanelInner(props: MoleculePanelInnerProps) {
|
|
|
86
75
|
}
|
|
87
76
|
}, [molecules.length, moleculesProp]);
|
|
88
77
|
|
|
89
|
-
function handleReplaceMolecule(molecule: any, molfile: any) {
|
|
90
|
-
const { id, label } = molecule;
|
|
91
|
-
dispatch({
|
|
92
|
-
type: 'SET_MOLECULE',
|
|
93
|
-
payload: { molfile, id, label },
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
|
|
97
78
|
function moleculeIndexHandler(index: any) {
|
|
98
79
|
setCurrentIndex(index);
|
|
99
80
|
}
|
|
@@ -101,88 +82,82 @@ function MoleculePanelInner(props: MoleculePanelInnerProps) {
|
|
|
101
82
|
const lastIndex = molecules?.length > 0 ? molecules.length - 1 : 0;
|
|
102
83
|
const activeIndex = Math.min(currentIndex, lastIndex);
|
|
103
84
|
|
|
85
|
+
const settingsPanelHandler = useCallback(() => {
|
|
86
|
+
setFlipStatus(!isFlipped);
|
|
87
|
+
}, [isFlipped]);
|
|
88
|
+
|
|
89
|
+
const onClose = useCallback(() => {
|
|
90
|
+
setFlipStatus(false);
|
|
91
|
+
}, []);
|
|
92
|
+
|
|
104
93
|
return (
|
|
105
94
|
<div css={styles.panel}>
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
setHoverAtom={handleOnAtomHover}
|
|
164
|
-
showAtomNumber={
|
|
165
|
-
moleculesView?.[mol.id]?.showAtomNumber || false
|
|
166
|
-
}
|
|
167
|
-
/>
|
|
168
|
-
</div>
|
|
95
|
+
{!isFlipped && (
|
|
96
|
+
<MoleculePanelHeader
|
|
97
|
+
currentIndex={activeIndex}
|
|
98
|
+
moleculesView={moleculesView}
|
|
99
|
+
molecules={molecules}
|
|
100
|
+
onOpenMoleculeEditor={() => openMoleculeEditor()}
|
|
101
|
+
onMoleculeIndexChange={moleculeIndexHandler}
|
|
102
|
+
onClickPreferences={settingsPanelHandler}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
{isFlipped && <MoleculeOptionsPanel onClose={onClose} />}
|
|
106
|
+
{!isFlipped && (
|
|
107
|
+
<div css={styles.innerPanel}>
|
|
108
|
+
<div css={styles.molecule}>
|
|
109
|
+
<ResponsiveChart>
|
|
110
|
+
{({ height, width }) => {
|
|
111
|
+
return (
|
|
112
|
+
<NextPrev
|
|
113
|
+
onChange={(slideIndex) => setCurrentIndex(slideIndex)}
|
|
114
|
+
index={currentIndex}
|
|
115
|
+
>
|
|
116
|
+
{molecules && molecules.length > 0 ? (
|
|
117
|
+
molecules.map((mol: StateMoleculeExtended, index) => {
|
|
118
|
+
return (
|
|
119
|
+
<div key={mol.id} css={styles.items}>
|
|
120
|
+
<MoleculeHeader
|
|
121
|
+
currentMolecule={mol}
|
|
122
|
+
molecules={molecules}
|
|
123
|
+
/>
|
|
124
|
+
|
|
125
|
+
<div
|
|
126
|
+
css={styles.slider}
|
|
127
|
+
className="mol-svg-container"
|
|
128
|
+
onDoubleClick={() => openMoleculeEditor(mol)}
|
|
129
|
+
style={{
|
|
130
|
+
backgroundColor:
|
|
131
|
+
(index + 1) % 2 !== 0 ? '#fafafa' : 'white',
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
<MoleculeStructure
|
|
135
|
+
index={index}
|
|
136
|
+
width={width}
|
|
137
|
+
height={height - 60}
|
|
138
|
+
molecule={mol}
|
|
139
|
+
moleculeView={moleculesView?.[mol.id] || {}}
|
|
140
|
+
/>
|
|
141
|
+
</div>
|
|
142
|
+
</div>
|
|
143
|
+
);
|
|
144
|
+
})
|
|
145
|
+
) : (
|
|
146
|
+
<div
|
|
147
|
+
css={styles.slider}
|
|
148
|
+
style={{ height: '100%' }}
|
|
149
|
+
onClick={() => openMoleculeEditor()}
|
|
150
|
+
>
|
|
151
|
+
<span>Click to draw molecule</span>
|
|
169
152
|
</div>
|
|
170
|
-
)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
>
|
|
177
|
-
<span>Click to draw molecule</span>
|
|
178
|
-
</div>
|
|
179
|
-
)}
|
|
180
|
-
</NextPrev>
|
|
181
|
-
);
|
|
182
|
-
}}
|
|
183
|
-
</ResponsiveChart>
|
|
153
|
+
)}
|
|
154
|
+
</NextPrev>
|
|
155
|
+
);
|
|
156
|
+
}}
|
|
157
|
+
</ResponsiveChart>
|
|
158
|
+
</div>
|
|
184
159
|
</div>
|
|
185
|
-
|
|
160
|
+
)}
|
|
186
161
|
{modal}
|
|
187
162
|
</div>
|
|
188
163
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Molecule } from 'openchemlib';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
3
|
import { useCallback } from 'react';
|
|
4
4
|
import {
|
|
5
5
|
FaCopy,
|
|
@@ -8,10 +8,12 @@ import {
|
|
|
8
8
|
FaFileImage,
|
|
9
9
|
FaPaste,
|
|
10
10
|
FaPlus,
|
|
11
|
+
FaRegBookmark,
|
|
11
12
|
FaRegTrashAlt,
|
|
12
13
|
} from 'react-icons/fa';
|
|
13
14
|
import { FaMaximize, FaMinimize } from 'react-icons/fa6';
|
|
14
15
|
import { IoOpenOutline } from 'react-icons/io5';
|
|
16
|
+
import { MdNumbers, MdOutlineLabelOff } from 'react-icons/md';
|
|
15
17
|
import { PanelHeader, Toolbar } from 'react-science/ui';
|
|
16
18
|
|
|
17
19
|
import type {
|
|
@@ -23,28 +25,20 @@ import { ClipboardFallbackModal } from '../../../utils/clipboard/clipboardCompon
|
|
|
23
25
|
import { useClipboard } from '../../../utils/clipboard/clipboardHooks.js';
|
|
24
26
|
import { useDispatch } from '../../context/DispatchContext.js';
|
|
25
27
|
import { useGlobal } from '../../context/GlobalContext.js';
|
|
28
|
+
import { usePreferences } from '../../context/PreferencesContext.tsx';
|
|
26
29
|
import { useToaster } from '../../context/ToasterContext.js';
|
|
27
30
|
import { useTopicMolecule } from '../../context/TopicMoleculeContext.js';
|
|
28
31
|
import type { ToolbarPopoverMenuItem } from '../../elements/ToolbarPopoverItem.js';
|
|
29
32
|
import { ToolbarPopoverItem } from '../../elements/ToolbarPopoverItem.js';
|
|
30
33
|
import AboutPredictionModal from '../../modal/AboutPredictionModal.js';
|
|
31
34
|
import PredictSpectraModal from '../../modal/PredictSpectraModal.js';
|
|
35
|
+
import { booleanToString } from '../../utility/booleanToString.ts';
|
|
32
36
|
import {
|
|
33
37
|
browserNotSupportedErrorToast,
|
|
34
38
|
copyPNGToClipboard,
|
|
35
39
|
exportAsSVG,
|
|
36
40
|
} from '../../utility/export.js';
|
|
37
|
-
|
|
38
|
-
const styles: Record<'atomLabel', CSSProperties> = {
|
|
39
|
-
atomLabel: {
|
|
40
|
-
width: '14px',
|
|
41
|
-
height: '14px',
|
|
42
|
-
padding: 0,
|
|
43
|
-
margin: 0,
|
|
44
|
-
textAlign: 'center',
|
|
45
|
-
lineHeight: 1,
|
|
46
|
-
},
|
|
47
|
-
};
|
|
41
|
+
import { useMoleculeAnnotationCore } from '../hooks/useMoleculeAnnotationCore.ts';
|
|
48
42
|
|
|
49
43
|
const MOL_EXPORT_MENU: ToolbarPopoverMenuItem[] = [
|
|
50
44
|
{
|
|
@@ -110,7 +104,9 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
|
|
|
110
104
|
const { rootRef } = useGlobal();
|
|
111
105
|
const toaster = useToaster();
|
|
112
106
|
const dispatch = useDispatch();
|
|
113
|
-
|
|
107
|
+
const {
|
|
108
|
+
current: { defaultMoleculeSettings },
|
|
109
|
+
} = usePreferences();
|
|
114
110
|
const moleculeKey = molecules?.[currentIndex]?.id;
|
|
115
111
|
const saveAsSVGHandler = useCallback(() => {
|
|
116
112
|
if (!rootRef) return;
|
|
@@ -208,7 +204,10 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
|
|
|
208
204
|
if (!text) return;
|
|
209
205
|
try {
|
|
210
206
|
const molecules = getMolecules(text);
|
|
211
|
-
dispatch({
|
|
207
|
+
dispatch({
|
|
208
|
+
type: 'ADD_MOLECULES',
|
|
209
|
+
payload: { molecules, defaultMoleculeSettings },
|
|
210
|
+
});
|
|
212
211
|
} catch {
|
|
213
212
|
toaster.show({
|
|
214
213
|
intent: 'danger',
|
|
@@ -237,13 +236,6 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
|
|
|
237
236
|
});
|
|
238
237
|
}
|
|
239
238
|
|
|
240
|
-
function showAtomNumbersHandler() {
|
|
241
|
-
dispatch({
|
|
242
|
-
type: 'TOGGLE_MOLECULE_ATOM_NUMBER',
|
|
243
|
-
payload: { id: moleculeKey },
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
239
|
const topicMolecule = useTopicMolecule();
|
|
248
240
|
|
|
249
241
|
function expandMoleculeHydrogens(expand?: boolean) {
|
|
@@ -258,30 +250,49 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
|
|
|
258
250
|
dispatch({ type: 'SET_MOLECULE', payload: { id, label, molfile } });
|
|
259
251
|
}
|
|
260
252
|
|
|
253
|
+
function clearCustomAtomLabels() {
|
|
254
|
+
const currentMolecule = molecules[currentIndex];
|
|
255
|
+
|
|
256
|
+
if (!currentMolecule) return;
|
|
257
|
+
const { id, label, molfile } = currentMolecule;
|
|
258
|
+
|
|
259
|
+
const molecule = Molecule.fromMolfile(molfile);
|
|
260
|
+
|
|
261
|
+
for (let atom = 0; atom < molecule.getAllAtoms(); atom++) {
|
|
262
|
+
molecule.setAtomCustomLabel(atom, null);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
dispatch({
|
|
266
|
+
type: 'SET_MOLECULE',
|
|
267
|
+
payload: { id, label, molfile: molecule.toMolfileV3() },
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
|
|
261
271
|
const hasMolecules = molecules && molecules.length > 0;
|
|
262
272
|
const showCounter = hasMolecules && renderSource !== 'predictionPanel';
|
|
263
|
-
|
|
264
273
|
const moreMenu: ToolbarPopoverMenuItem[] = [
|
|
265
274
|
{
|
|
266
275
|
icon: <FaMaximize />,
|
|
267
276
|
text: 'Expand all hydrogens',
|
|
268
|
-
data: {
|
|
269
|
-
id: 'expandAllHydrogens',
|
|
270
|
-
},
|
|
271
277
|
disabled: !hasMolecules,
|
|
272
278
|
onClick: () => expandMoleculeHydrogens(true),
|
|
273
279
|
},
|
|
274
280
|
{
|
|
275
281
|
icon: <FaMinimize />,
|
|
276
282
|
text: 'Collapse all hydrogens',
|
|
277
|
-
data: {
|
|
278
|
-
id: 'collapseAllHydrogens',
|
|
279
|
-
},
|
|
280
283
|
disabled: !hasMolecules,
|
|
281
284
|
onClick: () => expandMoleculeHydrogens(false),
|
|
282
285
|
},
|
|
286
|
+
{
|
|
287
|
+
icon: <MdOutlineLabelOff />,
|
|
288
|
+
text: 'Clear custom atom labels',
|
|
289
|
+
disabled: !hasMolecules,
|
|
290
|
+
onClick: () => clearCustomAtomLabels(),
|
|
291
|
+
},
|
|
283
292
|
];
|
|
284
293
|
|
|
294
|
+
const { handleChangeAtomAnnotation, isAnnotation } =
|
|
295
|
+
useMoleculeAnnotationCore(moleculeKey, moleculesView[moleculeKey]);
|
|
285
296
|
return (
|
|
286
297
|
<PanelHeader
|
|
287
298
|
onClickSettings={onClickPreferences}
|
|
@@ -324,6 +335,21 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
|
|
|
324
335
|
{hasMolecules && (
|
|
325
336
|
<PredictSpectraModal molecule={molecules[currentIndex]} />
|
|
326
337
|
)}
|
|
338
|
+
|
|
339
|
+
<Toolbar.Item
|
|
340
|
+
tooltip={`${booleanToString(!isAnnotation('atom-numbers'))} atom number`}
|
|
341
|
+
icon={<MdNumbers />}
|
|
342
|
+
onClick={() => handleChangeAtomAnnotation('atom-numbers')}
|
|
343
|
+
active={isAnnotation('atom-numbers')}
|
|
344
|
+
disabled={!hasMolecules}
|
|
345
|
+
/>
|
|
346
|
+
<Toolbar.Item
|
|
347
|
+
tooltip={`${booleanToString(!isAnnotation('custom-labels'))} custom labels`}
|
|
348
|
+
icon={<FaRegBookmark />}
|
|
349
|
+
onClick={() => handleChangeAtomAnnotation('custom-labels')}
|
|
350
|
+
active={isAnnotation('custom-labels')}
|
|
351
|
+
disabled={!hasMolecules}
|
|
352
|
+
/>
|
|
327
353
|
</>
|
|
328
354
|
)}
|
|
329
355
|
|
|
@@ -334,13 +360,6 @@ export default function MoleculePanelHeader(props: MoleculePanelHeaderProps) {
|
|
|
334
360
|
active={moleculesView?.[moleculeKey]?.floating.visible || false}
|
|
335
361
|
disabled={!hasMolecules}
|
|
336
362
|
/>
|
|
337
|
-
<Toolbar.Item
|
|
338
|
-
tooltip="Show atom number"
|
|
339
|
-
icon={<p style={styles.atomLabel}>#</p>}
|
|
340
|
-
onClick={showAtomNumbersHandler}
|
|
341
|
-
active={moleculesView?.[moleculeKey]?.showAtomNumber || false}
|
|
342
|
-
disabled={!hasMolecules}
|
|
343
|
-
/>
|
|
344
363
|
|
|
345
364
|
<ToolbarPopoverItem
|
|
346
365
|
options={moreMenu}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { MoleculeView } from '@zakodium/nmrium-core';
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import type { MolfileSvgRendererProps } from 'react-ocl';
|
|
4
|
+
import { MolfileSvgRenderer } from 'react-ocl';
|
|
5
|
+
import type { OCLnmrProps } from 'react-ocl-nmr';
|
|
6
|
+
import OCLnmr from 'react-ocl-nmr';
|
|
7
|
+
|
|
8
|
+
import type { StateMoleculeExtended } from '../../../data/molecules/Molecule.ts';
|
|
9
|
+
import { useDispatch } from '../../context/DispatchContext.tsx';
|
|
10
|
+
import { useHighlightColor } from '../../hooks/useHighlightColor.ts';
|
|
11
|
+
|
|
12
|
+
import useAtomAssignment from './hooks/useAtomAssignment.tsx';
|
|
13
|
+
import { useExtractAtomAssignmentLabel } from './hooks/useExtractAtomAssignmentLabel.ts';
|
|
14
|
+
|
|
15
|
+
interface MoleculeStructureProps extends Pick<OCLnmrProps, 'width' | 'height'> {
|
|
16
|
+
moleculeView: MoleculeView;
|
|
17
|
+
renderAsSVG?: boolean;
|
|
18
|
+
molecule: StateMoleculeExtended;
|
|
19
|
+
showMoleculeLabel?: boolean;
|
|
20
|
+
index?: number;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function MoleculeStructure(props: MoleculeStructureProps) {
|
|
24
|
+
const {
|
|
25
|
+
molecule,
|
|
26
|
+
moleculeView,
|
|
27
|
+
width,
|
|
28
|
+
height,
|
|
29
|
+
renderAsSVG = false,
|
|
30
|
+
showMoleculeLabel,
|
|
31
|
+
index = 0,
|
|
32
|
+
} = props;
|
|
33
|
+
const {
|
|
34
|
+
currentDiaIDsToHighlight,
|
|
35
|
+
handleOnAtomHover,
|
|
36
|
+
handleOnClickAtom,
|
|
37
|
+
assignedDiaIDsMerged,
|
|
38
|
+
} = useAtomAssignment();
|
|
39
|
+
const highlightColor = useHighlightColor();
|
|
40
|
+
const dispatch = useDispatch();
|
|
41
|
+
const { onAtomHover, getAssignmentLabelByHover, getLastHoverAtom } =
|
|
42
|
+
useExtractAtomAssignmentLabel();
|
|
43
|
+
//TODO Temporary workaround to prevent other focused elements from being triggered by the space key
|
|
44
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
45
|
+
|
|
46
|
+
const atomHighlightColor =
|
|
47
|
+
currentDiaIDsToHighlight?.length > 0 ? '#ff000080' : highlightColor;
|
|
48
|
+
const baseProps: MolfileSvgRendererProps = {
|
|
49
|
+
height,
|
|
50
|
+
width,
|
|
51
|
+
label: (showMoleculeLabel ?? moleculeView.showLabel) ? molecule.label : '',
|
|
52
|
+
labelFontSize: 15,
|
|
53
|
+
labelColor: 'rgba(138, 59, 59, 1)',
|
|
54
|
+
molfile: molecule.molfile,
|
|
55
|
+
atomHighlightColor,
|
|
56
|
+
atomHighlightOpacity: 1,
|
|
57
|
+
showAtomNumber: moleculeView.atomAnnotation === 'atom-numbers',
|
|
58
|
+
noAtomCustomLabels: moleculeView.atomAnnotation !== 'custom-labels',
|
|
59
|
+
noCarbonLabelWithCustomLabel: true,
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
if (renderAsSVG) {
|
|
63
|
+
return <MolfileSvgRenderer {...baseProps} />;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<div tabIndex={0} ref={containerRef}>
|
|
68
|
+
<OCLnmr
|
|
69
|
+
id={`molSVG${index}`}
|
|
70
|
+
{...baseProps}
|
|
71
|
+
setSelectedAtom={(atom, event) =>
|
|
72
|
+
handleOnClickAtom(atom, event, molecule.id)
|
|
73
|
+
}
|
|
74
|
+
highlights={
|
|
75
|
+
currentDiaIDsToHighlight?.length > 0
|
|
76
|
+
? currentDiaIDsToHighlight
|
|
77
|
+
: assignedDiaIDsMerged
|
|
78
|
+
}
|
|
79
|
+
atomHighlightStrategy="prefer-editor-props"
|
|
80
|
+
setHoverAtom={(atom) => {
|
|
81
|
+
//TODO Temporary workaround to prevent other focused elements from being triggered by the space key
|
|
82
|
+
containerRef.current?.focus();
|
|
83
|
+
handleOnAtomHover(atom);
|
|
84
|
+
if (atom) {
|
|
85
|
+
onAtomHover(atom);
|
|
86
|
+
}
|
|
87
|
+
}}
|
|
88
|
+
setMolfile={(molfile) => {
|
|
89
|
+
const diaObject = getLastHoverAtom();
|
|
90
|
+
const assignmentObj = getAssignmentLabelByHover(molecule.id, molfile);
|
|
91
|
+
|
|
92
|
+
if (assignmentObj && diaObject) {
|
|
93
|
+
dispatch({
|
|
94
|
+
type: 'CHANGE_ASSIGNMENT_LABEL_BY_DIAIDS',
|
|
95
|
+
payload: {
|
|
96
|
+
diaIDs: [diaObject.idCode].concat(
|
|
97
|
+
diaObject.attachedHydrogensIDCodes,
|
|
98
|
+
),
|
|
99
|
+
assignment: assignmentObj.assignment,
|
|
100
|
+
previousAssignment: assignmentObj.previousAssignment,
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
dispatch({
|
|
106
|
+
type: 'SET_MOLECULE',
|
|
107
|
+
payload: {
|
|
108
|
+
molfile,
|
|
109
|
+
id: molecule.id,
|
|
110
|
+
label: molecule.label,
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
}}
|
|
114
|
+
/>
|
|
115
|
+
</div>
|
|
116
|
+
);
|
|
117
|
+
}
|