nmrium 1.7.0 → 1.9.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/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-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 -42
- 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/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/zones/SignalsGuideLines.js +1 -1
- package/lib/component/2d/zones/SignalsGuideLines.js.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.js +6 -0
- package/lib/component/EventsTrackers/KeysListenerTracker.js.map +1 -1
- package/lib/component/hooks/useExport.js +1 -1
- package/lib/component/hooks/useExport.js.map +1 -1
- package/lib/component/loader/useLoadFiles.d.ts.map +1 -1
- package/lib/component/loader/useLoadFiles.js +17 -7
- package/lib/component/loader/useLoadFiles.js.map +1 -1
- package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
- package/lib/component/main/NMRiumStateProvider.js +2 -3
- package/lib/component/main/NMRiumStateProvider.js.map +1 -1
- package/lib/component/modal/LoadJCAMPModal.js +7 -2
- 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 +1 -1
- package/lib/component/modal/SaveAsModal.d.ts.map +1 -1
- package/lib/component/modal/SaveAsModal.js +6 -2
- package/lib/component/modal/SaveAsModal.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 +17 -1
- package/lib/component/modal/setting/settings-tabs/ToolsTabContent.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 -26
- 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 +36 -31
- 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} +32 -16
- 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/databasePanel/DatabaseInfo.d.ts +5 -0
- package/lib/component/panels/databasePanel/DatabaseInfo.d.ts.map +1 -0
- package/lib/component/panels/databasePanel/DatabaseInfo.js +29 -0
- package/lib/component/panels/databasePanel/DatabaseInfo.js.map +1 -0
- package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
- package/lib/component/panels/databasePanel/DatabaseTable.js +21 -3
- package/lib/component/panels/databasePanel/DatabaseTable.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/informationPanel/InformationEditionModal.js +1 -1
- package/lib/component/panels/informationPanel/InformationEditionModal.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 +11 -5
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +8 -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 +4 -2
- package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
- package/lib/component/reducer/actions/LoadAction.d.ts +7 -4
- package/lib/component/reducer/actions/LoadAction.d.ts.map +1 -1
- package/lib/component/reducer/actions/LoadAction.js +35 -26
- package/lib/component/reducer/actions/LoadAction.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +20 -5
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.js +42 -28
- package/lib/component/reducer/actions/MoleculeActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +10 -4
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +24 -3
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts +1 -1
- package/lib/component/reducer/actions/ZonesActions.d.ts.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/panelsPreferencesDefaultValues.js +1 -1
- package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -2
- package/lib/component/reducer/preferences/preferencesReducer.d.ts.map +1 -1
- package/lib/component/reducer/preferences/preferencesReducer.js +3 -0
- 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 +5 -1
- package/lib/component/toolbar/ToolBar.js.map +1 -1
- package/lib/component/toolbar/ToolTypes.d.ts.map +1 -1
- package/lib/component/toolbar/ToolTypes.js +2 -1
- package/lib/component/toolbar/ToolTypes.js.map +1 -1
- package/lib/component/utility/filterDatabaseInfoEntry.d.ts +3 -0
- package/lib/component/utility/filterDatabaseInfoEntry.d.ts.map +1 -0
- package/lib/component/utility/filterDatabaseInfoEntry.js +9 -0
- package/lib/component/utility/filterDatabaseInfoEntry.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 +6 -1
- 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/simulation.js +1 -1
- package/lib/component/workspaces/simulation.js.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.d.ts.map +1 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js +19 -1
- package/lib/component/workspaces/workspaceDefaultProperties.js.map +1 -1
- package/lib/data/SpectraManager.d.ts +1 -1
- package/lib/data/SpectraManager.d.ts.map +1 -1
- package/lib/data/SpectraManager.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts +0 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +17 -16
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +2 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts +0 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +7 -6
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/detectZonesManual.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/zones/initiateZones.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.d.ts +1 -17
- package/lib/data/molecules/Molecule.d.ts.map +1 -1
- package/lib/data/molecules/Molecule.js +3 -7
- 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 +31 -7
- package/lib/data/molecules/MoleculeManager.js.map +1 -1
- package/lib/utils/clipboard/clipboardHooks.js +4 -4
- package/lib/utils/clipboard/clipboardHooks.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +30 -29
- package/src/component/1d/ranges/Atoms.tsx +36 -13
- package/src/component/1d-2d/components/FloatMoleculeStructures/DraggableStructure.tsx +38 -79
- package/src/component/1d-2d/components/FloatMoleculeStructures/FloatMolecules.tsx +5 -2
- package/src/component/2d/useTracesSpectra.ts +2 -0
- package/src/component/2d/zones/SignalsGuideLines.tsx +1 -1
- package/src/component/EventsTrackers/KeysListenerTracker.tsx +6 -0
- package/src/component/hooks/useExport.tsx +1 -1
- package/src/component/loader/useLoadFiles.ts +19 -7
- package/src/component/main/NMRiumStateProvider.tsx +2 -3
- package/src/component/modal/LoadJCAMPModal.tsx +10 -4
- package/src/component/modal/MoleculeStructureEditorModal.tsx +10 -3
- package/src/component/modal/MultipletAnalysisModal.tsx +1 -1
- package/src/component/modal/SaveAsModal.tsx +8 -2
- package/src/component/modal/setting/settings-tabs/ToolsTabContent.tsx +17 -1
- package/src/component/panels/MoleculesPanel/MoleculeOptionsPanel.tsx +160 -0
- package/src/component/panels/MoleculesPanel/MoleculePanel.tsx +77 -101
- package/src/component/panels/MoleculesPanel/MoleculePanelHeader.tsx +63 -42
- package/src/component/panels/MoleculesPanel/MoleculeStructure.tsx +117 -0
- package/src/component/panels/MoleculesPanel/{useAtomAssignment.tsx → hooks/useAtomAssignment.tsx} +47 -25
- 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/databasePanel/DatabaseInfo.tsx +43 -0
- package/src/component/panels/databasePanel/DatabaseTable.tsx +33 -1
- package/src/component/panels/hooks/useMoleculeAnnotationCore.ts +36 -0
- package/src/component/panels/informationPanel/InformationEditionModal.tsx +2 -0
- package/src/component/reducer/IgnoreActions.ts +2 -1
- package/src/component/reducer/Reducer.ts +21 -8
- package/src/component/reducer/actions/DatabaseActions.ts +4 -2
- package/src/component/reducer/actions/LoadAction.ts +51 -38
- package/src/component/reducer/actions/MoleculeActions.ts +85 -37
- package/src/component/reducer/actions/RangesActions.ts +50 -5
- package/src/component/reducer/actions/ZonesActions.ts +1 -1
- package/src/component/reducer/preferences/actions/changeDefaultMoleculeSettings.ts +16 -0
- package/src/component/reducer/preferences/panelsPreferencesDefaultValues.ts +1 -1
- package/src/component/reducer/preferences/preferencesReducer.ts +11 -1
- package/src/component/toolbar/ToolBar.tsx +6 -1
- package/src/component/toolbar/ToolTypes.ts +2 -1
- package/src/component/utility/filterDatabaseInfoEntry.ts +10 -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 +6 -1
- package/src/component/workspaces/process1D.ts +6 -0
- package/src/component/workspaces/simulation.ts +1 -1
- package/src/component/workspaces/workspaceDefaultProperties.ts +19 -1
- package/src/data/SpectraManager.ts +1 -7
- package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +17 -19
- package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +2 -1
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +7 -10
- package/src/data/molecules/Molecule.ts +5 -25
- package/src/data/molecules/MoleculeManager.ts +40 -8
- package/src/index.tsx +0 -3
- package/src/utils/clipboard/clipboardHooks.ts +6 -6
- 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 -129
- 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/src/component/panels/MoleculesPanel/Utilities.ts +0 -188
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clipboardHooks.js","sourceRoot":"","sources":["../../../src/utils/clipboard/clipboardHooks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EACL,gBAAgB,EAChB,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,SAAS,GACV,MAAM,gBAAgB,CAAC;AA6DxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,EAEjD,CAAC;IACJ,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,EAAsB,CAAC;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAsB,CAAC;IACzD,MAAM,mBAAmB,GAAG,WAAW,CAAC,GAAG,EAAE;QAC3C,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC7B,OAAO,CAAC,SAAS,CAAC,CAAC;QACnB,QAAQ,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,OAAO,CAC1B,GAAG,EAAE,CAAC,CAAC;QACL,KAAK,CAAC,IAAI;YACR,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,EAAE,CAAC;YACtB,CAAC;YAAC,
|
|
1
|
+
{"version":3,"file":"clipboardHooks.js","sourceRoot":"","sources":["../../../src/utils/clipboard/clipboardHooks.ts"],"names":[],"mappings":"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"}
|
package/lib/versionInfo.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export default { version: 'v1.
|
|
1
|
+
export default { version: 'v1.9.0' };
|
|
2
2
|
//# sourceMappingURL=versionInfo.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nmrium",
|
|
3
3
|
"description": "React component to display and process nuclear magnetic resonance (NMR) spectra.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
"@emotion/react": "^11.14.0",
|
|
69
69
|
"@emotion/styled": "^11.14.1",
|
|
70
70
|
"@hookform/resolvers": "^5.2.2",
|
|
71
|
-
"@zakodium/nmr-types": "^0.4.
|
|
72
|
-
"@zakodium/nmrium-core": "^0.4.
|
|
73
|
-
"@zakodium/nmrium-core-plugins": "^0.6.
|
|
71
|
+
"@zakodium/nmr-types": "^0.4.3",
|
|
72
|
+
"@zakodium/nmrium-core": "^0.4.10",
|
|
73
|
+
"@zakodium/nmrium-core-plugins": "^0.6.12",
|
|
74
74
|
"@zakodium/pdnd-esm": "^1.0.2",
|
|
75
|
-
"@zip.js/zip.js": "^2.8.
|
|
75
|
+
"@zip.js/zip.js": "^2.8.11",
|
|
76
76
|
"cheminfo-font": "^1.13.1",
|
|
77
77
|
"cheminfo-types": "^1.8.1",
|
|
78
78
|
"clipboard-polyfill": "^4.1.1",
|
|
@@ -82,32 +82,33 @@
|
|
|
82
82
|
"dlv": "^1.1.3",
|
|
83
83
|
"eventemitter3": "^5.0.1",
|
|
84
84
|
"fifo-logger": "^2.0.1",
|
|
85
|
-
"file-collection": "^6.
|
|
85
|
+
"file-collection": "^6.3.0",
|
|
86
86
|
"file-saver": "^2.0.5",
|
|
87
|
+
"get-jpaths": "^1.1.0",
|
|
87
88
|
"immer": "^10.2.0",
|
|
88
89
|
"lodash": "^4.17.21",
|
|
89
90
|
"mf-parser": "^3.6.0",
|
|
90
91
|
"ml-array-mean": "^1.1.6",
|
|
91
92
|
"ml-array-median": "^1.1.6",
|
|
92
93
|
"ml-conrec": "^5.0.3",
|
|
93
|
-
"ml-gsd": "^13.1.
|
|
94
|
+
"ml-gsd": "^13.1.1",
|
|
94
95
|
"ml-signal-processing": "^2.1.0",
|
|
95
|
-
"ml-spectra-processing": "^14.18.
|
|
96
|
+
"ml-spectra-processing": "^14.18.1",
|
|
96
97
|
"ml-tree-similarity": "^2.2.0",
|
|
97
98
|
"nmr-correlation": "2.3.3",
|
|
98
|
-
"nmr-processing": "^21.
|
|
99
|
+
"nmr-processing": "^21.2.0",
|
|
99
100
|
"numeral": "^2.0.6",
|
|
100
|
-
"openchemlib": "^9.
|
|
101
|
-
"openchemlib-utils": "^8.
|
|
101
|
+
"openchemlib": "^9.18.1",
|
|
102
|
+
"openchemlib-utils": "^8.8.1",
|
|
102
103
|
"papaparse": "^5.5.3",
|
|
103
104
|
"react-d3-utils": "^3.1.2",
|
|
104
105
|
"react-dropzone": "^14.3.8",
|
|
105
106
|
"react-error-boundary": "^6.0.0",
|
|
106
|
-
"react-hook-form": "^7.
|
|
107
|
+
"react-hook-form": "^7.66.1",
|
|
107
108
|
"react-icons": "^5.5.0",
|
|
108
109
|
"react-inspector": "^9.0.0",
|
|
109
110
|
"react-mf": "^3.1.1",
|
|
110
|
-
"react-ocl": "^8.
|
|
111
|
+
"react-ocl": "^8.4.0",
|
|
111
112
|
"react-ocl-nmr": "^4.1.1",
|
|
112
113
|
"react-plot": "^3.1.1",
|
|
113
114
|
"react-rnd": "^10.5.2",
|
|
@@ -117,9 +118,9 @@
|
|
|
117
118
|
"yup": "^1.7.1"
|
|
118
119
|
},
|
|
119
120
|
"devDependencies": {
|
|
120
|
-
"@blueprintjs/core": "^6.3.
|
|
121
|
-
"@blueprintjs/icons": "^6.
|
|
122
|
-
"@blueprintjs/select": "^6.0.
|
|
121
|
+
"@blueprintjs/core": "^6.3.4",
|
|
122
|
+
"@blueprintjs/icons": "^6.3.1",
|
|
123
|
+
"@blueprintjs/select": "^6.0.8",
|
|
123
124
|
"@playwright/test": "^1.56.1",
|
|
124
125
|
"@simbathesailor/use-what-changed": "^2.0.0",
|
|
125
126
|
"@types/d3-array": "^3.2.2",
|
|
@@ -128,21 +129,21 @@
|
|
|
128
129
|
"@types/dlv": "^1.1.5",
|
|
129
130
|
"@types/file-saver": "^2.0.7",
|
|
130
131
|
"@types/lodash": "^4.17.20",
|
|
131
|
-
"@types/node": "^24.
|
|
132
|
+
"@types/node": "^24.10.1",
|
|
132
133
|
"@types/numeral": "^2.0.5",
|
|
133
|
-
"@types/papaparse": "^5.
|
|
134
|
+
"@types/papaparse": "^5.5.0",
|
|
134
135
|
"@types/react": "^18.3.13",
|
|
135
136
|
"@types/react-dom": "^18.3.1",
|
|
136
137
|
"@types/react-table": "^7.7.20",
|
|
137
|
-
"@vitejs/plugin-react": "^5.1.
|
|
138
|
-
"@vitest/coverage-v8": "^4.0.
|
|
138
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
139
|
+
"@vitest/coverage-v8": "^4.0.12",
|
|
139
140
|
"@zakodium/tsconfig": "^1.0.2",
|
|
140
141
|
"cross-env": "^10.1.0",
|
|
141
|
-
"cspell": "^9.
|
|
142
|
-
"eslint": "^9.
|
|
143
|
-
"eslint-config-cheminfo-react": "^
|
|
144
|
-
"eslint-config-cheminfo-typescript": "^
|
|
145
|
-
"knip": "^5.
|
|
142
|
+
"cspell": "^9.3.2",
|
|
143
|
+
"eslint": "^9.39.1",
|
|
144
|
+
"eslint-config-cheminfo-react": "^19.0.0",
|
|
145
|
+
"eslint-config-cheminfo-typescript": "^21.0.1",
|
|
146
|
+
"knip": "^5.70.1",
|
|
146
147
|
"modern-normalize": "^3.0.1",
|
|
147
148
|
"postcss": "^8.5.6",
|
|
148
149
|
"postcss-styled-syntax": "^0.7.1",
|
|
@@ -150,15 +151,15 @@
|
|
|
150
151
|
"rc-menu": "^9.16.1",
|
|
151
152
|
"react": "^18.3.1",
|
|
152
153
|
"react-dom": "^18.3.1",
|
|
153
|
-
"react-router-dom": "^7.9.
|
|
154
|
-
"rimraf": "^6.1.
|
|
154
|
+
"react-router-dom": "^7.9.6",
|
|
155
|
+
"rimraf": "^6.1.2",
|
|
155
156
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
156
157
|
"serve": "^14.2.5",
|
|
157
158
|
"stylelint": "^16.25.0",
|
|
158
159
|
"stylelint-config-standard": "^39.0.1",
|
|
159
160
|
"typescript": "~5.9.3",
|
|
160
|
-
"vite": "^7.
|
|
161
|
-
"vitest": "^4.0.
|
|
161
|
+
"vite": "^7.2.4",
|
|
162
|
+
"vitest": "^4.0.12"
|
|
162
163
|
},
|
|
163
164
|
"volta": {
|
|
164
165
|
"node": "24.11.0"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Range } from '@zakodium/nmr-types';
|
|
2
|
+
import type { MoleculesView } from '@zakodium/nmrium-core';
|
|
2
3
|
|
|
3
4
|
import { useChartData } from '../../context/ChartContext.js';
|
|
4
5
|
import { useTopicMolecule } from '../../context/TopicMoleculeContext.js';
|
|
@@ -19,24 +20,48 @@ function getDiaIds(range: Range) {
|
|
|
19
20
|
return ids;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
|
-
function useAtoms(range: Range) {
|
|
23
|
+
function useAtoms(range: Range, moleculesView: MoleculesView) {
|
|
23
24
|
const topicMolecule = useTopicMolecule();
|
|
24
25
|
const diaIDs = getDiaIds(range);
|
|
25
|
-
const atomsList: Array<{ id: string; atoms: number
|
|
26
|
+
const atomsList: Array<{ id: string; atoms: Array<string | number> }> = [];
|
|
26
27
|
|
|
27
28
|
for (const [id, topicMoleculeObject] of Object.entries(topicMolecule)) {
|
|
28
|
-
const atoms: number
|
|
29
|
+
const atoms: Array<string | number> = [];
|
|
29
30
|
const diaIDsObject = topicMoleculeObject.getDiaIDsObject();
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
|
|
32
|
+
if (!diaIDsObject || !(id in moleculesView)) continue;
|
|
33
|
+
|
|
34
|
+
const { atomAnnotation } = moleculesView[id];
|
|
35
|
+
for (const id of diaIDs) {
|
|
36
|
+
if (!(id in diaIDsObject)) continue;
|
|
37
|
+
|
|
38
|
+
const {
|
|
39
|
+
existingAtoms = [],
|
|
40
|
+
customLabels = [],
|
|
41
|
+
heavyAtomsCustomLabels = [],
|
|
42
|
+
} = diaIDsObject[id];
|
|
43
|
+
|
|
44
|
+
if (atomAnnotation === 'atom-numbers') {
|
|
45
|
+
atoms.push(...existingAtoms);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (atomAnnotation === 'custom-labels') {
|
|
49
|
+
const labels =
|
|
50
|
+
customLabels.length > 0 ? customLabels : heavyAtomsCustomLabels;
|
|
51
|
+
atoms.push(...labels);
|
|
36
52
|
}
|
|
37
53
|
}
|
|
54
|
+
|
|
38
55
|
if (atoms.length > 0) {
|
|
39
|
-
atoms.sort((a, b) =>
|
|
56
|
+
atoms.sort((a, b) => {
|
|
57
|
+
if (typeof a === 'number' && typeof b === 'number') {
|
|
58
|
+
return a - b;
|
|
59
|
+
}
|
|
60
|
+
if (typeof a === 'string' && typeof b === 'string') {
|
|
61
|
+
return a.localeCompare(b);
|
|
62
|
+
}
|
|
63
|
+
return 0;
|
|
64
|
+
});
|
|
40
65
|
atomsList.push({
|
|
41
66
|
id,
|
|
42
67
|
atoms: Array.from(new Set(atoms)),
|
|
@@ -56,9 +81,7 @@ export function Atoms(props: AtomsProps) {
|
|
|
56
81
|
const {
|
|
57
82
|
view: { molecules },
|
|
58
83
|
} = useChartData();
|
|
59
|
-
const atomsList = useAtoms(range)
|
|
60
|
-
(atomsList) => molecules?.[atomsList.id]?.showAtomNumber,
|
|
61
|
-
);
|
|
84
|
+
const atomsList = useAtoms(range, molecules);
|
|
62
85
|
|
|
63
86
|
return (
|
|
64
87
|
<SVGGroup
|
|
@@ -1,33 +1,26 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
|
+
import type { MoleculeView } from '@zakodium/nmrium-core';
|
|
2
3
|
import { useEffect, useState } from 'react';
|
|
3
4
|
import { ResponsiveChart } from 'react-d3-utils';
|
|
4
5
|
import { BsArrowsMove } from 'react-icons/bs';
|
|
5
|
-
import { FaTimes } from 'react-icons/fa';
|
|
6
|
-
import
|
|
7
|
-
import { MolfileSvgRenderer } from 'react-ocl';
|
|
8
|
-
import OCLnmr from 'react-ocl-nmr';
|
|
6
|
+
import { FaRegBookmark, FaTimes } from 'react-icons/fa';
|
|
7
|
+
import { MdFormatColorText, MdNumbers } from 'react-icons/md';
|
|
9
8
|
import { Rnd } from 'react-rnd';
|
|
10
9
|
|
|
11
10
|
import type {
|
|
12
11
|
MoleculeBoundingRect,
|
|
13
|
-
MoleculeView,
|
|
14
12
|
StateMoleculeExtended,
|
|
15
13
|
} from '../../../../data/molecules/Molecule.js';
|
|
16
14
|
import { useDispatch } from '../../../context/DispatchContext.js';
|
|
17
15
|
import { useGlobal } from '../../../context/GlobalContext.js';
|
|
18
16
|
import type { ActionsButtonsPopoverProps } from '../../../elements/ActionsButtonsPopover.js';
|
|
19
17
|
import { ActionsButtonsPopover } from '../../../elements/ActionsButtonsPopover.js';
|
|
20
|
-
import { useHighlightColor } from '../../../hooks/useHighlightColor.js';
|
|
21
18
|
import { useSVGUnitConverter } from '../../../hooks/useSVGUnitConverter.js';
|
|
22
19
|
import { useCheckExportStatus } from '../../../hooks/useViewportSize.js';
|
|
23
20
|
import { useMoleculeEditor } from '../../../modal/MoleculeStructureEditorModal.js';
|
|
24
|
-
import
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
renderAsSVG?: boolean;
|
|
30
|
-
}
|
|
21
|
+
import { MoleculeStructure } from '../../../panels/MoleculesPanel/MoleculeStructure.tsx';
|
|
22
|
+
import { useMoleculeAnnotationCore } from '../../../panels/hooks/useMoleculeAnnotationCore.ts';
|
|
23
|
+
import { booleanToString } from '../../../utility/booleanToString.ts';
|
|
31
24
|
|
|
32
25
|
interface DraggableStructureProps {
|
|
33
26
|
moleculeView: MoleculeView;
|
|
@@ -103,6 +96,12 @@ export function DraggableStructure(props: DraggableStructureProps) {
|
|
|
103
96
|
return { x: pixelToPercent(x, 'x'), y: pixelToPercent(y, 'y') };
|
|
104
97
|
}
|
|
105
98
|
|
|
99
|
+
const {
|
|
100
|
+
handleChangeAtomAnnotation,
|
|
101
|
+
isAnnotation,
|
|
102
|
+
handleToggleMoleculeLabel,
|
|
103
|
+
} = useMoleculeAnnotationCore(molecule.id, moleculeView);
|
|
104
|
+
|
|
106
105
|
if (!viewerRef) return null;
|
|
107
106
|
|
|
108
107
|
const actionsButtons: ActionsButtonsPopoverProps['buttons'] = [
|
|
@@ -119,8 +118,31 @@ export function DraggableStructure(props: DraggableStructureProps) {
|
|
|
119
118
|
title: 'Hide molecule',
|
|
120
119
|
onClick: floatMoleculeHandler,
|
|
121
120
|
},
|
|
121
|
+
{
|
|
122
|
+
elementType: 'separator',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
icon: <MdFormatColorText />,
|
|
126
|
+
title: `${booleanToString(!moleculeView.showLabel)} molecule label`,
|
|
127
|
+
onClick: handleToggleMoleculeLabel,
|
|
128
|
+
active: moleculeView.showLabel,
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
elementType: 'separator',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
icon: <MdNumbers />,
|
|
135
|
+
title: `${booleanToString(!isAnnotation('atom-numbers'))} atom number`,
|
|
136
|
+
onClick: () => handleChangeAtomAnnotation('atom-numbers'),
|
|
137
|
+
active: isAnnotation('atom-numbers'),
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
icon: <FaRegBookmark />,
|
|
141
|
+
title: `${booleanToString(!isAnnotation('custom-labels'))} custom labels`,
|
|
142
|
+
onClick: () => handleChangeAtomAnnotation('custom-labels'),
|
|
143
|
+
active: isAnnotation('custom-labels'),
|
|
144
|
+
},
|
|
122
145
|
];
|
|
123
|
-
|
|
124
146
|
const { x: xInPercent, y: yInPercent, width, height } = bounding;
|
|
125
147
|
|
|
126
148
|
const x = percentToPixel(xInPercent, 'x');
|
|
@@ -129,7 +151,7 @@ export function DraggableStructure(props: DraggableStructureProps) {
|
|
|
129
151
|
if (isExportProcessStart) {
|
|
130
152
|
return (
|
|
131
153
|
<g transform={`translate(${x} ${y})`}>
|
|
132
|
-
<
|
|
154
|
+
<MoleculeStructure renderAsSVG {...{ width, height }} {...props} />
|
|
133
155
|
</g>
|
|
134
156
|
);
|
|
135
157
|
}
|
|
@@ -176,7 +198,7 @@ export function DraggableStructure(props: DraggableStructureProps) {
|
|
|
176
198
|
>
|
|
177
199
|
<ResponsiveChart>
|
|
178
200
|
{({ width, height }) => {
|
|
179
|
-
return <
|
|
201
|
+
return <MoleculeStructure {...{ width, height }} {...props} />;
|
|
180
202
|
}}
|
|
181
203
|
</ResponsiveChart>
|
|
182
204
|
</div>
|
|
@@ -186,66 +208,3 @@ export function DraggableStructure(props: DraggableStructureProps) {
|
|
|
186
208
|
</ReactRnd>
|
|
187
209
|
);
|
|
188
210
|
}
|
|
189
|
-
|
|
190
|
-
function DraggableMolecule(props: DraggableMoleculeProps) {
|
|
191
|
-
const {
|
|
192
|
-
molecule,
|
|
193
|
-
index,
|
|
194
|
-
moleculeView,
|
|
195
|
-
width,
|
|
196
|
-
height,
|
|
197
|
-
renderAsSVG = false,
|
|
198
|
-
} = props;
|
|
199
|
-
const {
|
|
200
|
-
currentDiaIDsToHighlight,
|
|
201
|
-
handleOnAtomHover,
|
|
202
|
-
handleOnClickAtom,
|
|
203
|
-
assignedDiaIDsMerged,
|
|
204
|
-
} = useAtomAssignment();
|
|
205
|
-
const highlightColor = useHighlightColor();
|
|
206
|
-
const dispatch = useDispatch();
|
|
207
|
-
|
|
208
|
-
const atomHighlightColor =
|
|
209
|
-
currentDiaIDsToHighlight?.length > 0 ? '#ff000080' : highlightColor;
|
|
210
|
-
const baseProps: MolfileSvgRendererProps = {
|
|
211
|
-
id: `molSVG${index || ''}`,
|
|
212
|
-
height,
|
|
213
|
-
width,
|
|
214
|
-
label: molecule.label,
|
|
215
|
-
labelFontSize: 15,
|
|
216
|
-
labelColor: 'rgb(0,0,0)',
|
|
217
|
-
molfile: molecule.molfile,
|
|
218
|
-
atomHighlightColor,
|
|
219
|
-
atomHighlightOpacity: 1,
|
|
220
|
-
showAtomNumber: moleculeView.showAtomNumber,
|
|
221
|
-
noCarbonLabelWithCustomLabel: true,
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
if (renderAsSVG) {
|
|
225
|
-
return <MolfileSvgRenderer {...baseProps} />;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
return (
|
|
229
|
-
<OCLnmr
|
|
230
|
-
{...baseProps}
|
|
231
|
-
setSelectedAtom={handleOnClickAtom}
|
|
232
|
-
highlights={
|
|
233
|
-
currentDiaIDsToHighlight?.length > 0
|
|
234
|
-
? currentDiaIDsToHighlight
|
|
235
|
-
: assignedDiaIDsMerged
|
|
236
|
-
}
|
|
237
|
-
atomHighlightStrategy="prefer-editor-props"
|
|
238
|
-
setHoverAtom={handleOnAtomHover}
|
|
239
|
-
setMolfile={(molfile) => {
|
|
240
|
-
dispatch({
|
|
241
|
-
type: 'SET_MOLECULE',
|
|
242
|
-
payload: {
|
|
243
|
-
molfile,
|
|
244
|
-
id: molecule.id,
|
|
245
|
-
label: molecule.label,
|
|
246
|
-
},
|
|
247
|
-
});
|
|
248
|
-
}}
|
|
249
|
-
/>
|
|
250
|
-
);
|
|
251
|
-
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { Ranges, Zones } from '@zakodium/nmr-types';
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
MoleculeView,
|
|
4
|
+
Spectrum1D,
|
|
5
|
+
Spectrum2D,
|
|
6
|
+
} from '@zakodium/nmrium-core';
|
|
3
7
|
import { memo } from 'react';
|
|
4
8
|
import { assert } from 'react-science/ui';
|
|
5
9
|
|
|
6
10
|
import type {
|
|
7
|
-
MoleculeView,
|
|
8
11
|
MoleculesView,
|
|
9
12
|
StateMoleculeExtended,
|
|
10
13
|
} from '../../../../data/molecules/Molecule.js';
|
|
@@ -360,6 +360,12 @@ function KeysListenerTracker(props: KeysListenerTrackerProps) {
|
|
|
360
360
|
|
|
361
361
|
break;
|
|
362
362
|
}
|
|
363
|
+
case 'm': {
|
|
364
|
+
if (isToolVisible('multipleSpectraAnalysis')) {
|
|
365
|
+
handleChangeOption(options.multipleSpectraAnalysis.id);
|
|
366
|
+
}
|
|
367
|
+
break;
|
|
368
|
+
}
|
|
363
369
|
case 't': {
|
|
364
370
|
if (isToolVisible('fft')) {
|
|
365
371
|
dispatch({
|
|
@@ -94,7 +94,7 @@ export function useExport() {
|
|
|
94
94
|
const archive = await core.serializeNmriumArchive({
|
|
95
95
|
molecules: state.molecules,
|
|
96
96
|
spectra: state.data,
|
|
97
|
-
|
|
97
|
+
aggregator: state.aggregator,
|
|
98
98
|
includeData: options.include.dataType === 'SELF_CONTAINED',
|
|
99
99
|
serializedState: blob,
|
|
100
100
|
});
|
|
@@ -40,24 +40,30 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
|
40
40
|
let nmriumState: Partial<NmriumState>;
|
|
41
41
|
let containsNmrium: boolean;
|
|
42
42
|
let parseMetaFileResult: ParseResult<any> | null = null;
|
|
43
|
-
const { onLoadProcessing, spectraColors } =
|
|
44
|
-
|
|
43
|
+
const { onLoadProcessing, spectraColors, defaultMoleculeSettings } =
|
|
44
|
+
workspacePreferences;
|
|
45
|
+
const { nmrLoaders: selector } = preferences.current;
|
|
45
46
|
|
|
46
47
|
const parsingOptions: Partial<ParsingOptions> = {
|
|
47
|
-
|
|
48
|
+
selector,
|
|
48
49
|
logger: logger.child({ context: 'nmr-processing' }),
|
|
49
50
|
onLoadProcessing,
|
|
50
51
|
experimentalFeatures,
|
|
51
52
|
};
|
|
52
53
|
|
|
54
|
+
let aggregator: FileCollection | undefined;
|
|
53
55
|
let fileCollection: FileCollection | undefined;
|
|
54
|
-
let
|
|
56
|
+
let selectorRoot: string | undefined;
|
|
57
|
+
let resetSourceObject = false;
|
|
58
|
+
|
|
55
59
|
if (files.length === 1 && files[0].name.endsWith('.nmrium.zip')) {
|
|
56
|
-
[
|
|
60
|
+
const [state, ium] = await core.readNMRiumArchive(
|
|
57
61
|
files[0].stream(),
|
|
58
62
|
parsingOptions,
|
|
59
63
|
);
|
|
64
|
+
nmriumState = state;
|
|
60
65
|
containsNmrium = true;
|
|
66
|
+
aggregator = ium;
|
|
61
67
|
} else {
|
|
62
68
|
for (const file of files) {
|
|
63
69
|
if (file.name.endsWith('.nmrium.zip')) {
|
|
@@ -84,10 +90,13 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
|
84
90
|
if (metaFile) {
|
|
85
91
|
parseMetaFileResult = await parseMetaFile(metaFile);
|
|
86
92
|
}
|
|
87
|
-
({ nmriumState, containsNmrium } = await core.read(
|
|
93
|
+
({ nmriumState, containsNmrium, selectorRoot } = await core.read(
|
|
88
94
|
fileCollection,
|
|
89
95
|
parsingOptions,
|
|
90
96
|
));
|
|
97
|
+
if (containsNmrium) {
|
|
98
|
+
resetSourceObject = true;
|
|
99
|
+
}
|
|
91
100
|
}
|
|
92
101
|
|
|
93
102
|
if (nmriumState.settings) {
|
|
@@ -106,8 +115,11 @@ export function useLoadFiles(onOpenMetaInformation?: (file: File) => void) {
|
|
|
106
115
|
containsNmrium,
|
|
107
116
|
parseMetaFileResult,
|
|
108
117
|
spectraColors,
|
|
118
|
+
aggregator,
|
|
109
119
|
fileCollection,
|
|
110
|
-
|
|
120
|
+
selectorRoot,
|
|
121
|
+
resetSourceObject,
|
|
122
|
+
defaultMoleculeSettings,
|
|
111
123
|
},
|
|
112
124
|
});
|
|
113
125
|
}
|
|
@@ -78,7 +78,6 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
78
78
|
sources,
|
|
79
79
|
view,
|
|
80
80
|
actionType,
|
|
81
|
-
fileCollections: {},
|
|
82
81
|
},
|
|
83
82
|
{ current: workspaces[workspace.current] },
|
|
84
83
|
{ serialize: false, exportTarget: 'onChange' },
|
|
@@ -120,7 +119,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
120
119
|
void core
|
|
121
120
|
.readNMRiumObject(nmriumData)
|
|
122
121
|
.then((result) => {
|
|
123
|
-
const [nmriumState,
|
|
122
|
+
const [nmriumState, aggregator] = result;
|
|
124
123
|
if (nmriumState?.settings) {
|
|
125
124
|
dispatchPreferences({
|
|
126
125
|
type: 'SET_WORKSPACE',
|
|
@@ -132,7 +131,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
132
131
|
}
|
|
133
132
|
dispatch({
|
|
134
133
|
type: 'INITIATE',
|
|
135
|
-
payload: { nmriumState,
|
|
134
|
+
payload: { nmriumState, aggregator },
|
|
136
135
|
});
|
|
137
136
|
})
|
|
138
137
|
.catch((error: unknown) => {
|
|
@@ -66,13 +66,19 @@ function InnerLoadJCAMPModal({ onCloseDialog }: InnerLoadJCAMPModalProps) {
|
|
|
66
66
|
});
|
|
67
67
|
const { pathname, origin } = new URL(url);
|
|
68
68
|
try {
|
|
69
|
-
const [nmriumState, fileCollection] =
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
const [nmriumState, fileCollection, selectorRoot] =
|
|
70
|
+
await core.readFromWebSource({
|
|
71
|
+
entries: [{ relativePath: pathname, baseURL: origin }],
|
|
72
|
+
});
|
|
72
73
|
|
|
73
74
|
dispatch({
|
|
74
75
|
type: 'LOAD_DROP_FILES',
|
|
75
|
-
payload: {
|
|
76
|
+
payload: {
|
|
77
|
+
nmriumState,
|
|
78
|
+
resetSourceObject: false,
|
|
79
|
+
fileCollection,
|
|
80
|
+
selectorRoot,
|
|
81
|
+
},
|
|
76
82
|
});
|
|
77
83
|
} catch {
|
|
78
84
|
toaster.show({ message: `Failed to load ${url}`, intent: 'danger' });
|
|
@@ -8,6 +8,7 @@ import { useOnOff } from 'react-science/ui';
|
|
|
8
8
|
|
|
9
9
|
import type { StateMoleculeExtended } from '../../data/molecules/Molecule.js';
|
|
10
10
|
import { useDispatch } from '../context/DispatchContext.js';
|
|
11
|
+
import { usePreferences } from '../context/PreferencesContext.tsx';
|
|
11
12
|
import ActionButtons from '../elements/ActionButtons.js';
|
|
12
13
|
import { StyledDialogBody } from '../elements/StyledDialogBody.js';
|
|
13
14
|
|
|
@@ -24,10 +25,14 @@ function MoleculeStructureEditorModal(
|
|
|
24
25
|
const {
|
|
25
26
|
onClose = () => null,
|
|
26
27
|
selectedMolecule,
|
|
27
|
-
floatMoleculeOnSave
|
|
28
|
+
floatMoleculeOnSave,
|
|
28
29
|
isOpen = false,
|
|
29
30
|
} = props;
|
|
30
31
|
|
|
32
|
+
const {
|
|
33
|
+
current: { defaultMoleculeSettings },
|
|
34
|
+
} = usePreferences();
|
|
35
|
+
|
|
31
36
|
const initialMolfile = selectedMolecule?.molfile;
|
|
32
37
|
const initialEnhancedMolfile = useMemo(() => {
|
|
33
38
|
if (!initialMolfile) {
|
|
@@ -92,6 +97,7 @@ function MoleculeStructureEditorModal(
|
|
|
92
97
|
payload: {
|
|
93
98
|
molfile,
|
|
94
99
|
floatMoleculeOnSave,
|
|
100
|
+
defaultMoleculeSettings,
|
|
95
101
|
},
|
|
96
102
|
});
|
|
97
103
|
onClose('new');
|
|
@@ -102,8 +108,9 @@ function MoleculeStructureEditorModal(
|
|
|
102
108
|
selectedMolecule,
|
|
103
109
|
initialEnhancedMolfile,
|
|
104
110
|
dispatch,
|
|
105
|
-
floatMoleculeOnSave,
|
|
106
111
|
onClose,
|
|
112
|
+
floatMoleculeOnSave,
|
|
113
|
+
defaultMoleculeSettings,
|
|
107
114
|
]);
|
|
108
115
|
|
|
109
116
|
return (
|
|
@@ -132,7 +139,7 @@ function MoleculeStructureEditorModal(
|
|
|
132
139
|
);
|
|
133
140
|
}
|
|
134
141
|
|
|
135
|
-
export function useMoleculeEditor(floatMoleculeOnSave
|
|
142
|
+
export function useMoleculeEditor(floatMoleculeOnSave?: boolean) {
|
|
136
143
|
const [isOpen, openModal, closeModal] = useOnOff(false);
|
|
137
144
|
const [molecule, setMolecule] = useState<StateMoleculeExtended | undefined>();
|
|
138
145
|
const modal = (
|
|
@@ -151,7 +151,7 @@ function InnerMultipleAnalysis(props: InnerMultipleAnalysisProps) {
|
|
|
151
151
|
frequency: info.originFrequency,
|
|
152
152
|
minimalResolution: 0.1,
|
|
153
153
|
critFoundJ: 0.75,
|
|
154
|
-
maxTestedJ:
|
|
154
|
+
maxTestedJ: 25,
|
|
155
155
|
minTestedJ: 1,
|
|
156
156
|
checkSymmetryFirst: false,
|
|
157
157
|
takeBestPartMultiplet: true,
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
Radio,
|
|
6
6
|
RadioGroup,
|
|
7
7
|
} from '@blueprintjs/core';
|
|
8
|
+
import { useMemo } from 'react';
|
|
8
9
|
import { Controller, useForm } from 'react-hook-form';
|
|
9
10
|
|
|
10
11
|
import type { ExportOptions } from '../../data/SpectraManager.js';
|
|
@@ -58,7 +59,7 @@ function SaveAsModal(props: SaveAsModalProps) {
|
|
|
58
59
|
}
|
|
59
60
|
function InnerSaveAsModal(props: InnerSaveAsModalProps) {
|
|
60
61
|
const { onCloseDialog } = props;
|
|
61
|
-
const { sources, data } = useChartData();
|
|
62
|
+
const { sources, data, aggregator } = useChartData();
|
|
62
63
|
const { saveHandler } = useExport();
|
|
63
64
|
const experimentalFlagEnabled = useCheckExperimentalFeature();
|
|
64
65
|
|
|
@@ -72,6 +73,11 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
|
|
|
72
73
|
const { handleSubmit, control, register } = useForm({
|
|
73
74
|
defaultValues: { ...INITIAL_VALUE, name: fileName },
|
|
74
75
|
});
|
|
76
|
+
|
|
77
|
+
const containsLinkedFiles = useMemo(() => {
|
|
78
|
+
return aggregator.sources.some((s) => !s.baseURL?.startsWith('ium:'));
|
|
79
|
+
}, [aggregator]);
|
|
80
|
+
|
|
75
81
|
return (
|
|
76
82
|
<Dialog
|
|
77
83
|
isOpen
|
|
@@ -129,7 +135,7 @@ function InnerSaveAsModal(props: InnerSaveAsModalProps) {
|
|
|
129
135
|
{experimentalFlagEnabled && (
|
|
130
136
|
<Radio
|
|
131
137
|
label="Full data (external data linked, experimental)"
|
|
132
|
-
disabled={
|
|
138
|
+
disabled={!containsLinkedFiles}
|
|
133
139
|
value={
|
|
134
140
|
DataExportOptions.SELF_CONTAINED_EXTERNAL_DATASOURCE
|
|
135
141
|
}
|