nmrium 1.10.1 → 1.12.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/BrushTracker1D.d.ts.map +1 -1
- package/lib/component/1d/BrushTracker1D.js +7 -0
- package/lib/component/1d/BrushTracker1D.js.map +1 -1
- package/lib/component/1d/FloatPublicationString.d.ts.map +1 -1
- package/lib/component/1d/FloatPublicationString.js +170 -109
- package/lib/component/1d/FloatPublicationString.js.map +1 -1
- package/lib/component/1d/FloatingRanges.d.ts.map +1 -1
- package/lib/component/1d/FloatingRanges.js +3 -3
- package/lib/component/1d/FloatingRanges.js.map +1 -1
- package/lib/component/1d/SVGContent1D.js +1 -1
- package/lib/component/1d/SVGContent1D.js.map +1 -1
- package/lib/component/1d/inset/DraggableInset.d.ts.map +1 -1
- package/lib/component/1d/inset/DraggableInset.js +4 -4
- package/lib/component/1d/inset/DraggableInset.js.map +1 -1
- package/lib/component/1d/matrix/Boxplot.js +1 -1
- package/lib/component/1d/matrix/Stocsy.js +1 -1
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js +2 -2
- package/lib/component/1d/multiplicityTree/MultiplicityTree.js.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.js +1 -1
- package/lib/component/1d/peaks/PeakAnnotationsSpreadMode.js.map +1 -1
- package/lib/component/1d/peaks/Peaks.js +2 -2
- package/lib/component/1d/peaks/Peaks.js.map +1 -1
- package/lib/component/1d/ranges/Range.d.ts +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/Ranges.js +2 -2
- package/lib/component/1d/ranges/Ranges.js.map +1 -1
- package/lib/component/1d/ranges/RangesIntegrals.js +1 -1
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts +1 -1
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.d.ts.map +1 -1
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js +4 -4
- package/lib/component/1d/ranges/useAssignmentsPopoverActionsButtons.js.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.d.ts.map +1 -1
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js +14 -5
- package/lib/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.js.map +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.d.ts.map +1 -1
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js +2 -2
- package/lib/component/1d-2d/components/SpectrumInfoBlock.js.map +1 -1
- package/lib/component/2d/FooterBanner.d.ts +1 -1
- package/lib/component/2d/SVGContent2D.d.ts +1 -1
- package/lib/component/2d/YAxis.js +3 -3
- package/lib/component/2d/YAxis.js.map +1 -1
- package/lib/component/2d/ft/FTContainer.d.ts +1 -1
- package/lib/component/2d/tools/XYLabelPointer.d.ts +1 -1
- package/lib/component/2d/useTracesSpectra.js +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js +5 -5
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/2d/zones/Zone.js +1 -1
- package/lib/component/2d/zones/Zone.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +9 -3
- package/lib/component/EventsTrackers/KeysListenerTracker.js.map +1 -1
- package/lib/component/context/LoggerContext.d.ts +1 -0
- package/lib/component/context/LoggerContext.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.js.map +1 -1
- package/lib/component/context/PreferencesContext.d.ts +1 -1
- package/lib/component/context/PreferencesContext.d.ts.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.d.ts +9 -5
- package/lib/component/elements/ActionsButtonsPopover.d.ts.map +1 -1
- package/lib/component/elements/ActionsButtonsPopover.js +42 -10
- package/lib/component/elements/ActionsButtonsPopover.js.map +1 -1
- package/lib/component/elements/Alert.d.ts.map +1 -1
- package/lib/component/elements/Alert.js +3 -2
- package/lib/component/elements/Alert.js.map +1 -1
- package/lib/component/elements/DraggableDialog.d.ts +1 -1
- package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
- package/lib/component/elements/NextPrev.d.ts.map +1 -1
- package/lib/component/elements/NextPrev.js +23 -4
- package/lib/component/elements/NextPrev.js.map +1 -1
- package/lib/component/elements/StandardDialog.d.ts +3 -0
- package/lib/component/elements/StandardDialog.d.ts.map +1 -0
- package/lib/component/elements/StandardDialog.js +7 -0
- package/lib/component/elements/StandardDialog.js.map +1 -0
- package/lib/component/elements/ToolbarPopoverItem.d.ts +7 -2
- package/lib/component/elements/ToolbarPopoverItem.d.ts.map +1 -1
- package/lib/component/elements/ToolbarPopoverItem.js +6 -2
- package/lib/component/elements/ToolbarPopoverItem.js.map +1 -1
- package/lib/component/elements/export/ExportManager.js +1 -1
- package/lib/component/elements/export/ExportManager.js.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.js +3 -2
- package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
- package/lib/component/elements/export/utilities/exportOptionValidationSchema.d.ts +1 -1
- package/lib/component/elements/print/PrintContent.d.ts.map +1 -1
- package/lib/component/elements/print/PrintContent.js +3 -2
- package/lib/component/elements/print/PrintContent.js.map +1 -1
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/Header.js.map +1 -1
- package/lib/component/hooks/useActiveNucleusTab.js +1 -1
- package/lib/component/hooks/useActiveNucleusTab.js.map +1 -1
- package/lib/component/hooks/useActiveSpectrumRangesViewState.js +1 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js +1 -1
- package/lib/component/hooks/useDatumWithSpectraStatistics.js.map +1 -1
- package/lib/component/hooks/useExport.d.ts +7 -7
- package/lib/component/hooks/useExport.d.ts.map +1 -1
- package/lib/component/hooks/useExport.js +23 -43
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/hooks/useSVGUnitConverter.d.ts.map +1 -1
- package/lib/component/hooks/useSVGUnitConverter.js +12 -9
- package/lib/component/hooks/useSVGUnitConverter.js.map +1 -1
- package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +3 -2
- package/lib/component/hooks/useSaveSettings.js.map +1 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.d.ts.map +1 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.js +3 -1
- package/lib/component/hooks/useSetActiveSpectrumAction.js.map +1 -1
- package/lib/component/hooks/useTextMetrics.d.ts +16 -1
- package/lib/component/hooks/useTextMetrics.d.ts.map +1 -1
- package/lib/component/hooks/useTextMetrics.js +43 -15
- package/lib/component/hooks/useTextMetrics.js.map +1 -1
- package/lib/component/hooks/useToggleSpectraVisibility.js +1 -1
- package/lib/component/hooks/use_acs_settings.d.ts +4 -0
- package/lib/component/hooks/use_acs_settings.d.ts.map +1 -0
- package/lib/component/hooks/use_acs_settings.js +21 -0
- package/lib/component/hooks/use_acs_settings.js.map +1 -0
- package/lib/component/hooks/use_publication_strings.d.ts +9 -0
- package/lib/component/hooks/use_publication_strings.d.ts.map +1 -0
- package/lib/component/hooks/use_publication_strings.js +42 -0
- package/lib/component/hooks/use_publication_strings.js.map +1 -0
- package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
- package/lib/component/loader/useLoadFiles.js +81 -86
- package/lib/component/loader/useLoadFiles.js.map +1 -1
- package/lib/component/main/ErrorOverlay.d.ts.map +1 -1
- package/lib/component/main/ErrorOverlay.js +6 -1
- package/lib/component/main/ErrorOverlay.js.map +1 -1
- package/lib/component/main/InnerNMRiumContents.d.ts.map +1 -1
- package/lib/component/main/InnerNMRiumContents.js +1 -2
- package/lib/component/main/InnerNMRiumContents.js.map +1 -1
- package/lib/component/main/NMRiumViewer.js +2 -2
- package/lib/component/main/NMRiumViewer.js.map +1 -1
- package/lib/component/main/NMRiumViewerWrapper.d.ts.map +1 -1
- package/lib/component/main/NMRiumViewerWrapper.js +9 -3
- package/lib/component/main/NMRiumViewerWrapper.js.map +1 -1
- package/lib/component/modal/AboutPredictionModal.js +2 -2
- package/lib/component/modal/AboutPredictionModal.js.map +1 -1
- package/lib/component/modal/AboutSpectrumSimulationModal.js +2 -2
- package/lib/component/modal/AboutSpectrumSimulationModal.js.map +1 -1
- package/lib/component/modal/EditPeakShapeModal.d.ts.map +1 -1
- package/lib/component/modal/EditPeakShapeModal.js +4 -3
- package/lib/component/modal/EditPeakShapeModal.js.map +1 -1
- package/lib/component/modal/ExportAsJcampModal.d.ts.map +1 -1
- package/lib/component/modal/ExportAsJcampModal.js +3 -2
- package/lib/component/modal/ExportAsJcampModal.js.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.js +3 -2
- package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.d.ts.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +3 -2
- package/lib/component/modal/LoadJCAMPModal.js.map +1 -1
- package/lib/component/modal/LogsHistoryModal.d.ts.map +1 -1
- package/lib/component/modal/LogsHistoryModal.js +3 -2
- package/lib/component/modal/LogsHistoryModal.js.map +1 -1
- package/lib/component/modal/MoleculeAutoLabelsDatabaseModal.d.ts +6 -0
- package/lib/component/modal/MoleculeAutoLabelsDatabaseModal.d.ts.map +1 -0
- package/lib/component/modal/MoleculeAutoLabelsDatabaseModal.js +128 -0
- package/lib/component/modal/MoleculeAutoLabelsDatabaseModal.js.map +1 -0
- package/lib/component/modal/MoleculeStructureEditorModal.d.ts.map +1 -1
- package/lib/component/modal/MoleculeStructureEditorModal.js +4 -3
- package/lib/component/modal/MoleculeStructureEditorModal.js.map +1 -1
- package/lib/component/modal/MultipletAnalysisModal.d.ts.map +1 -1
- package/lib/component/modal/MultipletAnalysisModal.js +2 -2
- package/lib/component/modal/MultipletAnalysisModal.js.map +1 -1
- package/lib/component/modal/PredictSpectraModal.d.ts.map +1 -1
- package/lib/component/modal/PredictSpectraModal.js +3 -2
- package/lib/component/modal/PredictSpectraModal.js.map +1 -1
- package/lib/component/modal/PublicationStringModal.d.ts +10 -1
- package/lib/component/modal/PublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/PublicationStringModal.js +89 -77
- package/lib/component/modal/PublicationStringModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +6 -9
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.js +2 -2
- package/lib/component/modal/aboutUs/AboutUsModal.js.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.d.ts.map +1 -1
- package/lib/component/modal/changeSum/ChangeSumModal.js +2 -2
- package/lib/component/modal/changeSum/ChangeSumModal.js.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.js +4 -1
- package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
- package/lib/component/modal/editRange/EditRangeModal.js +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
- package/lib/component/modal/metaImportation/MetaImportationModal.js +3 -2
- package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
- package/lib/component/modal/setting/{GeneralSettings.d.ts → general_settings.d.ts} +1 -1
- package/lib/component/modal/setting/general_settings.d.ts.map +1 -0
- package/lib/component/modal/setting/{GeneralSettings.js → general_settings.js} +11 -5
- package/lib/component/modal/setting/general_settings.js.map +1 -0
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/DatabasesTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/DisplayTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/NucleiTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js.map +1 -1
- package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js +1 -1
- package/lib/component/modal/setting/settings-tabs/SpectraColorsTabContent.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts +8 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +65 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +624 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js +42 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +624 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.js +22 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +7 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js +50 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts +7 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js +105 -0
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +622 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts +55 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js +123 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.js +11 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +622 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js +34 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +622 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.js +26 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +622 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js +123 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +622 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js +40 -0
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.d.ts +10 -0
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.js +40 -0
- package/lib/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.d.ts +166 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.js +58 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts +40 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js +37 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/import_filters_tab_validation.d.ts +37 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/import_filters_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/import_filters_tab_validation.js +26 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/import_filters_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts +9 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js +18 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts +167 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js +69 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.js.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +342 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts.map +1 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.js +51 -0
- package/lib/component/modal/setting/tanstack_general_settings/validation.js.map +1 -0
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js +2 -2
- package/lib/component/panels/MoleculesPanel/MoleculeOptionsPanel.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculePanel.js +2 -2
- 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 +75 -20
- package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js +4 -4
- package/lib/component/panels/MoleculesPanel/MoleculeStructure.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js +17 -17
- package/lib/component/panels/MoleculesPanel/hooks/useAtomAssignment.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/extractFromAtom.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getAssignIds.js +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.js.map +1 -1
- package/lib/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.d.ts +1 -1
- package/lib/component/panels/Panels.d.ts +0 -9
- package/lib/component/panels/Panels.d.ts.map +1 -1
- package/lib/component/panels/Panels.js +13 -54
- package/lib/component/panels/Panels.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/RangesHeader.js +23 -15
- package/lib/component/panels/RangesPanel/RangesHeader.js.map +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js +1 -1
- package/lib/component/panels/RangesPanel/RangesTableRow.js.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +2 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraTable.js +1 -1
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +3 -2
- package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js.map +1 -1
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +3 -2
- package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseInfo.js +1 -1
- package/lib/component/panels/databasePanel/DatabasePanel.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +2 -2
- package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +1 -1
- package/lib/component/panels/header/DefaultPanelHeader.d.ts.map +1 -1
- package/lib/component/panels/header/DefaultPanelHeader.js +2 -1
- package/lib/component/panels/header/DefaultPanelHeader.js.map +1 -1
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js +1 -1
- package/lib/component/panels/hooks/useMoleculeAnnotationCore.js.map +1 -1
- package/lib/component/panels/hooks/useTogglePanel.d.ts.map +1 -1
- package/lib/component/panels/hooks/useTogglePanel.js +4 -3
- package/lib/component/panels/hooks/useTogglePanel.js.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.js +3 -2
- package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
- package/lib/component/panels/informationPanel/InformationPanel.d.ts.map +1 -1
- package/lib/component/panels/informationPanel/InformationPanel.js +38 -3
- package/lib/component/panels/informationPanel/InformationPanel.js.map +1 -1
- package/lib/component/reducer/actions/AssignmentsActions.js +3 -3
- package/lib/component/reducer/actions/CorrelationsActions.js +2 -2
- package/lib/component/reducer/actions/DatabaseActions.js +1 -1
- package/lib/component/reducer/actions/DomainActions.js +1 -1
- package/lib/component/reducer/actions/InsetActions.js +2 -2
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
- package/lib/component/reducer/actions/LoadAction.js +8 -2
- package/lib/component/reducer/actions/LoadAction.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +23 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +5 -5
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/PreferencesActions.js +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -1
- package/lib/component/reducer/actions/RangesActions.js +2 -2
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts +2 -1
- package/lib/component/reducer/actions/SpectraActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/SpectraActions.js +3 -3
- package/lib/component/reducer/actions/SpectraActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +2 -2
- package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
- package/lib/component/reducer/actions/ZonesActions.js +2 -2
- package/lib/component/reducer/helper/get2DRange.d.ts +1 -1
- package/lib/component/reducer/preferences/actions/analyzeSpectra.d.ts +2 -1
- package/lib/component/reducer/preferences/actions/analyzeSpectra.d.ts.map +1 -1
- package/lib/component/reducer/preferences/actions/analyzeSpectra.js +10 -0
- package/lib/component/reducer/preferences/actions/analyzeSpectra.js.map +1 -1
- package/lib/component/reducer/preferences/actions/toggleOpenSplitPanel.d.ts +4 -0
- package/lib/component/reducer/preferences/actions/toggleOpenSplitPanel.d.ts.map +1 -0
- package/lib/component/reducer/preferences/actions/toggleOpenSplitPanel.js +9 -0
- package/lib/component/reducer/preferences/actions/toggleOpenSplitPanel.js.map +1 -0
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +8 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +8 -3
- package/lib/component/reducer/preferences/preferencesReducer.js.map +1 -1
- package/lib/component/toolbar/ToolBar.d.ts.map +1 -1
- package/lib/component/toolbar/ToolBar.js +11 -8
- package/lib/component/toolbar/ToolBar.js.map +1 -1
- package/lib/component/toolbar/toolbarMenu.d.ts +5 -1
- package/lib/component/toolbar/toolbarMenu.d.ts.map +1 -1
- package/lib/component/toolbar/toolbarMenu.js +1 -1
- package/lib/component/toolbar/toolbarMenu.js.map +1 -1
- package/lib/component/utility/export.d.ts +2 -1
- package/lib/component/utility/export.d.ts.map +1 -1
- package/lib/component/utility/export.js +6 -2
- package/lib/component/utility/export.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +3 -0
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/PredictionManager.js +1 -1
- package/lib/data/SpectraManager.d.ts +1 -1
- package/lib/data/SpectraManager.d.ts.map +1 -1
- package/lib/data/SpectraManager.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/autoRangesDetection.js +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectRanges.js +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts +1 -0
- package/lib/data/data1d/multipleSpectraAnalysis.d.ts.map +1 -1
- package/lib/data/data1d/multipleSpectraAnalysis.js +14 -0
- package/lib/data/data1d/multipleSpectraAnalysis.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +13 -6
- package/lib/data/data2d/Spectrum2D/contours.js.map +1 -1
- package/lib/data/molecules/MoleculeManager.d.ts +6 -1
- package/lib/data/molecules/MoleculeManager.d.ts.map +1 -1
- package/lib/data/molecules/MoleculeManager.js +3 -2
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/data/utilities/FindUtilities.js +2 -2
- package/lib/utils/clipboard/clipboardComponents.js +2 -2
- package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +45 -45
- package/src/component/1d/BrushTracker1D.tsx +8 -0
- package/src/component/1d/FloatPublicationString.tsx +275 -177
- package/src/component/1d/FloatingRanges.tsx +1 -3
- package/src/component/1d/SVGContent1D.tsx +1 -1
- package/src/component/1d/inset/DraggableInset.tsx +2 -4
- package/src/component/1d/integral/IntegralResizable.tsx +1 -1
- package/src/component/1d/matrix/Boxplot.tsx +1 -1
- package/src/component/1d/matrix/Stocsy.tsx +1 -1
- package/src/component/1d/multiAnalysis/AnalysisRange.tsx +1 -1
- package/src/component/1d/multiplicityTree/MultiplicityTree.tsx +2 -2
- package/src/component/1d/peaks/PeakAnnotations.tsx +2 -2
- package/src/component/1d/peaks/PeakAnnotationsSpreadMode.tsx +2 -2
- package/src/component/1d/peaks/Peaks.tsx +2 -2
- package/src/component/1d/ranges/Range.tsx +5 -5
- package/src/component/1d/ranges/Ranges.tsx +2 -2
- package/src/component/1d/ranges/RangesIntegrals.tsx +1 -1
- package/src/component/1d/ranges/useAssignmentsPopoverActionsButtons.tsx +5 -5
- package/src/component/1d/tool/BaseLineZones.tsx +1 -1
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +14 -6
- package/src/component/1d-2d/components/SpectrumInfoBlock.tsx +1 -2
- package/src/component/2d/FooterBanner.tsx +1 -1
- package/src/component/2d/SVGContent2D.tsx +1 -1
- package/src/component/2d/YAxis.tsx +3 -3
- package/src/component/2d/ft/FTContainer.tsx +1 -1
- package/src/component/2d/tools/XYLabelPointer.tsx +1 -1
- package/src/component/2d/useTracesSpectra.ts +1 -1
- package/src/component/2d/zones/SignalsGuideLines.tsx +5 -5
- package/src/component/2d/zones/Zone.tsx +1 -1
- package/src/component/EventsTrackers/BrushTracker.tsx +1 -1
- package/src/component/EventsTrackers/KeysListenerTracker.tsx +9 -3
- package/src/component/context/LoggerContext.tsx +9 -0
- package/src/component/context/PreferencesContext.tsx +1 -1
- package/src/component/elements/ActionsButtonsPopover.tsx +80 -24
- package/src/component/elements/Alert.tsx +4 -2
- package/src/component/elements/DraggableDialog.tsx +2 -2
- package/src/component/elements/NextPrev.tsx +28 -4
- package/src/component/elements/StandardDialog.tsx +11 -0
- package/src/component/elements/ToolbarPopoverItem.tsx +16 -3
- package/src/component/elements/export/ExportManager.tsx +1 -1
- package/src/component/elements/export/ExportOptionsModal.tsx +3 -3
- package/src/component/elements/print/PrintContent.tsx +4 -9
- package/src/component/header/Header.tsx +1 -1
- package/src/component/hooks/useActiveNucleusTab.ts +1 -1
- package/src/component/hooks/useActiveSpectrumRangesViewState.ts +1 -1
- package/src/component/hooks/useDatumWithSpectraStatistics.ts +1 -1
- package/src/component/hooks/useExport.tsx +36 -66
- package/src/component/hooks/useSVGUnitConverter.ts +13 -9
- package/src/component/hooks/useSaveSettings.tsx +4 -3
- package/src/component/hooks/useSetActiveSpectrumAction.ts +3 -2
- package/src/component/hooks/useTextMetrics.ts +66 -18
- package/src/component/hooks/useToggleSpectraVisibility.tsx +1 -1
- package/src/component/hooks/use_acs_settings.ts +27 -0
- package/src/component/hooks/use_publication_strings.ts +67 -0
- package/src/component/loader/useLoadFiles.ts +134 -111
- package/src/component/main/ErrorOverlay.tsx +11 -2
- package/src/component/main/InnerNMRiumContents.tsx +6 -9
- package/src/component/main/NMRiumViewer.tsx +3 -3
- package/src/component/main/NMRiumViewerWrapper.tsx +12 -6
- package/src/component/modal/AboutPredictionModal.tsx +3 -3
- package/src/component/modal/AboutSpectrumSimulationModal.tsx +3 -3
- package/src/component/modal/EditPeakShapeModal.tsx +5 -4
- package/src/component/modal/ExportAsJcampModal.tsx +4 -3
- package/src/component/modal/ImportPublicationStringModal.tsx +4 -3
- package/src/component/modal/LoadJCAMPModal.tsx +4 -3
- package/src/component/modal/LogsHistoryModal.tsx +4 -3
- package/src/component/modal/MoleculeAutoLabelsDatabaseModal.tsx +220 -0
- package/src/component/modal/MoleculeStructureEditorModal.tsx +9 -4
- package/src/component/modal/MultipletAnalysisModal.tsx +3 -3
- package/src/component/modal/PredictSpectraModal.tsx +4 -3
- package/src/component/modal/PublicationStringModal.tsx +234 -134
- package/src/component/modal/SaveAsModal.tsx +18 -50
- package/src/component/modal/aboutUs/AboutUsModal.tsx +3 -3
- package/src/component/modal/changeSum/ChangeSumModal.tsx +5 -4
- package/src/component/modal/changeSum/SelectMolecule.tsx +23 -23
- package/src/component/modal/editRange/EditRangeModal.tsx +1 -1
- package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +1 -1
- package/src/component/modal/metaImportation/MetaImportationModal.tsx +4 -3
- package/src/component/modal/setting/{GeneralSettings.tsx → general_settings.tsx} +34 -4
- package/src/component/modal/setting/settings-tabs/DatabasesTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/DisplayTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/ExternalAPIsTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/GeneralTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/InfoBlockTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/NucleiTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.tsx +1 -1
- package/src/component/modal/setting/settings-tabs/SpectraColorsTabContent.tsx +1 -1
- package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +106 -0
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.tsx +69 -0
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.tsx +39 -0
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.tsx +98 -0
- package/src/component/modal/setting/tanstack_general_settings/general_settings_dialog_header_actions_buttons.tsx +218 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.tsx +231 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/export_tab.tsx +24 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/general_tab.tsx +94 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.tsx +72 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.tsx +261 -0
- package/src/component/modal/setting/tanstack_general_settings/tabs/panels_tab.tsx +150 -0
- package/src/component/modal/setting/tanstack_general_settings/utils/checkUniqueByKey.ts +55 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.ts +63 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.ts +42 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/import_filters_tab_validation.ts +26 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/nuclei_tab_validation.ts +21 -0
- package/src/component/modal/setting/tanstack_general_settings/validation/panels_tab_validation.ts +80 -0
- package/src/component/modal/setting/tanstack_general_settings/validation.ts +66 -0
- package/src/component/panels/MoleculesPanel/MoleculeOptionsPanel.tsx +2 -2
- package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +2 -2
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +106 -21
- package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +5 -5
- package/src/component/panels/MoleculesPanel/hooks/useAtomAssignment.tsx +21 -21
- package/src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts +1 -1
- package/src/component/panels/MoleculesPanel/utilities/extractFromAtom.ts +1 -1
- package/src/component/panels/MoleculesPanel/utilities/getAssignIds.ts +1 -1
- package/src/component/panels/MoleculesPanel/utilities/getCurrentDiaIDsToHighlight.ts +1 -1
- package/src/component/panels/MoleculesPanel/utilities/getHighlightsOnHover.ts +2 -2
- package/src/component/panels/MoleculesPanel/utilities/getUniqueDiaIDs.ts +1 -1
- package/src/component/panels/Panels.tsx +5 -93
- package/src/component/panels/RangesPanel/RangesHeader.tsx +34 -29
- package/src/component/panels/RangesPanel/RangesTableRow.tsx +1 -1
- package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +3 -3
- package/src/component/panels/SpectraPanel/SpectraTable.tsx +1 -1
- package/src/component/panels/SummaryPanel/SetMolecularFormulaModal.tsx +4 -3
- package/src/component/panels/SummaryPanel/SetShiftTolerancesModal.tsx +4 -3
- package/src/component/panels/databasePanel/DatabaseInfo.tsx +1 -1
- package/src/component/panels/databasePanel/DatabasePanel.tsx +1 -1
- package/src/component/panels/databasePanel/DatabaseStructureSearchModal.tsx +3 -3
- package/src/component/panels/databasePanel/DatabaseTable.tsx +1 -1
- package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +1 -1
- package/src/component/panels/header/DefaultPanelHeader.tsx +2 -1
- package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +1 -1
- package/src/component/panels/hooks/useTogglePanel.ts +4 -3
- package/src/component/panels/informationPanel/InformationEditionModal.tsx +4 -3
- package/src/component/panels/informationPanel/InformationPanel.tsx +83 -2
- package/src/component/reducer/actions/AssignmentsActions.ts +3 -3
- package/src/component/reducer/actions/CorrelationsActions.ts +2 -2
- package/src/component/reducer/actions/DatabaseActions.ts +1 -1
- package/src/component/reducer/actions/DomainActions.ts +1 -1
- package/src/component/reducer/actions/InsetActions.ts +2 -2
- package/src/component/reducer/actions/LoadAction.ts +17 -3
- package/src/component/reducer/actions/MoleculeActions.ts +7 -5
- package/src/component/reducer/actions/PreferencesActions.ts +1 -1
- package/src/component/reducer/actions/RangesActions.ts +4 -4
- package/src/component/reducer/actions/SpectraActions.ts +7 -3
- package/src/component/reducer/actions/ToolsActions.ts +2 -2
- package/src/component/reducer/actions/ZonesActions.ts +3 -3
- package/src/component/reducer/helper/get2DRange.ts +1 -1
- package/src/component/reducer/preferences/actions/analyzeSpectra.ts +16 -0
- package/src/component/reducer/preferences/actions/toggleOpenSplitPanel.ts +18 -0
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +1 -1
- package/src/component/reducer/preferences/preferencesReducer.ts +24 -3
- package/src/component/toolbar/ToolBar.tsx +15 -10
- package/src/component/toolbar/toolbarMenu.tsx +13 -2
- package/src/component/utility/export.ts +7 -1
- package/src/component/workspaces/workspaceDefaultProperties.ts +5 -1
- package/src/data/PredictionManager.ts +1 -1
- package/src/data/SpectraManager.ts +2 -2
- package/src/data/data1d/Spectrum1D/ranges/autoRangesDetection.ts +1 -1
- package/src/data/data1d/Spectrum1D/ranges/detectRanges.ts +1 -1
- package/src/data/data1d/multipleSpectraAnalysis.ts +20 -0
- package/src/data/data2d/Spectrum2D/contours.ts +16 -6
- package/src/data/molecules/MoleculeManager.ts +7 -2
- package/src/data/utilities/FindUtilities.ts +2 -2
- package/src/utils/clipboard/clipboardComponents.tsx +3 -3
- package/src/versionInfo.ts +1 -1
- package/lib/component/modal/setting/GeneralSettings.d.ts.map +0 -1
- package/lib/component/modal/setting/GeneralSettings.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import type { CSSProperties, ReactElement } from 'react';
|
|
3
|
-
import { Children } from 'react';
|
|
4
|
-
import { useResizeObserver } from 'react-d3-utils';
|
|
3
|
+
import { Children, useLayoutEffect, useRef, useState } from 'react';
|
|
5
4
|
import { FaAngleLeft } from 'react-icons/fa';
|
|
6
5
|
|
|
7
6
|
type Direction = 'right' | 'left';
|
|
@@ -90,10 +89,35 @@ interface NextPrevProps {
|
|
|
90
89
|
|
|
91
90
|
export function NextPrev(props: NextPrevProps) {
|
|
92
91
|
const { children, index = 0, onChange = () => null, style = {} } = props;
|
|
93
|
-
const [ref, { width } = { width: 0 }] = useResizeObserver();
|
|
94
92
|
const slidersCount = Children.count(children);
|
|
95
93
|
const lastIndex = slidersCount > 0 ? slidersCount - 1 : 0;
|
|
96
94
|
const activeIndex = Math.min(index, lastIndex);
|
|
95
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
96
|
+
|
|
97
|
+
const [width, setWidth] = useState(0);
|
|
98
|
+
|
|
99
|
+
useLayoutEffect(() => {
|
|
100
|
+
const container = containerRef.current;
|
|
101
|
+
if (!container) return;
|
|
102
|
+
|
|
103
|
+
const observer = new ResizeObserver((entries) => {
|
|
104
|
+
for (const entry of entries) {
|
|
105
|
+
const newWidth = entry.contentRect.width;
|
|
106
|
+
if (newWidth > 0) {
|
|
107
|
+
setWidth(newWidth);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
observer.observe(container);
|
|
113
|
+
|
|
114
|
+
const rect = container.getBoundingClientRect();
|
|
115
|
+
if (rect.width > 0) {
|
|
116
|
+
setWidth(rect.width);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return () => observer.disconnect();
|
|
120
|
+
}, []);
|
|
97
121
|
|
|
98
122
|
function nextHandler() {
|
|
99
123
|
if (index < lastIndex) {
|
|
@@ -113,7 +137,7 @@ export function NextPrev(props: NextPrevProps) {
|
|
|
113
137
|
const slidersWidth = width * slidersCount;
|
|
114
138
|
|
|
115
139
|
return (
|
|
116
|
-
<Container ref={
|
|
140
|
+
<Container ref={containerRef}>
|
|
117
141
|
<TransformController
|
|
118
142
|
translation={translation}
|
|
119
143
|
slidersWidth={slidersWidth}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DialogProps } from '@blueprintjs/core';
|
|
2
|
+
import { Dialog } from '@blueprintjs/core';
|
|
3
|
+
|
|
4
|
+
export function StandardDialog(options: DialogProps) {
|
|
5
|
+
const { children, ...otherProps } = options;
|
|
6
|
+
return (
|
|
7
|
+
<Dialog canOutsideClickClose={false} {...otherProps}>
|
|
8
|
+
{children}
|
|
9
|
+
</Dialog>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MenuItemProps } from '@blueprintjs/core';
|
|
2
|
-
import { Menu, MenuItem, Tooltip } from '@blueprintjs/core';
|
|
1
|
+
import type { MenuDividerProps, MenuItemProps } from '@blueprintjs/core';
|
|
2
|
+
import { Menu, MenuDivider, MenuItem, Tooltip } from '@blueprintjs/core';
|
|
3
3
|
import type {
|
|
4
4
|
ToolbarItemProps,
|
|
5
5
|
ToolbarPopoverItemProps,
|
|
@@ -9,10 +9,16 @@ import { Toolbar, TooltipHelpContent } from 'react-science/ui';
|
|
|
9
9
|
|
|
10
10
|
export interface ToolbarPopoverMenuItem<T = object>
|
|
11
11
|
extends MenuItemProps, Pick<ToolbarItemProps, 'tooltipProps'> {
|
|
12
|
+
menuItemType?: 'item';
|
|
12
13
|
data?: T;
|
|
13
14
|
tooltip?: string | TooltipItem;
|
|
14
15
|
}
|
|
15
16
|
|
|
17
|
+
export interface ToolbarPopoverMenuDivider extends MenuDividerProps {
|
|
18
|
+
menuItemType: 'divider';
|
|
19
|
+
key: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
interface CustomToolbarPopoverItemProps<T = object>
|
|
17
23
|
extends
|
|
18
24
|
Omit<ToolbarPopoverItemProps, 'onClick' | 'content' | 'itemProps'>,
|
|
@@ -21,7 +27,7 @@ interface CustomToolbarPopoverItemProps<T = object>
|
|
|
21
27
|
'tooltip' | 'icon' | 'tooltipProps' | 'active' | 'id'
|
|
22
28
|
> {
|
|
23
29
|
itemProps?: Omit<ToolbarItemProps, 'onClick' | 'disabled'>;
|
|
24
|
-
options: Array<ToolbarPopoverMenuItem<T
|
|
30
|
+
options: Array<ToolbarPopoverMenuItem<T> | ToolbarPopoverMenuDivider>;
|
|
25
31
|
onClick?: (data?: T) => void;
|
|
26
32
|
}
|
|
27
33
|
|
|
@@ -49,12 +55,19 @@ export function ToolbarPopoverItem<T = object>(
|
|
|
49
55
|
content={
|
|
50
56
|
<Menu>
|
|
51
57
|
{options.map((option) => {
|
|
58
|
+
if (option.menuItemType === 'divider') {
|
|
59
|
+
const { menuItemType, key, children, ...dividerProps } = option;
|
|
60
|
+
|
|
61
|
+
return <MenuDivider key={key} {...dividerProps} />;
|
|
62
|
+
}
|
|
63
|
+
|
|
52
64
|
const {
|
|
53
65
|
data,
|
|
54
66
|
text,
|
|
55
67
|
tooltip = '',
|
|
56
68
|
tooltipProps,
|
|
57
69
|
disabled,
|
|
70
|
+
menuItemType,
|
|
58
71
|
...otherOptions
|
|
59
72
|
} = option;
|
|
60
73
|
return (
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import { useChartData } from '../../context/ChartContext.js';
|
|
12
12
|
import { usePreferences } from '../../context/PreferencesContext.js';
|
|
13
|
-
import { useToaster } from '../../context/ToasterContext.
|
|
13
|
+
import { useToaster } from '../../context/ToasterContext.js';
|
|
14
14
|
import { useExportViewPort } from '../../hooks/useExport.js';
|
|
15
15
|
import { useWorkspaceExportSettings } from '../../hooks/useWorkspaceExportSettings.js';
|
|
16
16
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Button,
|
|
3
|
-
Dialog,
|
|
4
3
|
DialogFooter,
|
|
5
4
|
Radio,
|
|
6
5
|
RadioGroup,
|
|
@@ -22,6 +21,7 @@ import type { LabelStyle } from '../Label.js';
|
|
|
22
21
|
import Label from '../Label.js';
|
|
23
22
|
import { NumberInput2Controller } from '../NumberInput2Controller.js';
|
|
24
23
|
import { Select2Controller } from '../Select2Controller.js';
|
|
24
|
+
import { StandardDialog } from '../StandardDialog.tsx';
|
|
25
25
|
import { StyledDialogBody } from '../StyledDialogBody.js';
|
|
26
26
|
import type { SizeItem } from '../print/pageSize.js';
|
|
27
27
|
import { getSizesList } from '../print/pageSize.js';
|
|
@@ -150,7 +150,7 @@ function InnerExportOptionsModal(props: InnerExportOptionsModalProps) {
|
|
|
150
150
|
}, [handleSubmit, mode, onExportOptionsChange, setFocus]);
|
|
151
151
|
|
|
152
152
|
return (
|
|
153
|
-
<
|
|
153
|
+
<StandardDialog
|
|
154
154
|
isOpen
|
|
155
155
|
title="Export options"
|
|
156
156
|
onClose={onCloseDialog}
|
|
@@ -317,6 +317,6 @@ function InnerExportOptionsModal(props: InnerExportOptionsModalProps) {
|
|
|
317
317
|
/>
|
|
318
318
|
</div>
|
|
319
319
|
</DialogFooter>
|
|
320
|
-
</
|
|
320
|
+
</StandardDialog>
|
|
321
321
|
);
|
|
322
322
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Dialog,
|
|
3
|
-
DialogFooter,
|
|
4
|
-
Radio,
|
|
5
|
-
RadioGroup,
|
|
6
|
-
Tag,
|
|
7
|
-
} from '@blueprintjs/core';
|
|
1
|
+
import { DialogFooter, Radio, RadioGroup, Tag } from '@blueprintjs/core';
|
|
8
2
|
import type { PageSizeName, PrintPageOptions } from '@zakodium/nmrium-core';
|
|
9
3
|
import type { CSSProperties, ReactNode } from 'react';
|
|
10
4
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
@@ -16,6 +10,7 @@ import type { LabelStyle } from '../Label.js';
|
|
|
16
10
|
import Label from '../Label.js';
|
|
17
11
|
import { NumberInput2Controller } from '../NumberInput2Controller.js';
|
|
18
12
|
import { Select2Controller } from '../Select2Controller.js';
|
|
13
|
+
import { StandardDialog } from '../StandardDialog.tsx';
|
|
19
14
|
import { StyledDialogBody } from '../StyledDialogBody.js';
|
|
20
15
|
|
|
21
16
|
import { PrintProvider } from './PrintProvider.js';
|
|
@@ -342,7 +337,7 @@ function InnerPrintOptionsModal(props: InnerPrintOptionsModalProps) {
|
|
|
342
337
|
const layout = watch('layout');
|
|
343
338
|
const sizesList = getSizesList(layout);
|
|
344
339
|
return (
|
|
345
|
-
<
|
|
340
|
+
<StandardDialog
|
|
346
341
|
isOpen
|
|
347
342
|
title="Print options"
|
|
348
343
|
onClose={onCloseDialog}
|
|
@@ -387,6 +382,6 @@ function InnerPrintOptionsModal(props: InnerPrintOptionsModalProps) {
|
|
|
387
382
|
onCancel={() => onCloseDialog?.()}
|
|
388
383
|
/>
|
|
389
384
|
</DialogFooter>
|
|
390
|
-
</
|
|
385
|
+
</StandardDialog>
|
|
391
386
|
);
|
|
392
387
|
}
|
|
@@ -25,8 +25,8 @@ import { useSaveSettings } from '../hooks/useSaveSettings.js';
|
|
|
25
25
|
import { useWorkspaceAction } from '../hooks/useWorkspaceAction.js';
|
|
26
26
|
import { LogsHistoryModal } from '../modal/LogsHistoryModal.js';
|
|
27
27
|
import AboutUsModal from '../modal/aboutUs/AboutUsModal.js';
|
|
28
|
-
import GeneralSettingsModal from '../modal/setting/GeneralSettings.js';
|
|
29
28
|
import WorkspaceItem from '../modal/setting/WorkspaceItem.js';
|
|
29
|
+
import GeneralSettingsModal from '../modal/setting/general_settings.js';
|
|
30
30
|
import { options } from '../toolbar/ToolTypes.js';
|
|
31
31
|
import { renderCoreSlot } from '../utility/renderCoreSlot.js';
|
|
32
32
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RangesViewState } from '@zakodium/nmrium-core';
|
|
2
2
|
|
|
3
|
-
import { isProton } from '../../data/utilities/isProton.
|
|
3
|
+
import { isProton } from '../../data/utilities/isProton.js';
|
|
4
4
|
import { useInsetOptions } from '../1d/inset/InsetProvider.js';
|
|
5
5
|
import { useChartData } from '../context/ChartContext.js';
|
|
6
6
|
|
|
@@ -42,7 +42,7 @@ export default function useDatumWithSpectraStatistics(): SpectrumWithStatisticsP
|
|
|
42
42
|
if (isFt) {
|
|
43
43
|
ftCounter++;
|
|
44
44
|
}
|
|
45
|
-
if (
|
|
45
|
+
if (dataInfo.id === activeSpectrum?.id) {
|
|
46
46
|
info = dataInfo.info;
|
|
47
47
|
datum = dataInfo.data;
|
|
48
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { NmriumState } from '@zakodium/nmrium-core';
|
|
1
2
|
import { useCallback } from 'react';
|
|
2
3
|
|
|
3
|
-
import type { ExportOptions } from '../../data/SpectraManager.js';
|
|
4
4
|
import { toJSON } from '../../data/SpectraManager.js';
|
|
5
5
|
import { useChartData } from '../context/ChartContext.js';
|
|
6
6
|
import { useCore } from '../context/CoreContext.js';
|
|
@@ -9,17 +9,21 @@ import { useToaster } from '../context/ToasterContext.js';
|
|
|
9
9
|
import {
|
|
10
10
|
browserNotSupportedErrorToast,
|
|
11
11
|
copyPNGToClipboard,
|
|
12
|
-
exportAsJsonBlob,
|
|
13
12
|
exportAsPng,
|
|
14
13
|
exportAsSVG,
|
|
15
14
|
} from '../utility/export.js';
|
|
16
|
-
import { saveAs } from '../utility/save_as.
|
|
17
|
-
|
|
18
|
-
interface SaveOptions {
|
|
19
|
-
include:
|
|
15
|
+
import { saveAs } from '../utility/save_as.js';
|
|
16
|
+
|
|
17
|
+
export interface SaveOptions {
|
|
18
|
+
include: {
|
|
19
|
+
settings: boolean;
|
|
20
|
+
view: boolean;
|
|
21
|
+
dataType:
|
|
22
|
+
| 'NO_DATA'
|
|
23
|
+
| 'SELF_CONTAINED'
|
|
24
|
+
| 'SELF_CONTAINED_EXTERNAL_DATASOURCE';
|
|
25
|
+
};
|
|
20
26
|
name: string;
|
|
21
|
-
compressed: boolean;
|
|
22
|
-
pretty: boolean;
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
export function useExport() {
|
|
@@ -28,75 +32,29 @@ export function useExport() {
|
|
|
28
32
|
const preferencesState = usePreferences();
|
|
29
33
|
const core = useCore();
|
|
30
34
|
|
|
31
|
-
const saveAsJSONHandler = useCallback(
|
|
32
|
-
(spaceIndent = 0, isCompressed = true) => {
|
|
33
|
-
const hideLoading = toaster.showLoading({
|
|
34
|
-
message: 'Exporting as NMRium process in progress',
|
|
35
|
-
});
|
|
36
|
-
setTimeout(async () => {
|
|
37
|
-
try {
|
|
38
|
-
const name = state.data[0]?.info?.name || 'experiment';
|
|
39
|
-
const exportedData = toJSON(core, state, preferencesState, {
|
|
40
|
-
exportTarget: 'nmrium',
|
|
41
|
-
view: true,
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const blob = await exportAsJsonBlob(
|
|
45
|
-
exportedData,
|
|
46
|
-
name,
|
|
47
|
-
spaceIndent,
|
|
48
|
-
isCompressed,
|
|
49
|
-
);
|
|
50
|
-
saveAs({ blob, name, extension: '.nmrium' });
|
|
51
|
-
} catch (error) {
|
|
52
|
-
toaster.show({
|
|
53
|
-
intent: 'danger',
|
|
54
|
-
message: `Export failed due to an unexpected error: ${(error as Error)?.message || 'Unknown error'}`,
|
|
55
|
-
});
|
|
56
|
-
reportError(error);
|
|
57
|
-
} finally {
|
|
58
|
-
hideLoading();
|
|
59
|
-
}
|
|
60
|
-
}, 0);
|
|
61
|
-
},
|
|
62
|
-
[core, preferencesState, state, toaster],
|
|
63
|
-
);
|
|
64
|
-
|
|
65
35
|
const saveHandler = useCallback(
|
|
66
36
|
(options: SaveOptions) => {
|
|
67
37
|
async function handler() {
|
|
68
|
-
const { pretty, compressed, include } = options;
|
|
69
38
|
const name = options.name || 'experiment';
|
|
70
|
-
const
|
|
71
|
-
include.dataType?.startsWith('SELF_CONTAINED') ?? false;
|
|
39
|
+
const include = options.include;
|
|
72
40
|
|
|
73
41
|
const hideLoading = toaster.showLoading({
|
|
74
|
-
message: `Exporting as ${name}.nmrium process in progress`,
|
|
42
|
+
message: `Exporting as ${name}.nmrium.zip process in progress`,
|
|
75
43
|
});
|
|
76
44
|
setTimeout(async () => {
|
|
77
45
|
try {
|
|
78
|
-
const
|
|
79
|
-
|
|
46
|
+
const nmriumState = toJSON(core, state, preferencesState, {
|
|
47
|
+
serialize: false,
|
|
80
48
|
exportTarget: 'nmrium',
|
|
81
|
-
});
|
|
82
|
-
const spaceIndent = pretty || exportArchive ? 2 : 0;
|
|
83
|
-
const blob = await exportAsJsonBlob(
|
|
84
|
-
exportedData,
|
|
85
|
-
name,
|
|
86
|
-
spaceIndent,
|
|
87
|
-
compressed && !exportArchive,
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
if (!exportArchive) {
|
|
91
|
-
return saveAs({ blob, name, extension: '.nmrium' });
|
|
92
|
-
}
|
|
93
|
-
|
|
49
|
+
}) as NmriumState;
|
|
94
50
|
const archive = await core.serializeNmriumArchive({
|
|
95
|
-
|
|
96
|
-
spectra: state.data,
|
|
51
|
+
state: nmriumState,
|
|
97
52
|
aggregator: state.aggregator,
|
|
98
|
-
includeData:
|
|
99
|
-
|
|
53
|
+
includeData: include.dataType !== 'NO_DATA',
|
|
54
|
+
externalData:
|
|
55
|
+
include.dataType === 'SELF_CONTAINED' ? 'embedded' : 'linked',
|
|
56
|
+
includeSettings: include.settings,
|
|
57
|
+
includeView: include.view,
|
|
100
58
|
});
|
|
101
59
|
const zipBlob = new Blob([archive], {
|
|
102
60
|
type: 'chemical/x-nmrium+zip',
|
|
@@ -119,8 +77,20 @@ export function useExport() {
|
|
|
119
77
|
[core, preferencesState, state, toaster],
|
|
120
78
|
);
|
|
121
79
|
|
|
80
|
+
const defaultName = state.data[0]?.info?.name || 'experiment';
|
|
81
|
+
const defaultSaveAsHandler = useCallback(() => {
|
|
82
|
+
saveHandler({
|
|
83
|
+
name: defaultName,
|
|
84
|
+
include: {
|
|
85
|
+
dataType: 'SELF_CONTAINED',
|
|
86
|
+
view: true,
|
|
87
|
+
settings: false,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
}, [saveHandler, defaultName]);
|
|
91
|
+
|
|
122
92
|
return {
|
|
123
|
-
|
|
93
|
+
defaultSaveAsHandler,
|
|
124
94
|
saveHandler,
|
|
125
95
|
};
|
|
126
96
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
|
|
1
3
|
import { useChartData } from '../context/ChartContext.js';
|
|
2
4
|
|
|
3
5
|
function truncate(value: any, numberOfDigits = 0) {
|
|
@@ -15,14 +17,16 @@ export function convertPercentToPixel(value: number, baseValue: number) {
|
|
|
15
17
|
export function useSVGUnitConverter() {
|
|
16
18
|
const { width, height } = useChartData();
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
20
|
+
return useMemo(() => {
|
|
21
|
+
function pixelToPercent(value: number, axis: 'x' | 'y') {
|
|
22
|
+
const size = axis === 'x' ? width : height;
|
|
23
|
+
return convertPixelToPercent(value, size);
|
|
24
|
+
}
|
|
25
|
+
function percentToPixel(value: number, axis: 'x' | 'y') {
|
|
26
|
+
const size = axis === 'x' ? width : height;
|
|
27
|
+
return convertPercentToPixel(value, size);
|
|
28
|
+
}
|
|
26
29
|
|
|
27
|
-
|
|
30
|
+
return { pixelToPercent, percentToPixel };
|
|
31
|
+
}, [width, height]);
|
|
28
32
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button,
|
|
1
|
+
import { Button, DialogBody, DialogFooter } from '@blueprintjs/core';
|
|
2
2
|
import { revalidateLogic } from '@tanstack/react-form';
|
|
3
3
|
import type { Workspace } from '@zakodium/nmrium-core';
|
|
4
4
|
import { useRef } from 'react';
|
|
@@ -7,6 +7,7 @@ import { z } from 'zod/v4';
|
|
|
7
7
|
|
|
8
8
|
import { usePreferences } from '../context/PreferencesContext.js';
|
|
9
9
|
import { useToaster } from '../context/ToasterContext.js';
|
|
10
|
+
import { StandardDialog } from '../elements/StandardDialog.tsx';
|
|
10
11
|
|
|
11
12
|
import { useWorkspaceAction } from './useWorkspaceAction.js';
|
|
12
13
|
|
|
@@ -56,7 +57,7 @@ export function useSaveSettings() {
|
|
|
56
57
|
saveSettings,
|
|
57
58
|
SaveSettingsModal: () => {
|
|
58
59
|
return (
|
|
59
|
-
<
|
|
60
|
+
<StandardDialog
|
|
60
61
|
style={{ width: 500 }}
|
|
61
62
|
onClose={closeDialog}
|
|
62
63
|
isOpen={isOpenDialog}
|
|
@@ -104,7 +105,7 @@ export function useSaveSettings() {
|
|
|
104
105
|
}
|
|
105
106
|
/>
|
|
106
107
|
</form>
|
|
107
|
-
</
|
|
108
|
+
</StandardDialog>
|
|
108
109
|
);
|
|
109
110
|
},
|
|
110
111
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { useChartData } from '../context/ChartContext.js';
|
|
1
2
|
import { useDispatch } from '../context/DispatchContext.js';
|
|
2
3
|
import type { EventModifierKeys } from '../context/KeyModifierContext.js';
|
|
3
4
|
import { getModifiers } from '../context/KeyModifierContext.js';
|
|
4
5
|
|
|
5
6
|
export function useSetActiveSpectrumAction() {
|
|
6
7
|
const dispatch = useDispatch();
|
|
7
|
-
|
|
8
|
+
const { data: spectra } = useChartData();
|
|
8
9
|
function setActiveSpectrum(event: EventModifierKeys, id: string) {
|
|
9
10
|
setTimeout(() => {
|
|
10
11
|
const { ctrlKey, shiftKey } = getModifiers(event);
|
|
@@ -13,7 +14,7 @@ export function useSetActiveSpectrumAction() {
|
|
|
13
14
|
}]`;
|
|
14
15
|
dispatch({
|
|
15
16
|
type: 'CHANGE_ACTIVE_SPECTRUM',
|
|
16
|
-
payload: { modifier, id },
|
|
17
|
+
payload: { modifier, id, sortedSpectra: spectra },
|
|
17
18
|
});
|
|
18
19
|
}, 0);
|
|
19
20
|
}
|
|
@@ -1,27 +1,75 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect, useMemo } from 'react';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
interface UseTextMetricsOptions {
|
|
4
|
+
labelSize?: number;
|
|
5
|
+
labelStyle?: string;
|
|
6
|
+
labelWeight?: string;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Dev purpose only.
|
|
10
|
+
* Set a width to see the canvas used to measure text.
|
|
11
|
+
*/
|
|
12
|
+
debugCanvasWidth?: number;
|
|
9
13
|
}
|
|
10
14
|
|
|
11
|
-
export function useTextMetrics(
|
|
12
|
-
const
|
|
15
|
+
export function useTextMetrics(options: UseTextMetricsOptions = {}) {
|
|
16
|
+
const {
|
|
17
|
+
labelSize = 12,
|
|
18
|
+
labelStyle = 'normal',
|
|
19
|
+
labelWeight = 'normal',
|
|
20
|
+
debugCanvasWidth,
|
|
21
|
+
} = options;
|
|
22
|
+
const canvas = useCanvas(debugCanvasWidth);
|
|
13
23
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
contextRef.current = canvas.getContext('2d');
|
|
17
|
-
if (contextRef.current) {
|
|
18
|
-
contextRef.current.font = `${labelSize}px Arial`;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
24
|
+
const ctx = canvas.getContext('2d');
|
|
25
|
+
if (ctx) ctx.font = `${labelStyle} ${labelWeight} ${labelSize}px Arial`;
|
|
21
26
|
|
|
22
27
|
function getTextWidth(text: string): number {
|
|
23
|
-
return measureTextWidth(
|
|
28
|
+
return measureTextWidth(ctx, text);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
getTextWidth,
|
|
33
|
+
/**
|
|
34
|
+
* @deprecated Use only for debug mode
|
|
35
|
+
*/
|
|
36
|
+
ctx,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function useCanvas(width: number | undefined) {
|
|
41
|
+
const canvas = useMemo(() => {
|
|
42
|
+
const canvas = document.createElement('canvas');
|
|
43
|
+
if (width) {
|
|
44
|
+
canvas.width = width;
|
|
45
|
+
canvas.height = 450;
|
|
46
|
+
}
|
|
47
|
+
canvas.style.position = 'absolute';
|
|
48
|
+
canvas.style.bottom = '0';
|
|
49
|
+
canvas.style.left = '0';
|
|
50
|
+
canvas.style.zIndex = '100';
|
|
51
|
+
canvas.style.opacity = '50%';
|
|
52
|
+
canvas.style.background = 'white';
|
|
53
|
+
return canvas;
|
|
54
|
+
}, [width]);
|
|
55
|
+
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!width) return;
|
|
58
|
+
|
|
59
|
+
document.body.append(canvas);
|
|
60
|
+
|
|
61
|
+
return () => {
|
|
62
|
+
canvas.remove();
|
|
63
|
+
};
|
|
64
|
+
}, [canvas, width]);
|
|
65
|
+
|
|
66
|
+
return canvas;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function measureTextWidth(
|
|
70
|
+
context: CanvasRenderingContext2D | null,
|
|
71
|
+
text: string,
|
|
72
|
+
) {
|
|
73
|
+
if (!context) return 0;
|
|
74
|
+
return Math.round(context.measureText(text).width);
|
|
27
75
|
}
|
|
@@ -6,7 +6,7 @@ import { useDispatch } from '../context/DispatchContext.js';
|
|
|
6
6
|
import type { ToolbarItemProps } from '../panels/header/DefaultPanelHeader.js';
|
|
7
7
|
import type { SpectraSelectedMode } from '../reducer/actions/SpectraActions.js';
|
|
8
8
|
|
|
9
|
-
import { useActiveNucleusTab } from './useActiveNucleusTab.
|
|
9
|
+
import { useActiveNucleusTab } from './useActiveNucleusTab.js';
|
|
10
10
|
|
|
11
11
|
interface ToggleSpectraVisibility {
|
|
12
12
|
enableShowAll: boolean;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ACSExportOptions } from '@zakodium/nmrium-core';
|
|
2
|
+
|
|
3
|
+
import { usePreferences } from '../context/PreferencesContext.tsx';
|
|
4
|
+
|
|
5
|
+
import { useActiveNucleusTab } from './useActiveNucleusTab.ts';
|
|
6
|
+
|
|
7
|
+
const defaultOptions: ACSExportOptions = {
|
|
8
|
+
signalKind: 'signal',
|
|
9
|
+
ascending: true,
|
|
10
|
+
format: 'IMJA',
|
|
11
|
+
couplingFormat: '0.00',
|
|
12
|
+
deltaFormat: '0.00',
|
|
13
|
+
textStyle: {},
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export function useActiveACSSettings() {
|
|
17
|
+
const nucleus = useActiveNucleusTab();
|
|
18
|
+
|
|
19
|
+
return useACSSettings(nucleus);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function useACSSettings(nucleus: string | undefined) {
|
|
23
|
+
const { current } = usePreferences();
|
|
24
|
+
if (!nucleus) return structuredClone(defaultOptions);
|
|
25
|
+
|
|
26
|
+
return current.acsExportSettings[nucleus] || structuredClone(defaultOptions);
|
|
27
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { ACSExportOptions, Spectrum } from '@zakodium/nmrium-core';
|
|
2
|
+
import type { RangesToACSOptions } from 'nmr-processing';
|
|
3
|
+
import { rangesToACS } from 'nmr-processing';
|
|
4
|
+
import { assert } from 'react-science/ui';
|
|
5
|
+
|
|
6
|
+
import { isSpectrum1D } from '../../data/data1d/Spectrum1D/index.ts';
|
|
7
|
+
|
|
8
|
+
import useSpectraByActiveNucleus from './useSpectraPerNucleus.ts';
|
|
9
|
+
import { useActiveACSSettings } from './use_acs_settings.ts';
|
|
10
|
+
|
|
11
|
+
export function usePublicationStrings() {
|
|
12
|
+
const spectra = useSpectraByActiveNucleus();
|
|
13
|
+
const acs = useActiveACSSettings();
|
|
14
|
+
|
|
15
|
+
const output: Record<string, string> = {};
|
|
16
|
+
|
|
17
|
+
for (const spectrum of spectra) {
|
|
18
|
+
if (!isSpectrum1D(spectrum)) continue;
|
|
19
|
+
|
|
20
|
+
const { id, ranges } = spectrum;
|
|
21
|
+
|
|
22
|
+
if (!Array.isArray(ranges?.values) || ranges.values.length === 0) {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
output[id] = buildPublicationString({ spectrum, acs });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return output;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface BuildPublicationStringOptions {
|
|
33
|
+
spectrum: Spectrum;
|
|
34
|
+
acs: ACSExportOptions;
|
|
35
|
+
}
|
|
36
|
+
export function buildPublicationString(options: BuildPublicationStringOptions) {
|
|
37
|
+
const { spectrum, acs } = options;
|
|
38
|
+
assert(isSpectrum1D(spectrum));
|
|
39
|
+
|
|
40
|
+
const {
|
|
41
|
+
info,
|
|
42
|
+
ranges: { values },
|
|
43
|
+
} = spectrum;
|
|
44
|
+
const { originFrequency, nucleus } = info;
|
|
45
|
+
const { signalKind, format, couplingFormat, ...otherOptions } = acs;
|
|
46
|
+
|
|
47
|
+
const ranges =
|
|
48
|
+
signalKind === 'all'
|
|
49
|
+
? values
|
|
50
|
+
: values.filter((range) =>
|
|
51
|
+
range.signals?.some((signal) => signal.kind === 'signal'),
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const rangesToACSOptions: RangesToACSOptions = {
|
|
55
|
+
nucleus,
|
|
56
|
+
observedFrequency: originFrequency,
|
|
57
|
+
...otherOptions,
|
|
58
|
+
format: '',
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
if (format !== 'D') {
|
|
62
|
+
rangesToACSOptions.format = format;
|
|
63
|
+
rangesToACSOptions.couplingFormat = couplingFormat;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return rangesToACS(ranges, rangesToACSOptions);
|
|
67
|
+
}
|