nmrium 0.45.0 → 0.46.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 (95) hide show
  1. package/lib/component/1d/tool/PeakPointer.js +6 -16
  2. package/lib/component/1d/utilities/scale.js +13 -8
  3. package/lib/component/1d-2d/components/SpectrumInfoBlock.js +15 -4
  4. package/lib/component/elements/ContextMenuBluePrint.d.ts +16 -0
  5. package/lib/component/elements/ContextMenuBluePrint.js +20 -0
  6. package/lib/component/elements/DropdownMenu.d.ts +9 -0
  7. package/lib/component/elements/DropdownMenu.js +7 -0
  8. package/lib/component/elements/Header.d.ts +1 -1
  9. package/lib/component/elements/Header.js +4 -6
  10. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +2 -2
  11. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +2 -2
  12. package/lib/component/elements/ReactTable/ReactTable.d.ts +5 -5
  13. package/lib/component/elements/Select.js +11 -4
  14. package/lib/component/header/Header.js +3 -4
  15. package/lib/component/hooks/useActiveSpectrumIntegralsViewState.js +3 -1
  16. package/lib/component/hooks/useActiveSpectrumPeaksViewState.js +3 -1
  17. package/lib/component/hooks/useActiveSpectrumRangesViewState.js +3 -1
  18. package/lib/component/hooks/useActiveSpectrumStyleOptions.js +6 -2
  19. package/lib/component/hooks/useActiveSpectrumZonesViewState.js +3 -1
  20. package/lib/component/hooks/useCheckToolsVisibility.d.ts +1 -1
  21. package/lib/component/hooks/useSaveSettings.js +1 -1
  22. package/lib/component/hooks/useSpectrum.js +1 -1
  23. package/lib/component/hooks/useToolsFunctions.js +2 -2
  24. package/lib/component/modal/MoleculeStructureEditorModal.d.ts +0 -8
  25. package/lib/component/modal/MoleculeStructureEditorModal.js +31 -8
  26. package/lib/component/modal/MultipletAnalysisModal.d.ts +1 -2
  27. package/lib/component/modal/PredictSpectraModal.js +3 -2
  28. package/lib/component/modal/aboutUs/AboutUsModal.js +1 -5
  29. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -0
  30. package/lib/component/modal/editRange/forms/validation/EditRangeValidation.js +4 -1
  31. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  32. package/lib/component/modal/setting/GeneralSettings.js +1 -1
  33. package/lib/component/modal/setting/settings-tabs/InfoBlockTabContent.js +1 -1
  34. package/lib/component/modal/setting/settingsValidation.js +3 -1
  35. package/lib/component/panels/MatrixGenerationPanel/FiltersOptions.js +7 -2
  36. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +7 -14
  37. package/lib/component/panels/RangesPanel/RangesHeader.js +1 -1
  38. package/lib/component/panels/RangesPanel/RangesPanel.js +1 -2
  39. package/lib/component/panels/RangesPanel/RangesTable.d.ts +2 -2
  40. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  41. package/lib/component/panels/RangesPanel/RangesTableRow.js +2 -2
  42. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +3 -3
  43. package/lib/component/panels/SpectrumsPanel/SpectraTable.d.ts +1 -2
  44. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +15 -18
  45. package/lib/component/panels/SummaryPanel/utilities/Utilities.d.ts +2 -2
  46. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +2 -2
  47. package/lib/component/panels/ZonesPanel/ZonesTableRow.js +2 -2
  48. package/lib/component/panels/extra/preferences/ColumnsHelper.js +1 -2
  49. package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
  50. package/lib/component/panels/multipleAnalysisPanel/preferences/index.js +6 -2
  51. package/lib/component/reducer/Reducer.d.ts +0 -4
  52. package/lib/component/reducer/actions/FiltersActions.d.ts +2 -1
  53. package/lib/component/reducer/actions/FiltersActions.js +1 -1
  54. package/lib/component/reducer/actions/MoleculeActions.d.ts +4 -1
  55. package/lib/component/reducer/actions/MoleculeActions.js +6 -2
  56. package/lib/component/reducer/actions/PeaksActions.js +4 -3
  57. package/lib/component/reducer/actions/SpectrumsActions.js +1 -0
  58. package/lib/component/reducer/actions/ToolsActions.js +8 -6
  59. package/lib/component/reducer/actions/utilities/deepReplaceDiaIDs.d.ts +3 -0
  60. package/lib/component/reducer/actions/utilities/deepReplaceDiaIDs.js +24 -0
  61. package/lib/component/reducer/helper/Zoom1DManager.js +1 -1
  62. package/lib/component/reducer/helper/getActiveSpectra.js +2 -1
  63. package/lib/component/reducer/helper/getActiveSpectrum.js +1 -1
  64. package/lib/component/reducer/preferences/panelsPreferencesDefaultValues.js +1 -1
  65. package/lib/component/toolbar/BasicToolBar.js +53 -34
  66. package/lib/component/toolbar/FunctionToolBar.js +102 -9
  67. package/lib/component/toolbar/ToolBar.js +1 -1
  68. package/lib/component/utility/getClosePeak.d.ts +10 -0
  69. package/lib/component/utility/getClosePeak.js +15 -0
  70. package/lib/component/utility/maxAbsoluteValue.d.ts +3 -0
  71. package/lib/component/utility/maxAbsoluteValue.js +21 -0
  72. package/lib/data/data1d/Spectrum1D/index.d.ts +0 -1
  73. package/lib/data/data1d/Spectrum1D/index.js +0 -1
  74. package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -2
  75. package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -1
  76. package/lib/data/data1d/Spectrum1D/ranges/addRange.js +1 -1
  77. package/lib/data/data1d/Spectrum1D/ranges/detectRange.js +1 -1
  78. package/lib/data/data2d/Spectrum2D/contours.js +2 -2
  79. package/lib/data/data2d/Spectrum2D/getMissingProjection.js +2 -2
  80. package/lib/data/data2d/Spectrum2D/getSlice.js +3 -3
  81. package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +1 -1
  82. package/lib/data/parseMeta/mapErrors.js +3 -1
  83. package/lib/data/utilities/generateNumbersPowerOfX.js +1 -1
  84. package/lib/versionInfo.js +1 -1
  85. package/package.json +39 -38
  86. package/lib/component/elements/ToolbarMenu.d.ts +0 -18
  87. package/lib/component/elements/ToolbarMenu.js +0 -102
  88. package/lib/component/elements/toggle/ToggleButton.d.ts +0 -13
  89. package/lib/component/elements/toggle/ToggleButton.js +0 -24
  90. package/lib/component/elements/toggle/ToggleButtonGroup.d.ts +0 -8
  91. package/lib/component/elements/toggle/ToggleButtonGroup.js +0 -48
  92. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.d.ts +0 -17
  93. package/lib/data/data1d/Spectrum1D/peaks/lookupPeak.js +0 -18
  94. package/lib/data/data2d/Processing2D.d.ts +0 -32
  95. package/lib/data/data2d/Processing2D.js +0 -130
@@ -1,6 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import max from 'ml-array-max';
3
- import { get1DDataXY } from '../../../data/data1d/Spectrum1D/get1DDataXY';
4
2
  import { useBrushTracker } from '../../EventsTrackers/BrushTracker';
5
3
  import { useMouseTracker } from '../../EventsTrackers/MouseTracker';
6
4
  import { useChartData } from '../../context/ChartContext';
@@ -8,6 +6,7 @@ import { useScaleChecked } from '../../context/ScaleContext';
8
6
  import { useActiveSpectrum } from '../../hooks/useActiveSpectrum';
9
7
  import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus';
10
8
  import { options } from '../../toolbar/ToolTypes';
9
+ import { getClosePeak } from '../../utility/getClosePeak';
11
10
  const styles = {
12
11
  radius: 10,
13
12
  borderColor: '#1f1f1f',
@@ -16,18 +15,6 @@ const styles = {
16
15
  SVGPadding: 1,
17
16
  };
18
17
  const LookWidth = 10;
19
- function getClosePeak(spectrum, range) {
20
- const datum = get1DDataXY(spectrum);
21
- const maxIndex = datum.x.findIndex((number) => number >= range[1]) - 1;
22
- const minIndex = datum.x.findIndex((number) => number >= range[0]);
23
- const yDataRange = datum.y.slice(minIndex, maxIndex);
24
- if (!yDataRange || yDataRange.length === 0)
25
- return null;
26
- const y = max(yDataRange);
27
- const xIndex = minIndex + yDataRange.indexOf(y);
28
- const x = datum.x[xIndex];
29
- return { x, y };
30
- }
31
18
  function PeakPointer() {
32
19
  const { height, width, margin, toolOptions: { selectedTool }, } = useChartData();
33
20
  const { scaleX, scaleY, shiftY } = useScaleChecked();
@@ -48,13 +35,16 @@ function PeakPointer() {
48
35
  const spectrumIndex = spectra.findIndex((d) => d.id === activeSpectrum.id);
49
36
  if (spectrumIndex === -1)
50
37
  return null;
51
- const range = [
38
+ const [from, to] = [
52
39
  scaleX().invert(position.x - LookWidth),
53
40
  scaleX().invert(position.x + LookWidth),
54
41
  ].sort((a, b) => {
55
42
  return a - b;
56
43
  });
57
- const closePeak = getClosePeak(spectra[spectrumIndex], range);
44
+ const closePeak = getClosePeak(spectra[spectrumIndex], {
45
+ from,
46
+ to,
47
+ });
58
48
  if (!closePeak)
59
49
  return null;
60
50
  const x = scaleX()(closePeak.x);
@@ -11,17 +11,22 @@ function getXScale(options, spectrumId = null) {
11
11
  }
12
12
  function getYScale(options, spectrumId = null) {
13
13
  const { height, margin, verticalAlign, yDomain, yDomains } = options;
14
- const _height = verticalAlign === 'center'
15
- ? (height - 40) / 2
16
- : height - margin.bottom - 40;
17
- let domainY = [];
18
- if (spectrumId === null || yDomains[spectrumId] === undefined) {
19
- domainY = [0, yDomain[1]];
14
+ let domainY = yDomain;
15
+ if (spectrumId && yDomains?.[spectrumId]) {
16
+ domainY = yDomains[spectrumId];
17
+ }
18
+ const [min, max] = domainY;
19
+ let bottomShift = 40;
20
+ if (verticalAlign === 'center') {
21
+ bottomShift = 0;
22
+ const maxim = Math.max(Math.abs(max), Math.abs(min));
23
+ domainY = [-maxim, maxim];
20
24
  }
21
25
  else {
22
- domainY = [0, yDomains[spectrumId][1]];
26
+ domainY = [0, domainY[1]];
23
27
  }
24
- return scaleLinear(domainY, [_height, margin.top]);
28
+ const innerHeight = height - margin.bottom - bottomShift;
29
+ return scaleLinear(domainY, [innerHeight, margin.top]);
25
30
  }
26
31
  function getIntegralYScale(options) {
27
32
  const { height, margin, yDomain, scaleRatio } = options;
@@ -20,6 +20,20 @@ const styles = {
20
20
  height: '2px',
21
21
  },
22
22
  };
23
+ function getInfoValue(spectrum, field) {
24
+ const { jpath, format } = field;
25
+ const value = lodashGet(spectrum, jpath, '');
26
+ switch (typeof value) {
27
+ case 'number':
28
+ return formatNumber(value, format);
29
+ case 'string':
30
+ return value;
31
+ case 'boolean':
32
+ return value ? 'Yes' : 'No';
33
+ default:
34
+ return JSON.stringify(value);
35
+ }
36
+ }
23
37
  function SpectrumInfoBlock() {
24
38
  const { margin } = useChartData();
25
39
  const spectrum = useSpectrum();
@@ -29,10 +43,7 @@ function SpectrumInfoBlock() {
29
43
  return (_jsx("g", { className: "spectra-info-block", transform: `translate(${margin.left + 5} ${margin.top})`, children: fields
30
44
  .filter((field) => field.visible)
31
45
  .map((field, index) => {
32
- const value = lodashGet(spectrum, field.jpath, '');
33
- return (_jsxs(SVGGroup, { transform: `translate(0,${20 * (index + 1)})`, space: 5, children: [_jsxs("text", { alignmentBaseline: "middle", style: styles.label, children: [field.label, " :"] }), _jsx("text", { alignmentBaseline: "middle", style: styles.value, children: field?.format && typeof value === 'number'
34
- ? formatNumber(value, field.format)
35
- : value })] }, field.jpath + field.label));
46
+ return (_jsxs(SVGGroup, { transform: `translate(0,${20 * (index + 1)})`, space: 5, children: [_jsxs("text", { alignmentBaseline: "middle", style: styles.label, children: [field.label, " :"] }), _jsx("text", { alignmentBaseline: "middle", style: styles.value, children: getInfoValue(spectrum, field) })] }, field.jpath + field.label));
36
47
  }) }));
37
48
  }
38
49
  export default SpectrumInfoBlock;
@@ -0,0 +1,16 @@
1
+ import { ContextMenuProps as BluePrintContextMenuProps, MenuItemProps } from '@blueprintjs/core';
2
+ import { ComponentProps, ElementType, ReactNode } from 'react';
3
+ export interface ContextMenuItem extends MenuItemProps {
4
+ data?: object;
5
+ }
6
+ type ElementProps<E = 'div'> = E extends ElementType ? ComponentProps<E> : never;
7
+ export interface BaseContextMenuProps {
8
+ options: ContextMenuItem[];
9
+ onSelect: (data?: object) => void;
10
+ }
11
+ export interface ContextMenuProps<E> extends BaseContextMenuProps, Omit<BluePrintContextMenuProps, 'onSelect' | 'content' | 'children'> {
12
+ as?: E;
13
+ children: ReactNode;
14
+ }
15
+ export declare function ContextMenu<E extends ElementType = 'div'>(props: ContextMenuProps<E> & ElementProps<E>): import("react/jsx-runtime").JSX.Element;
16
+ export {};
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Menu, MenuItem, showContextMenu, } from '@blueprintjs/core';
3
+ export function ContextMenu(props) {
4
+ const { options, onSelect, children, as: Wrapper = 'div', ...other } = props;
5
+ function handleContextMenu(event) {
6
+ if (!Array.isArray(options) || options.length === 0) {
7
+ return;
8
+ }
9
+ const content = (_jsx(Menu, { children: options.map((option) => (_jsx(MenuItem, { ...option, onClick: () => onSelect(option?.data) }, JSON.stringify(option)))) }));
10
+ event.preventDefault();
11
+ showContextMenu({
12
+ content,
13
+ targetOffset: {
14
+ left: event.clientX,
15
+ top: event.clientY,
16
+ },
17
+ });
18
+ }
19
+ return (_jsx(Wrapper, { ...other, onContextMenu: handleContextMenu, children: children }));
20
+ }
@@ -0,0 +1,9 @@
1
+ import { MenuItemProps, PopoverProps } from '@blueprintjs/core';
2
+ export interface DropdownMenuItem extends MenuItemProps {
3
+ data?: object;
4
+ }
5
+ export interface DropdownMenuProps extends Omit<PopoverProps, 'onSelect' | 'content'> {
6
+ options: DropdownMenuItem[];
7
+ onSelect: (data?: object) => void;
8
+ }
9
+ export declare function DropdownMenu(props: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Menu, MenuItem, Popover, } from '@blueprintjs/core';
3
+ export function DropdownMenu(props) {
4
+ const { options, onSelect, children, ...other } = props;
5
+ const content = (_jsx(Menu, { children: options.map((option) => (_jsx(MenuItem, { ...option, onClick: () => onSelect(option?.data) }, JSON.stringify(option)))) }));
6
+ return (_jsx(Popover, { ...other, content: content, children: children }));
7
+ }
@@ -7,5 +7,5 @@ interface HeaderProps {
7
7
  containerStyle?: CSSProperties;
8
8
  };
9
9
  }
10
- export declare function Header(props: HeaderProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
+ export declare function Header(props: HeaderProps): import("react/jsx-runtime").JSX.Element;
11
11
  export {};
@@ -1,17 +1,15 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import { css } from '@emotion/react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
2
  const styles = {
5
- header: css({
3
+ header: {
6
4
  width: '100%',
7
5
  display: 'flex',
8
6
  flexDirection: 'row',
9
7
  justifyContent: 'space-between',
10
8
  borderBottom: '1px solid rgb(247, 247, 247);',
11
9
  boxShadow: 'rgb(255, 255, 255) 0px 1px 0px 0px inset',
12
- }),
10
+ },
13
11
  };
14
12
  export function Header(props) {
15
13
  const { children, style: { leftStyle = {}, rightStyle = {}, containerStyle = {} } = {}, } = props;
16
- return (_jsxs("div", { css: css({ ...styles.header, ...containerStyle }), children: [_jsx("div", { style: leftStyle, children: children[0] }), _jsx("div", { style: rightStyle, children: children[1] })] }));
14
+ return (_jsxs("div", { style: { ...styles.header, ...containerStyle }, children: [_jsx("div", { style: leftStyle, children: children[0] }), _jsx("div", { style: rightStyle, children: children[1] })] }));
17
15
  }
@@ -1,10 +1,10 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  import { HighlightEventSource } from '../../../highlight/index';
3
- import { BaseRowStyle, ContextMenuProps } from '../ReactTable';
3
+ import { BaseRowStyle, TableContextMenuProps } from '../ReactTable';
4
4
  export interface ClickEvent {
5
5
  onClick?: (event: Event, data: unknown) => void;
6
6
  }
7
- interface ReactTableRowProps extends ClickEvent, ContextMenuProps {
7
+ interface ReactTableRowProps extends ClickEvent, TableContextMenuProps {
8
8
  row: any;
9
9
  highlightedSource?: HighlightEventSource;
10
10
  isRowActive: boolean;
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import { useMemo, useEffect, useCallback } from 'react';
5
- import { DropdownMenu } from 'react-science/ui';
6
5
  import { HighlightEventSource, useHighlight } from '../../../highlight/index';
6
+ import { ContextMenu } from '../../ContextMenuBluePrint';
7
7
  function getRowStyle(isActive, rowStyle = {}, disableDefaultRowStyle) {
8
8
  const { hover = {}, active = {}, base = {}, activated = {} } = rowStyle;
9
9
  const hoverStyle = disableDefaultRowStyle
@@ -51,7 +51,7 @@ function ReactTableRow(props) {
51
51
  const clickHandler = useCallback((event) => {
52
52
  onClick?.(event, row);
53
53
  }, [onClick, row]);
54
- return (_jsx(DropdownMenu, { trigger: "contextMenu", options: contextMenu, onSelect: (selected) => onContextMenuSelect?.(selected, row.original), as: "tr", css: getRowStyle(highlight.isActive || isRowActive, rowStyle, disableDefaultRowStyle), ...row.getRowProps(), ...highlight.onHover, children: row.cells.map((cell) => {
54
+ return (_jsx(ContextMenu, { options: contextMenu, onSelect: (selected) => onContextMenuSelect?.(selected, row.original), as: "tr", style: { position: 'static' }, css: getRowStyle(highlight.isActive || isRowActive, rowStyle, disableDefaultRowStyle), ...row.getRowProps(), ...highlight.onHover, children: row.cells.map((cell) => {
55
55
  const { style, padding } = cell.column;
56
56
  if (cell.isRowSpanned) {
57
57
  return null;
@@ -1,9 +1,9 @@
1
1
  /** @jsxImportSource @emotion/react */
2
2
  import { CSSObject, SerializedStyles } from '@emotion/react';
3
3
  import { CSSProperties } from 'react';
4
- import { DropdownMenuProps } from 'react-science/ui';
5
4
  import { CellProps, Column as ReactColumn, UseSortByColumnOptions } from 'react-table';
6
5
  import { HighlightEventSource } from '../../highlight';
6
+ import { BaseContextMenuProps } from '../ContextMenuBluePrint';
7
7
  import { ClickEvent } from './Elements/ReactTableRow';
8
8
  interface ExtraColumn<T extends object> {
9
9
  enableRowSpan?: boolean;
@@ -20,11 +20,11 @@ export interface BaseRowStyle {
20
20
  hover?: CSSProperties;
21
21
  base?: CSSProperties;
22
22
  }
23
- export interface ContextMenuProps {
24
- onContextMenuSelect?: (selected: Parameters<DropdownMenuProps<any, any>['onSelect']>[0], data: any) => void;
25
- contextMenu?: DropdownMenuProps<any, any>['options'];
23
+ export interface TableContextMenuProps {
24
+ onContextMenuSelect?: (selected: Parameters<BaseContextMenuProps['onSelect']>[0], data: any) => void;
25
+ contextMenu?: BaseContextMenuProps['options'];
26
26
  }
27
- interface ReactTableProps extends ContextMenuProps, ClickEvent, SortEvent {
27
+ interface ReactTableProps extends TableContextMenuProps, ClickEvent, SortEvent {
28
28
  data: any;
29
29
  columns: any;
30
30
  highlightedSource?: HighlightEventSource;
@@ -39,12 +39,19 @@ const Select = forwardRef(function Select(props, ref) {
39
39
  onChange(returnValue ? selectedData[itemValueField] : selectedData);
40
40
  }, [itemValueField, onChange, returnValue]);
41
41
  return (_jsxs("select", { ref: ref, css: styles.select(style?.width), name: name, onChange: handleOnChanged, defaultValue: defaultValue, value: value, className: className, style: style, required: true, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), items.map((option) => {
42
- if (typeof option[itemValueField] !== 'string' ||
43
- typeof option[itemTextField] !== 'string') {
44
- // TODO: throw error
42
+ const value = option[itemValueField];
43
+ if (!['number', 'string'].includes(typeof option[itemTextField])) {
44
+ // eslint-disable-next-line no-console
45
+ console.log(`The '${itemTextField}' field should be a string , option : ${JSON.stringify(option)}`);
45
46
  return null;
46
47
  }
47
- return (_jsx("option", { value: option[itemValueField], "data-value": JSON.stringify(option), children: textRender?.(option[itemTextField]) || option[itemTextField] }, JSON.stringify(option)));
48
+ if (!['number', 'string'].includes(typeof value)) {
49
+ // eslint-disable-next-line no-console
50
+ console.log(`The '${itemValueField}' field should be either a string or a number, option : ${JSON.stringify(option)}`);
51
+ return null;
52
+ }
53
+ const label = String(option[itemTextField]);
54
+ return (_jsx("option", { value: value, "data-value": JSON.stringify(option), children: textRender?.(label) || label }, JSON.stringify(option)));
48
55
  })] }));
49
56
  });
50
57
  export default Select;
@@ -87,7 +87,6 @@ function HeaderInner(props) {
87
87
  return _jsx(Zones2DOptionPanel, {});
88
88
  default:
89
89
  return null;
90
- break;
91
90
  }
92
91
  }, [selectedOptionPanel]);
93
92
  const changeWorkspaceHandler = useCallback((option) => {
@@ -101,11 +100,11 @@ function HeaderInner(props) {
101
100
  function renderItem(item) {
102
101
  return _jsx(WorkspaceItem, { item: item });
103
102
  }
104
- return (_jsx("div", { css: styles, children: _jsxs(Header, { style: { leftStyle: { flex: 1 } }, children: [_jsxs(HeaderContainer, { style: {
103
+ return (_jsx("div", { css: styles, children: _jsxs(Header, { style: { leftStyle: { flex: 1 }, containerStyle: { padding: '2px' } }, children: [_jsxs(HeaderContainer, { style: {
105
104
  alignItems: 'center',
106
- }, children: [_jsx("div", { children: _jsx(Toolbar, { orientation: "horizontal", children: _jsx(AboutUsModal, {}) }) }), _jsx("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), _jsxs(HeaderContainer, { style: {
105
+ }, children: [_jsx("div", { children: _jsx(Toolbar, { children: _jsx(AboutUsModal, {}) }) }), _jsx("div", { className: "toolOptionsPanel", style: { flex: 1 }, children: selectedPanel })] }), _jsxs(HeaderContainer, { style: {
107
106
  alignItems: 'center',
108
- }, children: [!hideWorkspaces && (_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })), !hideGeneralSettings && _jsx(SaveButton, {}), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { orientation: "horizontal", children: [!general?.hideHelp && (_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), children: _jsx(FaQuestionCircle, {}) })), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreenEnabled && !general?.hideMaximize && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onEnableFullscreen, title: "Full Screen", className: "windowButton", children: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
107
+ }, children: [!hideWorkspaces && (_jsx(DropDownButton, { data: workspacesList, selectedKey: workspace.current, onSelect: changeWorkspaceHandler, renderItem: renderItem })), !hideGeneralSettings && _jsx(SaveButton, {}), !general?.hideLogs && _jsx(LogsHistoryModal, {}), _jsx("div", { children: _jsxs(Toolbar, { children: [!general?.hideHelp && (_jsx(Toolbar.Item, { id: "user-manual", title: "User manual", onClick: () => window.open(docsBaseUrl, '_blank'), icon: _jsx(FaQuestionCircle, {}) })), !hideGeneralSettings && (_jsx(GeneralSettingsModal, { height: height / 2 })), !isFullscreenEnabled && !general?.hideMaximize && (_jsx(Toolbar.Item, { id: "full-screen", onClick: onEnableFullscreen, title: "Full Screen", className: "windowButton", icon: _jsx(FaRegWindowMaximize, {}) }))] }) })] })] }) }));
109
108
  }
110
109
  function SaveButton() {
111
110
  const { workspace, workspaces, originalWorkspaces } = usePreferences();
@@ -6,7 +6,9 @@ export const defaultIntegralsViewState = {
6
6
  export function useActiveSpectrumIntegralsViewState() {
7
7
  const activeSpectrum = useActiveSpectrum();
8
8
  const { view: { integrals }, } = useChartData();
9
- if (activeSpectrum?.id && integrals[activeSpectrum?.id]) {
9
+ if (activeSpectrum?.id &&
10
+ activeSpectrum?.selected &&
11
+ integrals[activeSpectrum?.id]) {
10
12
  return integrals[activeSpectrum?.id];
11
13
  }
12
14
  else {
@@ -9,7 +9,9 @@ export const defaultPeaksViewState = {
9
9
  export function useActiveSpectrumPeaksViewState() {
10
10
  const activeSpectrum = useActiveSpectrum();
11
11
  const { view: { peaks }, } = useChartData();
12
- if (activeSpectrum?.id && peaks[activeSpectrum?.id]) {
12
+ if (activeSpectrum?.id &&
13
+ activeSpectrum?.selected &&
14
+ peaks[activeSpectrum?.id]) {
13
15
  return peaks[activeSpectrum?.id];
14
16
  }
15
17
  else {
@@ -11,7 +11,9 @@ export const defaultRangesViewState = {
11
11
  export function useActiveSpectrumRangesViewState() {
12
12
  const activeSpectrum = useActiveSpectrum();
13
13
  const { view: { ranges }, } = useChartData();
14
- if (activeSpectrum?.id && ranges[activeSpectrum?.id]) {
14
+ if (activeSpectrum?.id &&
15
+ activeSpectrum?.selected &&
16
+ ranges[activeSpectrum?.id]) {
15
17
  return ranges[activeSpectrum?.id];
16
18
  }
17
19
  else {
@@ -6,8 +6,12 @@ export default function useActiveSpectrumStyleOptions(id) {
6
6
  const activeSpectra = useActiveSpectra();
7
7
  const preferences = usePreferences();
8
8
  return useMemo(() => {
9
- const index = activeSpectra?.findIndex((activeSpectrum) => activeSpectrum.id === id);
10
- const isActive = !!(activeSpectra?.length === 0 || index !== -1);
9
+ const index = activeSpectra?.findIndex((activeSpectrum) => activeSpectrum?.selected && activeSpectrum.id === id);
10
+ let isNoneSelected = false;
11
+ isNoneSelected =
12
+ activeSpectra?.every((activeSpectrum) => !activeSpectrum?.selected) ||
13
+ false;
14
+ const isActive = !!(activeSpectra?.length === 0 || index !== -1) || isNoneSelected;
11
15
  const opacity = isActive
12
16
  ? 1
13
17
  : get(preferences.current, 'general.dimmedSpectraOpacity', 0.1);
@@ -8,7 +8,9 @@ export const defaultZonesViewState = {
8
8
  export function useActiveSpectrumZonesViewState() {
9
9
  const activeSpectrum = useActiveSpectrum();
10
10
  const { view: { zones }, } = useChartData();
11
- if (activeSpectrum?.id && zones[activeSpectrum?.id]) {
11
+ if (activeSpectrum?.id &&
12
+ activeSpectrum?.selected &&
13
+ zones[activeSpectrum?.id]) {
12
14
  return zones[activeSpectrum?.id];
13
15
  }
14
16
  else {
@@ -1,7 +1,7 @@
1
1
  import { NMRiumToolBarPreferences } from 'nmr-load-save';
2
2
  import { Info1D, Info2D } from 'nmr-processing';
3
3
  type SpectrumInfo = Info1D | Info2D;
4
- interface CheckOptions {
4
+ export interface CheckOptions {
5
5
  checkSpectrumType?: boolean;
6
6
  checkMode?: boolean;
7
7
  extraInfoCheckParameters?: SpectrumInfo;
@@ -13,7 +13,7 @@ const schema = Yup.object().shape({
13
13
  const WorkspaceAddForm = forwardRef(({ className, message, onSave }, ref) => {
14
14
  return (_jsxs("div", { className: className, children: [_jsx("p", { style: { paddingBottom: '10px' }, children: message }), _jsx(Formik, { initialValues: { workspaceName: '' }, validationSchema: schema, onSubmit: onSave, innerRef: ref, children: _jsx(FormikInput, { name: "workspaceName", placeholder: "Enter workspace Name", style: {
15
15
  input: {
16
- height: '35px',
16
+ padding: '0.5em',
17
17
  width: '90%',
18
18
  fontWeight: 'normal',
19
19
  color: 'black',
@@ -5,7 +5,7 @@ export default function useSpectrum(defaultValue = null) {
5
5
  const { data } = useChartData();
6
6
  const activeSpectrum = useActiveSpectrum();
7
7
  return useMemo(() => {
8
- if (data && activeSpectrum?.id) {
8
+ if (data && activeSpectrum?.id && activeSpectrum?.selected) {
9
9
  const datum = data.find((datum) => datum.id === activeSpectrum.id) || defaultValue;
10
10
  return datum;
11
11
  }
@@ -34,7 +34,7 @@ export default function useToolsFunctions() {
34
34
  if (debounceClickEventsRef.current.clicks.length === 0) {
35
35
  dispatch({
36
36
  type: 'FULL_ZOOM_OUT',
37
- payload: { zoomType: 'FULL' },
37
+ payload: { zoomType: 'HORIZONTAL' },
38
38
  });
39
39
  }
40
40
  const callback = lodashDebounce(() => {
@@ -47,7 +47,7 @@ export default function useToolsFunctions() {
47
47
  debounceClickEventsRef.current.clicks = [];
48
48
  dispatch({
49
49
  type: 'FULL_ZOOM_OUT',
50
- payload: {},
50
+ payload: { zoomType: 'FULL' },
51
51
  });
52
52
  }
53
53
  }, [dispatch, debounceClickEventsRef]);
@@ -1,13 +1,5 @@
1
1
  import { StateMoleculeExtended } from '../../data/molecules/Molecule';
2
- interface MoleculeStructureEditorModalProps {
3
- onClose?: (element?: string) => void;
4
- selectedMolecule?: StateMoleculeExtended;
5
- floatMoleculeOnSave?: boolean;
6
- isOpen?: boolean;
7
- }
8
- declare function MoleculeStructureEditorModal(props: MoleculeStructureEditorModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
9
2
  export declare function useMoleculeEditor(floatMoleculeOnSave?: boolean): {
10
3
  modal: import("@emotion/react/jsx-runtime").JSX.Element;
11
4
  openMoleculeEditor: (molecule?: StateMoleculeExtended) => void;
12
5
  };
13
- export default MoleculeStructureEditorModal;
@@ -1,21 +1,35 @@
1
1
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
- import { useState, useEffect, useCallback } from 'react';
3
+ import { Molecule } from 'openchemlib/full';
4
+ import { TopicMolecule } from 'openchemlib-utils';
5
+ import { useState, useEffect, useCallback, useMemo } from 'react';
4
6
  import { StructureEditor } from 'react-ocl/full';
5
7
  import { ConfirmModal, Modal, useOnOff } from 'react-science/ui';
6
8
  import { useDispatch } from '../context/DispatchContext';
7
9
  function MoleculeStructureEditorModal(props) {
8
10
  const { onClose = () => null, selectedMolecule, floatMoleculeOnSave = false, isOpen = false, } = props;
11
+ const initialMolfile = selectedMolecule?.molfile;
12
+ const initialEnhancedMolfile = useMemo(() => {
13
+ if (!initialMolfile) {
14
+ return null;
15
+ }
16
+ // Add mapNo to molfile, so we can remap diaIDs after edition.
17
+ const molecule = Molecule.fromMolfile(initialMolfile);
18
+ const topicMolecule = new TopicMolecule(molecule);
19
+ topicMolecule.ensureMapNo();
20
+ const newMolfile = topicMolecule.toMolfile({ version: 3 });
21
+ return { molfile: newMolfile, topicMolecule };
22
+ }, [initialMolfile]);
9
23
  const [molfile, setMolfile] = useState(null);
10
24
  const dispatch = useDispatch();
11
25
  useEffect(() => {
12
- if (selectedMolecule) {
13
- setMolfile(selectedMolecule.molfile);
26
+ if (initialEnhancedMolfile) {
27
+ setMolfile(initialEnhancedMolfile.molfile);
14
28
  }
15
29
  else {
16
30
  setMolfile(null);
17
31
  }
18
- }, [selectedMolecule]);
32
+ }, [initialEnhancedMolfile]);
19
33
  const cb = useCallback((newMolfile, molecule) => {
20
34
  if (molecule.getAllAtoms() === 0) {
21
35
  setMolfile(null);
@@ -29,14 +43,17 @@ function MoleculeStructureEditorModal(props) {
29
43
  }, [onClose]);
30
44
  const handleSave = useCallback(() => {
31
45
  if (molfile) {
32
- if (selectedMolecule) {
46
+ if (selectedMolecule && initialEnhancedMolfile) {
33
47
  const { id, label } = selectedMolecule;
48
+ const editedMolecule = Molecule.fromMolfile(molfile);
49
+ const mappings = initialEnhancedMolfile.topicMolecule.getDiaIDsMapping(editedMolecule);
34
50
  dispatch({
35
51
  type: 'SET_MOLECULE',
36
52
  payload: {
37
53
  molfile,
38
54
  id,
39
55
  label,
56
+ mappings,
40
57
  },
41
58
  });
42
59
  onClose('replace');
@@ -52,8 +69,15 @@ function MoleculeStructureEditorModal(props) {
52
69
  onClose('new');
53
70
  }
54
71
  }
55
- }, [molfile, selectedMolecule, dispatch, floatMoleculeOnSave, onClose]);
56
- return (_jsx(ConfirmModal, { headerColor: "transparent", isOpen: isOpen, onRequestClose: handleClose, onCancel: handleClose, onConfirm: handleSave, maxWidth: 700, children: _jsx(Modal.Body, { children: _jsx(StructureEditor, { initialMolfile: selectedMolecule?.molfile, svgMenu: true, fragment: false, onChange: cb }) }) }));
72
+ }, [
73
+ molfile,
74
+ selectedMolecule,
75
+ initialEnhancedMolfile,
76
+ dispatch,
77
+ floatMoleculeOnSave,
78
+ onClose,
79
+ ]);
80
+ return (_jsx(ConfirmModal, { headerColor: "transparent", isOpen: isOpen, onRequestClose: handleClose, onCancel: handleClose, onConfirm: handleSave, maxWidth: 700, children: _jsx(Modal.Body, { children: _jsx(StructureEditor, { initialMolfile: initialEnhancedMolfile?.molfile, svgMenu: true, fragment: false, onChange: cb }) }) }));
57
81
  }
58
82
  export function useMoleculeEditor(floatMoleculeOnSave = false) {
59
83
  const [isOpen, openModal, closeModal] = useOnOff(false);
@@ -65,4 +89,3 @@ export function useMoleculeEditor(floatMoleculeOnSave = false) {
65
89
  }, [openModal]);
66
90
  return { modal, openMoleculeEditor };
67
91
  }
68
- export default MoleculeStructureEditorModal;
@@ -1,5 +1,4 @@
1
- import { Spectrum } from 'nmr-load-save';
2
- import { ActiveSpectrum } from '../reducer/Reducer';
1
+ import { ActiveSpectrum, Spectrum } from 'nmr-load-save';
3
2
  interface InnerMultipleAnalysisProps {
4
3
  data: Spectrum[];
5
4
  activeSpectrum: ActiveSpectrum | null;
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Checkbox } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { SvgNmrFt } from 'cheminfo-font';
5
6
  import { useCallback, useRef, useState, useMemo } from 'react';
6
- import { Checkbox, Modal, useOnOff } from 'react-science/ui';
7
+ import { Modal, useOnOff } from 'react-science/ui';
7
8
  import { getDefaultPredictionOptions, predictSpectra, } from '../../data/PredictionManager';
8
9
  import { useChartData } from '../context/ChartContext';
9
10
  import { useDispatch } from '../context/DispatchContext';
@@ -106,6 +107,6 @@ export function PredictSpectraModal({ onClose = () => null, molecule, }) {
106
107
  return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { color: { base: '#4e4e4e', hover: '#4e4e4e' }, onClick: openDialog, toolTip: "Predict spectra", tooltipOrientation: "horizontal", children: _jsx(SvgNmrFt, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
107
108
  onClose();
108
109
  closeDialog();
109
- }, width: 600, maxWidth: 1000, children: _jsxs("div", { css: [ModalStyles, styles], children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header handle", children: _jsx("span", { children: "Prediction of NMR spectrum" }) }) }), _jsxs("div", { className: "inner-content", children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsx("div", { className: "warning-container", children: _jsx(Checkbox, { onChange: setApproved, checked: isApproved, label: "I confirm that the chemical structure is not confidential." }, String(isApproved)) })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }) })] }));
110
+ }, width: 600, maxWidth: 1000, children: _jsxs("div", { css: [ModalStyles, styles], children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header handle", children: _jsx("span", { children: "Prediction of NMR spectrum" }) }) }), _jsxs("div", { className: "inner-content", children: [_jsx(PredictionPreferences, { onSubmit: submitHandler, options: initValues, ref: refForm }), _jsx("p", { className: "warning", children: "In order to predict spectra we are calling an external service and the chemical structure will leave your browser! You should never predict spectra for confidential molecules." }), _jsx("div", { className: "warning-container", children: _jsx(Checkbox, { onChange: (value) => setApproved(value.target.checked), checked: isApproved, label: "I confirm that the chemical structure is not confidential." }) })] }), _jsx("div", { className: "footer-container", children: _jsx(Button.Done, { onClick: handleSave, disabled: !isApproved, children: "Predict spectrum" }) })] }) })] }));
110
111
  }
111
112
  export default PredictSpectraModal;
@@ -89,11 +89,7 @@ const styles = css `
89
89
  `;
90
90
  function AboutUsModal() {
91
91
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
92
- return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, titleOrientation: "horizontal", id: "logo", title: "About NMRium", children: _jsx("div", { style: {
93
- display: 'flex',
94
- alignItems: 'center',
95
- justifyContent: 'center',
96
- }, children: _jsx(SvgLogoNmrium, {}) }) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About NMRium" }) }) }), _jsxs("div", { className: "container", children: [_jsxs("div", { className: "center-container", children: [_jsx(Logo, { width: 160, height: 50 }), "Version ", _jsx(VersionInfo, {}), _jsx("span", { className: "separator" }), _jsx("a", { href: "https://git.nmrium.org", target: "_blank", rel: "noreferrer", children: "GitHub ( https://git.nmrium.org )" })] }), _jsx("div", { className: "center-container", children: _jsx("span", { className: "separator" }) }), _jsx("span", { className: "content", children: "This project is developed by Zakodium S\u00E0rl (Switzerland), the University of Cologne (Germany), Johannes Gutenberg University Mainz (Germany) and Universidad del Valle (Colombia)." }), _jsxs("div", { className: "center-container", children: [_jsx("span", { className: "separator" }), _jsx("span", { className: "title", children: "Funding is provided by" }), _jsx("span", { className: "separator" })] }), _jsx("div", { className: "content", children: _jsxs("ul", { children: [_jsx("li", { children: "IDNMR grant, which part of the Scientific Library Services and Information Systems (LIS) initiative of the DFG." }), _jsx("li", { children: _jsx(AboutUsZakodium, {}) }), _jsx("li", { children: "Universidad del Valle (Cali, Colombia)." })] }) })] })] }) })] }));
92
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar.Item, { onClick: openDialog, id: "logo", title: "About NMRium", icon: _jsx(SvgLogoNmrium, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, maxWidth: 1000, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About NMRium" }) }) }), _jsxs("div", { className: "container", children: [_jsxs("div", { className: "center-container", children: [_jsx(Logo, { width: 160, height: 50 }), "Version ", _jsx(VersionInfo, {}), _jsx("span", { className: "separator" }), _jsx("a", { href: "https://git.nmrium.org", target: "_blank", rel: "noreferrer", children: "GitHub ( https://git.nmrium.org )" })] }), _jsx("div", { className: "center-container", children: _jsx("span", { className: "separator" }) }), _jsx("span", { className: "content", children: "This project is developed by Zakodium S\u00E0rl (Switzerland), the University of Cologne (Germany), Johannes Gutenberg University Mainz (Germany) and Universidad del Valle (Colombia)." }), _jsxs("div", { className: "center-container", children: [_jsx("span", { className: "separator" }), _jsx("span", { className: "title", children: "Funding is provided by" }), _jsx("span", { className: "separator" })] }), _jsx("div", { className: "content", children: _jsxs("ul", { children: [_jsx("li", { children: "IDNMR grant, which part of the Scientific Library Services and Information Systems (LIS) initiative of the DFG." }), _jsx("li", { children: _jsx(AboutUsZakodium, {}) }), _jsx("li", { children: "Universidad del Valle (Cali, Colombia)." })] }) })] })] }) })] }));
97
93
  }
98
94
  export default AboutUsModal;
99
95
  function VersionInfo() {
@@ -51,6 +51,7 @@ function AddSignalFormTab({ onFocus, onBlur, range, preferences }, ref) {
51
51
  return Yup.object().shape({
52
52
  newSignalDelta: Yup.number()
53
53
  .test(`test-range`, '', function testNewSignalDelta(value) {
54
+ // eslint-disable-next-line no-invalid-this
54
55
  const { path, createError } = this;
55
56
  if (value && value > range.from && value < range.to) {
56
57
  return true;
@@ -7,8 +7,11 @@ const editRangeFormValidation = Yup.object().shape({
7
7
  .of(Yup.object().shape({
8
8
  multiplicity: Yup.string().required(),
9
9
  coupling: Yup.mixed().test('checkValue', '', function testCoupling(value) {
10
+ // eslint-disable-next-line no-invalid-this
10
11
  const { path, createError } = this;
11
- const hasCoupling = hasCouplingConstant(this.parent.multiplicity);
12
+ const hasCoupling = hasCouplingConstant(
13
+ // eslint-disable-next-line no-invalid-this
14
+ this.parent.multiplicity);
12
15
  if ((!hasCoupling && !value) || (hasCoupling && value)) {
13
16
  return true;
14
17
  }
@@ -168,7 +168,7 @@ function MetaImportationModal({ onClose, file }) {
168
168
  });
169
169
  onClose?.();
170
170
  }
171
- return (_jsxs("div", { css: ModalStyles, style: { overflow: 'hidden' }, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import Meta Information" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { style: styles.container, children: _jsx("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? (_jsx(DropZone, { fileValidator: fileValidator, color: "gray", emptyText: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { height: '130px' }, children: [_jsx(Formik, { innerRef: formRef, initialValues: {
171
+ return (_jsxs("div", { css: ModalStyles, style: { overflow: 'hidden' }, children: [_jsxs("div", { className: "header handle", children: [_jsx("span", { children: "Import Meta Information" }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { style: styles.container, children: _jsx("div", { style: { flex: 1, width: '100%' }, children: !parseResult ? (_jsx(DropZone, { fileValidator: fileValidator, emptyDescription: "Drag and Drop CSV or tab-delimited file (.csv, .txt or .tsv)", onDrop: handleDrop })) : (_jsxs(_Fragment, { children: [_jsxs("div", { style: { height: '130px' }, children: [_jsx(Formik, { innerRef: formRef, initialValues: {
172
172
  source: null,
173
173
  target: '',
174
174
  }, onSubmit: handleLinkSpectra, validationSchema: validationSchema, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "Source field", style: { label: { width: '100px' } }, children: _jsx(FormikSelect, { name: "source", items: mapColumnToSelectItems(parseResult?.meta.fields || []), style: {