nmrium 0.49.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 (104) 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/Viewer1D.js +9 -11
  6. package/lib/component/1d/multiplicityTree/MultiplicityTree.d.ts +1 -7
  7. package/lib/component/1d/multiplicityTree/MultiplicityTree.js +114 -125
  8. package/lib/component/1d/multiplicityTree/MultiplicityTrees.d.ts +1 -0
  9. package/lib/component/1d/multiplicityTree/MultiplicityTrees.js +23 -0
  10. package/lib/component/1d/multiplicityTree/generateTreeNodes.d.ts +18 -0
  11. package/lib/component/1d/multiplicityTree/generateTreeNodes.js +66 -0
  12. package/lib/component/1d/ranges/Range.d.ts +1 -1
  13. package/lib/component/1d/ranges/Range.js +8 -9
  14. package/lib/component/elements/CloseButton.d.ts +2 -10
  15. package/lib/component/elements/CloseButton.js +3 -20
  16. package/lib/component/elements/CounterLabel.js +0 -1
  17. package/lib/component/elements/DeleteButton.d.ts +5 -7
  18. package/lib/component/elements/DeleteButton.js +7 -5
  19. package/lib/component/elements/FilterButton.d.ts +6 -0
  20. package/lib/component/elements/FilterButton.js +8 -0
  21. package/lib/component/elements/PreferencesButton.d.ts +2 -4
  22. package/lib/component/elements/PreferencesButton.js +5 -3
  23. package/lib/component/elements/ReactTable/ReactTable.js +5 -2
  24. package/lib/component/elements/SaveButton.d.ts +2 -11
  25. package/lib/component/elements/SaveButton.js +4 -19
  26. package/lib/component/elements/ToolBarButton.d.ts +9 -0
  27. package/lib/component/elements/ToolBarButton.js +14 -0
  28. package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +2 -1
  29. package/lib/component/elements/popup/Modal/ConfirmDialog.js +11 -8
  30. package/lib/component/hooks/useSaveSettings.js +3 -2
  31. package/lib/component/main/InnerNMRiumContents.js +1 -1
  32. package/lib/component/modal/AboutPredictionModal.js +4 -8
  33. package/lib/component/modal/AboutSpectrumSimulationModal.js +4 -8
  34. package/lib/component/modal/CopyClipboardModal.js +1 -1
  35. package/lib/component/modal/EditPeakShapeModal.js +2 -2
  36. package/lib/component/modal/ExportAsJcampModal.d.ts +1 -1
  37. package/lib/component/modal/ExportAsJcampModal.js +7 -3
  38. package/lib/component/modal/ImportPublicationStringModal.js +15 -11
  39. package/lib/component/modal/LoadJCAMPModal.js +12 -9
  40. package/lib/component/modal/LogsHistoryModal.d.ts +1 -1
  41. package/lib/component/modal/LogsHistoryModal.js +9 -4
  42. package/lib/component/modal/MoleculeStructureEditorModal.js +10 -3
  43. package/lib/component/modal/MultipletAnalysisModal.js +8 -8
  44. package/lib/component/modal/PredictSpectraModal.js +6 -5
  45. package/lib/component/modal/SaveAsModal.js +2 -2
  46. package/lib/component/modal/aboutUs/AboutUsModal.js +11 -26
  47. package/lib/component/modal/changeSum/ChangeSumModal.d.ts +4 -3
  48. package/lib/component/modal/changeSum/ChangeSumModal.js +10 -3
  49. package/lib/component/modal/changeSum/ChangeSumModalContents.d.ts +1 -3
  50. package/lib/component/modal/changeSum/ChangeSumModalContents.js +9 -6
  51. package/lib/component/modal/editRange/EditRangeModal.js +8 -6
  52. package/lib/component/modal/editRange/forms/components/AddSignalFormTab.js +1 -0
  53. package/lib/component/modal/editRange/forms/components/CouplingsTable.js +13 -10
  54. package/lib/component/modal/editRange/forms/components/SignalFormTab.js +1 -1
  55. package/lib/component/modal/editRange/forms/components/SignalsForm.js +1 -0
  56. package/lib/component/modal/editZone/EditZoneModal.js +3 -3
  57. package/lib/component/modal/metaImportation/MetaImportationModal.js +1 -1
  58. package/lib/component/modal/setting/GeneralSettings.js +17 -38
  59. package/lib/component/modal/setting/settings-tabs/OnLoadProcessingTabContent.js +2 -4
  60. package/lib/component/panels/AutomaticAssignment/AutomaticAssignment.js +2 -2
  61. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +6 -23
  62. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +3 -3
  63. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +6 -4
  64. package/lib/component/panels/PeaksPanel/PeaksPanel.js +7 -8
  65. package/lib/component/panels/PeaksPanel/PeaksToggleActions.d.ts +8 -6
  66. package/lib/component/panels/PeaksPanel/PeaksToggleActions.js +3 -6
  67. package/lib/component/panels/RangesPanel/RangesHeader.d.ts +1 -1
  68. package/lib/component/panels/RangesPanel/RangesHeader.js +8 -31
  69. package/lib/component/panels/SpectrumsPanel/SpectraPanelHeader.js +2 -2
  70. package/lib/component/panels/SpectrumsPanel/SpectraTable.js +40 -9
  71. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +1 -1
  72. package/lib/component/panels/SummaryPanel/SetMolecularFormulaModal.js +1 -1
  73. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +1 -1
  74. package/lib/component/panels/SummaryPanel/SummaryPanel.js +4 -3
  75. package/lib/component/panels/ZonesPanel/ZonesPanel.js +2 -26
  76. package/lib/component/panels/databasePanel/DatabasePanel.js +6 -6
  77. package/lib/component/panels/databasePanel/DatabaseSearchOptions.d.ts +4 -6
  78. package/lib/component/panels/databasePanel/DatabaseSearchOptions.js +12 -13
  79. package/lib/component/panels/databasePanel/DatabaseStructureSearchModal.js +7 -8
  80. package/lib/component/panels/filtersPanel/FiltersTable.js +1 -1
  81. package/lib/component/panels/header/DefaultPanelHeader.js +9 -4
  82. package/lib/component/panels/header/PanelHeader.js +0 -1
  83. package/lib/component/panels/header/PreferencesHeader.d.ts +2 -4
  84. package/lib/component/panels/header/PreferencesHeader.js +9 -23
  85. package/lib/component/panels/header/SpectraAutomaticPickingButton.js +2 -2
  86. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisPanel.js +9 -9
  87. package/lib/component/panels/spectrumSimulation/SpectrumSimulationSimpleOptions.js +3 -3
  88. package/lib/component/reducer/Reducer.js +3 -0
  89. package/lib/component/reducer/actions/DatabaseActions.d.ts +3 -2
  90. package/lib/component/reducer/actions/DatabaseActions.js +5 -1
  91. package/lib/utils/clipboard/clipboardComponents.d.ts +2 -2
  92. package/lib/utils/clipboard/clipboardComponents.js +8 -3
  93. package/lib/versionInfo.js +1 -1
  94. package/package.json +17 -16
  95. package/lib/component/1d/multiplicityTree/LevelNode.d.ts +0 -8
  96. package/lib/component/1d/multiplicityTree/LevelNode.js +0 -8
  97. package/lib/component/1d/multiplicityTree/StringNode.d.ts +0 -11
  98. package/lib/component/1d/multiplicityTree/StringNode.js +0 -7
  99. package/lib/component/1d/multiplicityTree/TreeColors.d.ts +0 -1
  100. package/lib/component/1d/multiplicityTree/TreeColors.js +0 -1
  101. package/lib/component/1d/multiplicityTree/TreeNodes.d.ts +0 -21
  102. package/lib/component/1d/multiplicityTree/TreeNodes.js +0 -23
  103. package/lib/component/1d/multiplicityTree/buildTreeNode.d.ts +0 -11
  104. package/lib/component/1d/multiplicityTree/buildTreeNode.js +0 -57
@@ -1,23 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { memo } from 'react';
3
2
  import { FaTimes } from 'react-icons/fa';
4
- import ToolTip from './ToolTip/ToolTip';
5
- const styles = {
6
- button: {
7
- backgroundColor: 'transparent',
8
- border: 'none',
9
- height: '100%',
10
- display: 'flex',
11
- justifyContent: 'center',
12
- alignItems: 'center',
13
- },
14
- svg: {
15
- fill: '#ca0000',
16
- fontSize: '16px',
17
- },
18
- };
19
- function CloseButton(props) {
20
- const { onClick = () => null, popupTitle = 'Close', popupPlacement = 'left', className = '', } = props;
21
- return (_jsx("div", { className: className, children: _jsx(ToolTip, { title: popupTitle, popupPlacement: popupPlacement, children: _jsx("button", { style: styles.button, type: "button", onClick: onClick, children: _jsx(FaTimes, { style: styles.svg }) }) }) }));
3
+ import { ToolBarButton } from './ToolBarButton';
4
+ export function CloseButton(props) {
5
+ return (_jsx(ToolBarButton, { id: "close-button", ...props, intent: "danger", icon: _jsx(FaTimes, {}), placement: "bottom-start" }));
22
6
  }
23
- export default memo(CloseButton);
@@ -2,7 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  const labelStyle = {
3
3
  margin: 0,
4
4
  textAlign: 'right',
5
- lineHeight: '22px',
6
5
  padding: '0 5px',
7
6
  whiteSpace: 'nowrap',
8
7
  };
@@ -1,8 +1,6 @@
1
- interface DeleteButtonProps {
2
- onDelete?: () => void;
3
- fill?: string;
4
- x: string | number;
5
- y: string | number;
1
+ import { ButtonProps } from '@blueprintjs/core';
2
+ interface DeleteButtonProps extends Pick<ButtonProps, 'onClick' | 'title' | 'disabled' | 'active'> {
3
+ title: string;
6
4
  }
7
- declare function DeleteButton(props: DeleteButtonProps): import("react/jsx-runtime").JSX.Element;
8
- export default DeleteButton;
5
+ export declare function DeleteButton(props: DeleteButtonProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,6 +1,8 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- function DeleteButton(props) {
3
- const { x = 'initial', y = 'initial', onDelete = () => null, fill = '#c81121', } = props;
4
- return (_jsxs("svg", { className: "delete-button", x: x, y: y, onClick: onDelete, "data-no-export": "true", children: [_jsx("rect", { rx: "5", width: "16", height: "16", fill: fill }), _jsx("line", { x1: "5", x2: "10", y1: "8", y2: "8", stroke: "white", strokeWidth: "2" })] }));
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FaRegTrashAlt } from 'react-icons/fa';
3
+ import { ToolBarButton } from './ToolBarButton';
4
+ export function DeleteButton(props) {
5
+ return (_jsx(ToolBarButton, { intent: "danger", style: {
6
+ fontSize: '1.125em',
7
+ }, ...props, id: "delete-button", icon: _jsx(FaRegTrashAlt, {}) }));
5
8
  }
6
- export default DeleteButton;
@@ -0,0 +1,6 @@
1
+ import { ButtonProps } from '@blueprintjs/core';
2
+ interface FilterButtonProps extends Pick<ButtonProps, 'onClick' | 'title' | 'disabled' | 'active'> {
3
+ title: string;
4
+ }
5
+ export declare function FilterButton(props: FilterButtonProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { FaFilter } from 'react-icons/fa';
3
+ import { ToolBarButton } from './ToolBarButton';
4
+ export function FilterButton(props) {
5
+ return (_jsx(ToolBarButton, { id: "filter-button", ...props, style: {
6
+ fontSize: '1.125em',
7
+ }, icon: _jsx(FaFilter, {}) }));
8
+ }
@@ -1,4 +1,2 @@
1
- /// <reference types="react" />
2
- type PreferencesButtonProps = Pick<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onClick'>;
3
- export declare function PreferencesButton({ onClick }: PreferencesButtonProps): import("react/jsx-runtime").JSX.Element;
4
- export {};
1
+ import { ToolBarButtonProps } from './ToolBarButton';
2
+ export declare function PreferencesButton({ onClick, }: Pick<ToolBarButtonProps, 'onClick'>): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { FaCog } from 'react-icons/fa';
3
- import ToolTip from './ToolTip/ToolTip';
4
- export function PreferencesButton({ onClick }) {
5
- return (_jsx(ToolTip, { title: "Preferences", popupPlacement: "left", children: _jsx("button", { type: "button", onClick: onClick, children: _jsx(FaCog, {}) }) }));
3
+ import { ToolBarButton } from './ToolBarButton';
4
+ export function PreferencesButton({ onClick, }) {
5
+ return (_jsx(ToolBarButton, { style: {
6
+ fontSize: '1.125em',
7
+ }, id: "preferences-button", icon: _jsx(FaCog, {}), onClick: onClick }));
6
8
  }
@@ -1,4 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
+ /* eslint-disable unicorn/prefer-logical-operator-over-ternary */
3
+ /** @jsxImportSource @emotion/react */
4
+ import { css } from '@emotion/react';
2
5
  import { useRef, memo, forwardRef, useState, useLayoutEffect, useEffect, useMemo, } from 'react';
3
6
  import { useTable, useSortBy, } from 'react-table';
4
7
  import { useMeasure } from 'react-use';
@@ -224,9 +227,9 @@ function ReactTable(props) {
224
227
  });
225
228
  }
226
229
  }
227
- return (_jsx(ReactTableProvider, { value: tableVirtualBoundary, children: _jsx("div", { ref: mRef, style: {
230
+ return (_jsx(ReactTableProvider, { value: tableVirtualBoundary, children: _jsx("div", { ref: mRef, css: css({
228
231
  position: 'relative',
229
232
  height: '100%',
230
- }, css: style, children: _jsx(ReactTableInner, { onScroll: scrollHandler, onSortEnd: onSortEnd, ref: containerRef, ...props }) }) }));
233
+ }, style), children: _jsx(ReactTableInner, { onScroll: scrollHandler, onSortEnd: onSortEnd, ref: containerRef, ...props }) }) }));
231
234
  }
232
235
  export default memo(ReactTable);
@@ -1,11 +1,2 @@
1
- /// <reference types="react" />
2
- interface SaveButtonProps {
3
- popupTitle?: string;
4
- popupPlacement?: string;
5
- disabled?: boolean;
6
- className?: string;
7
- onClick?: () => void;
8
- }
9
- declare function SaveButton(props: SaveButtonProps): import("@emotion/react/jsx-runtime").JSX.Element;
10
- declare const _default: import("react").MemoExoticComponent<typeof SaveButton>;
11
- export default _default;
1
+ import { ToolBarButtonProps } from './ToolBarButton';
2
+ export declare function SaveButton(props: Pick<ToolBarButtonProps, 'onClick' | 'title'>): import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,6 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
2
- /** @jsxImportSource @emotion/react */
3
- import { css } from '@emotion/react';
4
- import { memo } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
5
2
  import { FaCheck } from 'react-icons/fa';
6
- import ToolTip from './ToolTip/ToolTip';
7
- const styles = css `
8
- background-color: transparent;
9
- border: none;
10
- height: 100%;
11
-
12
- svg {
13
- fill: green;
14
- font-size: 16px;
15
- }
16
- `;
17
- function SaveButton(props) {
18
- const { className = '', disabled = false, popupPlacement = 'left', popupTitle = 'Save', onClick, } = props;
19
- return (_jsx("div", { className: className, children: _jsx(ToolTip, { title: popupTitle, popupPlacement: popupPlacement, children: _jsx("button", { css: styles, type: "button", onClick: onClick, disabled: disabled, className: className, children: _jsx(FaCheck, {}) }) }) }));
3
+ import { ToolBarButton } from './ToolBarButton';
4
+ export function SaveButton(props) {
5
+ return (_jsx(ToolBarButton, { id: "save-button", ...props, intent: "success", icon: _jsx(FaCheck, {}), placement: "bottom-start" }));
20
6
  }
21
- export default memo(SaveButton);
@@ -0,0 +1,9 @@
1
+ import { ButtonProps, Placement } from '@blueprintjs/core';
2
+ import { CSSProperties } from 'react';
3
+ import { ToolbarItemProps } from 'react-science/ui';
4
+ export interface ToolBarButtonProps extends Omit<ToolbarItemProps, 'onClick' | 'title'>, Pick<ButtonProps, 'onClick' | 'title'> {
5
+ disabled?: boolean;
6
+ placement?: Placement;
7
+ style?: CSSProperties;
8
+ }
9
+ export declare function ToolBarButton(props: ToolBarButtonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button } from 'react-science/ui';
3
+ export function ToolBarButton(props) {
4
+ const { intent, title = '', placement = 'bottom', style = {}, ...other } = props;
5
+ return (_jsx(Button, { ...other, intent: intent, minimal: true, tooltipProps: {
6
+ content: title,
7
+ placement,
8
+ intent,
9
+ compact: true,
10
+ }, style: {
11
+ fontSize: '1.25em',
12
+ ...style,
13
+ } }));
14
+ }
@@ -15,6 +15,7 @@ interface ConfirmationDialogProps {
15
15
  className: string;
16
16
  }) => ReactNode;
17
17
  id?: string;
18
+ disableDefaultStyle?: boolean;
18
19
  }
19
- declare function ConfirmationDialog({ style, buttons, onClose, message, render, id, }: ConfirmationDialogProps): import("@emotion/react/jsx-runtime").JSX.Element;
20
+ declare function ConfirmationDialog({ style, buttons, onClose, message, render, id, disableDefaultStyle, }: ConfirmationDialogProps): import("@emotion/react/jsx-runtime").JSX.Element;
20
21
  export default ConfirmationDialog;
@@ -1,14 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { DialogBody } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { useCallback } from 'react';
5
6
  const styles = css `
6
- display: block;
7
- border-radius: 5px;
8
- overflow: hidden;
9
- width: 30vw;
10
- min-width: 350px;
11
- border-top: 10px solid #ed0000;
7
+ background-color: white;
8
+ padding: 0;
12
9
 
13
10
  .message {
14
11
  font-weight: bold;
@@ -53,13 +50,19 @@ const styles = css `
53
50
  }
54
51
  }
55
52
  `;
56
- function ConfirmationDialog({ style = {}, buttons = [], onClose, message, render, id, }) {
53
+ const defaultStyle = {
54
+ display: 'block',
55
+ borderRadius: '5px',
56
+ minWidth: '400px',
57
+ borderTop: '10px solid #ed0000',
58
+ };
59
+ function ConfirmationDialog({ style = {}, buttons = [], onClose, message, render, id, disableDefaultStyle = false, }) {
57
60
  const optionsHandler = useCallback((e, { handler = () => null, preventClose = false }) => {
58
61
  handler(e);
59
62
  if (!preventClose) {
60
63
  onClose();
61
64
  }
62
65
  }, [onClose]);
63
- return (_jsxs("div", { style: style, css: styles, "data-testid": id, children: [render ? (render({ message, className: 'message' })) : (_jsx("p", { className: "message", children: message })), _jsx("div", { className: "buttons-container", children: buttons.map((option) => (_jsx("button", { type: "button", onClick: (e) => optionsHandler(e, option), style: option.style && option.style, children: option.text }, option.text))) })] }));
66
+ return (_jsx(DialogBody, { css: styles, children: _jsxs("div", { style: { ...(!disableDefaultStyle && defaultStyle), ...style }, "data-testid": id, children: [render ? (render({ message, className: 'message' })) : (_jsx("p", { className: "message", children: message })), _jsx("div", { className: "buttons-container", children: buttons.map((option) => (_jsx("button", { type: "button", onClick: (e) => optionsHandler(e, option), style: option.style && option.style, children: option.text }, option.text))) })] }) }));
64
67
  }
65
68
  export default ConfirmationDialog;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Dialog } from '@blueprintjs/core';
2
3
  import { Formik } from 'formik';
3
4
  import { useRef, forwardRef } from 'react';
4
- import { Modal, useOnOff } from 'react-science/ui';
5
+ import { useOnOff } from 'react-science/ui';
5
6
  import * as Yup from 'yup';
6
7
  import { usePreferences } from '../context/PreferencesContext';
7
8
  import FormikInput from '../elements/formik/FormikInput';
@@ -68,7 +69,7 @@ export function useSaveSettings() {
68
69
  id: 'save-workspace-dialog',
69
70
  onClose: closeDialog,
70
71
  };
71
- return (_jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: _jsx(ConfirmationDialog, { ...alertConfig }) }));
72
+ return (_jsx(Dialog, { onClose: closeDialog, isOpen: isOpenDialog, title: "Save workspace", children: _jsx(ConfirmationDialog, { disableDefaultStyle: true, ...alertConfig }) }));
72
73
  },
73
74
  };
74
75
  }
@@ -79,7 +79,7 @@ export function InnerNMRiumContents(props) {
79
79
  }, children: [_jsx(FloatMoleculeStructures, {}), displayerMode === '1D' ? (_jsx(Viewer1D, { emptyText: emptyText })) : (_jsx(Viewer2D, { emptyText: emptyText }))] })] }), _jsx(Panels, {})] }), _jsx("div", { ref: elementsWrapperRef, id: "main-wrapper", style: {
80
80
  position: 'absolute',
81
81
  pointerEvents: 'none',
82
- zIndex: 2,
82
+ zIndex: 10,
83
83
  left: 0,
84
84
  right: 0,
85
85
  top: 0,
@@ -1,15 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { FaInfo } from 'react-icons/fa';
5
- import { Modal, useOnOff } from 'react-science/ui';
6
- import Button from '../elements/Button';
6
+ import { Toolbar, useOnOff } from 'react-science/ui';
7
7
  const styles = css `
8
- width: 600px;
9
-
10
- .content {
11
- padding: 2em;
12
- }
8
+ background-color: white;
13
9
 
14
10
  ul {
15
11
  list-style-type: disc;
@@ -44,6 +40,6 @@ const styles = css `
44
40
  `;
45
41
  function AboutPredictionModal() {
46
42
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
47
- return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: _jsx(FaInfo, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About Prediction" }) }) }), _jsx(Modal.Body, { children: _jsxs("div", { className: "content", children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsxs("ul", { children: [_jsxs("li", { children: ["Damiano Banfi and Luc Patiny", ' ', _jsx("a", { href: "http://dx.doi.org/10.2533/chimia.2008.280", target: "_blank", rel: "noreferrer", children: "www.nmrdb.org: Resurrecting and processing NMR spectra on-line" }), ' ', _jsx("i", { children: "Chimia" }), ", ", _jsx("b", { children: "2008" }), ", 62(4), 280-281."] }), _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "1" }), "H NMR prediction is possible thanks to the tool of the FCT-Universidade NOVA de Lisboa developed by Yuri Binev and Joao Aires-de-Sousa:"] }), _jsxs("ul", { children: [_jsxs("li", { children: ["Yuri Binev, Maria M. B. Marques and Jo\u00E3o Aires-de-Sousa", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR coupling constants with associative neural networks trained for chemical shifts"] }), ' ', _jsx("i", { children: "J. Chem. Inf. Model." }), " ", _jsx("b", { children: "2007" }), ", 47(6), 2089-2097."] }), _jsxs("li", { children: ["Jo\u00E3o Aires-de-Sousa, Markus C. Hemmer and Johann Gasteiger", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR Chemical Shifts Using Neural Networks"] }), ", ", _jsx("i", { children: "Analytical Chemistry" }), ", ", _jsx("b", { children: "2002" }), ", 74(1), 80-90."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "13" }), "C NMR prediction was possible thanks to NMRshiftDB:"] }), _jsx("ul", { children: _jsxs("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn", ' ', _jsx("a", { href: "http://dx.doi.org/10.1021/ci0341363", target: "_blank", rel: "noreferrer", children: "NMRShiftDB Constructing a Free Chemical Information System with Open-Source Components" }), ' ', _jsx("i", { children: "Journal of chemical information and computer sciences" }), ",", ' ', _jsx("b", { children: "2003" }), ", 43(6): 1733-1739."] }) })] }) })] }) })] }));
43
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { icon: _jsx(FaInfo, {}), onClick: openDialog, title: "About Prediction" }) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About Prediction", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsxs("ul", { children: [_jsxs("li", { children: ["Damiano Banfi and Luc Patiny", ' ', _jsx("a", { href: "http://dx.doi.org/10.2533/chimia.2008.280", target: "_blank", rel: "noreferrer", children: "www.nmrdb.org: Resurrecting and processing NMR spectra on-line" }), ' ', _jsx("i", { children: "Chimia" }), ", ", _jsx("b", { children: "2008" }), ", 62(4), 280-281."] }), _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "1" }), "H NMR prediction is possible thanks to the tool of the FCT-Universidade NOVA de Lisboa developed by Yuri Binev and Joao Aires-de-Sousa:"] }), _jsxs("ul", { children: [_jsxs("li", { children: ["Yuri Binev, Maria M. B. Marques and Jo\u00E3o Aires-de-Sousa", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ci700172n", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR coupling constants with associative neural networks trained for chemical shifts"] }), ' ', _jsx("i", { children: "J. Chem. Inf. Model." }), " ", _jsx("b", { children: "2007" }), ", 47(6), 2089-2097."] }), _jsxs("li", { children: ["Jo\u00E3o Aires-de-Sousa, Markus C. Hemmer and Johann Gasteiger", ' ', _jsxs("a", { href: "http://dx.doi.org/10.1021/ac010737m", target: "_blank", rel: "noreferrer", children: ["Prediction of ", _jsx("sup", { children: "1" }), "H NMR Chemical Shifts Using Neural Networks"] }), ", ", _jsx("i", { children: "Analytical Chemistry" }), ", ", _jsx("b", { children: "2002" }), ", 74(1), 80-90."] })] }), _jsxs("p", { children: [_jsx("sup", { children: "13" }), "C NMR prediction was possible thanks to NMRshiftDB:"] }), _jsx("ul", { children: _jsxs("li", { children: ["Steinbeck, Christoph, Stefan Krause, and Stefan Kuhn", ' ', _jsx("a", { href: "http://dx.doi.org/10.1021/ci0341363", target: "_blank", rel: "noreferrer", children: "NMRShiftDB Constructing a Free Chemical Information System with Open-Source Components" }), ' ', _jsx("i", { children: "Journal of chemical information and computer sciences" }), ",", ' ', _jsx("b", { children: "2003" }), ", 43(6): 1733-1739."] }) })] }) })] }));
48
44
  }
49
45
  export default AboutPredictionModal;
@@ -1,15 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { FaInfo } from 'react-icons/fa';
5
- import { Modal, useOnOff } from 'react-science/ui';
6
- import Button from '../elements/Button';
6
+ import { Toolbar, useOnOff } from 'react-science/ui';
7
7
  const styles = css `
8
- width: 600px;
9
-
10
- .content {
11
- padding: 2em;
12
- }
8
+ background-color: white;
13
9
 
14
10
  ul {
15
11
  list-style-type: disc;
@@ -44,6 +40,6 @@ const styles = css `
44
40
  `;
45
41
  function AboutSpectrumSimulationModal() {
46
42
  const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
47
- return (_jsxs(_Fragment, { children: [_jsx(Button.BarButton, { onClick: openDialog, tooltipOrientation: "horizontal", toolTip: "About Prediction", children: _jsx(FaInfo, {}) }), _jsx(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: closeDialog, children: _jsxs("div", { css: styles, children: [_jsx(Modal.Header, { children: _jsx("div", { className: "header", children: _jsx("span", { children: "About spectrum simulation" }) }) }), _jsx(Modal.Body, { children: _jsxs("div", { className: "content", children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsx("ul", { children: _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] }) })] }) })] }) })] }));
43
+ return (_jsxs(_Fragment, { children: [_jsx(Toolbar, { children: _jsx(Toolbar.Item, { onClick: openDialog, title: "About Prediction", icon: _jsx(FaInfo, {}) }) }), _jsx(Dialog, { isOpen: isOpenDialog, onClose: closeDialog, title: "About spectrum simulation", style: { width: '600px' }, children: _jsxs(DialogBody, { css: styles, children: [_jsx("p", { children: "If you are using our tools please cite us:" }), _jsx("ul", { children: _jsxs("li", { children: ["Andr\u00E9s M. Castillo, Luc Patiny and Julien Wist", ' ', _jsx("a", { href: "http://dx.doi.org/10.1016/j.jmr.2010.12.008", target: "_blank", rel: "noreferrer", children: "Fast and Accurate Algorithm for the Simulation of NMR spectra of Large Spin Systems" }), ' ', _jsx("i", { children: "Journal of Magnetic Resonance" }), " ", _jsx("b", { children: "2011" }), ", 209(2), 123-130."] }) })] }) })] }));
48
44
  }
49
45
  export default AboutSpectrumSimulationModal;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { css } from '@emotion/react';
4
4
  import { FaCopy } from 'react-icons/fa';
5
- import CloseButton from '../elements/CloseButton';
5
+ import { CloseButton } from '../elements/CloseButton';
6
6
  const styles = css `
7
7
  overflow: auto;
8
8
  width: 400px;
@@ -6,7 +6,7 @@ import { useCallback, useRef, useState } from 'react';
6
6
  import * as Yup from 'yup';
7
7
  import { useDispatch } from '../context/DispatchContext';
8
8
  import ActionButtons from '../elements/ActionButtons';
9
- import CloseButton from '../elements/CloseButton';
9
+ import { CloseButton } from '../elements/CloseButton';
10
10
  import Label from '../elements/Label';
11
11
  import Select from '../elements/Select';
12
12
  import FormikInput from '../elements/formik/FormikInput';
@@ -79,6 +79,6 @@ function EditPeakShapeModal({ onClose = () => null, peak, peaksPreferences, }) {
79
79
  }, [dispatch, onClose, peak.id]);
80
80
  const values = getValues(peak, kind);
81
81
  const valuePPM = formatNumber(peak.x, peaksPreferences.deltaPPM.format);
82
- return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsxs("span", { children: [`Peak Shape Edition ( ${valuePPM} PPM)`, " "] }), _jsx(CloseButton, { onClick: onClose, className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: values, validationSchema: validation(kind), onSubmit: changePeakShapeHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "kind : ", style: labelStyle, children: _jsx(Select, { items: KINDS, style: { margin: 0, height: 30 }, value: kind, onChange: (kind) => setKind(kind) }) }), _jsx(Label, { title: "fwhm: ", style: labelStyle, children: _jsx(FormikInput, { name: "fwhm", style: inputStyle }) }), kind === 'pseudoVoigt' && (_jsx(Label, { title: "mu: ", style: labelStyle, children: _jsx(FormikInput, { name: "mu", style: inputStyle }) }))] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current.submitForm(), doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
82
+ return (_jsxs("div", { css: [ModalStyles, styles], children: [_jsxs("div", { className: "header handle", children: [_jsxs("span", { children: [`Peak Shape Edition ( ${valuePPM} PPM)`, " "] }), _jsx(CloseButton, { onClick: () => onClose?.(), className: "close-bt" })] }), _jsx("div", { className: "inner-content", children: _jsx(Formik, { enableReinitialize: true, innerRef: refForm, initialValues: values, validationSchema: validation(kind), onSubmit: changePeakShapeHandler, children: _jsxs(_Fragment, { children: [_jsx(Label, { title: "kind : ", style: labelStyle, children: _jsx(Select, { items: KINDS, style: { margin: 0, height: 30 }, value: kind, onChange: (kind) => setKind(kind) }) }), _jsx(Label, { title: "fwhm: ", style: labelStyle, children: _jsx(FormikInput, { name: "fwhm", style: inputStyle }) }), kind === 'pseudoVoigt' && (_jsx(Label, { title: "mu: ", style: labelStyle, children: _jsx(FormikInput, { name: "mu", style: inputStyle }) }))] }) }) }), _jsx("div", { className: "footer-container", children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current.submitForm(), doneLabel: "Save", onCancel: () => onClose?.() }) })] }));
83
83
  }
84
84
  export default EditPeakShapeModal;
@@ -3,5 +3,5 @@ interface ExportAsJCAMPProps {
3
3
  closeDialog: () => void;
4
4
  spectrum: Spectrum;
5
5
  }
6
- declare function ExportAsJcampModal(props: ExportAsJCAMPProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function ExportAsJcampModal(props: ExportAsJCAMPProps): import("@emotion/react/jsx-runtime").JSX.Element;
7
7
  export default ExportAsJcampModal;
@@ -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, DialogFooter } from '@blueprintjs/core';
4
+ import { css } from '@emotion/react';
2
5
  import { Formik } from 'formik';
3
6
  import { useRef } from 'react';
4
- import { Modal } from 'react-science/ui';
5
7
  import { DataExportStage, exportAsJcamp, } from '../../data/SpectraManager';
6
8
  import ActionButtons from '../elements/ActionButtons';
7
9
  import FormikCheckBox from '../elements/formik/FormikCheckBox';
@@ -55,7 +57,9 @@ function ExportAsJcampModal(props) {
55
57
  }
56
58
  })();
57
59
  }
58
- return (_jsxs(Modal, { hasCloseButton: true, isOpen: true, onRequestClose: closeDialog, children: [_jsx(Modal.Header, { children: _jsx("span", { children: "Export as JCAMP" }) }), _jsx(Modal.Body, { children: _jsx("div", { children: _jsx(Formik, { innerRef: refForm, initialValues: initValues, onSubmit: submitHandler, children: _jsxs("div", { style: styles.container, children: [_jsxs("div", { style: styles.row, children: [_jsx("span", { style: styles.label, children: " Data " }), _jsx("div", { style: styles.innerContainer, children: _jsx(FormikSelect, { name: "dataExportStage", items: DATA_STAGES, style: { width: '100%' } }) })] }), _jsxs("div", { style: styles.row, children: [_jsx("span", { style: styles.label, children: " Only real " }), _jsx("div", { style: styles.innerContainer, children: _jsx(FormikCheckBox, { name: "onlyReal" }) })] })] }) }) }) }), _jsx(Modal.Footer, { children: _jsx("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "export", onCancel: () => {
60
+ return (_jsxs(Dialog, { isOpen: true, onClose: closeDialog, title: "Export as JCAMP", children: [_jsx(DialogBody, { css: css `
61
+ background-color: white;
62
+ `, children: _jsx(Formik, { innerRef: refForm, initialValues: initValues, onSubmit: submitHandler, children: _jsxs("div", { style: styles.container, children: [_jsxs("div", { style: styles.row, children: [_jsx("span", { style: styles.label, children: " Data " }), _jsx("div", { style: styles.innerContainer, children: _jsx(FormikSelect, { name: "dataExportStage", items: DATA_STAGES, style: { width: '100%' } }) })] }), _jsxs("div", { style: styles.row, children: [_jsx("span", { style: styles.label, children: " Only real " }), _jsx("div", { style: styles.innerContainer, children: _jsx(FormikCheckBox, { name: "onlyReal" }) })] })] }) }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', justifyContent: 'flex-end' }, children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: () => refForm.current?.submitForm(), doneLabel: "export", onCancel: () => {
59
63
  closeDialog?.();
60
64
  } }) }) })] }));
61
65
  }
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
2
3
  import { FifoLogger } from 'fifo-logger';
3
4
  import { Formik } from 'formik';
4
5
  import debounce from 'lodash/debounce';
5
6
  import { resurrect } from 'nmr-processing';
6
7
  import { useMemo, useRef, useState } from 'react';
7
- import { Modal } from 'react-science/ui';
8
8
  import * as yup from 'yup';
9
9
  import { useDispatch } from '../context/DispatchContext';
10
10
  import Button from '../elements/Button';
@@ -86,15 +86,19 @@ function ImportPublicationStringModal(props) {
86
86
  }
87
87
  }
88
88
  const isNotValid = logs.some((log) => ['error', 'fatal'].includes(log.levelLabel));
89
- return (_jsx(Modal, { hasCloseButton: true, isOpen: true, onRequestClose: onClose, children: _jsx(Formik, { innerRef: formRef, initialValues: INITIAL_VALUES, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: ({ isValid }) => (_jsxs(_Fragment, { children: [_jsx(Modal.Header, { children: "Generate spectrum from publication string" }), _jsx(Modal.Body, { children: _jsxs("div", { style: { width: 800, minHeight: 400, padding: '10px' }, children: [_jsxs("p", { children: ["Paste a publication string in the text area below and click on the button ", _jsx("i", { children: "Generate spectrum" })] }), _jsx(FormikTextarea, { style: {
90
- width: '100%',
91
- height: '180px',
92
- outline: 'none',
93
- borderWidth: '1px',
94
- borderColor: '#dedede',
95
- borderRadius: '5px',
96
- resize: 'none',
97
- padding: '15px',
98
- }, name: "publicationText", className: "text-area", placeholder: "Enter publication string", onChange: handleOnChange }), _jsx(GroupPane, { text: "Logs", children: _jsx(ReactTable, { columns: COLUMNS, data: logs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle }) })] }) }), _jsx(Modal.Footer, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), disabled: isNotValid || !isValid, children: "Generate spectrum" }) }) })] })) }) }));
89
+ return (_jsx(Dialog, { title: "Generate spectrum from publication string", isOpen: true, onClose: onClose, style: { width: 800, height: 500 }, children: _jsx(Formik, { innerRef: formRef, initialValues: INITIAL_VALUES, validationSchema: validationSchema, onSubmit: publicationStringHandler, children: ({ isValid }) => (_jsxs(_Fragment, { children: [_jsx(DialogBody, { children: _jsxs("div", { style: {
90
+ display: 'flex',
91
+ flexDirection: 'column',
92
+ height: '100%',
93
+ }, children: [_jsxs("div", { style: { display: 'flex', flexDirection: 'column', flex: 1 }, children: [_jsxs("p", { children: ["Paste a publication string in the text area below and click on the button ", _jsx("i", { children: "Generate spectrum" })] }), _jsx(FormikTextarea, { style: {
94
+ width: '100%',
95
+ flex: 1,
96
+ outline: 'none',
97
+ borderWidth: '1px',
98
+ borderColor: '#dedede',
99
+ borderRadius: '5px',
100
+ resize: 'none',
101
+ padding: '15px',
102
+ }, name: "publicationText", className: "text-area", placeholder: "Enter publication string", onChange: handleOnChange })] }), _jsx(GroupPane, { text: "Logs", children: _jsx(ReactTable, { columns: COLUMNS, data: logs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle, style: { height: '120px' } }) })] }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button.Done, { onClick: () => formRef.current.submitForm(), disabled: isNotValid || !isValid, children: "Generate spectrum" }) }) })] })) }) }));
99
103
  }
100
104
  export default ImportPublicationStringModal;
@@ -1,9 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
4
+ import { css } from '@emotion/react';
3
5
  import { Formik } from 'formik';
4
6
  import { readFromWebSource } from 'nmr-load-save';
5
7
  import { useRef } from 'react';
6
- import { Modal } from 'react-science/ui';
7
8
  import * as Yup from 'yup';
8
9
  import { useDispatch } from '../context/DispatchContext';
9
10
  import Button from '../elements/Button';
@@ -59,12 +60,14 @@ export function LoadJCAMPModal({ onCloseDialog, isOpen }) {
59
60
  onCloseDialog?.();
60
61
  }
61
62
  }
62
- return (_jsxs(Modal, { hasCloseButton: true, isOpen: true, onRequestClose: onCloseDialog, children: [_jsx(Modal.Header, { children: "Load JCAMP Dialog" }), _jsx(Modal.Body, { children: _jsx("div", { style: { minWidth: '400px', padding: '1.5em' }, children: _jsx(Formik, { initialValues: { url: '' }, validationSchema: loadFormValidation, onSubmit: loadJCAMPHandler, innerRef: ref, children: _jsx(Label, { title: "URL", style: labelStyle, children: _jsx(FormikError, { name: "url", style: { container: { flex: 1 } }, children: _jsx(FormikInput, { name: "url", type: "string", style: {
63
- input: {
64
- padding: '0.8em',
65
- textAlign: 'left',
66
- width: '100%',
67
- },
68
- inputWrapper: { width: '100%' },
69
- }, placeholder: "Enter URL to JCAMP-DX file" }) }) }) }) }) }), _jsx(Modal.Footer, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button.Done, { onClick: () => ref.current?.submitForm(), children: "Load" }) }) })] }));
63
+ return (_jsxs(Dialog, { isOpen: true, onClose: onCloseDialog, title: "Load JCAMP Dialog", style: { minWidth: '400px' }, children: [_jsx(DialogBody, { css: css `
64
+ background-color: white;
65
+ `, children: _jsx(Formik, { initialValues: { url: '' }, validationSchema: loadFormValidation, onSubmit: loadJCAMPHandler, innerRef: ref, children: _jsx(Label, { title: "URL", style: labelStyle, children: _jsx(FormikError, { name: "url", style: { container: { flex: 1 } }, children: _jsx(FormikInput, { name: "url", type: "string", style: {
66
+ input: {
67
+ padding: '0.8em',
68
+ textAlign: 'left',
69
+ width: '100%',
70
+ },
71
+ inputWrapper: { width: '100%' },
72
+ }, placeholder: "Enter URL to JCAMP-DX file" }) }) }) }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button.Done, { onClick: () => ref.current?.submitForm(), children: "Load" }) }) })] }));
70
73
  }
@@ -2,5 +2,5 @@ interface LogsHistoryModalProps {
2
2
  autoOpen?: boolean;
3
3
  onClose?: () => void;
4
4
  }
5
- export declare function LogsHistoryModal(props: LogsHistoryModalProps): import("react/jsx-runtime").JSX.Element;
5
+ export declare function LogsHistoryModal(props: LogsHistoryModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
6
  export {};
@@ -1,9 +1,12 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
+ /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
4
+ import { css } from '@emotion/react';
2
5
  import { useMemo } from 'react';
3
6
  import { FaRegTrashAlt } from 'react-icons/fa';
4
7
  import { IoBugOutline } from 'react-icons/io5';
5
8
  import { ObjectInspector } from 'react-inspector';
6
- import { useOnOff, Modal } from 'react-science/ui';
9
+ import { useOnOff } from 'react-science/ui';
7
10
  import { useLogger } from '../context/LoggerContext';
8
11
  import Button from '../elements/Button';
9
12
  import { ColumnWrapper } from '../elements/ColumnWrapper';
@@ -100,9 +103,11 @@ export function LogsHistoryModal(props) {
100
103
  minWidth: '14px',
101
104
  fontSize: '0.75em',
102
105
  color: 'white',
103
- }, children: count }))] }) })), _jsxs(Modal, { hasCloseButton: true, isOpen: isOpenDialog, onRequestClose: () => {
106
+ }, children: count }))] }) })), _jsxs(Dialog, { isOpen: isOpenDialog, onClose: () => {
104
107
  markAsRead();
105
108
  closeDialog();
106
109
  onClose?.();
107
- }, children: [_jsx(Modal.Header, { children: "Logs History " }), _jsx(Modal.Body, { children: _jsx("div", { style: { width: '50vw', height: '50vh', padding: '0.5em' }, children: _jsx(ReactTable, { columns: COLUMNS, data: sortedLogs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle }) }) }), _jsx(Modal.Footer, { children: _jsx(Button.Danger, { onClick: () => logger.clear(), fill: "outline", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(FaRegTrashAlt, {}), _jsx("span", { style: { paddingLeft: '5px' }, children: "Clear Logs" })] }) }) })] })] }));
110
+ }, title: "Logs History", style: { width: '50vw', height: '50vh' }, children: [_jsx(DialogBody, { css: css `
111
+ background-color: white;
112
+ `, children: _jsx(ReactTable, { columns: COLUMNS, data: sortedLogs, emptyDataRowText: "No Logs", rowStyle: handleRowStyle }) }), _jsx(DialogFooter, { children: _jsx(Button.Danger, { onClick: () => logger.clear(), fill: "outline", children: _jsxs("div", { style: { display: 'flex', alignItems: 'center' }, children: [_jsx(FaRegTrashAlt, {}), _jsx("span", { style: { paddingLeft: '5px' }, children: "Clear Logs" })] }) }) })] })] }));
108
113
  }
@@ -1,11 +1,14 @@
1
- import { jsx as _jsx } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
4
+ import { css } from '@emotion/react';
3
5
  import { Molecule } from 'openchemlib/full';
4
6
  import { TopicMolecule } from 'openchemlib-utils';
5
7
  import { useState, useEffect, useCallback, useMemo } from 'react';
6
8
  import { StructureEditor } from 'react-ocl/full';
7
- import { ConfirmModal, Modal, useOnOff } from 'react-science/ui';
9
+ import { useOnOff } from 'react-science/ui';
8
10
  import { useDispatch } from '../context/DispatchContext';
11
+ import ActionButtons from '../elements/ActionButtons';
9
12
  function MoleculeStructureEditorModal(props) {
10
13
  const { onClose = () => null, selectedMolecule, floatMoleculeOnSave = false, isOpen = false, } = props;
11
14
  const initialMolfile = selectedMolecule?.molfile;
@@ -77,7 +80,11 @@ function MoleculeStructureEditorModal(props) {
77
80
  floatMoleculeOnSave,
78
81
  onClose,
79
82
  ]);
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 }) }) }));
83
+ return (_jsxs(Dialog, { isOpen: isOpen, onClose: handleClose, style: { width: 710 }, children: [_jsx(DialogBody, { css: css `
84
+ background-color: white;
85
+ `, children: _jsx(StructureEditor, { initialMolfile: initialEnhancedMolfile?.molfile, svgMenu: true, fragment: false, onChange: cb }) }), _jsx(DialogFooter, { children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: handleSave, doneLabel: "Save", onCancel: () => {
86
+ onClose();
87
+ } }) })] }));
81
88
  }
82
89
  export function useMoleculeEditor(floatMoleculeOnSave = false) {
83
90
  const [isOpen, openModal, closeModal] = useOnOff(false);