nmrium 0.48.0 → 0.50.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.
Files changed (154) hide show
  1. package/lib/component/1d/Chart1D.js +3 -1
  2. package/lib/component/1d/LinesSeries.js +1 -1
  3. package/lib/component/1d/SimilarityTree.d.ts +1 -0
  4. package/lib/component/1d/SimilarityTree.js +60 -0
  5. package/lib/component/1d/SpectraLegends.js +1 -1
  6. package/lib/component/1d/Viewer1D.js +142 -124
  7. package/lib/component/1d/jCouplingGraph/JsCoupling.js +1 -1
  8. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -7
  9. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +114 -125
  10. package/lib/component/1d/multiplicityTree/MultiplicityTrees.d.ts +1 -0
  11. package/lib/component/1d/multiplicityTree/MultiplicityTrees.js +23 -0
  12. package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +18 -0
  13. package/lib/component/1d/multiplicityTree/generateTreeNodes.js +66 -0
  14. package/lib/component/1d/ranges/Atoms.d.ts +7 -0
  15. package/lib/component/1d/ranges/Atoms.js +43 -0
  16. package/lib/component/1d/ranges/Range.d.ts +1 -1
  17. package/lib/component/1d/ranges/Range.js +10 -9
  18. package/lib/component/1d/tool/BaseLine.d.ts +2 -0
  19. package/lib/component/1d/tool/BaseLine.js +26 -0
  20. package/lib/component/1d/tool/BaseLineZones.js +18 -3
  21. package/lib/component/2d/Chart2D.js +6 -4
  22. package/lib/component/2d/Viewer2D.js +35 -26
  23. package/lib/component/context/KeyModifierContext.d.ts +13 -2
  24. package/lib/component/context/KeyModifierContext.js +35 -4
  25. package/lib/component/context/LoggerContext.d.ts +9 -0
  26. package/lib/component/context/LoggerContext.js +21 -7
  27. package/lib/component/context/PreferencesContext.d.ts +1 -108
  28. package/lib/component/context/TopicMoleculeContext.d.ts +8 -0
  29. package/lib/component/context/TopicMoleculeContext.js +30 -0
  30. package/lib/component/elements/CloseButton.d.ts +2 -10
  31. package/lib/component/elements/CloseButton.js +3 -20
  32. package/lib/component/elements/CounterLabel.js +0 -1
  33. package/lib/component/elements/DeleteButton.d.ts +5 -7
  34. package/lib/component/elements/DeleteButton.js +7 -5
  35. package/lib/component/elements/FilterButton.d.ts +6 -0
  36. package/lib/component/elements/FilterButton.js +8 -0
  37. package/lib/component/elements/Input.js +4 -1
  38. package/lib/component/elements/PreferencesButton.d.ts +2 -4
  39. package/lib/component/elements/PreferencesButton.js +5 -3
  40. package/lib/component/elements/ReactTable/ReactTable.js +5 -2
  41. package/lib/component/elements/ResizerWithScale.js +19 -2
  42. package/lib/component/elements/SVGGroup.js +2 -2
  43. package/lib/component/elements/SaveButton.d.ts +2 -11
  44. package/lib/component/elements/SaveButton.js +4 -19
  45. package/lib/component/elements/ToolBarButton.d.ts +9 -0
  46. package/lib/component/elements/ToolBarButton.js +14 -0
  47. package/lib/component/elements/formik/FormikTextarea.js +8 -9
  48. package/lib/component/elements/linearAxis/LinearVerticalAxis.js +1 -1
  49. package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +2 -1
  50. package/lib/component/elements/popup/Modal/ConfirmDialog.js +11 -8
  51. package/lib/component/elements/resizer/SVGResizer.js +1 -1
  52. package/lib/component/header/BaseLineCorrectionPanel.js +3 -2
  53. package/lib/component/header/Header.js +2 -2
  54. package/lib/component/hooks/useCheckToolsVisibility.js +1 -1
  55. package/lib/component/hooks/useSaveSettings.js +3 -2
  56. package/lib/component/hooks/useToolsFunctions.js +4 -2
  57. package/lib/component/main/InnerNMRium.js +2 -1
  58. package/lib/component/main/InnerNMRiumContents.js +1 -1
  59. package/lib/component/modal/AboutPredictionModal.js +4 -8
  60. package/lib/component/modal/AboutSpectrumSimulationModal.js +4 -8
  61. package/lib/component/modal/CopyClipboardModal.js +1 -1
  62. package/lib/component/modal/EditPeakShapeModal.js +2 -2
  63. package/lib/component/modal/ExportAsJcampModal.d.ts +1 -1
  64. package/lib/component/modal/ExportAsJcampModal.js +8 -4
  65. package/lib/component/modal/ImportPublicationStringModal.d.ts +2 -1
  66. package/lib/component/modal/ImportPublicationStringModal.js +80 -32
  67. package/lib/component/modal/LoadJCAMPModal.js +12 -9
  68. package/lib/component/modal/LogsHistoryModal.d.ts +1 -1
  69. package/lib/component/modal/LogsHistoryModal.js +9 -4
  70. package/lib/component/modal/MoleculeStructureEditorModal.js +10 -3
  71. package/lib/component/modal/MultipletAnalysisModal.js +8 -8
  72. package/lib/component/modal/PredictSpectraModal.js +6 -5
  73. package/lib/component/modal/SaveAsModal.js +2 -2
  74. package/lib/component/modal/aboutUs/AboutUsModal.js +11 -26
  75. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +4 -3
  76. package/lib/component/modal/changeSum/ChangeSumModal.js +10 -3
  77. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +1 -3
  78. package/lib/component/modal/changeSum/ChangeSumModalContents.js +9 -6
  79. package/lib/component/modal/editRange/EditRangeModal.js +8 -6
  80. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -0
  81. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +13 -10
  82. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  83. package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -0
  84. package/lib/component/modal/editZone/EditZoneModal.js +3 -3
  85. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  86. package/lib/component/modal/setting/GeneralSettings.js +17 -38
  87. package/lib/component/modal/setting/settings-tabs/GeneralTabContent.js +9 -11
  88. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +2 -4
  89. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +2 -2
  90. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -23
  91. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  92. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -4
  93. package/lib/component/panels/PeaksPanel/PeaksPanel.js +7 -8
  94. package/lib/component/panels/PeaksPanel/PeaksToggleActions.d.ts +8 -6
  95. package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +3 -6
  96. package/lib/component/panels/RangesPanel/RangesHeader.d.ts +1 -1
  97. package/lib/component/panels/RangesPanel/RangesHeader.js +8 -31
  98. package/lib/component/panels/RangesPanel/RangesTable.js +1 -1
  99. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +2 -2
  100. package/lib/component/panels/SpectrumsPanel/SpectraPreferences.js +39 -5
  101. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +42 -11
  102. package/lib/component/panels/SpectrumsPanel/SpectrumListPanel.js +4 -2
  103. package/lib/component/panels/SpectrumsPanel/base/SpectraColumnsManager.js +19 -16
  104. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
  105. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  106. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -1
  107. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -3
  108. package/lib/component/panels/ZonesPanel/ZonesPanel.js +2 -26
  109. package/lib/component/panels/databasePanel/DatabasePanel.js +6 -6
  110. package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +4 -6
  111. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +12 -13
  112. package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +7 -8
  113. package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
  114. package/lib/component/panels/header/DefaultPanelHeader.js +9 -4
  115. package/lib/component/panels/header/PanelHeader.js +0 -1
  116. package/lib/component/panels/header/PreferencesHeader.d.ts +2 -4
  117. package/lib/component/panels/header/PreferencesHeader.js +9 -23
  118. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -2
  119. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -9
  120. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +3 -3
  121. package/lib/component/reducer/Reducer.js +5 -0
  122. package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
  123. package/lib/component/reducer/actions/DatabaseActions.js +5 -1
  124. package/lib/component/reducer/actions/FiltersActions.d.ts +3 -4
  125. package/lib/component/reducer/actions/FiltersActions.js +92 -55
  126. package/lib/component/reducer/actions/LoadActions.js +10 -8
  127. package/lib/component/reducer/actions/SpectrumsActions.d.ts +8 -1
  128. package/lib/component/reducer/actions/SpectrumsActions.js +3 -3
  129. package/lib/component/reducer/actions/ToolsActions.d.ts +8 -5
  130. package/lib/component/reducer/actions/ToolsActions.js +51 -44
  131. package/lib/component/toolbar/BasicToolBar.js +11 -29
  132. package/lib/component/utility/export.js +3 -0
  133. package/lib/component/workspaces/exercise.js +1 -0
  134. package/lib/component/workspaces/prediction.js +1 -16
  135. package/lib/component/workspaces/simulation.js +1 -2
  136. package/lib/component/workspaces/workspaceDefaultProperties.js +4 -3
  137. package/lib/data/data1d/Spectrum1D/index.d.ts +0 -1
  138. package/lib/data/data1d/Spectrum1D/index.js +0 -1
  139. package/lib/utils/clipboard/clipboardComponents.d.ts +2 -2
  140. package/lib/utils/clipboard/clipboardComponents.js +8 -3
  141. package/lib/versionInfo.js +1 -1
  142. package/package.json +25 -23
  143. package/lib/component/1d/multiplicityTree/LevelNode.d.ts +0 -8
  144. package/lib/component/1d/multiplicityTree/LevelNode.js +0 -8
  145. package/lib/component/1d/multiplicityTree/StringNode.d.ts +0 -11
  146. package/lib/component/1d/multiplicityTree/StringNode.js +0 -7
  147. package/lib/component/1d/multiplicityTree/TreeColors.d.ts +0 -1
  148. package/lib/component/1d/multiplicityTree/TreeColors.js +0 -1
  149. package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +0 -21
  150. package/lib/component/1d/multiplicityTree/TreeNodes.js +0 -23
  151. package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +0 -11
  152. package/lib/component/1d/multiplicityTree/buildTreeNode.js +0 -57
  153. package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.d.ts +0 -2
  154. package/lib/data/data1d/Spectrum1D/generateSpectrumFromPublicationString.js +0 -6
@@ -1,12 +1,11 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { SvgNmrRealImag, SvgNmrOverlay3, SvgNmrOverlay3Aligned, SvgNmrAlignBottom, SvgNmrAlignCenter, } from 'cheminfo-font';
3
- import { Fragment, useCallback, memo } from 'react';
3
+ import { memo } from 'react';
4
4
  import { FaDownload, FaFileDownload, FaFileImage, FaCopy, FaFileExport, FaFile, FaFileImport, } from 'react-icons/fa';
5
5
  import { Toolbar, useOnOff } from 'react-science/ui';
6
6
  import { useChartData } from '../context/ChartContext';
7
7
  import { useLoader } from '../context/LoaderContext';
8
8
  import { DropdownMenu } from '../elements/DropdownMenu';
9
- import { useModal } from '../elements/popup/Modal';
10
9
  import useCheckExperimentalFeature from '../hooks/useCheckExperimentalFeature';
11
10
  import { useCheckToolsVisibility } from '../hooks/useCheckToolsVisibility';
12
11
  import useDatumWithSpectraStatistics from '../hooks/useDatumWithSpectraStatistics';
@@ -34,7 +33,7 @@ const IMPORT_MENU = [
34
33
  },
35
34
  {
36
35
  icon: _jsx(FaFile, {}),
37
- text: 'Import from publication string',
36
+ text: 'Generate spectrum from publication string',
38
37
  data: {
39
38
  id: 'importPublicationString',
40
39
  },
@@ -92,12 +91,12 @@ const EXPORT_MENU = [
92
91
  },
93
92
  ];
94
93
  function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
95
- const modal = useModal();
96
94
  const openLoader = useLoader();
97
95
  const openMetaInformationModal = useMetaInformationImportationModal();
98
96
  const isExperimentalFeature = useCheckExperimentalFeature();
99
97
  const isButtonVisible = useCheckToolsVisibility();
100
- const [isLoadModalOpened, openLoadModal, closeLoadModal] = useOnOff(false);
98
+ const [isLoadJCAMPModalOpened, openLoadJCAMPModal, closeLoadJCAMPModal] = useOnOff(false);
99
+ const [isPublicationStringModalOpened, openPublicationStringModal, closePublicationStringModal,] = useOnOff(false);
101
100
  const importMenu = isExperimentalFeature
102
101
  ? IMPORT_MENU
103
102
  : IMPORT_MENU.filter((item) => item.id !== 'importPublicationString');
@@ -106,35 +105,24 @@ function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
106
105
  : EXPORT_MENU.filter((item) => item.id !== 'nmre');
107
106
  const { isRealSpectrumShown, changeSpectrumViewHandler, changeDisplayViewModeHandler, alignSpectrumsVerticallyHandler, } = useToolsFunctions();
108
107
  const { saveAsSVGHandler, saveAsPNGHandler, saveAsJSONHandler, saveToClipboardHandler, saveAsHandler, } = useExport();
109
- const importJCAMPFile = useCallback(() => {
110
- openLoadModal();
111
- }, [openLoadModal]);
112
- const openImportPublicationStringModal = useCallback(() => {
113
- modal.show(_jsx(ImportPublicationStringModal, { onClose: () => modal.close() }), {});
114
- }, [modal]);
115
- const importHandler = useCallback((data) => {
108
+ function importHandler(data) {
116
109
  switch (data?.id) {
117
110
  case 'importFile':
118
111
  openLoader();
119
112
  break;
120
113
  case 'importJDX':
121
- importJCAMPFile();
114
+ openLoadJCAMPModal();
122
115
  break;
123
116
  case 'importPublicationString':
124
- openImportPublicationStringModal();
117
+ openPublicationStringModal();
125
118
  break;
126
119
  case 'importMetaInformation':
127
120
  openMetaInformationModal();
128
121
  break;
129
122
  default:
130
123
  }
131
- }, [
132
- openLoader,
133
- importJCAMPFile,
134
- openImportPublicationStringModal,
135
- openMetaInformationModal,
136
- ]);
137
- const exportHandler = useCallback((data) => {
124
+ }
125
+ function exportHandler(data) {
138
126
  switch (data?.id) {
139
127
  case 'svg':
140
128
  void saveAsSVGHandler();
@@ -154,14 +142,8 @@ function BasicToolBarInner({ verticalAlign, ftCounter, fidCounter, }) {
154
142
  default:
155
143
  break;
156
144
  }
157
- }, [
158
- saveAsSVGHandler,
159
- saveAsPNGHandler,
160
- saveAsJSONHandler,
161
- saveAsHandler,
162
- saveToClipboardHandler,
163
- ]);
164
- return (_jsxs(Fragment, { children: [_jsx(LoadJCAMPModal, { isOpen: isLoadModalOpened, onCloseDialog: closeLoadModal }), isButtonVisible('import') && (_jsx(DropdownMenu, { placement: "right-start", onSelect: (data) => {
145
+ }
146
+ return (_jsxs(_Fragment, { children: [_jsx(LoadJCAMPModal, { isOpen: isLoadJCAMPModalOpened, onCloseDialog: closeLoadJCAMPModal }), _jsx(ImportPublicationStringModal, { isOpen: isPublicationStringModalOpened, onClose: closePublicationStringModal }), isButtonVisible('import') && (_jsx(DropdownMenu, { placement: "right-start", onSelect: (data) => {
165
147
  importHandler(data);
166
148
  }, targetTagName: "div", targetProps: { style: { flex: 'none' } }, options: importMenu, children: _jsx(Toolbar.Item, { id: options.import.id, title: options.import.label, icon: _jsx(FaFileImport, {}) }) })), isButtonVisible('exportAs') && (_jsx(DropdownMenu, { onSelect: (data) => {
167
149
  exportHandler(data);
@@ -186,6 +186,9 @@ function getBlob(rootRef, elementID, css) {
186
186
  const floatingMoleculesGroup = getMoleculesElement(rootRef);
187
187
  _svg.append(floatingMoleculesGroup);
188
188
  const nmrCss = `
189
+ * {
190
+ font-family: Arial, Helvetica, sans-serif;
191
+ }
189
192
  .grid line,.grid path{stroke:none;} .peaks-text{fill:#730000} .x path{stroke-width:1px} .x text{
190
193
  font-size: 12px;
191
194
  font-weight: bold;
@@ -33,6 +33,7 @@ export const exercise = {
33
33
  verticalSplitterCloseThreshold: 600,
34
34
  spectraRendering: 'auto',
35
35
  loggingLevel: 'info',
36
+ popupLoggingLevel: 'error',
36
37
  invert: false,
37
38
  },
38
39
  formatting: {
@@ -7,6 +7,7 @@ export const prediction = {
7
7
  verticalSplitterCloseThreshold: 600,
8
8
  spectraRendering: 'auto',
9
9
  loggingLevel: 'info',
10
+ popupLoggingLevel: 'error',
10
11
  invert: false,
11
12
  },
12
13
  display: {
@@ -59,9 +60,7 @@ export const prediction = {
59
60
  visible: true,
60
61
  },
61
62
  {
62
- name: 'name',
63
63
  label: 'Spectrum Name',
64
- description: 'Spectrum Name',
65
64
  jpath: ['info', 'name'],
66
65
  visible: true,
67
66
  },
@@ -72,9 +71,7 @@ export const prediction = {
72
71
  visible: true,
73
72
  },
74
73
  {
75
- name: 'solvent',
76
74
  label: 'Solvent',
77
- description: 'Solvent',
78
75
  jpath: ['info', 'solvent'],
79
76
  visible: false,
80
77
  },
@@ -105,9 +102,7 @@ export const prediction = {
105
102
  visible: true,
106
103
  },
107
104
  {
108
- name: 'name',
109
105
  label: 'Spectrum Name',
110
- description: 'Spectrum Name',
111
106
  jpath: ['info', 'name'],
112
107
  visible: true,
113
108
  },
@@ -118,9 +113,7 @@ export const prediction = {
118
113
  visible: true,
119
114
  },
120
115
  {
121
- name: 'solvent',
122
116
  label: 'Solvent',
123
- description: 'Solvent',
124
117
  jpath: ['info', 'solvent'],
125
118
  visible: false,
126
119
  },
@@ -151,9 +144,7 @@ export const prediction = {
151
144
  visible: true,
152
145
  },
153
146
  {
154
- name: 'name',
155
147
  label: 'Spectrum Name',
156
- description: 'Spectrum Name',
157
148
  jpath: ['info', 'name'],
158
149
  visible: true,
159
150
  },
@@ -164,9 +155,7 @@ export const prediction = {
164
155
  visible: true,
165
156
  },
166
157
  {
167
- name: 'solvent',
168
158
  label: 'Solvent',
169
- description: 'Solvent',
170
159
  jpath: ['info', 'solvent'],
171
160
  visible: false,
172
161
  },
@@ -197,9 +186,7 @@ export const prediction = {
197
186
  visible: true,
198
187
  },
199
188
  {
200
- name: 'name',
201
189
  label: 'Spectrum Name',
202
- description: 'Spectrum Name',
203
190
  jpath: ['info', 'name'],
204
191
  visible: true,
205
192
  },
@@ -210,9 +197,7 @@ export const prediction = {
210
197
  visible: true,
211
198
  },
212
199
  {
213
- name: 'solvent',
214
200
  label: 'Solvent',
215
- description: 'Solvent',
216
201
  jpath: ['info', 'solvent'],
217
202
  visible: false,
218
203
  },
@@ -7,6 +7,7 @@ export const simulation = {
7
7
  verticalSplitterCloseThreshold: 600,
8
8
  spectraRendering: 'auto',
9
9
  loggingLevel: 'info',
10
+ popupLoggingLevel: 'error',
10
11
  invert: false,
11
12
  },
12
13
  display: {
@@ -42,9 +43,7 @@ export const simulation = {
42
43
  visible: true,
43
44
  },
44
45
  {
45
- name: 'name',
46
46
  label: 'Spectrum Name',
47
- description: 'Spectrum Name',
48
47
  jpath: ['info', 'name'],
49
48
  visible: true,
50
49
  },
@@ -57,6 +57,7 @@ export const workspaceDefaultProperties = {
57
57
  verticalSplitterCloseThreshold: 600,
58
58
  spectraRendering: 'auto',
59
59
  loggingLevel: 'info',
60
+ popupLoggingLevel: 'error',
60
61
  invert: false,
61
62
  },
62
63
  formatting: {
@@ -95,15 +96,15 @@ export const workspaceDefaultProperties = {
95
96
  infoBlock: {
96
97
  visible: false,
97
98
  fields: [
98
- { label: 'name', jpath: ['info', 'name'], visible: true, format: '' },
99
+ { label: 'Name', jpath: ['info', 'name'], visible: true, format: '' },
99
100
  {
100
- label: 'Number Of Scan',
101
+ label: 'Number of scans',
101
102
  jpath: ['info', 'numberOfScans'],
102
103
  visible: true,
103
104
  format: '0',
104
105
  },
105
106
  {
106
- label: 'Pulse Sequence',
107
+ label: 'Pulse sequence',
107
108
  jpath: ['info', 'pulseSequence'],
108
109
  visible: true,
109
110
  format: '',
@@ -1,4 +1,3 @@
1
- export { generateSpectrumFromPublicationString } from './generateSpectrumFromPublicationString';
2
1
  export { get1DDataXY } from './get1DDataXY';
3
2
  export { getReferenceShift } from './getReferenceShift';
4
3
  export { initiateDatum1D } from './initiateDatum1D';
@@ -1,4 +1,3 @@
1
- export { generateSpectrumFromPublicationString } from './generateSpectrumFromPublicationString';
2
1
  export { get1DDataXY } from './get1DDataXY';
3
2
  export { getReferenceShift } from './getReferenceShift';
4
3
  export { initiateDatum1D } from './initiateDatum1D';
@@ -18,14 +18,14 @@ export interface ClipboardFallbackProps extends CFBP, Partial<Omit<ClipboardFall
18
18
  *
19
19
  * @param props
20
20
  */
21
- export declare function ClipboardFallback(props: ClipboardFallbackProps): import("react/jsx-runtime").JSX.Element | null;
21
+ export declare function ClipboardFallback(props: ClipboardFallbackProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
22
22
  /**
23
23
  * return null if !props.mode
24
24
  *
25
25
  * @param props
26
26
  * @see ClipboardFallback
27
27
  */
28
- export declare function ClipboardFallbackModal(props: ClipboardFallbackProps): import("react/jsx-runtime").JSX.Element | null;
28
+ export declare function ClipboardFallbackModal(props: ClipboardFallbackProps): import("@emotion/react/jsx-runtime").JSX.Element | null;
29
29
  interface ClipboardFallbackReadProps extends CFBP {
30
30
  onRead: (file: File) => void;
31
31
  mode: 'read';
@@ -1,7 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody } from '@blueprintjs/core';
4
+ import { css } from '@emotion/react';
2
5
  import styled from '@emotion/styled';
3
6
  import { useCallback, useEffect, useMemo, useRef } from 'react';
4
- import { Modal } from 'react-science/ui';
5
7
  import Button from '../../component/elements/Button';
6
8
  const ClipboardForm = styled.form `
7
9
  padding: 0.5rem;
@@ -90,7 +92,10 @@ export function ClipboardFallbackModal(props) {
90
92
  write: `Export data to file`,
91
93
  writeText: `Copy text from text area`,
92
94
  };
93
- return (_jsxs(Modal, { hasCloseButton: true, isOpen: true, onRequestClose: props.onDismiss, children: [_jsx(Modal.Header, { children: _jsx("h2", { children: titles[props.mode] }) }), _jsx(Modal.Body, { children: _jsx(ClipboardFallback, { ...props }) })] }));
95
+ return (_jsx(Dialog, { isOpen: true, onClose: props.onDismiss, title: titles[props.mode], children: _jsx(DialogBody, { css: css `
96
+ padding: 0;
97
+ background-color: white;
98
+ `, children: _jsx(ClipboardFallback, { ...props }) }) }));
94
99
  }
95
100
  function ClipboardFallbackRead(props) {
96
101
  const onFileRef = useRef(props.onRead);
@@ -1 +1 @@
1
- export default { version: 'v0.48.0' };
1
+ export default { version: 'v0.50.0' };
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": "0.48.0",
4
+ "version": "0.50.0",
5
5
  "license": "MIT",
6
6
  "module": "lib/component/main/index.js",
7
7
  "types": "lib/component/main/index.d.ts",
@@ -23,6 +23,7 @@
23
23
  "eslint": "eslint . --cache",
24
24
  "eslint-fix": "npm run eslint -- --fix",
25
25
  "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm start",
26
+ "playwright": "playwright test --ui",
26
27
  "prepack": "npm run clean-lib && npm run compile",
27
28
  "prepublishOnly": "npm run set-version-npm",
28
29
  "prettier": "prettier --check src test-e2e",
@@ -56,8 +57,8 @@
56
57
  "react-dom": ">=18.0.0"
57
58
  },
58
59
  "dependencies": {
59
- "@blueprintjs/core": "^5.8.2",
60
- "@blueprintjs/icons": "^5.7.0",
60
+ "@blueprintjs/core": "^5.9.1",
61
+ "@blueprintjs/icons": "^5.7.1",
61
62
  "@emotion/react": "^11.11.3",
62
63
  "@emotion/styled": "^11.11.0",
63
64
  "@lukeed/uuid": "^2.0.1",
@@ -82,16 +83,17 @@
82
83
  "ml-conrec": "^5.0.2",
83
84
  "ml-gsd": "^12.1.3",
84
85
  "ml-matrix": "^6.11.0",
85
- "ml-spectra-processing": "^12.8.0",
86
+ "ml-spectra-processing": "^12.10.2",
86
87
  "ml-stat": "^1.3.3",
88
+ "ml-tree-similarity": "^2.2.0",
87
89
  "multiplet-analysis": "^2.1.2",
88
90
  "nmr-correlation": "^2.3.3",
89
- "nmr-load-save": "^0.24.0",
90
- "nmr-processing": "^11.7.0",
91
+ "nmr-load-save": "^0.27.2",
92
+ "nmr-processing": "^11.10.1",
91
93
  "nmredata": "^0.9.9",
92
94
  "numeral": "^2.0.6",
93
- "openchemlib": "^8.7.2",
94
- "openchemlib-utils": "^5.6.1",
95
+ "openchemlib": "^8.8.1",
96
+ "openchemlib-utils": "^5.9.0",
95
97
  "papaparse": "^5.4.1",
96
98
  "re-resizable": "6.9.11",
97
99
  "react-d3-utils": "^1.0.0",
@@ -104,7 +106,7 @@
104
106
  "react-ocl-nmr": "^3.0.1",
105
107
  "react-plot": "^1.4.2",
106
108
  "react-rnd": "^10.4.1",
107
- "react-science": "^0.32.2",
109
+ "react-science": "^0.35.0",
108
110
  "react-slider": "^2.0.6",
109
111
  "react-table": "^7.8.0",
110
112
  "react-transition-group": "^4.4.5",
@@ -116,36 +118,36 @@
116
118
  "@babel/plugin-transform-modules-commonjs": "^7.23.3",
117
119
  "@babel/preset-react": "^7.23.3",
118
120
  "@babel/preset-typescript": "^7.23.3",
119
- "@playwright/test": "^1.41.1",
121
+ "@playwright/test": "^1.41.2",
120
122
  "@simbathesailor/use-what-changed": "^2.0.0",
121
123
  "@types/d3": "^7.4.3",
122
124
  "@types/lodash": "^4.14.202",
123
- "@types/node": "^20.11.5",
125
+ "@types/node": "^20.11.19",
124
126
  "@types/papaparse": "^5.3.14",
125
- "@types/react": "^18.2.48",
126
- "@types/react-dom": "^18.2.18",
127
+ "@types/react": "^18.2.57",
128
+ "@types/react-dom": "^18.2.19",
127
129
  "@types/react-table": "^7.7.19",
128
- "@vitejs/plugin-react-swc": "^3.5.0",
129
- "@vitest/coverage-v8": "^1.2.1",
130
+ "@vitejs/plugin-react-swc": "^3.6.0",
131
+ "@vitest/coverage-v8": "^1.3.1",
130
132
  "cross-env": "^7.0.3",
131
- "cspell": "^8.3.2",
133
+ "cspell": "^8.4.1",
132
134
  "eslint": "^8.56.0",
133
135
  "eslint-config-cheminfo-react": "^10.1.0",
134
- "eslint-config-cheminfo-typescript": "^12.1.0",
136
+ "eslint-config-cheminfo-typescript": "^12.2.0",
135
137
  "modern-normalize": "^2.0.0",
136
138
  "postcss-styled-syntax": "^0.6.4",
137
- "prettier": "^3.2.4",
139
+ "prettier": "^3.2.5",
138
140
  "rc-menu": "^9.12.4",
139
141
  "react": "^18.2.0",
140
142
  "react-dom": "^18.2.0",
141
- "react-router-dom": "^6.21.3",
143
+ "react-router-dom": "^6.22.1",
142
144
  "rimraf": "^5.0.5",
143
145
  "rollup-plugin-analyzer": "^4.0.0",
144
146
  "serve": "^14.2.1",
145
- "stylelint": "^16.2.0",
147
+ "stylelint": "^16.2.1",
146
148
  "stylelint-config-standard": "^36.0.0",
147
149
  "typescript": "^5.3.3",
148
- "vite": "^5.0.12",
149
- "vitest": "^1.2.1"
150
+ "vite": "^5.1.3",
151
+ "vitest": "^1.3.1"
150
152
  }
151
- }
153
+ }
@@ -1,8 +0,0 @@
1
- import { Signal1D } from 'nmr-processing';
2
- interface LevelNodeProps {
3
- signal: Signal1D;
4
- startY: number;
5
- levelHeight: number;
6
- }
7
- declare function LevelNode({ signal, startY, levelHeight }: LevelNodeProps): import("react/jsx-runtime").JSX.Element;
8
- export default LevelNode;
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useScaleChecked } from '../../context/ScaleContext';
3
- import { TREE_LEVEL_COLORS } from './TreeColors';
4
- function LevelNode({ signal, startY, levelHeight }) {
5
- const { scaleX } = useScaleChecked();
6
- return (_jsx("line", { x1: scaleX()(signal.delta), y1: startY, x2: scaleX()(signal.delta), y2: startY + levelHeight, stroke: TREE_LEVEL_COLORS[0] }, `startLevelNode_${signal.id}`));
7
- }
8
- export default LevelNode;
@@ -1,11 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- import { Signal1D } from 'nmr-processing';
3
- interface StringNodeProps {
4
- signal: Signal1D;
5
- startY: number;
6
- levelHeight: number;
7
- fontSize: CSSProperties['fontSize'];
8
- showLabels: boolean;
9
- }
10
- declare function StringNode({ signal, startY, levelHeight, fontSize, showLabels, }: StringNodeProps): import("react/jsx-runtime").JSX.Element;
11
- export default StringNode;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useScaleChecked } from '../../context/ScaleContext';
3
- function StringNode({ signal, startY, levelHeight, fontSize, showLabels, }) {
4
- const { scaleX } = useScaleChecked();
5
- return (_jsx("text", { textAnchor: "middle", x: scaleX()(signal.delta), y: startY + levelHeight / 2, fontSize: fontSize, lengthAdjust: "spacing", fill: "black", visibility: showLabels ? 'visible' : 'hidden', children: signal.multiplicity }, `multiplicityString_${signal.id}`));
6
- }
7
- export default StringNode;
@@ -1 +0,0 @@
1
- export declare const TREE_LEVEL_COLORS: string[];
@@ -1 +0,0 @@
1
- export const TREE_LEVEL_COLORS = ['red', 'green', 'blue', 'magenta'];
@@ -1,21 +0,0 @@
1
- import { CSSProperties } from 'react';
2
- interface NodeData {
3
- startX: number;
4
- _startX: number;
5
- ratio: number;
6
- multiplicityIndex: number;
7
- color: string;
8
- }
9
- interface TreeNodesProps {
10
- showLabels: boolean;
11
- startY: number;
12
- signalID: string;
13
- levelHeight: number;
14
- nodesData: NodeData[];
15
- labelOptions: {
16
- distance: number;
17
- fontSize: CSSProperties['fontSize'];
18
- };
19
- }
20
- declare function TreeNodes({ nodesData, levelHeight, startY, signalID, labelOptions, showLabels, }: TreeNodesProps): import("react/jsx-runtime").JSX.Element;
21
- export default TreeNodes;
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- /* eslint-disable react/no-unused-prop-types */
3
- import { useCallback } from 'react';
4
- import { useScaleChecked } from '../../context/ScaleContext';
5
- function TreeNodes({ nodesData, levelHeight, startY, signalID, labelOptions, showLabels, }) {
6
- const { scaleX } = useScaleChecked();
7
- const buildTreeNodeAndEdge = useCallback(({ startX, _startX, ratio, multiplicityIndex, color }) => {
8
- const edgeLevel = 2 * multiplicityIndex + 2;
9
- const _startYEdge = startY + edgeLevel * levelHeight;
10
- const _startYNode = startY + (edgeLevel + 1) * levelHeight;
11
- return (_jsxs("g", { children: [_jsx("text", { textAnchor: "middle", x: scaleX()(_startX) + labelOptions.distance, y: _startYNode + 2 * (levelHeight / 3), fontSize: labelOptions.fontSize, fill: color, visibility: showLabels ? 'visible' : 'hidden', children: ratio }), _jsx("line", { x1: scaleX()(startX), y1: _startYEdge, x2: scaleX()(_startX), y2: _startYNode, stroke: color }), _jsx("line", { x1: scaleX()(_startX), y1: _startYNode, x2: scaleX()(_startX), y2: _startYNode + levelHeight, stroke: color })] }, `${multiplicityIndex}_${signalID}_${startX}_${_startX}_${ratio}`));
12
- }, [
13
- signalID,
14
- labelOptions.distance,
15
- labelOptions.fontSize,
16
- scaleX,
17
- showLabels,
18
- startY,
19
- levelHeight,
20
- ]);
21
- return _jsx(_Fragment, { children: nodesData?.map((node) => buildTreeNodeAndEdge(node)) });
22
- }
23
- export default TreeNodes;
@@ -1,11 +0,0 @@
1
- import { Spectrum1D } from 'nmr-load-save';
2
- import { Signal1D } from 'nmr-processing';
3
- export interface TreeNodeData {
4
- startX: number;
5
- _startX: number;
6
- ratio: number;
7
- multiplicityIndex: number;
8
- color: string;
9
- }
10
- declare function createTreeNodes(signal: Signal1D, spectrumData: Spectrum1D): (multiplicityIndex: number, jIndices: number[], treeNodesData: TreeNodeData[], startX: number) => TreeNodeData[] | null;
11
- export default createTreeNodes;
@@ -1,57 +0,0 @@
1
- import lodashGet from 'lodash/get';
2
- import { getMultiplicityNumber, getPascal, } from '../../panels/extra/utilities/MultiplicityUtilities';
3
- import { TREE_LEVEL_COLORS } from './TreeColors';
4
- function createTreeNodes(signal, spectrumData) {
5
- function buildTreeNodesData(multiplicityIndex, jIndices, treeNodesData, startX) {
6
- if (!signal.multiplicity) {
7
- return null;
8
- }
9
- if (multiplicityIndex >= signal.multiplicity.length) {
10
- return treeNodesData;
11
- }
12
- // re-use colors if needed
13
- const color = TREE_LEVEL_COLORS[multiplicityIndex % TREE_LEVEL_COLORS.length];
14
- const jIndex = jIndices.indexOf(multiplicityIndex);
15
- const frequency = lodashGet(spectrumData, 'info.originFrequency', 0);
16
- const coupling = jIndex >= 0 && frequency > 0 && signal?.js?.[jIndex]
17
- ? signal.js[jIndex].coupling / frequency // convert to ppm
18
- : null;
19
- // in case of "s": no coupling constant and build one tree node only
20
- if (!coupling) {
21
- treeNodesData.push({
22
- startX,
23
- _startX: startX,
24
- ratio: 1,
25
- multiplicityIndex,
26
- color,
27
- });
28
- // go to next multiplet in multiplicity string
29
- buildTreeNodesData(multiplicityIndex + 1, jIndices, treeNodesData, startX);
30
- }
31
- else {
32
- // in case of other multiplets
33
- const multiplicity = signal.multiplicity || '';
34
- const pascal = getPascal(getMultiplicityNumber(multiplicity.charAt(multiplicityIndex)), 0.5); // @TODO for now we use the default spin of 1 / 2 only
35
- let _startX = pascal.length % 2 === 0
36
- ? startX - (pascal.length / 2) * coupling + coupling / 2 // in case of even number of nodes
37
- : startX - (pascal.length / 2 - 0.5) * coupling; // in case of odd number of nodes
38
- for (const [k, ratio] of pascal.entries()) {
39
- if (k > 0) {
40
- _startX += coupling;
41
- }
42
- treeNodesData.push({
43
- startX,
44
- _startX,
45
- ratio,
46
- multiplicityIndex,
47
- color,
48
- });
49
- // go to next multiplet in multiplicity string
50
- buildTreeNodesData(multiplicityIndex + 1, jIndices, treeNodesData, _startX);
51
- }
52
- }
53
- return treeNodesData;
54
- }
55
- return buildTreeNodesData;
56
- }
57
- export default createTreeNodes;
@@ -1,2 +0,0 @@
1
- import { UsedColors } from '../../../types/UsedColors';
2
- export declare function generateSpectrumFromPublicationString(publicationString: string, usedColors: UsedColors): import("nmr-load-save").Spectrum1D | undefined;
@@ -1,6 +0,0 @@
1
- import { resurrect } from 'nmr-processing';
2
- import { generateSpectrumFromRanges } from './ranges/generateSpectrumFromRanges';
3
- export function generateSpectrumFromPublicationString(publicationString, usedColors) {
4
- const { ranges, experiment: { nucleus, solvent }, parts, } = resurrect(publicationString);
5
- return generateSpectrumFromRanges(ranges, { nucleus, solvent, name: parts[0] }, usedColors);
6
- }