nmrium 2.8.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/SVGContent1D.js +3 -3
- package/lib/component/1d/SVGContent1D.js.map +1 -1
- package/lib/component/1d/inset/DraggableInset.d.ts +1 -1
- package/lib/component/1d/inset/DraggableInset.d.ts.map +1 -1
- package/lib/component/1d/inset/DraggableInset.js.map +1 -1
- package/lib/component/1d/inset/InsetProvider.d.ts +1 -1
- package/lib/component/1d/inset/InsetProvider.d.ts.map +1 -1
- package/lib/component/1d/inset/InsetProvider.js.map +1 -1
- package/lib/component/1d/inset/SpectraInsets.d.ts +0 -23
- package/lib/component/1d/inset/SpectraInsets.d.ts.map +1 -1
- package/lib/component/1d/inset/SpectraInsets.js +1 -1
- package/lib/component/1d/inset/SpectraInsets.js.map +1 -1
- package/lib/component/1d/peaks/PeakEditionManager.d.ts +1 -1
- package/lib/component/1d/peaks/PeakEditionManager.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeaksShapes.d.ts +1 -2
- package/lib/component/1d/peaks/PeaksShapes.d.ts.map +1 -1
- package/lib/component/1d/peaks/PeaksShapes.js +31 -17
- package/lib/component/1d/peaks/PeaksShapes.js.map +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts +1 -2
- package/lib/component/1d/peaks/usePeakShapesPath.d.ts.map +1 -1
- package/lib/component/1d/peaks/usePeakShapesPath.js +2 -3
- package/lib/component/1d/peaks/usePeakShapesPath.js.map +1 -1
- package/lib/component/1d/plugin_chart_brush_tracker.js +1 -1
- package/lib/component/1d/plugin_chart_brush_tracker.js.map +1 -1
- package/lib/component/1d/plugin_svg_chart.d.ts +1 -1
- package/lib/component/1d/plugin_svg_chart.d.ts.map +1 -1
- package/lib/component/1d/plugin_svg_chart.js +16 -11
- package/lib/component/1d/plugin_svg_chart.js.map +1 -1
- package/lib/component/1d-2d/tools/CursorToolIcon.d.ts.map +1 -1
- package/lib/component/1d-2d/tools/CursorToolIcon.js +23 -6
- package/lib/component/1d-2d/tools/CursorToolIcon.js.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts +1 -1
- package/lib/component/EventsTrackers/KeysListenerTracker.d.ts.map +1 -1
- package/lib/component/context/LoggerContext.js +1 -1
- package/lib/component/context/LoggerContext.js.map +1 -1
- package/lib/component/context/ScaleContext.d.ts +1 -1
- package/lib/component/context/ScaleContext.d.ts.map +1 -1
- package/lib/component/context/ScaleContext.js.map +1 -1
- package/lib/component/context/processings_mutations_context.api.d.ts +3 -2
- package/lib/component/context/processings_mutations_context.api.d.ts.map +1 -1
- package/lib/component/context/processings_mutations_context.api.js +82 -10
- package/lib/component/context/processings_mutations_context.api.js.map +1 -1
- package/lib/component/elements/Anchor.d.ts +1 -1
- package/lib/component/elements/Anchor.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.js.map +1 -1
- package/lib/component/elements/EditableColumn.d.ts +6 -2
- package/lib/component/elements/EditableColumn.d.ts.map +1 -1
- package/lib/component/elements/EditableColumn.js +35 -25
- package/lib/component/elements/EditableColumn.js.map +1 -1
- package/lib/component/elements/ResizerWithScale.js +1 -1
- package/lib/component/elements/ResizerWithScale.js.map +1 -1
- package/lib/component/elements/export/ExportManager.d.ts +1 -1
- package/lib/component/elements/export/ExportManager.d.ts.map +1 -1
- package/lib/component/elements/export/ExportManager.js.map +1 -1
- package/lib/component/elements/tanstack_table/table.js +1 -1
- package/lib/component/elements/tanstack_table/table.js.map +1 -1
- package/lib/component/header/Header.js +1 -1
- package/lib/component/header/Header.js.map +1 -1
- package/lib/component/hooks/reduce2DSpectrum.js +1 -1
- package/lib/component/hooks/useCombinedRefs.d.ts +2 -2
- package/lib/component/hooks/useCombinedRefs.d.ts.map +1 -1
- package/lib/component/hooks/useCombinedRefs.js +1 -1
- package/lib/component/hooks/useCombinedRefs.js.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +1 -1
- package/lib/component/hooks/useSaveSettings.js.map +1 -1
- package/lib/component/hooks/use_axis_unit.d.ts +3 -3
- package/lib/component/main/InnerNMRiumContents.d.ts +4 -4
- package/lib/component/main/InnerNMRiumContents.d.ts.map +1 -1
- package/lib/component/main/NMRium.d.ts +1 -1
- package/lib/component/main/NMRium.d.ts.map +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts +1 -1
- package/lib/component/main/NMRiumRefAPI.d.ts.map +1 -1
- package/lib/component/main/NMRiumRefAPI.js.map +1 -1
- package/lib/component/main/NMRiumStateProvider.d.ts.map +1 -1
- package/lib/component/main/NMRiumStateProvider.js +4 -2
- package/lib/component/main/NMRiumStateProvider.js.map +1 -1
- package/lib/component/main/NMRiumViewer.d.ts +1 -1
- package/lib/component/main/NMRiumViewer.d.ts.map +1 -1
- package/lib/component/main/NMRiumViewerWrapper.d.ts +1 -1
- package/lib/component/main/NMRiumViewerWrapper.d.ts.map +1 -1
- package/lib/component/main/types.d.ts +2 -2
- package/lib/component/main/types.d.ts.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/ImportPublicationStringModal.js +5 -0
- package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
- package/lib/component/modal/changeSum/SelectMolecule.js +2 -2
- package/lib/component/modal/changeSum/SelectMolecule.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +81 -81
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +81 -81
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +81 -81
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +9 -9
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.fields.d.ts +2 -2
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +54 -54
- package/lib/component/modal/setting/tanstack_general_settings/validation/auto_processing_tab_validation.d.ts +28 -28
- package/lib/component/modal/setting/tanstack_general_settings/validation/export_tab_validation.d.ts +10 -10
- package/lib/component/modal/setting/tanstack_general_settings/validation/general_tab_validation.d.ts +6 -6
- package/lib/component/modal/setting/tanstack_general_settings/validation/import_filters_tab_validation.d.ts +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/validation.d.ts +27 -27
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js +1 -1
- package/lib/component/panels/AutomaticAssignment/useAutoAssignments.js.map +1 -1
- package/lib/component/panels/IntegralsPanel/IntegralsPreferences.d.ts +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts +1 -0
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.d.ts.map +1 -1
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js +30 -6
- package/lib/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.d.ts +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.d.ts.map +1 -1
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js +33 -2
- package/lib/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.js.map +1 -1
- package/lib/component/panels/SpectraPanel/SpectraPreferences.d.ts +1 -1
- package/lib/component/panels/SpectraPanel/SpectrumListPanel.js +1 -1
- package/lib/component/panels/SpectraPanel/SpectrumListPanel.js.map +1 -1
- package/lib/component/panels/ZonesPanel/ZonesPreferences.d.ts +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.d.ts +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/FiltersSectionsPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrection.d.ts +2 -2
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrection.js +2 -2
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrection.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.d.ts +2 -2
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js +2 -2
- package/lib/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings/processing_item.js +1 -1
- package/lib/component/panels/filtersPanel/processings/processing_item.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings/use_live_edit.d.ts +2 -6
- package/lib/component/panels/filtersPanel/processings/use_live_edit.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/processings/use_live_edit.js +9 -9
- package/lib/component/panels/filtersPanel/processings/use_live_edit.js.map +1 -1
- package/lib/component/reducer/Reducer.d.ts +5 -6
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +1 -1
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/InsetActions.d.ts +1 -2
- package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/InsetActions.js +4 -5
- package/lib/component/reducer/actions/InsetActions.js.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +1 -0
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +33 -11
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/processings_actions.d.ts +1 -0
- package/lib/component/reducer/actions/processings_actions.d.ts.map +1 -1
- package/lib/component/reducer/actions/processings_actions.js +4 -2
- package/lib/component/reducer/actions/processings_actions.js.map +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
- package/lib/component/reducer/helper/ZoomHistoryManager.d.ts.map +1 -1
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js +1 -1
- package/lib/component/reducer/helper/removeSpectrumRelatedObjectsById.js.map +1 -1
- package/lib/component/utility/core_slots/core_operator_chart_mouse_icon.d.ts +9 -0
- package/lib/component/utility/core_slots/core_operator_chart_mouse_icon.d.ts.map +1 -0
- package/lib/component/utility/core_slots/core_operator_chart_mouse_icon.js +14 -0
- package/lib/component/utility/core_slots/core_operator_chart_mouse_icon.js.map +1 -0
- package/lib/component/utility/core_slots/core_operator_expanded.d.ts +1 -1
- package/lib/component/utility/core_slots/core_operator_expanded.d.ts.map +1 -1
- package/lib/component/utility/core_slots/core_slot.d.ts +1 -1
- package/lib/component/utility/core_slots/core_slot.d.ts.map +1 -1
- package/lib/component/utility/filterDatabaseInfoEntry.js +1 -1
- package/lib/component/utility/filterDatabaseInfoEntry.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js +2 -0
- package/lib/data/data1d/Spectrum1D/initiateDatum1D.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignals.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/contours.js +2 -2
- package/lib/data/data2d/Spectrum2D/get2DColor.js +5 -5
- package/lib/data/data2d/Spectrum2D/get2DColor.js.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.d.ts.map +1 -1
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js +2 -0
- package/lib/data/data2d/Spectrum2D/initiateDatum2D.js.map +1 -1
- package/lib/utils/clipboard/clipboardComponents.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +34 -35
- package/src/component/1d/SVGContent1D.tsx +3 -3
- package/src/component/1d/inset/DraggableInset.tsx +2 -1
- package/src/component/1d/inset/InsetProvider.tsx +1 -2
- package/src/component/1d/inset/SpectraInsets.tsx +1 -32
- package/src/component/1d/peaks/PeaksShapes.tsx +62 -40
- package/src/component/1d/peaks/usePeakShapesPath.ts +2 -4
- package/src/component/1d/plugin_chart_brush_tracker.tsx +1 -1
- package/src/component/1d/plugin_svg_chart.tsx +26 -15
- package/src/component/1d-2d/tools/CursorToolIcon.tsx +38 -16
- package/src/component/EventsTrackers/BrushTracker.tsx +1 -4
- package/src/component/EventsTrackers/KeysListenerTracker.tsx +1 -1
- package/src/component/context/LoggerContext.tsx +1 -1
- package/src/component/context/ScaleContext.tsx +2 -1
- package/src/component/context/processings_mutations_context.api.ts +115 -17
- package/src/component/elements/Anchor.tsx +1 -1
- package/src/component/elements/DraggableDialog.tsx +2 -2
- package/src/component/elements/EditableColumn.tsx +93 -63
- package/src/component/elements/ResizerWithScale.tsx +1 -1
- package/src/component/elements/export/ExportManager.tsx +1 -1
- package/src/component/elements/tanstack_table/table.tsx +1 -1
- package/src/component/header/Header.tsx +1 -1
- package/src/component/hooks/reduce2DSpectrum.ts +1 -1
- package/src/component/hooks/useCombinedRefs.ts +3 -3
- package/src/component/hooks/useSaveSettings.tsx +1 -1
- package/src/component/main/InnerNMRiumContents.tsx +4 -4
- package/src/component/main/NMRiumRefAPI.ts +1 -1
- package/src/component/main/NMRiumStateProvider.tsx +4 -2
- package/src/component/main/NMRiumViewer.tsx +1 -1
- package/src/component/main/NMRiumViewerWrapper.tsx +1 -1
- package/src/component/main/types.ts +3 -3
- package/src/component/modal/ImportPublicationStringModal.tsx +7 -0
- package/src/component/modal/changeSum/SelectMolecule.tsx +2 -2
- package/src/component/panels/AutomaticAssignment/useAutoAssignments.ts +1 -1
- package/src/component/panels/MoleculesPanel/hooks/useExtractAtomAssignmentLabel.ts +40 -8
- package/src/component/panels/RangesPanel/TableColumns/SignalAssignmentColumn.tsx +52 -2
- package/src/component/panels/SpectraPanel/SpectrumListPanel.tsx +1 -1
- package/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +1 -1
- package/src/component/panels/filtersPanel/Filters/hooks/usePhaseCorrection.tsx +2 -2
- package/src/component/panels/filtersPanel/Filters/hooks/usePhaseCorrectionTwoDimensions.tsx +2 -2
- package/src/component/panels/filtersPanel/processings/processing_item.tsx +1 -1
- package/src/component/panels/filtersPanel/processings/use_live_edit.ts +9 -17
- package/src/component/reducer/Reducer.ts +7 -4
- package/src/component/reducer/actions/InsetActions.ts +7 -9
- package/src/component/reducer/actions/RangesActions.ts +78 -20
- package/src/component/reducer/actions/processings_actions.ts +5 -2
- package/src/component/reducer/helper/ZoomHistoryManager.ts +1 -1
- package/src/component/reducer/helper/removeSpectrumRelatedObjectsById.ts +1 -1
- package/src/component/utility/core_slots/core_operator_chart_mouse_icon.tsx +32 -0
- package/src/component/utility/filterDatabaseInfoEntry.ts +1 -1
- package/src/data/data1d/Spectrum1D/initiateDatum1D.ts +3 -0
- package/src/data/data2d/Spectrum2D/contours.ts +2 -2
- package/src/data/data2d/Spectrum2D/get2DColor.ts +5 -5
- package/src/data/data2d/Spectrum2D/initiateDatum2D.ts +4 -0
- package/src/utils/clipboard/clipboardComponents.tsx +5 -5
- package/src/versionInfo.ts +1 -1
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { InputGroupProps } from '@blueprintjs/core';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
import type { CSSProperties, KeyboardEvent,
|
|
3
|
+
import type { CSSProperties, KeyboardEvent, ReactNode } from 'react';
|
|
4
4
|
import {
|
|
5
|
+
createContext,
|
|
5
6
|
forwardRef,
|
|
7
|
+
isValidElement,
|
|
6
8
|
useCallback,
|
|
9
|
+
useContext,
|
|
7
10
|
useEffect,
|
|
8
11
|
useImperativeHandle,
|
|
12
|
+
useRef,
|
|
9
13
|
useState,
|
|
10
14
|
} from 'react';
|
|
11
15
|
|
|
@@ -53,12 +57,16 @@ function extractNumber(val: string | number, type: string) {
|
|
|
53
57
|
return val;
|
|
54
58
|
}
|
|
55
59
|
|
|
56
|
-
function handleMousedown(event: MouseEvent) {
|
|
57
|
-
event.stopPropagation();
|
|
58
|
-
}
|
|
59
|
-
|
|
60
60
|
const style: CSSProperties = { minWidth: 60 };
|
|
61
61
|
const className = 'editable-column';
|
|
62
|
+
const CloseEditContext = createContext<(() => void) | undefined>(undefined);
|
|
63
|
+
|
|
64
|
+
export function CloseEditOnClick(props: { children: ReactNode }) {
|
|
65
|
+
const { children } = props;
|
|
66
|
+
const closeEdit = useContext(CloseEditContext);
|
|
67
|
+
|
|
68
|
+
return <span onClick={closeEdit}>{children}</span>;
|
|
69
|
+
}
|
|
62
70
|
|
|
63
71
|
interface BaseEditableColumnProps {
|
|
64
72
|
type: 'number' | 'text';
|
|
@@ -66,7 +74,8 @@ interface BaseEditableColumnProps {
|
|
|
66
74
|
validate?: (value: string | number) => boolean;
|
|
67
75
|
}
|
|
68
76
|
|
|
69
|
-
export interface EditableColumnProps
|
|
77
|
+
export interface EditableColumnProps
|
|
78
|
+
extends BaseEditableColumnProps, Pick<InputGroupProps, 'rightElement'> {
|
|
70
79
|
onSave?: (value: string | number) => void;
|
|
71
80
|
onEditStart?: (element: boolean) => void;
|
|
72
81
|
editStatus?: boolean;
|
|
@@ -91,6 +100,7 @@ export const EditableColumn = forwardRef(function EditableColumn(
|
|
|
91
100
|
onEditStart,
|
|
92
101
|
editStatus = false,
|
|
93
102
|
validate,
|
|
103
|
+
rightElement,
|
|
94
104
|
textOverflowEllipses = false,
|
|
95
105
|
clickType = 'single',
|
|
96
106
|
} = props;
|
|
@@ -109,17 +119,7 @@ export const EditableColumn = forwardRef(function EditableColumn(
|
|
|
109
119
|
},
|
|
110
120
|
}));
|
|
111
121
|
|
|
112
|
-
const mouseClickCallback = useCallback((e: globalThis.MouseEvent) => {
|
|
113
|
-
if (!(e.target as HTMLInputElement).classList.contains('editable-column')) {
|
|
114
|
-
enableEdit(false);
|
|
115
|
-
// TODO: refactor this
|
|
116
|
-
// eslint-disable-next-line react-hooks/immutability
|
|
117
|
-
globalThis.removeEventListener('mousedown', mouseClickCallback);
|
|
118
|
-
}
|
|
119
|
-
}, []);
|
|
120
|
-
|
|
121
122
|
function startEditHandler() {
|
|
122
|
-
globalThis.addEventListener('mousedown', mouseClickCallback);
|
|
123
123
|
onEditStart?.(true);
|
|
124
124
|
enableEdit(true);
|
|
125
125
|
}
|
|
@@ -127,12 +127,10 @@ export const EditableColumn = forwardRef(function EditableColumn(
|
|
|
127
127
|
function onConfirm(value: string | number) {
|
|
128
128
|
onSave?.(value);
|
|
129
129
|
enableEdit(false);
|
|
130
|
-
globalThis.removeEventListener('mousedown', mouseClickCallback);
|
|
131
130
|
}
|
|
132
131
|
|
|
133
132
|
function onCancel() {
|
|
134
133
|
enableEdit(false);
|
|
135
|
-
globalThis.removeEventListener('mousedown', mouseClickCallback);
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
let clickHandler = {};
|
|
@@ -165,6 +163,7 @@ export const EditableColumn = forwardRef(function EditableColumn(
|
|
|
165
163
|
onConfirm={onConfirm}
|
|
166
164
|
onCancel={onCancel}
|
|
167
165
|
validate={validate}
|
|
166
|
+
rightElement={rightElement}
|
|
168
167
|
/>
|
|
169
168
|
</div>
|
|
170
169
|
)}
|
|
@@ -175,21 +174,52 @@ export const EditableColumn = forwardRef(function EditableColumn(
|
|
|
175
174
|
interface EditFieldProps extends BaseEditableColumnProps {
|
|
176
175
|
onConfirm: (value: string | number) => void;
|
|
177
176
|
onCancel: (event?: KeyboardEvent<HTMLInputElement>) => void;
|
|
177
|
+
rightElement?: ReactNode;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
function EditField(props: EditFieldProps) {
|
|
181
|
-
const {
|
|
181
|
+
const {
|
|
182
|
+
value: externalValue,
|
|
183
|
+
type,
|
|
184
|
+
onConfirm,
|
|
185
|
+
onCancel,
|
|
186
|
+
validate,
|
|
187
|
+
rightElement,
|
|
188
|
+
} = props;
|
|
182
189
|
|
|
183
190
|
const [isValid, setValid] = useState<boolean>(true);
|
|
184
191
|
const [value, setVal] = useState(() => extractNumber(externalValue, type));
|
|
192
|
+
const editFieldRef = useRef<HTMLDivElement>(null);
|
|
193
|
+
const closeEdit = useCallback(() => onCancel(), [onCancel]);
|
|
185
194
|
|
|
186
|
-
|
|
195
|
+
const confirmValue = useCallback(() => {
|
|
187
196
|
const valid = typeof validate === 'function' ? validate(value) : true;
|
|
188
197
|
setValid(valid);
|
|
189
|
-
|
|
190
|
-
if (valid && ['Enter', 'Tab'].includes(event.key)) {
|
|
198
|
+
if (valid) {
|
|
191
199
|
onConfirm(value);
|
|
192
200
|
}
|
|
201
|
+
}, [onConfirm, validate, value]);
|
|
202
|
+
|
|
203
|
+
useEffect(() => {
|
|
204
|
+
function handleOutsideMouseDown(event: globalThis.MouseEvent) {
|
|
205
|
+
if (
|
|
206
|
+
!(event.target instanceof Node) ||
|
|
207
|
+
!editFieldRef.current?.contains(event.target)
|
|
208
|
+
) {
|
|
209
|
+
confirmValue();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
globalThis.addEventListener('mousedown', handleOutsideMouseDown);
|
|
214
|
+
return () =>
|
|
215
|
+
globalThis.removeEventListener('mousedown', handleOutsideMouseDown);
|
|
216
|
+
}, [confirmValue]);
|
|
217
|
+
|
|
218
|
+
function handleKeydown(event: KeyboardEvent<HTMLInputElement>) {
|
|
219
|
+
// when press Enter or Tab
|
|
220
|
+
if (['Enter', 'Tab'].includes(event.key)) {
|
|
221
|
+
confirmValue();
|
|
222
|
+
}
|
|
193
223
|
// close edit mode if press Enter, Tab or Escape
|
|
194
224
|
if (['Escape'].includes(event.key)) {
|
|
195
225
|
onCancel(event);
|
|
@@ -201,52 +231,52 @@ function EditField(props: EditFieldProps) {
|
|
|
201
231
|
}
|
|
202
232
|
|
|
203
233
|
const intent = !isValid ? 'danger' : 'none';
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
variant="minimal"
|
|
208
|
-
icon="cross"
|
|
209
|
-
onMouseDown={handleMousedown}
|
|
210
|
-
onClick={() => onCancel()}
|
|
211
|
-
/>
|
|
212
|
-
);
|
|
234
|
+
const inputRightElement = isValidElement(rightElement)
|
|
235
|
+
? rightElement
|
|
236
|
+
: undefined;
|
|
213
237
|
|
|
214
238
|
if (type === 'number') {
|
|
215
239
|
return (
|
|
216
|
-
<
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
240
|
+
<CloseEditContext.Provider value={closeEdit}>
|
|
241
|
+
<div ref={editFieldRef}>
|
|
242
|
+
<NumberInput2
|
|
243
|
+
intent={intent}
|
|
244
|
+
style={style}
|
|
245
|
+
autoSelect
|
|
246
|
+
className={className}
|
|
247
|
+
value={value}
|
|
248
|
+
onValueChange={(valueAsNumber, valueString) =>
|
|
249
|
+
handleChange(valueString ?? Number(valueString))
|
|
250
|
+
}
|
|
251
|
+
onKeyDown={handleKeydown}
|
|
252
|
+
size="small"
|
|
253
|
+
fill
|
|
254
|
+
buttonPosition="none"
|
|
255
|
+
stepSize={0.1}
|
|
256
|
+
minorStepSize={0.01}
|
|
257
|
+
majorStepSize={1}
|
|
258
|
+
rightElement={inputRightElement}
|
|
259
|
+
/>
|
|
260
|
+
</div>
|
|
261
|
+
</CloseEditContext.Provider>
|
|
235
262
|
);
|
|
236
263
|
}
|
|
237
264
|
|
|
238
265
|
return (
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
266
|
+
<CloseEditContext.Provider value={closeEdit}>
|
|
267
|
+
<div ref={editFieldRef}>
|
|
268
|
+
<Input2
|
|
269
|
+
intent={intent}
|
|
270
|
+
style={style}
|
|
271
|
+
autoSelect
|
|
272
|
+
className={className}
|
|
273
|
+
value={value as string}
|
|
274
|
+
onChange={(value) => handleChange(value)}
|
|
275
|
+
onKeyDown={handleKeydown}
|
|
276
|
+
size="small"
|
|
277
|
+
rightElement={inputRightElement}
|
|
278
|
+
/>
|
|
279
|
+
</div>
|
|
280
|
+
</CloseEditContext.Provider>
|
|
251
281
|
);
|
|
252
282
|
}
|
|
@@ -21,7 +21,7 @@ export function ResizerWithScale(props: ResizerWithScaleProps) {
|
|
|
21
21
|
const x2 = scaleX()(from);
|
|
22
22
|
const x1 = scaleX()(to);
|
|
23
23
|
const [position, setPosition] = useState({ x1, x2 });
|
|
24
|
-
const startPositionRef = useRef<Position>();
|
|
24
|
+
const startPositionRef = useRef<Position>(undefined);
|
|
25
25
|
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
const x2 = scaleX()(from);
|
|
@@ -33,7 +33,7 @@ interface ExportManagerState {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const ExportManagerContext =
|
|
36
|
-
createContext<RefObject<ExportManagerState> | null>(null);
|
|
36
|
+
createContext<RefObject<ExportManagerState | null> | null>(null);
|
|
37
37
|
|
|
38
38
|
export function useExportManagerAPI() {
|
|
39
39
|
const context = useContext(ExportManagerContext);
|
|
@@ -137,7 +137,7 @@ function TanStackTableInner<TData extends TanStackRowData>(
|
|
|
137
137
|
const isSortedEventTriggered = useRef<boolean>(false);
|
|
138
138
|
const virtualBoundary = useTanStackTableContext();
|
|
139
139
|
const [rowIndex, setRowIndex] = useState<number>();
|
|
140
|
-
const timeoutIdRef = useRef<NodeJS.Timeout>();
|
|
140
|
+
const timeoutIdRef = useRef<NodeJS.Timeout>(undefined);
|
|
141
141
|
const [isCounterVisible, setCounterVisibility] = useState(false);
|
|
142
142
|
|
|
143
143
|
const memoColumns = useMemo(() => {
|
|
@@ -274,7 +274,7 @@ function PluginTopBarTool() {
|
|
|
274
274
|
const core = useCore();
|
|
275
275
|
const stableSpectrum = useStableSpectrum();
|
|
276
276
|
const [liveOperation, setLiveOperation] = useLiveOperation();
|
|
277
|
-
const liveEdit = useLiveEdit(liveOperation);
|
|
277
|
+
const liveEdit = useLiveEdit(liveOperation?.uid);
|
|
278
278
|
const processingsMutations = useProcessingsMutations();
|
|
279
279
|
const dispatch = useDispatch();
|
|
280
280
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ForwardedRef,
|
|
1
|
+
import type { ForwardedRef, RefCallback, RefObject } from 'react';
|
|
2
2
|
import { useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
export default function useCombinedRefs<T>(
|
|
5
|
-
refs: Array<RefCallback<T> |
|
|
5
|
+
refs: Array<RefCallback<T> | RefObject<T> | ForwardedRef<T>>,
|
|
6
6
|
) {
|
|
7
|
-
const targetRef = useRef<any>();
|
|
7
|
+
const targetRef = useRef<any>(undefined);
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line react-hooks/immutability
|
|
10
10
|
useEffect(() => {
|
|
@@ -21,7 +21,7 @@ const schema = z.object({
|
|
|
21
21
|
export function useSaveSettings() {
|
|
22
22
|
const toaster = useToaster();
|
|
23
23
|
const [isOpenDialog, openDialog, closeDialog] = useOnOff(false);
|
|
24
|
-
const settingsRef = useRef<Workspace>();
|
|
24
|
+
const settingsRef = useRef<Workspace>(undefined);
|
|
25
25
|
const { current } = usePreferences();
|
|
26
26
|
|
|
27
27
|
const { saveWorkspace, addNewWorkspace } = useWorkspaceAction();
|
|
@@ -68,10 +68,10 @@ const NMRiumContainer = styled.div`
|
|
|
68
68
|
|
|
69
69
|
interface InnerNMRiumContentsProps {
|
|
70
70
|
emptyText: NMRiumProps['emptyText'];
|
|
71
|
-
mainDivRef: RefObject<HTMLDivElement>;
|
|
72
|
-
elementsWrapperRef: RefObject<HTMLDivElement>;
|
|
73
|
-
rootRef: RefObject<HTMLDivElement>;
|
|
74
|
-
viewerRef: RefObject<HTMLDivElement>;
|
|
71
|
+
mainDivRef: RefObject<HTMLDivElement | null>;
|
|
72
|
+
elementsWrapperRef: RefObject<HTMLDivElement | null>;
|
|
73
|
+
rootRef: RefObject<HTMLDivElement | null>;
|
|
74
|
+
viewerRef: RefObject<HTMLDivElement | null>;
|
|
75
75
|
apiRef: ForwardedRef<NMRiumRefAPI>;
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -17,7 +17,7 @@ export interface NMRiumRefAPI {
|
|
|
17
17
|
|
|
18
18
|
export function useNMRiumRefAPI(
|
|
19
19
|
ref: ForwardedRef<NMRiumRefAPI>,
|
|
20
|
-
rootRef: RefObject<HTMLDivElement>,
|
|
20
|
+
rootRef: RefObject<HTMLDivElement | null>,
|
|
21
21
|
) {
|
|
22
22
|
const loadFiles = useLoadFiles();
|
|
23
23
|
const createNmriumZip = useCreateNmriumZip();
|
|
@@ -74,7 +74,7 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
74
74
|
view,
|
|
75
75
|
} = state;
|
|
76
76
|
|
|
77
|
-
const stateRef = useRef<NmriumState>();
|
|
77
|
+
const stateRef = useRef<NmriumState>(undefined);
|
|
78
78
|
|
|
79
79
|
const handleChange = useRef<NMRiumChangeCb | undefined>(onChange);
|
|
80
80
|
useEffect(() => {
|
|
@@ -125,7 +125,9 @@ export default function NMRiumStateProvider(props: NMRiumStateProviderProps) {
|
|
|
125
125
|
}, [preferencesState]);
|
|
126
126
|
|
|
127
127
|
const loggerRef = useRef(logger);
|
|
128
|
-
useEffect(() =>
|
|
128
|
+
useEffect(() => {
|
|
129
|
+
loggerRef.current = logger;
|
|
130
|
+
});
|
|
129
131
|
useEffect(() => {
|
|
130
132
|
const logger = loggerRef.current;
|
|
131
133
|
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
import type { NMRiumProps } from './NMRium.js';
|
|
20
20
|
|
|
21
21
|
interface NMRiumViewerProps {
|
|
22
|
-
viewerRef: RefObject<HTMLDivElement>;
|
|
22
|
+
viewerRef: RefObject<HTMLDivElement | null>;
|
|
23
23
|
style?: CSSProperties;
|
|
24
24
|
onRender?: () => void;
|
|
25
25
|
emptyText: NMRiumProps['emptyText'];
|
|
@@ -11,7 +11,7 @@ import type { NMRiumProps } from './NMRium.js';
|
|
|
11
11
|
import { NMRiumViewer } from './NMRiumViewer.js';
|
|
12
12
|
|
|
13
13
|
interface NMRiumViewerWrapperProps {
|
|
14
|
-
viewerRef: RefObject<HTMLDivElement>;
|
|
14
|
+
viewerRef: RefObject<HTMLDivElement | null>;
|
|
15
15
|
emptyText: NMRiumProps['emptyText'];
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -6,9 +6,9 @@ import type {
|
|
|
6
6
|
import type { Source } from 'file-collection';
|
|
7
7
|
import type { CorrelationData } from 'nmr-processing';
|
|
8
8
|
|
|
9
|
-
type DeepPartial<T> =
|
|
10
|
-
[P in keyof T]?: DeepPartial<T[P]
|
|
11
|
-
|
|
9
|
+
type DeepPartial<T> = T extends object
|
|
10
|
+
? { [P in keyof T]?: DeepPartial<T[P]> }
|
|
11
|
+
: T;
|
|
12
12
|
|
|
13
13
|
interface NMRiumData {
|
|
14
14
|
source?: Source;
|
|
@@ -59,6 +59,7 @@ const logHelper = createTableColumnHelper<LogEntry>();
|
|
|
59
59
|
const logColumns = [
|
|
60
60
|
logHelper.accessor('id', {
|
|
61
61
|
header: '#',
|
|
62
|
+
cell: ({ row }) => row.index,
|
|
62
63
|
meta: {
|
|
63
64
|
thStyle: {
|
|
64
65
|
width: '40px',
|
|
@@ -166,6 +167,12 @@ function InnerImportPublicationStringModal(
|
|
|
166
167
|
name="publicationText"
|
|
167
168
|
listeners={{
|
|
168
169
|
onChange: ({ value }) => {
|
|
170
|
+
loggerRef.current.clear();
|
|
171
|
+
|
|
172
|
+
if (!value) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
|
|
169
176
|
debounceChanges(value);
|
|
170
177
|
},
|
|
171
178
|
}}
|
|
@@ -73,12 +73,12 @@ export default function SelectMolecule<
|
|
|
73
73
|
|
|
74
74
|
useEffect(() => {
|
|
75
75
|
if (molecules && molecules.length > 0) {
|
|
76
|
-
const index = value
|
|
76
|
+
const index = value?.id
|
|
77
77
|
? molecules.findIndex((molecule) => molecule.id === value.id)
|
|
78
78
|
: -1;
|
|
79
79
|
setValue(index !== -1 ? index : 0);
|
|
80
80
|
}
|
|
81
|
-
}, [molecules, setValue, value]);
|
|
81
|
+
}, [molecules, setValue, value?.id]);
|
|
82
82
|
|
|
83
83
|
const onChangeMoleculeSelectionHandler = useCallback(
|
|
84
84
|
(index: number) => {
|
|
@@ -49,7 +49,7 @@ function mapSpectra(data: Spectrum[]): SpectraData[] {
|
|
|
49
49
|
export function useAutoAssignments() {
|
|
50
50
|
const dispatch = useDispatch();
|
|
51
51
|
const { data, molecules } = useChartData();
|
|
52
|
-
const originData = useRef<SpectraData[]>();
|
|
52
|
+
const originData = useRef<SpectraData[]>(undefined);
|
|
53
53
|
const toaster = useToaster();
|
|
54
54
|
const [assignments, setAssignments] = useState<AutoAssignmentsData[]>([]);
|
|
55
55
|
|
|
@@ -4,9 +4,28 @@ import { useRef } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { useTopicMolecule } from '../../../context/TopicMoleculeContext.js';
|
|
6
6
|
|
|
7
|
+
function getUniqueLabels(labels: string[]) {
|
|
8
|
+
return [...new Set(labels.map((label) => label.trim()).filter(Boolean))];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function getCustomLabels(atomData: {
|
|
12
|
+
customLabels?: string[];
|
|
13
|
+
heavyAtomsCustomLabels?: string[];
|
|
14
|
+
}) {
|
|
15
|
+
const { customLabels = [], heavyAtomsCustomLabels = [] } = atomData;
|
|
16
|
+
return customLabels.length > 0 ? customLabels : heavyAtomsCustomLabels;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function getCustomLabel(atomData: {
|
|
20
|
+
customLabels?: string[];
|
|
21
|
+
heavyAtomsCustomLabels?: string[];
|
|
22
|
+
}) {
|
|
23
|
+
return getCustomLabels(atomData).find((label) => label.trim());
|
|
24
|
+
}
|
|
25
|
+
|
|
7
26
|
export function useExtractAtomAssignmentLabel() {
|
|
8
27
|
const topicMolecule = useTopicMolecule();
|
|
9
|
-
const lastHoverAtomIdRef = useRef<DiaIDAndInfo>();
|
|
28
|
+
const lastHoverAtomIdRef = useRef<DiaIDAndInfo>(undefined);
|
|
10
29
|
|
|
11
30
|
function getLastHoverAtom() {
|
|
12
31
|
return lastHoverAtomIdRef.current;
|
|
@@ -45,16 +64,28 @@ export function useExtractAtomAssignmentLabel() {
|
|
|
45
64
|
const atomData = getTopicAtom(moleculeId, oclID, molfile);
|
|
46
65
|
if (!atomData) return;
|
|
47
66
|
|
|
48
|
-
const
|
|
49
|
-
const labels =
|
|
50
|
-
customLabels.length > 0 ? customLabels : heavyAtomsCustomLabels;
|
|
51
|
-
|
|
52
|
-
const uniqueLabels = [
|
|
53
|
-
...new Set(labels.map((l: string) => l.trim()).filter(Boolean)),
|
|
54
|
-
];
|
|
67
|
+
const uniqueLabels = getUniqueLabels(getCustomLabels(atomData));
|
|
55
68
|
return uniqueLabels.join(',');
|
|
56
69
|
}
|
|
57
70
|
|
|
71
|
+
function getAssignmentLabelByDiaIDs(diaIDs: string[]) {
|
|
72
|
+
if (!diaIDs || diaIDs.length === 0) return;
|
|
73
|
+
const moleculeObjects = Object.values(topicMolecule);
|
|
74
|
+
for (const topicMoleculeObject of moleculeObjects) {
|
|
75
|
+
const diaIDsObject = topicMoleculeObject.getDiaIDsObject();
|
|
76
|
+
|
|
77
|
+
for (const diaID of diaIDs) {
|
|
78
|
+
const atomData = diaIDsObject?.[diaID];
|
|
79
|
+
if (!atomData) continue;
|
|
80
|
+
|
|
81
|
+
const label = getCustomLabel(atomData);
|
|
82
|
+
if (label) return label;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
|
|
58
89
|
function getAssignmentLabelByHover(moleculeId: string, molfile?: string) {
|
|
59
90
|
const diaId = lastHoverAtomIdRef.current?.idCode;
|
|
60
91
|
if (!diaId) return;
|
|
@@ -66,6 +97,7 @@ export function useExtractAtomAssignmentLabel() {
|
|
|
66
97
|
|
|
67
98
|
return {
|
|
68
99
|
getAssignmentLabelByHover,
|
|
100
|
+
getAssignmentLabelByDiaIDs,
|
|
69
101
|
getAssignmentLabelById,
|
|
70
102
|
onAtomHover,
|
|
71
103
|
getLastHoverAtom,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
import { Button } from 'react-science/ui';
|
|
2
|
+
|
|
1
3
|
import { useDispatch } from '../../../context/DispatchContext.js';
|
|
2
4
|
import type { EditableColumnProps } from '../../../elements/EditableColumn.js';
|
|
3
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
CloseEditOnClick,
|
|
7
|
+
EditableColumn,
|
|
8
|
+
} from '../../../elements/EditableColumn.js';
|
|
9
|
+
import { useExtractAtomAssignmentLabel } from '../../MoleculesPanel/hooks/useExtractAtomAssignmentLabel.js';
|
|
4
10
|
import type { BaseRangeColumnProps, OnHoverEvent } from '../RangesTableRow.js';
|
|
5
11
|
|
|
6
12
|
interface SignalAssignmentColumnProps
|
|
@@ -14,6 +20,8 @@ export function SignalAssignmentColumn(props: SignalAssignmentColumnProps) {
|
|
|
14
20
|
const { row, onHover } = props;
|
|
15
21
|
const dispatch = useDispatch();
|
|
16
22
|
const signal = row.tableMetaInfo.signal;
|
|
23
|
+
const { getAssignmentLabelByDiaIDs } = useExtractAtomAssignmentLabel();
|
|
24
|
+
const assignmentLabel = signal?.assignment || '';
|
|
17
25
|
|
|
18
26
|
const saveHandler: EditableColumnProps['onSave'] = (value) => {
|
|
19
27
|
dispatch({
|
|
@@ -26,14 +34,56 @@ export function SignalAssignmentColumn(props: SignalAssignmentColumnProps) {
|
|
|
26
34
|
});
|
|
27
35
|
};
|
|
28
36
|
|
|
37
|
+
function handleAssignmentLabel() {
|
|
38
|
+
if (!signal?.diaIDs || signal.diaIDs.length === 0) return;
|
|
39
|
+
|
|
40
|
+
const isAutoAssignment = !signal.isAutoAssignment;
|
|
41
|
+
const { id, diaIDs } = signal;
|
|
42
|
+
let { assignment = '' } = signal;
|
|
43
|
+
|
|
44
|
+
if (isAutoAssignment) {
|
|
45
|
+
const autoLabel = getAssignmentLabelByDiaIDs(diaIDs);
|
|
46
|
+
if (!autoLabel) return;
|
|
47
|
+
assignment = autoLabel;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
dispatch({
|
|
51
|
+
type: 'CHANGE_1D_SIGNAL_ASSIGNMENT_LABEL',
|
|
52
|
+
payload: {
|
|
53
|
+
value: assignment,
|
|
54
|
+
rangeId: row.id,
|
|
55
|
+
signalId: id,
|
|
56
|
+
isAutoAssignment,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const hasLink = signal?.diaIDs && signal.diaIDs.length > 0;
|
|
62
|
+
|
|
29
63
|
return (
|
|
30
64
|
<td {...onHover}>
|
|
31
65
|
<EditableColumn
|
|
32
|
-
value={
|
|
66
|
+
value={assignmentLabel}
|
|
33
67
|
onSave={saveHandler}
|
|
34
68
|
style={{ padding: '0.1rem 0.4rem' }}
|
|
35
69
|
type="text"
|
|
36
70
|
clickType={signal ? 'single' : 'none'}
|
|
71
|
+
rightElement={
|
|
72
|
+
<CloseEditOnClick>
|
|
73
|
+
<Button
|
|
74
|
+
variant="minimal"
|
|
75
|
+
icon={signal?.isAutoAssignment ? 'link' : 'unlink'}
|
|
76
|
+
|
|
77
|
+
onClick={handleAssignmentLabel}
|
|
78
|
+
disabled={!signal?.isAutoAssignment && !hasLink}
|
|
79
|
+
tooltipProps={{
|
|
80
|
+
content: signal?.isAutoAssignment
|
|
81
|
+
? 'Switch to manual assignment'
|
|
82
|
+
: 'Switch to automatic assignment',
|
|
83
|
+
}}
|
|
84
|
+
/>
|
|
85
|
+
</CloseEditOnClick>
|
|
86
|
+
}
|
|
37
87
|
/>
|
|
38
88
|
</td>
|
|
39
89
|
);
|
|
@@ -188,7 +188,7 @@ function FiltersInner(props: FiltersInnerProps) {
|
|
|
188
188
|
|
|
189
189
|
const dispatch = useDispatch();
|
|
190
190
|
const toaster = useToaster();
|
|
191
|
-
const selectedFilterIndex = useRef<number | null>();
|
|
191
|
+
const selectedFilterIndex = useRef<number | null>(null);
|
|
192
192
|
const activeSpectrum = useActiveSpectrum();
|
|
193
193
|
|
|
194
194
|
function filterSnapShotHandler(filter: FilterEntry, index: number) {
|
|
@@ -47,8 +47,8 @@ export function usePhaseCorrection(
|
|
|
47
47
|
const [value, setValue] = useState({ ph0: 0, ph1: 0 });
|
|
48
48
|
const valueRef = useRef({ ph0: 0, ph1: 0 });
|
|
49
49
|
|
|
50
|
-
const ph0Ref = useRef<any>();
|
|
51
|
-
const ph1Ref = useRef<any>();
|
|
50
|
+
const ph0Ref = useRef<any>(undefined);
|
|
51
|
+
const ph1Ref = useRef<any>(undefined);
|
|
52
52
|
const { value: phaseCorrectionTypeItem, ...defaultSelectProps } =
|
|
53
53
|
useSelect<AlgorithmItem>({
|
|
54
54
|
defaultSelectedItem: defaultPhasingTypeItem,
|
|
@@ -46,8 +46,8 @@ export function usePhaseCorrectionTwoDimensions(filter: Filter2DEntry | null) {
|
|
|
46
46
|
const [value, setValue] = useState<PhaseOptions>(defaultPhaseOptions);
|
|
47
47
|
const valueRef = useRef<PhaseOptions>(defaultPhaseOptions);
|
|
48
48
|
|
|
49
|
-
const ph0Ref = useRef<any>();
|
|
50
|
-
const ph1Ref = useRef<any>();
|
|
49
|
+
const ph0Ref = useRef<any>(undefined);
|
|
50
|
+
const ph1Ref = useRef<any>(undefined);
|
|
51
51
|
|
|
52
52
|
const { data } = useSpectrum(emptyData) as Spectrum2D;
|
|
53
53
|
const debounceCalculation = useRef(
|
|
@@ -50,7 +50,7 @@ export function ProcessingItem(props: ProcessingItemProps) {
|
|
|
50
50
|
const isEditable = operatorUI?.isEditable;
|
|
51
51
|
const isLiveEditable = operatorUI?.isLiveEditable;
|
|
52
52
|
|
|
53
|
-
const liveEdit = useLiveEdit(operation);
|
|
53
|
+
const liveEdit = useLiveEdit(operation?.uid);
|
|
54
54
|
const [liveOperation, setLiveOperation] = useLiveOperation();
|
|
55
55
|
|
|
56
56
|
function onReorder(sourceIndex: number, targetIndex: number) {
|