nmrium 0.58.0 → 0.60.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 (194) hide show
  1. package/lib/component/1d/LinesSeries.js +17 -5
  2. package/lib/component/1d/Viewer1D.js +10 -4
  3. package/lib/component/1d/integral/IntegralResizable.js +2 -2
  4. package/lib/component/1d/matrix/useMatrix.d.ts +1 -1
  5. package/lib/component/1d/multiAnalysis/AnalysisRange.js +1 -1
  6. package/lib/component/1d/ranges/Atoms.js +6 -4
  7. package/lib/component/1d/ranges/Range.js +4 -2
  8. package/lib/component/1d/tool/PivotIndicator.d.ts +1 -0
  9. package/lib/component/1d/tool/{VerticalIndicator.js → PivotIndicator.js} +8 -4
  10. package/lib/component/1d-2d/tools/BrushXY.js +0 -1
  11. package/lib/component/1d-2d/tools/CrossLinePointer.js +0 -1
  12. package/lib/component/2d/Viewer2D.js +7 -3
  13. package/lib/component/2d/tools/PivotIndicator.d.ts +1 -2
  14. package/lib/component/2d/tools/PivotIndicator.js +2 -3
  15. package/lib/component/2d/zones/Zone.js +2 -2
  16. package/lib/component/EventsTrackers/KeysListenerTracker.js +8 -8
  17. package/lib/component/context/ChartContext.js +12 -1
  18. package/lib/component/context/ShareDataContext.d.ts +1 -1
  19. package/lib/component/context/ShareDataContext.js +2 -4
  20. package/lib/component/context/ToasterContext.d.ts +1 -0
  21. package/lib/component/context/ToasterContext.js +12 -3
  22. package/lib/component/elements/ActionsButtonsPopover.js +1 -3
  23. package/lib/component/elements/Alert.d.ts +20 -0
  24. package/lib/component/elements/Alert.js +80 -0
  25. package/lib/component/elements/ContextMenuBluePrint.d.ts +7 -2
  26. package/lib/component/elements/ContextMenuBluePrint.js +9 -3
  27. package/lib/component/elements/DialogManager.d.ts +34 -0
  28. package/lib/component/elements/DialogManager.js +96 -0
  29. package/lib/component/elements/DraggableDialog.d.ts +13 -0
  30. package/lib/component/elements/DraggableDialog.js +156 -0
  31. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js +1 -1
  32. package/lib/component/elements/ReactTable/ReactTableFlexLayout.d.ts +0 -3
  33. package/lib/component/elements/ReactTable/ReactTableFlexLayout.js +1 -1
  34. package/lib/component/elements/Select2.d.ts +12 -7
  35. package/lib/component/elements/Select2.js +5 -4
  36. package/lib/component/elements/Select2Controller.d.ts +2 -2
  37. package/lib/component/elements/Select2Controller.js +5 -5
  38. package/lib/component/elements/TabTitle.d.ts +9 -0
  39. package/lib/component/elements/TabTitle.js +18 -0
  40. package/lib/component/elements/ToolbarPopoverItem.d.ts +7 -6
  41. package/lib/component/elements/ToolbarPopoverItem.js +13 -5
  42. package/lib/component/elements/print/PrintContent.d.ts +17 -0
  43. package/lib/component/elements/print/PrintContent.js +281 -0
  44. package/lib/component/elements/print/PrintProvider.d.ts +12 -0
  45. package/lib/component/elements/print/PrintProvider.js +28 -0
  46. package/lib/component/elements/print/index.d.ts +2 -0
  47. package/lib/component/elements/print/index.js +2 -0
  48. package/lib/component/header/ApodizationOptionsPanel.js +2 -2
  49. package/lib/component/header/BaseLineCorrectionPanel.js +3 -0
  50. package/lib/component/hooks/useSaveSettings.d.ts +1 -1
  51. package/lib/component/hooks/useSaveSettings.js +18 -22
  52. package/lib/component/hooks/useToggleSpectraVisibility.d.ts +14 -9
  53. package/lib/component/hooks/useToggleSpectraVisibility.js +45 -16
  54. package/lib/component/loader/DropZone.js +3 -67
  55. package/lib/component/loader/useLoadFiles.d.ts +1 -0
  56. package/lib/component/loader/useLoadFiles.js +78 -0
  57. package/lib/component/main/InnerNMRium.d.ts +4 -3
  58. package/lib/component/main/InnerNMRium.js +5 -10
  59. package/lib/component/main/InnerNMRiumContents.d.ts +3 -2
  60. package/lib/component/main/InnerNMRiumContents.js +38 -29
  61. package/lib/component/main/NMRium.d.ts +2 -5
  62. package/lib/component/main/NMRium.js +1 -1
  63. package/lib/component/main/NMRiumRefAPI.d.ts +7 -0
  64. package/lib/component/main/NMRiumRefAPI.js +12 -0
  65. package/lib/component/main/NMRiumViewer.d.ts +10 -0
  66. package/lib/component/main/NMRiumViewer.js +35 -0
  67. package/lib/component/main/index.d.ts +1 -0
  68. package/lib/component/modal/CopyClipboardModal.d.ts +3 -2
  69. package/lib/component/modal/CopyClipboardModal.js +18 -32
  70. package/lib/component/modal/EditPeakShapeModal.d.ts +4 -6
  71. package/lib/component/modal/EditPeakShapeModal.js +45 -33
  72. package/lib/component/modal/ExportAsJcampModal.d.ts +6 -3
  73. package/lib/component/modal/ExportAsJcampModal.js +69 -35
  74. package/lib/component/modal/ImportPublicationStringModal.js +1 -1
  75. package/lib/component/modal/editRange/EditRangeModal.d.ts +2 -10
  76. package/lib/component/modal/editRange/EditRangeModal.js +26 -54
  77. package/lib/component/modal/editZone/EditZoneModal.d.ts +3 -8
  78. package/lib/component/modal/editZone/EditZoneModal.js +74 -91
  79. package/lib/component/modal/editZone/SignalsForm.d.ts +1 -2
  80. package/lib/component/modal/editZone/SignalsForm.js +33 -50
  81. package/lib/component/modal/editZone/validation/isDefaultPathLength.d.ts +1 -2
  82. package/lib/component/modal/editZone/validation/isDefaultPathLength.js +3 -5
  83. package/lib/component/modal/setting/GeneralSettings.js +4 -2
  84. package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.d.ts +1 -0
  85. package/lib/component/modal/setting/settings-tabs/ExternalAPIsTabContent.js +89 -0
  86. package/lib/component/modal/setting/settingsValidation.js +15 -1
  87. package/lib/component/panels/IntegralsPanel/IntegralPanel.js +8 -5
  88. package/lib/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.js +5 -1
  89. package/lib/component/panels/MoleculesPanel/MoleculePanelHeader.js +13 -3
  90. package/lib/component/panels/Panels.js +2 -2
  91. package/lib/component/panels/PeaksPanel/PeaksPanel.js +8 -5
  92. package/lib/component/panels/PeaksPanel/PeaksTable.js +7 -13
  93. package/lib/component/panels/RangesPanel/RangesHeader.js +52 -15
  94. package/lib/component/panels/RangesPanel/RangesTable.js +6 -3
  95. package/lib/component/panels/RangesPanel/TableColumns/ActionsColumn.js +21 -3
  96. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.d.ts +6 -5
  97. package/lib/component/panels/RangesPanel/hooks/useEditRangeModal.js +41 -64
  98. package/lib/component/panels/SpectraPanel/SpectraPanelHeader.js +13 -6
  99. package/lib/component/panels/SpectraPanel/SpectraTable.js +63 -21
  100. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.d.ts +1 -2
  101. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnField.js +33 -41
  102. package/lib/component/panels/SummaryPanel/CorrelationTable/AdditionalColumnHeader.js +68 -53
  103. package/lib/component/panels/SummaryPanel/CorrelationTable/CorrelationTableRow.js +70 -58
  104. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.d.ts +13 -8
  105. package/lib/component/panels/SummaryPanel/CorrelationTable/editLink/EditLinkModal.js +17 -81
  106. package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts +3 -0
  107. package/lib/component/panels/SummaryPanel/SummaryPanel.js +8 -1
  108. package/lib/component/panels/SummaryPanel/utilities/Utilities.js +1 -1
  109. package/lib/component/panels/ZonesPanel/TableColumns/ActionsColumn.js +62 -43
  110. package/lib/component/panels/ZonesPanel/ZonesPanel.js +16 -8
  111. package/lib/component/panels/ZonesPanel/ZonesTable.js +4 -1
  112. package/lib/component/panels/ZonesPanel/hooks/useZoneActions.d.ts +5 -0
  113. package/lib/component/panels/ZonesPanel/hooks/useZoneActions.js +40 -0
  114. package/lib/component/panels/databasePanel/DatabasePanel.js +7 -8
  115. package/lib/component/panels/filtersPanel/FilterPanel.js +9 -6
  116. package/lib/component/panels/filtersPanel/FiltersTable.js +12 -10
  117. package/lib/component/panels/header/DefaultPanelHeader.d.ts +1 -0
  118. package/lib/component/panels/header/DefaultPanelHeader.js +2 -2
  119. package/lib/component/panels/multipleAnalysisPanel/AlignSpectra.js +10 -12
  120. package/lib/component/reducer/IgnoreActions.js +1 -0
  121. package/lib/component/reducer/Reducer.js +2 -4
  122. package/lib/component/reducer/actions/DatabaseActions.d.ts +15 -13
  123. package/lib/component/reducer/actions/DatabaseActions.js +52 -34
  124. package/lib/component/reducer/actions/DomainActions.d.ts +2 -2
  125. package/lib/component/reducer/actions/FiltersActions.js +9 -4
  126. package/lib/component/reducer/actions/RangesActions.d.ts +1 -0
  127. package/lib/component/reducer/actions/RangesActions.js +9 -4
  128. package/lib/component/reducer/actions/SpectraActions.d.ts +2 -1
  129. package/lib/component/reducer/actions/SpectraActions.js +53 -43
  130. package/lib/component/reducer/actions/ToolsActions.js +0 -17
  131. package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.d.ts +3 -0
  132. package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js +16 -0
  133. package/lib/component/reducer/preferences/actions/changePrintPageSettings.d.ts +3 -0
  134. package/lib/component/reducer/preferences/actions/changePrintPageSettings.js +6 -0
  135. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +0 -4
  136. package/lib/component/reducer/preferences/actions/matrixGeneration.js +1 -2
  137. package/lib/component/reducer/preferences/preferencesReducer.d.ts +3 -2
  138. package/lib/component/reducer/preferences/preferencesReducer.js +4 -1
  139. package/lib/component/toolbar/ToolBar.js +33 -14
  140. package/lib/component/toolbar/ToolTypes.d.ts +1 -1
  141. package/lib/component/toolbar/ToolTypes.js +0 -14
  142. package/lib/component/workspaces/workspaceDefaultProperties.js +2 -0
  143. package/lib/data/SpectraManager.d.ts +7 -10
  144. package/lib/data/SpectraManager.js +51 -30
  145. package/lib/data/data1d/Spectrum1D/SumManager.d.ts +0 -1
  146. package/lib/data/data1d/Spectrum1D/SumManager.js +2 -10
  147. package/lib/data/data1d/Spectrum1D/get1DColor.d.ts +1 -1
  148. package/lib/data/data1d/Spectrum1D/index.d.ts +1 -1
  149. package/lib/data/data1d/Spectrum1D/index.js +1 -1
  150. package/lib/data/data1d/Spectrum1D/ranges/createRange.d.ts +10 -16
  151. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -7
  152. package/lib/data/data1d/Spectrum1D/ranges/detectSignals.js +2 -1
  153. package/lib/data/data1d/Spectrum1D/ranges/initiateRanges.d.ts +10 -16
  154. package/lib/data/data1d/Spectrum1D/ranges/resizeRange.d.ts +10 -16
  155. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.d.ts +13 -0
  156. package/lib/data/data1d/Spectrum1D/ranges/resurrectSpectrum.js +65 -0
  157. package/lib/data/molecules/MoleculeManager.d.ts +1 -1
  158. package/lib/data/molecules/MoleculeManager.js +21 -49
  159. package/lib/data/utilities/getCustomColor.d.ts +1 -1
  160. package/lib/data/utilities/removeByPaths.d.ts +3 -0
  161. package/lib/data/utilities/removeByPaths.js +33 -0
  162. package/lib/versionInfo.js +1 -1
  163. package/package.json +34 -34
  164. package/lib/component/1d/tool/VerticalIndicator.d.ts +0 -2
  165. package/lib/component/elements/ContextMenu.d.ts +0 -9
  166. package/lib/component/elements/ContextMenu.js +0 -116
  167. package/lib/component/elements/popup/Modal/ConfirmDialog.d.ts +0 -21
  168. package/lib/component/elements/popup/Modal/ConfirmDialog.js +0 -68
  169. package/lib/component/elements/popup/Modal/Context.d.ts +0 -2
  170. package/lib/component/elements/popup/Modal/Context.js +0 -6
  171. package/lib/component/elements/popup/Modal/Modal.d.ts +0 -9
  172. package/lib/component/elements/popup/Modal/Modal.js +0 -42
  173. package/lib/component/elements/popup/Modal/ModalContent.d.ts +0 -6
  174. package/lib/component/elements/popup/Modal/ModalContent.js +0 -27
  175. package/lib/component/elements/popup/Modal/Provider.d.ts +0 -11
  176. package/lib/component/elements/popup/Modal/Provider.js +0 -172
  177. package/lib/component/elements/popup/Modal/index.d.ts +0 -4
  178. package/lib/component/elements/popup/Modal/index.js +0 -4
  179. package/lib/component/elements/popup/Transition.d.ts +0 -14
  180. package/lib/component/elements/popup/Transition.js +0 -35
  181. package/lib/component/elements/popup/Wrapper.d.ts +0 -8
  182. package/lib/component/elements/popup/Wrapper.js +0 -83
  183. package/lib/component/elements/popup/options.d.ts +0 -28
  184. package/lib/component/elements/popup/options.js +0 -25
  185. package/lib/component/elements/popup/utility.d.ts +0 -2
  186. package/lib/component/elements/popup/utility.js +0 -13
  187. package/lib/component/modal/editZone/EditPathLengthFormik.d.ts +0 -5
  188. package/lib/component/modal/editZone/EditPathLengthFormik.js +0 -67
  189. package/lib/component/modal/editZone/SignalFormTab.d.ts +0 -5
  190. package/lib/component/modal/editZone/SignalFormTab.js +0 -6
  191. package/lib/component/modal/editZone/validation/EditZoneValidation.d.ts +0 -14
  192. package/lib/component/modal/editZone/validation/EditZoneValidation.js +0 -14
  193. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.d.ts +0 -11
  194. package/lib/data/data1d/Spectrum1D/ranges/generateSpectrumFromRanges.js +0 -29
@@ -2,52 +2,82 @@ import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
3
  import { Dialog, DialogBody, DialogFooter } from '@blueprintjs/core';
4
4
  import { css } from '@emotion/react';
5
- import { Formik } from 'formik';
6
5
  import { useRef } from 'react';
7
- import { DataExportStage, exportAsJcamp, } from '../../data/SpectraManager';
6
+ import { exportAsJcamp } from '../../data/SpectraManager';
8
7
  import { useToaster } from '../context/ToasterContext';
9
8
  import ActionButtons from '../elements/ActionButtons';
10
- import FormikCheckBox from '../elements/formik/FormikCheckBox';
11
- import FormikSelect from '../elements/formik/FormikSelect';
12
- const initValues = {
13
- onlyReal: true,
14
- dataExportStage: 'PROCESSED',
15
- };
16
- const styles = {
17
- container: {
18
- width: '25em',
19
- padding: '1.5em 3em',
20
- display: 'flex',
21
- flexDirection: 'column',
9
+ import Label from '../elements/Label';
10
+ import { Select2 } from '../elements/Select2';
11
+ import useSpectrum from '../hooks/useSpectrum';
12
+ const originalFidExportDataTypes = [
13
+ {
14
+ label: 'Original FID',
15
+ value: 'originalFid',
16
+ },
17
+ ];
18
+ const originalFtDataTypes = [
19
+ {
20
+ label: 'Original FT real',
21
+ value: 'originalFtReal',
22
22
  },
23
- row: {
24
- display: 'flex',
25
- paddingBottom: '0.5em',
23
+ {
24
+ label: 'Original FT real and imaginary',
25
+ value: 'originalFtRealImaginary',
26
26
  },
27
- label: {
28
- flex: 6,
29
- fontSize: '1em',
30
- fontWeight: 'bold',
27
+ ];
28
+ const processedDataTypes = [
29
+ {
30
+ label: 'Processed real',
31
+ value: 'processedReal',
31
32
  },
32
- innerContainer: {
33
- flex: 6,
34
- justifyContent: 'flex-start',
33
+ {
34
+ label: 'Processed real and imaginary',
35
+ value: 'processedRealImaginary',
35
36
  },
37
+ ];
38
+ const labelStyle = {
39
+ wrapper: { display: 'flex', height: '100%', flex: 1 },
40
+ container: { alignItems: 'flex-start' },
41
+ label: { paddingTop: '5px', width: 80 },
36
42
  };
37
- const DATA_STAGES = Object.keys(DataExportStage).map((key) => ({
38
- label: key,
39
- value: DataExportStage[key],
40
- }));
41
43
  function ExportAsJcampModal(props) {
44
+ const { spectrum, exportActiveSpectrum = false } = props;
45
+ const activeSpectrum = useSpectrum();
46
+ if (!exportActiveSpectrum && !spectrum) {
47
+ return null;
48
+ }
49
+ if (exportActiveSpectrum && !activeSpectrum)
50
+ return null;
51
+ const currentSpectrum = exportActiveSpectrum ? activeSpectrum : spectrum;
52
+ if (!currentSpectrum)
53
+ return null;
54
+ return _jsx(InnerExportAsJcampModal, { spectrum: currentSpectrum, ...props });
55
+ }
56
+ function getExportDataTypes(spectrum) {
57
+ const { originalInfo, filters } = spectrum;
58
+ const menuItems = [];
59
+ if (originalInfo?.isFt) {
60
+ menuItems.push(...originalFtDataTypes);
61
+ }
62
+ if (originalInfo?.isFid) {
63
+ menuItems.push(...originalFidExportDataTypes);
64
+ }
65
+ if (filters?.length > 0) {
66
+ menuItems.push(...processedDataTypes);
67
+ }
68
+ return menuItems;
69
+ }
70
+ function InnerExportAsJcampModal(props) {
42
71
  const { closeDialog, spectrum } = props;
43
- const refForm = useRef(null);
44
72
  const toaster = useToaster();
45
- function submitHandler(options) {
73
+ const exportDataTypes = getExportDataTypes(spectrum);
74
+ const exportDataAsRef = useRef(exportDataTypes[0].value);
75
+ function submitHandler() {
46
76
  const hideLoading = toaster.showLoading({
47
77
  message: 'export as JCAMP-DX in progress',
48
78
  });
49
79
  try {
50
- exportAsJcamp(spectrum, options);
80
+ exportAsJcamp(spectrum, exportDataAsRef.current);
51
81
  }
52
82
  catch (error) {
53
83
  toaster.show({ message: error.message, intent: 'danger' });
@@ -57,10 +87,14 @@ function ExportAsJcampModal(props) {
57
87
  hideLoading();
58
88
  }
59
89
  }
60
- return (_jsxs(Dialog, { isOpen: true, onClose: closeDialog, title: "Export as JCAMP", children: [_jsx(DialogBody, { css: css `
90
+ function handleChangeExportDataType(data) {
91
+ exportDataAsRef.current = data.value;
92
+ }
93
+ return (_jsxs(Dialog, { isOpen: true, style: { width: 400 }, onClose: closeDialog, title: "Export as JCAMP", children: [_jsx(DialogBody, { css: css `
61
94
  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: () => {
63
- closeDialog?.();
64
- } }) }) })] }));
95
+ padding: 1.5em 3em;
96
+ `, children: _jsx(Label, { title: "Data", style: labelStyle, children: _jsx(Select2, { defaultSelectedItem: exportDataTypes[0], onItemSelect: handleChangeExportDataType, items: exportDataTypes }) }) }), _jsx(DialogFooter, { children: _jsx(ActionButtons, { style: { flexDirection: 'row-reverse', margin: 0 }, onDone: submitHandler, doneLabel: "export", onCancel: () => {
97
+ closeDialog?.();
98
+ } }) })] }));
65
99
  }
66
100
  export default ExportAsJcampModal;
@@ -27,7 +27,7 @@ function handleRowStyle(data) {
27
27
  return { base: { backgroundColor } };
28
28
  }
29
29
  const INITIAL_VALUES = {
30
- publicationText: '1H NMR (CDCl3, 400MHz) δ 10.58 (b, 1H), 7.40 (d, 1H, J = 8.0 Hz), 6.19 (d, 1H, J = 7.6 Hz), 4.88 (s, 1H), 2.17 (s, 3H), 1.02 (s, 9H), 1.01 (s, 9H), 0.89 (s, 9H)',
30
+ publicationText: '1H NMR (CDCl3, 400MHz) δ 1 (s, 1H), 2 (d, 1H, J=7), 3 (t, 1H, J=7), 4 (q, 1H, J=7), 5 (quint, 1H, J=7), 6 (hex, 1H, J=7), 7 (hept, 1H, J=7), 8 (dd, 1H, J=7, J=4)',
31
31
  };
32
32
  export function ImportPublicationStringModal(props) {
33
33
  const { onClose, isOpen } = props;
@@ -1,10 +1,2 @@
1
- import { Range } from 'nmr-processing';
2
- interface EditRangeModalProps {
3
- onSave: (value: any) => Promise<void> | null | void;
4
- onClose?: () => void;
5
- onRest: (originalRange: Range) => void;
6
- onZoom: (value: any) => void;
7
- rangeId: string;
8
- }
9
- declare function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }: EditRangeModalProps): import("@emotion/react/jsx-runtime").JSX.Element | undefined;
10
- export default EditRangeModal;
1
+ import { DialogProps } from '../../elements/DialogManager';
2
+ export declare function EditRangeModal(props: DialogProps<string>): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,81 +1,53 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
+ import { Button, DialogBody, DialogFooter } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
5
  import { v4 } from '@lukeed/uuid';
5
6
  import { Formik } from 'formik';
6
7
  import { splitPatterns, translateMultiplet } from 'nmr-processing';
7
- import { useMemo, useCallback, useRef, useEffect } from 'react';
8
+ import { useMemo, useCallback, useRef } from 'react';
8
9
  import { FaSearchPlus } from 'react-icons/fa';
9
10
  import { useChartData } from '../../context/ChartContext';
10
11
  import { useDispatch } from '../../context/DispatchContext';
11
- import Button from '../../elements/Button';
12
- import { CloseButton } from '../../elements/CloseButton';
13
- import { SaveButton } from '../../elements/SaveButton';
12
+ import { DraggableDialog } from '../../elements/DraggableDialog';
14
13
  import FormikOnChange from '../../elements/formik/FormikOnChange';
15
14
  import { usePanelPreferences } from '../../hooks/usePanelPreferences';
16
15
  import useSpectrum from '../../hooks/useSpectrum';
16
+ import useEditRangeModal from '../../panels/RangesPanel/hooks/useEditRangeModal';
17
17
  import { hasCouplingConstant } from '../../panels/extra/utilities/MultiplicityUtilities';
18
18
  import { formatNumber } from '../../utility/formatNumber';
19
19
  import SignalsContent from './forms/components/SignalsContent';
20
20
  import editRangeFormValidation from './forms/validation/EditRangeValidation';
21
21
  const styles = css `
22
- min-height: 500px;
23
- padding: 5px;
24
-
25
- button:focus {
26
- outline: none;
27
- }
28
-
29
- .header {
30
- border-bottom: 1px solid #f0f0f0;
31
- display: flex;
32
- align-items: center;
33
-
34
- .title {
35
- color: #464646;
36
- font-size: 15px;
37
- flex: 1;
38
- border-left: 1px solid #ececec;
39
- padding-left: 6px;
40
- }
41
-
42
- button {
43
- background-color: transparent;
44
- border: none;
45
- padding: 5px;
46
-
47
- svg {
48
- height: 16px;
49
- }
50
- }
51
- }
22
+ background-color: white;
52
23
 
53
24
  .tabs .tab-list {
54
25
  overflow-x: auto;
55
26
  }
56
27
  `;
57
- function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
28
+ export function EditRangeModal(props) {
29
+ const { reset, saveEditRange, zoomRange } = useEditRangeModal();
30
+ const { dialogData: rangeID, onCloseDialog } = props;
31
+ return (_jsx(InnerEditRangeModal, { onRest: (range) => {
32
+ onCloseDialog();
33
+ reset(range);
34
+ }, onSave: (range) => {
35
+ onCloseDialog();
36
+ saveEditRange(range);
37
+ }, onZoom: zoomRange, rangeID: rangeID }));
38
+ }
39
+ function InnerEditRangeModal(props) {
40
+ const { onSave, onZoom, onRest, rangeID } = props;
58
41
  const formRef = useRef(null);
59
42
  const { view: { spectra: { activeTab }, }, } = useChartData();
60
43
  const dispatch = useDispatch();
61
- const range = useRange(rangeId);
44
+ const range = useRange(rangeID);
62
45
  const originalRangeRef = useRef(range);
63
46
  const rangesPreferences = usePanelPreferences('ranges', activeTab);
64
- const handleOnZoom = useCallback(() => {
47
+ function handleOnZoom() {
65
48
  onZoom(range);
66
- }, [onZoom, range]);
67
- useEffect(() => {
68
- dispatch({
69
- type: 'SET_SELECTED_TOOL',
70
- payload: {
71
- selectedTool: 'zoom',
72
- },
73
- });
74
- if (!range) {
75
- onClose?.();
76
- }
77
- }, [activeTab, dispatch, onClose, range]);
78
- const handleOnClose = useCallback(() => {
49
+ }
50
+ function handleOnClose() {
79
51
  dispatch({
80
52
  type: 'SET_SELECTED_TOOL',
81
53
  payload: {
@@ -83,7 +55,7 @@ function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
83
55
  },
84
56
  });
85
57
  onRest(originalRangeRef.current);
86
- }, [dispatch, onRest]);
58
+ }
87
59
  const getCouplings = useCallback((couplings) => couplings
88
60
  .filter((coupling) => coupling.coupling !== '')
89
61
  .map((coupling) => {
@@ -154,7 +126,8 @@ function EditRangeModal({ onSave, onClose, onZoom, onRest, rangeId, }) {
154
126
  if (!rangesPreferences || !range) {
155
127
  return;
156
128
  }
157
- return (_jsxs("div", { css: styles, children: [_jsxs("div", { className: "header handle", children: [_jsx(Button.Action, { onClick: handleOnZoom, fill: "outline", style: { fontSize: '14' }, color: { base: '#5f5f5f', hover: 'white' }, children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { className: "title", children: ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), tooltip: "Save and Exit" }), _jsx(CloseButton, { tooltip: "Close", onClick: handleOnClose })] }), _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsContent, { range: range }), _jsx(FormikOnChange, { onChange: changeHandler })] }) })] }));
129
+ const title = ` Range and Signal edition: ${formatNumber(range?.from, rangesPreferences.from.format)} ppm to ${formatNumber(range?.to, rangesPreferences.to.format)} ppm`;
130
+ return (_jsxs(DraggableDialog, { hasBackdrop: false, canOutsideClickClose: false, style: { width: 700 }, title: title, isOpen: true, headerLeftElement: _jsx(Button, { intent: "success", style: { marginRight: '5px', borderRadius: '5px' }, icon: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }), minimal: true, onClick: handleOnZoom }), onClose: handleOnClose, placement: "top-right", children: [_jsx(DialogBody, { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: editRangeFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsx(SignalsContent, { range: range }), _jsx(FormikOnChange, { onChange: changeHandler })] }) }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button, { intent: "success", onClick: () => formRef.current.submitForm(), children: "Save and Exit" }) }) })] }));
158
131
  }
159
132
  function useRange(rangeId) {
160
133
  const { ranges } = useSpectrum({
@@ -163,4 +136,3 @@ function useRange(rangeId) {
163
136
  const index = ranges.values.findIndex((rangeRecord) => rangeRecord.id === rangeId);
164
137
  return ranges.values[index];
165
138
  }
166
- export default EditRangeModal;
@@ -1,8 +1,3 @@
1
- interface EditZoneModalProps {
2
- onSaveEditZoneModal: (value: any) => Promise<void> | null | void;
3
- onCloseEditZoneModal: () => void;
4
- onZoomEditZoneModal: (value: any) => void;
5
- rowData: any;
6
- }
7
- declare function EditZoneModal({ onSaveEditZoneModal, onCloseEditZoneModal, onZoomEditZoneModal, rowData, }: EditZoneModalProps): import("@emotion/react/jsx-runtime").JSX.Element;
8
- export default EditZoneModal;
1
+ import { DialogProps } from '../../elements/DialogManager';
2
+ import { ZoneData } from '../../panels/ZonesPanel/hooks/useMapZones';
3
+ export declare function EditZoneModal(props: DialogProps<ZoneData>): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,101 +1,84 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } 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 { Button, DialogBody, DialogFooter } from '@blueprintjs/core';
3
4
  import { css } from '@emotion/react';
4
- import { Formik } from 'formik';
5
- import { useCallback, useEffect, useMemo, useRef } from 'react';
5
+ import { yupResolver } from '@hookform/resolvers/yup';
6
+ import { FormProvider, useForm } from 'react-hook-form';
6
7
  import { FaSearchPlus } from 'react-icons/fa';
8
+ import * as Yup from 'yup';
7
9
  import DefaultPathLengths from '../../../data/constants/DefaultPathLengths';
8
- import Button from '../../elements/Button';
9
- import { CloseButton } from '../../elements/CloseButton';
10
- import { SaveButton } from '../../elements/SaveButton';
11
- import SignalsForm from './SignalsForm';
12
- import zoneFormValidation from './validation/EditZoneValidation';
13
- import isDefaultPathLength from './validation/isDefaultPathLength';
14
- const styles = css `
15
- width: 500px;
16
- height: 250px;
17
- padding: 5px;
18
-
19
- button:focus {
20
- outline: none;
21
- }
22
-
23
- .header {
24
- height: 24px;
25
- border-bottom: 1px solid #f0f0f0;
26
- display: flex;
27
- align-items: center;
28
-
29
- span {
30
- color: #464646;
31
- font-size: 15px;
32
- flex: 1;
33
- border-left: 1px solid #ececec;
34
- padding-left: 6px;
35
- }
36
-
37
- button {
38
- background-color: transparent;
39
- border: none;
40
- padding: 5px;
41
-
42
- svg {
43
- height: 16px;
44
- }
45
- }
46
- }
47
-
48
- .container {
49
- display: flex;
50
- margin: 30px 5px;
51
- }
52
- `;
53
- function EditZoneModal({ onSaveEditZoneModal = () => null, onCloseEditZoneModal = () => null, onZoomEditZoneModal = () => null, rowData, }) {
54
- const formRef = useRef(null);
55
- const handleOnZoom = useCallback(() => {
56
- onZoomEditZoneModal(rowData);
57
- }, [onZoomEditZoneModal, rowData]);
58
- useEffect(() => {
59
- handleOnZoom();
60
- }, [handleOnZoom]);
61
- const handleOnClose = useCallback(() => {
62
- onCloseEditZoneModal();
63
- }, [onCloseEditZoneModal]);
64
- const handleOnSave = useCallback((formValues) => {
10
+ import { DraggableDialog } from '../../elements/DraggableDialog';
11
+ import { useZoneActions } from '../../panels/ZonesPanel/hooks/useZoneActions';
12
+ import { SignalsForm } from './SignalsForm';
13
+ import { isDefaultPathLength } from './validation/isDefaultPathLength';
14
+ const signalSchema = Yup.object().shape({
15
+ j: Yup.object().shape({
16
+ pathLength: Yup.object().shape({
17
+ from: Yup.number().required().positive().integer(),
18
+ to: Yup.number().required().positive().integer(),
19
+ }),
20
+ }),
21
+ });
22
+ const zoneFormValidation = Yup.object().shape({
23
+ activeTab: Yup.string(),
24
+ signals: Yup.array()
25
+ .of(signalSchema)
26
+ .min(1, 'There must be at least one signal in a zone!'),
27
+ });
28
+ export function EditZoneModal(props) {
29
+ const { dialogData: zone, onCloseDialog } = props;
30
+ const { saveZone, zoomToZone } = useZoneActions();
31
+ function handleSave(values) {
65
32
  void (async () => {
66
- const _rowData = {
67
- ...rowData,
68
- signals: formValues.signals.map((signal) => {
69
- if (isDefaultPathLength(signal.j?.pathLength, rowData.tableMetaInfo.experiment)) {
70
- delete signal.j?.pathLength;
71
- if (signal.j && Object.keys(signal.j).length === 0) {
72
- delete signal.j;
73
- }
74
- }
75
- return signal;
76
- }),
33
+ const zoneData = {
34
+ ...zone,
35
+ signals: mapSignalsBeforeSave(values?.signals, zone.tableMetaInfo.experiment),
77
36
  };
78
- await onSaveEditZoneModal(_rowData);
79
- handleOnClose();
37
+ saveZone(zoneData);
38
+ onCloseDialog();
80
39
  })();
81
- }, [handleOnClose, onSaveEditZoneModal, rowData]);
82
- const data = useMemo(() => {
83
- return {
40
+ }
41
+ const methods = useForm({
42
+ defaultValues: {
84
43
  activeTab: '0',
85
- signals: rowData.signals.map((signal) => {
86
- return {
87
- ...signal,
88
- j: {
89
- pathLength: {
90
- from: DefaultPathLengths[rowData.tableMetaInfo.experiment]?.from || 1,
91
- to: DefaultPathLengths[rowData.tableMetaInfo.experiment]?.to || 1,
92
- },
93
- ...signal.j,
94
- },
95
- };
96
- }),
44
+ signals: mapSignals(zone),
45
+ },
46
+ resolver: yupResolver(zoneFormValidation),
47
+ });
48
+ const { handleSubmit } = methods;
49
+ return (_jsxs(DraggableDialog, { hasBackdrop: false, canOutsideClickClose: false, style: { width: 700 }, title: "Zone and Signal edition", isOpen: true, headerLeftElement: _jsx(Button, { intent: "success", style: { marginRight: '5px', borderRadius: '5px' }, icon: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }), minimal: true, onClick: () => zoomToZone(zone) }), onClose: onCloseDialog, placement: "top-right", children: [_jsx(DialogBody, { css: css `
50
+ background-color: white;
51
+ `, children: _jsx(FormProvider, { ...methods, children: _jsx(SignalsForm, {}) }) }), _jsx(DialogFooter, { children: _jsx("div", { style: { display: 'flex', flexDirection: 'row-reverse' }, children: _jsx(Button, { intent: "success", onClick: () => handleSubmit(handleSave)(), children: "Save and Exit" }) }) })] }));
52
+ }
53
+ function mapSignalsBeforeSave(signals, experiment) {
54
+ const outputSignals = [];
55
+ for (const signal of signals) {
56
+ if (isDefaultPathLength(signal.j?.pathLength, experiment)) {
57
+ delete signal.j?.pathLength;
58
+ if (signal.j && Object.keys(signal.j).length === 0) {
59
+ delete signal.j;
60
+ }
61
+ }
62
+ outputSignals.push(signal);
63
+ }
64
+ return outputSignals;
65
+ }
66
+ function mapSignals(zone) {
67
+ const outputSignals = [];
68
+ const { signals, tableMetaInfo: { experiment }, } = zone;
69
+ const { from = 1, to = 1 } = DefaultPathLengths?.[experiment] || {};
70
+ for (const signal of signals) {
71
+ const mappedSignal = {
72
+ ...signal,
73
+ j: {
74
+ pathLength: {
75
+ from,
76
+ to,
77
+ },
78
+ ...signal.j,
79
+ },
97
80
  };
98
- }, [rowData.signals, rowData.tableMetaInfo.experiment]);
99
- return (_jsx("div", { css: styles, children: _jsx(Formik, { innerRef: formRef, initialValues: data, validationSchema: zoneFormValidation, onSubmit: handleOnSave, children: _jsxs(_Fragment, { children: [_jsxs("div", { className: "header handle", children: [_jsx(Button, { onClick: handleOnZoom, className: "zoom-button", children: _jsx(FaSearchPlus, { title: "Set to default view on range in spectrum" }) }), _jsx("span", { children: `Zone and Signal edition` }), _jsx(SaveButton, { onClick: () => formRef.current.submitForm(), tooltip: "Save and exit" }), _jsx(CloseButton, { tooltip: "Close", onClick: handleOnClose })] }), _jsx(SignalsForm, {})] }) }) }));
81
+ outputSignals.push(mappedSignal);
82
+ }
83
+ return outputSignals;
100
84
  }
101
- export default EditZoneModal;
@@ -1,2 +1 @@
1
- declare function SignalsForm(): import("@emotion/react/jsx-runtime").JSX.Element;
2
- export default SignalsForm;
1
+ export declare function SignalsForm(): import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,52 +1,35 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@emotion/react/jsx-runtime";
2
2
  /** @jsxImportSource @emotion/react */
3
- import { css } from '@emotion/react';
4
- import { useFormikContext } from 'formik';
5
- import { useCallback, useMemo } from 'react';
6
- import Tab from '../../elements/Tab/Tab';
7
- import Tabs from '../../elements/Tab/Tabs';
8
- import SignalFormTab from './SignalFormTab';
9
- const textStyles = css `
10
- text-align: center;
11
- width: 100%;
12
-
13
- .error-text {
14
- color: red;
15
- }
16
- `;
17
- const tabStylesAddition = css `
18
- color: red;
19
- `;
20
- const tabStyles = css `
21
- display: inline-grid;
22
- list-style: none;
23
- padding: 0.5rem 1.5rem;
24
- `;
25
- function SignalsForm() {
26
- const { values, setFieldValue, errors, } = useFormikContext();
27
- const tabContainsErrors = useCallback((i) => {
28
- return !!errors?.signals?.[i];
29
- }, [errors]);
30
- const signalFormTabs = useMemo(() => {
31
- const signalTabs = values.signals.length > 0
32
- ? values.signals.map((signal, i) => (_jsx(Tab
33
- // eslint-disable-next-line react/no-array-index-key
34
- , { tabid: `${i}`, tabstyles: tabContainsErrors(i) ? tabStylesAddition : tabStyles, render: () => (_jsxs("div", { style: {
35
- display: 'flex',
36
- flexDirection: 'column',
37
- alignItems: 'center',
38
- fontSize: '11px',
39
- }, children: [_jsxs("span", { children: ["\uD835\uDEC5", _jsx("sub", { children: signal.x.nucleus }), ": ", signal.x.delta.toFixed(2)] }), _jsxs("span", { children: ["\uD835\uDEC5", _jsx("sub", { children: signal.y.nucleus }), ": ", signal.y.delta.toFixed(2)] })] })), children: _jsx(SignalFormTab, { signalIndex: i }) }, `signalForm_zone${i}`)))
40
- : [];
41
- return signalTabs;
42
- }, [tabContainsErrors, values.signals]);
43
- const tapClickHandler = useCallback(({ tabid }) => {
44
- setFieldValue('activeTab', tabid);
45
- }, [setFieldValue]);
46
- const handleDeleteSignal = useCallback(({ tabid }) => {
47
- const _signals = values.signals.filter((_signal, i) => i !== Number(tabid));
48
- setFieldValue('signals', _signals);
49
- }, [setFieldValue, values.signals]);
50
- return (_jsxs("div", { children: [_jsx("div", { css: textStyles }), _jsx(Tabs, { activeTab: values.activeTab, onClick: tapClickHandler, onDelete: handleDeleteSignal, children: signalFormTabs })] }));
3
+ import { Tab, Tabs } from '@blueprintjs/core';
4
+ import { useFormContext, useWatch } from 'react-hook-form';
5
+ import DefaultPathLengths from '../../../data/constants/DefaultPathLengths';
6
+ import IsotopesViewer from '../../elements/IsotopesViewer';
7
+ import Label from '../../elements/Label';
8
+ import { NumberInput2Controller } from '../../elements/NumberInput2Controller';
9
+ import { TabTitle } from '../../elements/TabTitle';
10
+ export function SignalsForm() {
11
+ const { setValue, formState: { errors }, } = useFormContext();
12
+ const { signals = [], activeTab, experimentType } = useWatch();
13
+ function handleTapChange(tabID) {
14
+ setValue('activeTab', tabID);
15
+ }
16
+ function handleDeleteSignal(index) {
17
+ const filteredSignals = signals.filter((_signal, i) => i !== index);
18
+ setValue('signals', filteredSignals);
19
+ }
20
+ return (_jsx("div", { children: _jsx(Tabs, { selectedTabId: activeTab, onChange: handleTapChange, children: signals.map((signal, index) => {
21
+ return (_jsx(Tab
22
+ // eslint-disable-next-line react/no-array-index-key
23
+ , { id: `${index}`, style: { ...(errors?.signals?.[index] && { color: 'red' }) }, panel: _jsx(SignalTab, { index: index, experimentType: experimentType }), children: _jsx(TabTitle, { onDelete: () => handleDeleteSignal(index), children: _jsx(Title, { signal: signal }) }) }, `zone-signal-${index}`));
24
+ }) }) }));
25
+ }
26
+ function SignalTab(props) {
27
+ const { index, experimentType } = props;
28
+ const { control } = useFormContext();
29
+ const { from = 1, to = 1 } = DefaultPathLengths?.[experimentType] || {};
30
+ return (_jsxs("div", { children: [_jsx("p", { children: "Setting of the minimum and maximum path length (J coupling)." }), _jsxs("div", { style: { display: 'flex', flexDirection: 'row' }, children: [_jsx(Label, { title: "Min:", children: _jsx(NumberInput2Controller, { name: `signals[${index}].j.pathLength.from`, control: control, defaultValue: from, min: 1, max: to, step: 1, majorStepSize: 1, minorStepSize: 1 }) }), _jsx(Label, { title: "Max:", style: { container: { paddingLeft: '5px' } }, children: _jsx(NumberInput2Controller, { name: `signals[${index}].j.pathLength.to`, control: control, defaultValue: to, min: from, step: 1, majorStepSize: 1, minorStepSize: 1 }) })] })] }));
31
+ }
32
+ function Title({ signal }) {
33
+ const { x, y } = signal;
34
+ return (_jsxs(_Fragment, { children: ["\uD835\uDEC5", _jsx(IsotopesViewer, { value: x.nucleus, style: { display: 'inline-block' } }), ":", x.delta.toFixed(2), " , \uD835\uDEC5", _jsx(IsotopesViewer, { value: y.nucleus, style: { display: 'inline-block' } }), ":", y.delta.toFixed(2)] }));
51
35
  }
52
- export default SignalsForm;
@@ -1,3 +1,2 @@
1
1
  import { FromTo } from 'cheminfo-types';
2
- declare function isDefaultPathLength(pathLength: FromTo, experimentType: string): boolean;
3
- export default isDefaultPathLength;
2
+ export declare function isDefaultPathLength(pathLength: FromTo, experimentType: string): boolean;
@@ -1,7 +1,5 @@
1
1
  import DefaultPathLengths from '../../../../data/constants/DefaultPathLengths';
2
- function isDefaultPathLength(pathLength, experimentType) {
3
- return (DefaultPathLengths[experimentType] &&
4
- pathLength.from === DefaultPathLengths[experimentType].from &&
5
- pathLength.to === DefaultPathLengths[experimentType].to);
2
+ export function isDefaultPathLength(pathLength, experimentType) {
3
+ const { from, to } = DefaultPathLengths?.[experimentType] || {};
4
+ return pathLength.from === from && pathLength.to === to;
6
5
  }
7
- export default isDefaultPathLength;
@@ -22,6 +22,7 @@ import PredefinedWorkspaces from '../../workspaces';
22
22
  import WorkspaceItem from './WorkspaceItem';
23
23
  import DatabasesTabContent from './settings-tabs/DatabasesTabContent';
24
24
  import DisplayTabContent from './settings-tabs/DisplayTabContent';
25
+ import { ExternalAPIsTabContent } from './settings-tabs/ExternalAPIsTabContent';
25
26
  import GeneralTabContent from './settings-tabs/GeneralTabContent';
26
27
  import ImportationFiltersTabContent from './settings-tabs/ImportationFiltersTabContent';
27
28
  import InfoBlockTabContent from './settings-tabs/InfoBlockTabContent';
@@ -65,7 +66,7 @@ function InnerGeneralSettingsModal(props) {
65
66
  defaultValues: currentWorkspace,
66
67
  resolver: yupResolver(validation),
67
68
  });
68
- const { reset, getValues } = methods;
69
+ const { reset, getValues, watch } = methods;
69
70
  const workspacesList = useMemo(() => {
70
71
  return baseWorkspaces.concat([
71
72
  {
@@ -103,6 +104,7 @@ function InnerGeneralSettingsModal(props) {
103
104
  });
104
105
  }
105
106
  }, [dispatch, preferences.workspace, workspaces, reset]);
107
+ const isExperimentalFeatures = watch('display.general.experimentalFeatures.display') || false;
106
108
  useEffect(() => {
107
109
  if (pastRef.current) {
108
110
  setWorkspaceSetting(pastRef.current);
@@ -130,7 +132,7 @@ function InnerGeneralSettingsModal(props) {
130
132
  overflow: auto;
131
133
  max-height: 100%;
132
134
  }
133
- `, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "Nuclei", id: "nuclei", panel: _jsx(NucleiTabContent, {}) }), _jsx(Tab, { title: "Panels", id: "display", panel: _jsx(DisplayTabContent, {}) }), _jsx(Tab, { title: "Tools", id: "tools", panel: _jsx(ToolsTabContent, {}) }), _jsx(Tab, { title: "Databases", id: "databases", panel: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }), _jsx(Tab, { title: "Import filters", id: "importation-filters", panel: _jsx(ImportationFiltersTabContent, {}) }), _jsx(Tab, { title: "Title block", id: "title-block", panel: _jsx(InfoBlockTabContent, {}) }), _jsx(Tab, { title: "Auto processing", id: "on-load-processing", panel: _jsx(OnLoadProcessingTabContent, {}) }), _jsx(Tab, { title: "Spectra colors", id: "spectra-colors", panel: _jsx(SpectraColorsTabContent, {}) })] }) }) }), _jsx(DialogFooter, { children: _jsx(DialogActionButtons, { onCloseDialog: onCloseDialog, onSave: onSave }) })] }) }));
135
+ `, children: [_jsx(Tab, { title: "General", id: "general", panel: _jsx(GeneralTabContent, {}) }), _jsx(Tab, { title: "Nuclei", id: "nuclei", panel: _jsx(NucleiTabContent, {}) }), _jsx(Tab, { title: "Panels", id: "display", panel: _jsx(DisplayTabContent, {}) }), _jsx(Tab, { title: "Tools", id: "tools", panel: _jsx(ToolsTabContent, {}) }), _jsx(Tab, { title: "Databases", id: "databases", panel: _jsx(DatabasesTabContent, { currentWorkspace: workspaceName, originalWorkspaces: originalWorkspaces }) }), _jsx(Tab, { title: "Import filters", id: "importation-filters", panel: _jsx(ImportationFiltersTabContent, {}) }), _jsx(Tab, { title: "Title block", id: "title-block", panel: _jsx(InfoBlockTabContent, {}) }), _jsx(Tab, { title: "Auto processing", id: "on-load-processing", panel: _jsx(OnLoadProcessingTabContent, {}) }), _jsx(Tab, { title: "Spectra colors", id: "spectra-colors", panel: _jsx(SpectraColorsTabContent, {}) }), isExperimentalFeatures && (_jsx(Tab, { title: "External APIs", id: "external-apis", panel: _jsx(ExternalAPIsTabContent, {}) }))] }) }) }), _jsx(DialogFooter, { children: _jsx(DialogActionButtons, { onCloseDialog: onCloseDialog, onSave: onSave }) })] }) }));
134
136
  }
135
137
  function WorkSpaceActionsButtons(props) {
136
138
  const { readText, rawWriteWithType, shouldFallback, cleanShouldFallback, text, } = useClipboard();
@@ -0,0 +1 @@
1
+ export declare function ExternalAPIsTabContent(): import("react/jsx-runtime").JSX.Element;