From 3d0ad4fabfafef932376a4460a194a949917b1cd Mon Sep 17 00:00:00 2001 From: jobo322 Date: Mon, 7 Oct 2024 09:41:07 -0500 Subject: [PATCH 01/26] fix: typo in the type name --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index c37104d8b..0fea0a5b2 100644 --- a/package.json +++ b/package.json @@ -88,8 +88,8 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.2.0", - "nmr-processing": "^12.12.3", + "nmr-load-save": "^1.1.1", + "nmr-processing": "^13.0.0", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", @@ -150,4 +150,4 @@ "vite": "^5.4.9", "vitest": "^2.1.3" } -} +} \ No newline at end of file From 7a85c70e92e9c44bb7494ad8ec386e9ea165c4c4 Mon Sep 17 00:00:00 2001 From: jobo322 Date: Mon, 7 Oct 2024 10:51:09 -0500 Subject: [PATCH 02/26] fix: add shape to manual peak added --- src/component/reducer/actions/PeaksActions.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/component/reducer/actions/PeaksActions.ts b/src/component/reducer/actions/PeaksActions.ts index 0361845c2..07207aec5 100644 --- a/src/component/reducer/actions/PeaksActions.ts +++ b/src/component/reducer/actions/PeaksActions.ts @@ -9,6 +9,7 @@ import type { RangesViewState, } from 'nmr-load-save'; import type { Peak1D, OptionsXYAutoPeaksPicking } from 'nmr-processing'; +import { mapPeaks } from 'nmr-processing'; import { getShiftX, @@ -87,9 +88,16 @@ function handleAddPeak(draft: Draft, action: AddPeakAction) { originalX: candidatePeak.x - shiftX, x: candidatePeak.x, y: candidatePeak.y, - width: 0, + width: 0.001, + shape: { + kind: 'generalizedLorentzian', + fwhm: 1, + gamma: 0.5, + }, }; - (draft.data[index] as Spectrum1D).peaks.values.push(peak); + (draft.data[index] as Spectrum1D).peaks.values.push( + ...mapPeaks([peak], draft.data[index] as Spectrum1D), + ); } } } @@ -111,7 +119,6 @@ function handleAddPeaks(draft: Draft, action: AddPeaksAction) { const peak = getClosePeak(datumOriginal, { from, to }); const shiftX = getShiftX(draft.data[index] as Spectrum1D); - if (peak && !datumOriginal.peaks.values.some((p) => p.x === peak.x)) { const newPeak: Peak1D = { id: v4(), @@ -119,6 +126,11 @@ function handleAddPeaks(draft: Draft, action: AddPeaksAction) { x: peak.x, y: peak.y, width: 0, + shape: { + kind: 'generalizedLorentzian', + fwhm: 0.001, + gamma: 0.5, + }, }; (draft.data[index] as Spectrum1D).peaks.values.push(newPeak); } @@ -194,7 +206,6 @@ function handleAutoPeakPicking( windowFromIndex, windowToIndex, }); - datum.peaks.values = datum.peaks.values.concat(peaks); } } From 8c3947b84d639051040bb256f560114f96227c87 Mon Sep 17 00:00:00 2001 From: jobo322 Date: Mon, 7 Oct 2024 11:18:32 -0500 Subject: [PATCH 03/26] fix: apodization 1D options --- src/component/1d/ApodizationLine.tsx | 6 +-- .../Filters/hooks/useSharedApodization.tsx | 8 +++- src/component/reducer/Reducer.ts | 6 +-- .../reducer/actions/FiltersActions.ts | 44 +++++++++---------- .../constants/DefaultApodizationOptions.ts | 8 +++- 5 files changed, 40 insertions(+), 32 deletions(-) diff --git a/src/component/1d/ApodizationLine.tsx b/src/component/1d/ApodizationLine.tsx index 2cc9f306c..90728ccd8 100644 --- a/src/component/1d/ApodizationLine.tsx +++ b/src/component/1d/ApodizationLine.tsx @@ -66,10 +66,10 @@ function ApodizationLine() { options: { length, dw, - exponentialHz: + lineBroadening: gaussBroadening > 0 ? lineBroadening : -lineBroadening, - gaussianHz: gaussBroadening, - center: lineBroadeningCenter, + gaussBroadening, + lineBroadeningCenter, }, }, }, diff --git a/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx b/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx index 1dc7ff82c..7d54ee0eb 100644 --- a/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx +++ b/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx @@ -1,13 +1,17 @@ import { yupResolver } from '@hookform/resolvers/yup'; import type { - ApodizationOptions as BaseApodizationOptions, Filter, } from 'nmr-processing'; import { useCallback, useEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; import * as Yup from 'yup'; -import { defaultApodizationOptions } from '../../../../../data/constants/DefaultApodizationOptions.js'; +import type { + Apodization1DOptions as BaseApodizationOptions +} from '../../../../../data/constants/DefaultApodizationOptions.js'; +import { + defaultApodizationOptions +} from '../../../../../data/constants/DefaultApodizationOptions.js'; import { useDispatch } from '../../../../context/DispatchContext.js'; import { useSyncedFilterOptions } from '../../../../context/FilterSyncOptionsContext.js'; diff --git a/src/component/reducer/Reducer.ts b/src/component/reducer/Reducer.ts index fca24dff0..5b3a62a84 100644 --- a/src/component/reducer/Reducer.ts +++ b/src/component/reducer/Reducer.ts @@ -6,11 +6,11 @@ import type { CorrelationData } from 'nmr-correlation'; import { buildCorrelationData } from 'nmr-correlation'; import type { Spectrum, ViewState } from 'nmr-load-save'; import type { - ApodizationOptions, BaselineCorrectionZone, } from 'nmr-processing'; import type { Reducer } from 'react'; +import type { Apodization1DOptions } from '../../data/constants/DefaultApodizationOptions.js'; import type { StateMoleculeExtended } from '../../data/molecules/Molecule.js'; import type { UsedColors } from '../../types/UsedColors.js'; import type { Action } from '../context/DispatchContext.js'; @@ -169,7 +169,7 @@ export const getInitialState = (): State => ({ zones: [], livePreview: true, }, - apodizationOptions: {} as ApodizationOptions, + apodizationOptions: {} as Apodization1DOptions, twoDimensionPhaseCorrection: { activeTraceDirection: 'horizontal', addTracesToBothDirections: true, @@ -347,7 +347,7 @@ export interface State { options: any; livePreview: boolean; }; - apodizationOptions: ApodizationOptions; + apodizationOptions: Apodization1DOptions; /** * pivot point for manual phase correction * @default {value:0,index:0} diff --git a/src/component/reducer/actions/FiltersActions.ts b/src/component/reducer/actions/FiltersActions.ts index a75ac01ec..2f568cb75 100644 --- a/src/component/reducer/actions/FiltersActions.ts +++ b/src/component/reducer/actions/FiltersActions.ts @@ -10,7 +10,6 @@ import type { Spectrum2D, } from 'nmr-load-save'; import type { - ApodizationOptions, BaselineCorrectionOptions, } from 'nmr-processing'; import { @@ -20,6 +19,7 @@ import { } from 'nmr-processing'; import { defaultApodizationOptions } from '../../../data/constants/DefaultApodizationOptions.js'; +import type { Apodization1DOptions } from '../../../data/constants/DefaultApodizationOptions.js'; import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.js'; import { getProjection } from '../../../data/data2d/Spectrum2D/getMissingProjection.js'; import { isSpectrum2D } from '../../../data/data2d/Spectrum2D/index.js'; @@ -84,11 +84,11 @@ type ShiftSpectrumOptions = ShiftOneDimension | ShiftTwoDimensions; type ShiftSpectrumAction = ActionType<'SHIFT_SPECTRUM', ShiftSpectrumOptions>; type ApodizationFilterAction = ActionType< 'APPLY_APODIZATION_FILTER', - { options: ApodizationOptions } + { options: Apodization1DOptions } >; type ApodizationFilterLiveAction = ActionType< 'CALCULATE_APODIZATION_FILTER', - { options: ApodizationOptions; livePreview: boolean } + { options: Apodization1DOptions; livePreview: boolean } >; type ZeroFillingFilterAction = ActionType< 'APPLY_ZERO_FILLING_FILTER', @@ -197,15 +197,15 @@ export type FiltersActions = | SetTwoDimensionPhaseCorrectionPivotPoint | ManualTwoDimensionsPhaseCorrectionFilterAction | ActionType< - | 'APPLY_FFT_FILTER' - | 'APPLY_FFT_DIMENSION_1_FILTER' - | 'APPLY_FFT_DIMENSION_2_FILTER' - | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' - | 'APPLY_ABSOLUTE_FILTER' - | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' - | 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS' - | 'APPLY_AUTO_PHASE_CORRECTION_TOW_DIMENSION_FILTER' - >; + | 'APPLY_FFT_FILTER' + | 'APPLY_FFT_DIMENSION_1_FILTER' + | 'APPLY_FFT_DIMENSION_2_FILTER' + | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' + | 'APPLY_ABSOLUTE_FILTER' + | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' + | 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS' + | 'APPLY_AUTO_PHASE_CORRECTION_TOW_DIMENSION_FILTER' + >; function getFilterUpdateDomainRules( filterName: string, @@ -371,16 +371,16 @@ function rollbackSpectrum( const applyFilter = !filterKey ? true : [ - phaseCorrection.id, - phaseCorrectionTwoDimensions.id, - fft.id, - shiftX.id, - shift2DX.id, - shift2DY.id, - signalProcessing.id, - digitalFilter.id, - digitalFilter2D.id, - ].includes(filterKey); + phaseCorrection.id, + phaseCorrectionTwoDimensions.id, + fft.id, + shiftX.id, + shift2DX.id, + shift2DY.id, + signalProcessing.id, + digitalFilter.id, + digitalFilter2D.id, + ].includes(filterKey); beforeRollback(draft, filterKey); diff --git a/src/data/constants/DefaultApodizationOptions.ts b/src/data/constants/DefaultApodizationOptions.ts index 2092e6097..756105f20 100644 --- a/src/data/constants/DefaultApodizationOptions.ts +++ b/src/data/constants/DefaultApodizationOptions.ts @@ -1,6 +1,10 @@ -import type { ApodizationOptions } from 'nmr-processing'; +export interface Apodization1DOptions { + lineBroadening: number; + gaussBroadening: number; + lineBroadeningCenter: number; +} -export const defaultApodizationOptions: ApodizationOptions = { +export const defaultApodizationOptions: Apodization1DOptions = { lineBroadening: 1, gaussBroadening: 0, lineBroadeningCenter: 0, From 16b3b61c056a3533021fc78dd8848502ee7a954a Mon Sep 17 00:00:00 2001 From: jobo322 Date: Thu, 10 Oct 2024 10:42:18 -0500 Subject: [PATCH 04/26] chore: correct use of generalized lorentzian --- src/component/modal/EditPeakShapeModal.tsx | 18 +++++++++++++++++- .../panels/PeaksPanel/PeaksPreferences.tsx | 6 ++++++ src/component/panels/PeaksPanel/PeaksTable.tsx | 17 +++++++++++++++++ src/component/reducer/actions/PeaksActions.ts | 6 +++--- 4 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/component/modal/EditPeakShapeModal.tsx b/src/component/modal/EditPeakShapeModal.tsx index b0a53d78e..9e54472d9 100644 --- a/src/component/modal/EditPeakShapeModal.tsx +++ b/src/component/modal/EditPeakShapeModal.tsx @@ -25,7 +25,9 @@ function getKindDefaultValues(kind: Kind) { return { kind, fwhm: 500, - ...(kind === 'pseudoVoigt' && { mu: 0.5 }), + ...(kind === 'pseudoVoigt' + ? { mu: 0.5 } + : kind === 'generalizedLorentzian' && { gamma: 0.5 }), }; } function getValues(peak: Peak1D, kind: Kind): Shape { @@ -61,6 +63,10 @@ const KINDS: Array<{ label: string; value: Kind }> = [ value: 'pseudoVoigt', label: 'PseudoVoigt', }, + { + value: 'generalizedLorentzian', + label: 'Generalized Lorentzian', + }, ]; const labelStyle: LabelStyle = { @@ -148,6 +154,16 @@ function InnerEditPeakShapeModal(props: Required) { )} + {kind === 'generalizedLorentzian' && ( + + )} diff --git a/src/component/panels/PeaksPanel/PeaksPreferences.tsx b/src/component/panels/PeaksPanel/PeaksPreferences.tsx index 08b07e65e..57b9a0fa1 100644 --- a/src/component/panels/PeaksPanel/PeaksPreferences.tsx +++ b/src/component/panels/PeaksPanel/PeaksPreferences.tsx @@ -58,6 +58,12 @@ const formatFields: NucleusPreferenceField[] = [ checkFieldName: 'mu.show', formatFieldName: 'mu.format', }, + { + id: 11, + label: 'gamma :', + checkFieldName: 'gamma.show', + formatFieldName: 'gamma.format', + }, { id: 9, label: 'Delete action :', diff --git a/src/component/panels/PeaksPanel/PeaksTable.tsx b/src/component/panels/PeaksPanel/PeaksTable.tsx index 1b7baaf42..93854ea16 100644 --- a/src/component/panels/PeaksPanel/PeaksTable.tsx +++ b/src/component/panels/PeaksPanel/PeaksTable.tsx @@ -141,6 +141,23 @@ function PeaksTable({ activeTab, data, info }: PeaksTableProps) { return ''; }, }, + { + showWhen: 'gamma.show', + index: 9, + Header: 'gamma', + accessor: (row) => + (row?.shape?.kind === 'generalizedLorentzian' && row?.shape?.gamma) || + '', + Cell: ({ row }) => { + const gamma = + row.original?.shape?.kind === 'generalizedLorentzian' && + row.original?.shape?.gamma; + if (gamma) { + return formatNumber(gamma, peaksPreferences.gamma.format); + } + return ''; + }, + }, { showWhen: 'showEditPeakShapeAction', ...createActionColumn({ diff --git a/src/component/reducer/actions/PeaksActions.ts b/src/component/reducer/actions/PeaksActions.ts index 07207aec5..88c97e1f7 100644 --- a/src/component/reducer/actions/PeaksActions.ts +++ b/src/component/reducer/actions/PeaksActions.ts @@ -88,7 +88,7 @@ function handleAddPeak(draft: Draft, action: AddPeakAction) { originalX: candidatePeak.x - shiftX, x: candidatePeak.x, y: candidatePeak.y, - width: 0.001, + width: 1, shape: { kind: 'generalizedLorentzian', fwhm: 1, @@ -125,10 +125,10 @@ function handleAddPeaks(draft: Draft, action: AddPeaksAction) { originalX: peak.x - shiftX, x: peak.x, y: peak.y, - width: 0, + width: 1, shape: { kind: 'generalizedLorentzian', - fwhm: 0.001, + fwhm: 1, gamma: 0.5, }, }; From a7617a042aa3742dfeaeafcb3abf4d630fc866ed Mon Sep 17 00:00:00 2001 From: jobo322 Date: Sat, 12 Oct 2024 23:17:17 -0500 Subject: [PATCH 05/26] chore: update format apodization --- package-lock.json | 63 ++-------------------------- src/component/1d/ApodizationLine.tsx | 6 +-- 2 files changed, 7 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index 92f05b75d..139584a78 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,8 +43,8 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.2.0", - "nmr-processing": "^12.12.3", + "nmr-load-save": "^1.1.1", + "nmr-processing": "^13.0.0", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", @@ -10091,22 +10091,7 @@ "varian-converter": "^1.0.0" } }, - "node_modules/nmr-load-save/node_modules/d3-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", - "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==", - "license": "BSD-3-Clause" - }, - "node_modules/nmr-load-save/node_modules/d3-interpolate": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", - "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", - "license": "BSD-3-Clause", - "dependencies": { - "d3-color": "1 - 2" - } - }, - "node_modules/nmr-load-save/node_modules/nmr-processing": { + "node_modules/nmr-processing": { "version": "13.0.1", "resolved": "https://registry.npmjs.org/nmr-processing/-/nmr-processing-13.0.1.tgz", "integrity": "sha512-U1r4PjZzAqbrBqgBkn27jF87GoRrxRGT9zlXXVcmbf4dgcmKOCo3FGd+ZXR9VLgZVsL64BGkpM+H1EDjfglBqg==", @@ -10146,46 +10131,6 @@ "spectrum-generator": "^8.0.11" } }, - "node_modules/nmr-processing": { - "version": "12.12.3", - "resolved": "https://registry.npmjs.org/nmr-processing/-/nmr-processing-12.12.3.tgz", - "integrity": "sha512-WNJFkPYeyRhQHOFPpgcp0ZT7Os7PATGduOYHphmzUjiVePLK1KdukBRajc89FEaeoSN5af18v/BugBiIsvzqEw==", - "license": "MIT", - "dependencies": { - "@lukeed/uuid": "^2.0.1", - "@types/d3-color": "^3.1.3", - "@types/d3-interpolate": "^3.0.4", - "binary-search": "^1.3.6", - "d3-color": "^2.0.0", - "d3-interpolate": "^2.0.1", - "gyromagnetic-ratio": "^1.2.0", - "is-any-array": "^2.0.1", - "linear-sum-assignment": "^1.0.7", - "lodash.omit": "^4.5.0", - "ml-airpls": "^2.0.0", - "ml-direct": "^1.0.0", - "ml-gsd": "^12.1.6", - "ml-hclust": "^3.1.0", - "ml-levenberg-marquardt": "^4.1.3", - "ml-matrix": "^6.11.1", - "ml-matrix-convolution": "^1.0.0", - "ml-matrix-peaks-finder": "^1.0.0", - "ml-peak-shape-generator": "^4.1.2", - "ml-regression-base": "^4.0.0", - "ml-regression-exponential": "^3.0.1", - "ml-regression-polynomial": "^3.0.1", - "ml-savitzky-golay-generalized": "^4.2.0", - "ml-signal-processing": "^1.0.4", - "ml-simple-clustering": "^0.1.0", - "ml-sparse-matrix": "^2.1.0", - "ml-spectra-processing": "^14.5.1", - "ml-tree-set": "^0.1.1", - "nmr-correlation": "^2.3.3", - "numeral": "^2.0.6", - "openchemlib-utils": "^6.1.0", - "spectrum-generator": "^8.0.11" - } - }, "node_modules/nmr-processing/node_modules/d3-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", @@ -14422,4 +14367,4 @@ } } } -} +} \ No newline at end of file diff --git a/src/component/1d/ApodizationLine.tsx b/src/component/1d/ApodizationLine.tsx index 90728ccd8..2d19a994c 100644 --- a/src/component/1d/ApodizationLine.tsx +++ b/src/component/1d/ApodizationLine.tsx @@ -58,8 +58,8 @@ function ApodizationLine() { apply: false, compose: { length, - shapes: [ - { + shapes: { + lorentzToGauss: { start: 0, shape: { kind: 'lorentzToGauss', @@ -73,7 +73,7 @@ function ApodizationLine() { }, }, }, - ], + }, }, }, ); From 1654dd9bde0acf7b1a2221704633371f4ff266be Mon Sep 17 00:00:00 2001 From: jobo322 Date: Sat, 12 Oct 2024 23:52:35 -0500 Subject: [PATCH 06/26] chore: update nmr deps --- package-lock.json | 16 ++++++++-------- package.json | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 139584a78..c39b6ff1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,8 +43,8 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.1.1", - "nmr-processing": "^13.0.0", + "nmr-load-save": "^1.1.2", + "nmr-processing": "^13.0.1", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", @@ -10065,9 +10065,9 @@ } }, "node_modules/nmr-load-save": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/nmr-load-save/-/nmr-load-save-1.2.0.tgz", - "integrity": "sha512-CjfxjqV9U6DyAm/IlJ5ehaWaD9QJ3xjl2U0UZ2swlddjy/FDDz4Ym7IGDWNKpmqUhXGUck17KRSjAZRmq/ED1A==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/nmr-load-save/-/nmr-load-save-1.1.2.tgz", + "integrity": "sha512-RF91qafyZ+ZUpd6sMDf1MeheYDy/5zjusSt6wsaOsBowbSB7/5wqx/zeVW06RsRYTQF67Olrmv8symWIICcvog==", "license": "MIT", "dependencies": { "@lukeed/uuid": "^2.0.1", @@ -10084,9 +10084,9 @@ "ml-spectra-processing": "^14.6.0", "nmr-correlation": "^2.3.3", "nmr-processing": "^13.0.1", - "nmredata": "^0.9.11", - "openchemlib": "^8.15.0", - "openchemlib-utils": "^6.4.1", + "nmredata": "^0.9.10", + "openchemlib": "^8.14.0", + "openchemlib-utils": "^6.0.1", "sdf-parser": "^6.0.1", "varian-converter": "^1.0.0" } diff --git a/package.json b/package.json index 0fea0a5b2..e03b9f0ca 100644 --- a/package.json +++ b/package.json @@ -88,8 +88,8 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.1.1", - "nmr-processing": "^13.0.0", + "nmr-load-save": "^1.1.2", + "nmr-processing": "^13.0.1", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", From be5f47c79967a0988ae01b9f1742eaf2f37aa48b Mon Sep 17 00:00:00 2001 From: jobo322 Date: Sun, 13 Oct 2024 00:35:59 -0500 Subject: [PATCH 07/26] chore: include gamma --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c39b6ff1f..31d1c55d2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.1.2", + "nmr-load-save": "^1.1.3", "nmr-processing": "^13.0.1", "nmredata": "^0.9.11", "numeral": "^2.0.6", @@ -10065,9 +10065,9 @@ } }, "node_modules/nmr-load-save": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/nmr-load-save/-/nmr-load-save-1.1.2.tgz", - "integrity": "sha512-RF91qafyZ+ZUpd6sMDf1MeheYDy/5zjusSt6wsaOsBowbSB7/5wqx/zeVW06RsRYTQF67Olrmv8symWIICcvog==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/nmr-load-save/-/nmr-load-save-1.1.3.tgz", + "integrity": "sha512-dlPPbSlb0D1R0u04dBLcqqeepeSlEo6pYpL7+D3N4Wo15n8xitTLseo/JNzXr+dnFsXUGnkl2JJOvn+TyochmA==", "license": "MIT", "dependencies": { "@lukeed/uuid": "^2.0.1", diff --git a/package.json b/package.json index e03b9f0ca..802425e88 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.1.2", + "nmr-load-save": "^1.1.3", "nmr-processing": "^13.0.1", "nmredata": "^0.9.11", "numeral": "^2.0.6", From 1dac76981e281e981957afc70971e01f19f95c68 Mon Sep 17 00:00:00 2001 From: jobo322 Date: Tue, 22 Oct 2024 10:19:19 -0500 Subject: [PATCH 08/26] fix: split back apodization 2D into dimensions --- package-lock.json | 50 +++++++++++++++++++++++++++++++++++------------ package.json | 2 +- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 31d1c55d2..a7e59a430 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.1.3", + "nmr-load-save": "^1.2.2", "nmr-processing": "^13.0.1", "nmredata": "^0.9.11", "numeral": "^2.0.6", @@ -4986,19 +4986,32 @@ } }, "node_modules/brukerconverter": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/brukerconverter/-/brukerconverter-7.0.3.tgz", - "integrity": "sha512-zxZWk6BO74hFRak9TUIQhRcZjkTdvn9EuCQgbbLT6uB3lxDMxy/wTVasubIOphwioKY8N075YdqHudVaq5XN2g==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/brukerconverter/-/brukerconverter-7.0.4.tgz", + "integrity": "sha512-G8Jx2f+hV02Zvkw+nXB1MpTFJaJhsuinrt+XQv/SFjA88rWYCrxw3WIMmHx06Bp19Zw03BYMdHy0YDMpyjplbw==", "license": "MIT", "dependencies": { "cheminfo-types": "^1.7.3", "filelist-utils": "^1.11.0", "iobuffer": "^5.3.2", "is-any-array": "^2.0.1", - "jcampconverter": "^9.6.4", + "jcampconverter": "^10.0.1", "ml-spectra-processing": "^14.5.0" } }, + "node_modules/brukerconverter/node_modules/jcampconverter": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/jcampconverter/-/jcampconverter-10.0.1.tgz", + "integrity": "sha512-1yQ9Q35K2A64Q5NQ7AN/w6KbooviQAQ33Yo6p4vMFAyntR09n/OzR65CubbCogp3bVCm+pdQ3RCkfrcKqTabRQ==", + "license": "MIT", + "dependencies": { + "cheminfo-types": "^1.8.0", + "dynamic-typing": "^1.0.1", + "ensure-string": "^1.2.0", + "gyromagnetic-ratio": "^1.2.0", + "ml-array-median": "^1.1.6" + } + }, "node_modules/builtin-modules": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", @@ -10065,9 +10078,9 @@ } }, "node_modules/nmr-load-save": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/nmr-load-save/-/nmr-load-save-1.1.3.tgz", - "integrity": "sha512-dlPPbSlb0D1R0u04dBLcqqeepeSlEo6pYpL7+D3N4Wo15n8xitTLseo/JNzXr+dnFsXUGnkl2JJOvn+TyochmA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/nmr-load-save/-/nmr-load-save-1.2.2.tgz", + "integrity": "sha512-YU3835DsFleIw0tvlFrPLRyYC5XG4ppywPPJhGBehADd3vF9K8cBmU5bxr7CSa/ZljxMNHTcdUSRR7EiuvWM/w==", "license": "MIT", "dependencies": { "@lukeed/uuid": "^2.0.1", @@ -10078,19 +10091,32 @@ "filelist-utils": "^1.11.2", "gyromagnetic-ratio": "^1.2.0", "is-any-array": "^2.0.1", - "jcampconverter": "^9.6.4", + "jcampconverter": "^10.0.1", "jeolconverter": "^1.0.3", "lodash.merge": "^4.6.2", "ml-spectra-processing": "^14.6.0", "nmr-correlation": "^2.3.3", "nmr-processing": "^13.0.1", - "nmredata": "^0.9.10", - "openchemlib": "^8.14.0", - "openchemlib-utils": "^6.0.1", + "nmredata": "^0.9.11", + "openchemlib": "^8.15.0", + "openchemlib-utils": "^6.4.1", "sdf-parser": "^6.0.1", "varian-converter": "^1.0.0" } }, + "node_modules/nmr-load-save/node_modules/jcampconverter": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/jcampconverter/-/jcampconverter-10.0.1.tgz", + "integrity": "sha512-1yQ9Q35K2A64Q5NQ7AN/w6KbooviQAQ33Yo6p4vMFAyntR09n/OzR65CubbCogp3bVCm+pdQ3RCkfrcKqTabRQ==", + "license": "MIT", + "dependencies": { + "cheminfo-types": "^1.8.0", + "dynamic-typing": "^1.0.1", + "ensure-string": "^1.2.0", + "gyromagnetic-ratio": "^1.2.0", + "ml-array-median": "^1.1.6" + } + }, "node_modules/nmr-processing": { "version": "13.0.1", "resolved": "https://registry.npmjs.org/nmr-processing/-/nmr-processing-13.0.1.tgz", diff --git a/package.json b/package.json index 802425e88..4d55f0406 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "ml-tree-similarity": "^2.2.0", "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", - "nmr-load-save": "^1.1.3", + "nmr-load-save": "^1.2.2", "nmr-processing": "^13.0.1", "nmredata": "^0.9.11", "numeral": "^2.0.6", From fce8ae143b8b4d6f563f51631df63e3800c69800 Mon Sep 17 00:00:00 2001 From: jobo322 Date: Tue, 22 Oct 2024 10:42:02 -0500 Subject: [PATCH 09/26] chore: force nmr-load-save v13.0.2 --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index a7e59a430..beca7360e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", "nmr-load-save": "^1.2.2", - "nmr-processing": "^13.0.1", + "nmr-processing": "^13.0.2", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", @@ -10118,9 +10118,9 @@ } }, "node_modules/nmr-processing": { - "version": "13.0.1", - "resolved": "https://registry.npmjs.org/nmr-processing/-/nmr-processing-13.0.1.tgz", - "integrity": "sha512-U1r4PjZzAqbrBqgBkn27jF87GoRrxRGT9zlXXVcmbf4dgcmKOCo3FGd+ZXR9VLgZVsL64BGkpM+H1EDjfglBqg==", + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/nmr-processing/-/nmr-processing-13.0.2.tgz", + "integrity": "sha512-hLaObBnrIwV78nykfKdnDBw3sWU95dTbTFir7kwKFPWDTAEAoMC6LL22So0zDqAdU+8z9XzTyOWqi8qZjZZAfQ==", "license": "MIT", "dependencies": { "@lukeed/uuid": "^2.0.1", @@ -10146,14 +10146,14 @@ "ml-regression-exponential": "^3.0.1", "ml-regression-polynomial": "^3.0.1", "ml-savitzky-golay-generalized": "^4.2.0", - "ml-signal-processing": "^1.0.4", + "ml-signal-processing": "^1.1.1", "ml-simple-clustering": "^0.1.0", "ml-sparse-matrix": "^2.1.0", - "ml-spectra-processing": "^14.5.1", + "ml-spectra-processing": "^14.6.0", "ml-tree-set": "^0.1.1", "nmr-correlation": "^2.3.3", "numeral": "^2.0.6", - "openchemlib-utils": "^6.1.0", + "openchemlib-utils": "^6.4.1", "spectrum-generator": "^8.0.11" } }, diff --git a/package.json b/package.json index 4d55f0406..16d61836c 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", "nmr-load-save": "^1.2.2", - "nmr-processing": "^13.0.1", + "nmr-processing": "^13.0.2", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", From 8984793171cc1cb9c266d65be9d14d3314a496cc Mon Sep 17 00:00:00 2001 From: hamed musallam Date: Wed, 23 Oct 2024 13:37:31 +0200 Subject: [PATCH 10/26] chore: fix prettier --- package-lock.json | 2 +- .../Filters/hooks/useSharedApodization.tsx | 12 ++---- src/component/reducer/Reducer.ts | 4 +- .../reducer/actions/FiltersActions.ts | 42 +++++++++---------- 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/package-lock.json b/package-lock.json index beca7360e..6527cc04b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14393,4 +14393,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx b/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx index 7d54ee0eb..d60676c8e 100644 --- a/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx +++ b/src/component/panels/filtersPanel/Filters/hooks/useSharedApodization.tsx @@ -1,17 +1,11 @@ import { yupResolver } from '@hookform/resolvers/yup'; -import type { - Filter, -} from 'nmr-processing'; +import type { Filter } from 'nmr-processing'; import { useCallback, useEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; import * as Yup from 'yup'; -import type { - Apodization1DOptions as BaseApodizationOptions -} from '../../../../../data/constants/DefaultApodizationOptions.js'; -import { - defaultApodizationOptions -} from '../../../../../data/constants/DefaultApodizationOptions.js'; +import type { Apodization1DOptions as BaseApodizationOptions } from '../../../../../data/constants/DefaultApodizationOptions.js'; +import { defaultApodizationOptions } from '../../../../../data/constants/DefaultApodizationOptions.js'; import { useDispatch } from '../../../../context/DispatchContext.js'; import { useSyncedFilterOptions } from '../../../../context/FilterSyncOptionsContext.js'; diff --git a/src/component/reducer/Reducer.ts b/src/component/reducer/Reducer.ts index 5b3a62a84..dd905f538 100644 --- a/src/component/reducer/Reducer.ts +++ b/src/component/reducer/Reducer.ts @@ -5,9 +5,7 @@ import { produce, original } from 'immer'; import type { CorrelationData } from 'nmr-correlation'; import { buildCorrelationData } from 'nmr-correlation'; import type { Spectrum, ViewState } from 'nmr-load-save'; -import type { - BaselineCorrectionZone, -} from 'nmr-processing'; +import type { BaselineCorrectionZone } from 'nmr-processing'; import type { Reducer } from 'react'; import type { Apodization1DOptions } from '../../data/constants/DefaultApodizationOptions.js'; diff --git a/src/component/reducer/actions/FiltersActions.ts b/src/component/reducer/actions/FiltersActions.ts index 2f568cb75..0a3c2a2d8 100644 --- a/src/component/reducer/actions/FiltersActions.ts +++ b/src/component/reducer/actions/FiltersActions.ts @@ -9,9 +9,7 @@ import type { Spectrum1D, Spectrum2D, } from 'nmr-load-save'; -import type { - BaselineCorrectionOptions, -} from 'nmr-processing'; +import type { BaselineCorrectionOptions } from 'nmr-processing'; import { Filters, FiltersManager, @@ -197,15 +195,15 @@ export type FiltersActions = | SetTwoDimensionPhaseCorrectionPivotPoint | ManualTwoDimensionsPhaseCorrectionFilterAction | ActionType< - | 'APPLY_FFT_FILTER' - | 'APPLY_FFT_DIMENSION_1_FILTER' - | 'APPLY_FFT_DIMENSION_2_FILTER' - | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' - | 'APPLY_ABSOLUTE_FILTER' - | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' - | 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS' - | 'APPLY_AUTO_PHASE_CORRECTION_TOW_DIMENSION_FILTER' - >; + | 'APPLY_FFT_FILTER' + | 'APPLY_FFT_DIMENSION_1_FILTER' + | 'APPLY_FFT_DIMENSION_2_FILTER' + | 'APPLY_AUTO_PHASE_CORRECTION_FILTER' + | 'APPLY_ABSOLUTE_FILTER' + | 'APPLY_MANUAL_PHASE_CORRECTION_TOW_DIMENSION_FILTER' + | 'TOGGLE_ADD_PHASE_CORRECTION_TRACE_TO_BOTH_DIRECTIONS' + | 'APPLY_AUTO_PHASE_CORRECTION_TOW_DIMENSION_FILTER' + >; function getFilterUpdateDomainRules( filterName: string, @@ -371,16 +369,16 @@ function rollbackSpectrum( const applyFilter = !filterKey ? true : [ - phaseCorrection.id, - phaseCorrectionTwoDimensions.id, - fft.id, - shiftX.id, - shift2DX.id, - shift2DY.id, - signalProcessing.id, - digitalFilter.id, - digitalFilter2D.id, - ].includes(filterKey); + phaseCorrection.id, + phaseCorrectionTwoDimensions.id, + fft.id, + shiftX.id, + shift2DX.id, + shift2DY.id, + signalProcessing.id, + digitalFilter.id, + digitalFilter2D.id, + ].includes(filterKey); beforeRollback(draft, filterKey); From 235764d47ecf06976debb2296fdb0f0fb369656c Mon Sep 17 00:00:00 2001 From: jobo322 Date: Thu, 31 Oct 2024 09:41:45 -0500 Subject: [PATCH 11/26] chore: work in progress to new splitted FilterManages --- src/component/1d/ApodizationLine.tsx | 43 +++++------ .../header/SimpleApodizationOptionsPanel.tsx | 17 +++-- .../SimpleBaseLineCorrectionOptionsPanel.tsx | 18 +++-- src/component/hooks/useFilter.ts | 6 +- .../Filters/FiltersSectionsPanel.tsx | 14 ++-- .../Filters/hooks/useBaselineCorrection.tsx | 13 ++-- .../panels/filtersPanel/Filters/index.tsx | 15 ++-- .../reducer/actions/FiltersActions.ts | 76 +++++++++++-------- .../reducer/actions/RangesActions.ts | 9 +-- .../reducer/actions/SpectraActions.ts | 4 +- src/component/reducer/actions/ZonesActions.ts | 2 +- .../constants/DefaultApodizationOptions.ts | 16 ++-- 12 files changed, 126 insertions(+), 107 deletions(-) diff --git a/src/component/1d/ApodizationLine.tsx b/src/component/1d/ApodizationLine.tsx index 2d19a994c..bdc152778 100644 --- a/src/component/1d/ApodizationLine.tsx +++ b/src/component/1d/ApodizationLine.tsx @@ -1,5 +1,5 @@ -import type { Spectrum1D } from 'nmr-load-save'; -import { apodization, Filters } from 'nmr-processing'; +import { Spectrum1D } from 'nmr-load-save'; +import { Filters1D, createApodizationWindowData } from 'nmr-processing'; import { defaultApodizationOptions } from '../../data/constants/DefaultApodizationOptions.js'; import { useChartData } from '../context/ChartContext.js'; @@ -39,44 +39,37 @@ function ApodizationLine() { const xyReduce = useXYReduce(XYReducerDomainAxis.XAxis); const scaleY = useWindowYScale(); - if (!activeSpectrum?.id || selectedTool !== Filters.apodization.id) { + if (!activeSpectrum?.id || selectedTool !== Filters1D.apodization.id) { return null; } const paths = () => { const pathBuilder = new PathBuilder(); - const { re, im = [], x } = spectrum.data; + const { re, x } = spectrum.data; const { lineBroadening, gaussBroadening, lineBroadeningCenter } = apodizationOptions || defaultApodizationOptions; const length = re.length; const dw = (x[length - 1] - x[0]) / (length - 1); - const { windowData: y } = apodization( - { re, im }, - { - apply: false, - compose: { - length, - shapes: { - lorentzToGauss: { - start: 0, - shape: { - kind: 'lorentzToGauss', - options: { - length, - dw, - lineBroadening: - gaussBroadening > 0 ? lineBroadening : -lineBroadening, - gaussBroadening, - lineBroadeningCenter, - }, - }, + const y = createApodizationWindowData({ + length, + shapes: { + lorentzToGauss: { + shape: { + kind: 'lorentzToGauss', + options: { + length, + dw, + lineBroadening: + gaussBroadening > 0 ? lineBroadening : -lineBroadening, + gaussBroadening, + lineBroadeningCenter, }, }, }, }, - ); + }); if (x && y) { const pathPoints = xyReduce({ x, y }); diff --git a/src/component/header/SimpleApodizationOptionsPanel.tsx b/src/component/header/SimpleApodizationOptionsPanel.tsx index 7a94bc22f..7bad6b4ab 100644 --- a/src/component/header/SimpleApodizationOptionsPanel.tsx +++ b/src/component/header/SimpleApodizationOptionsPanel.tsx @@ -1,6 +1,5 @@ import { Checkbox } from '@blueprintjs/core'; -import type { Filter } from 'nmr-processing'; -import { Filters } from 'nmr-processing'; +import { Filter1D, Filters1D } from 'nmr-processing'; import { memo } from 'react'; import ActionButtons from '../elements/ActionButtons.js'; @@ -13,7 +12,7 @@ import { headerLabelStyle } from './Header.js'; import { HeaderWrapper } from './HeaderWrapper.js'; interface ApodizationOptionsInnerPanelProps { - filter: Filter | null; + filter: Extract | null; } function ApodizationOptionsInnerPanel( @@ -70,6 +69,14 @@ function ApodizationOptionsInnerPanel( const MemoizedApodizationPanel = memo(ApodizationOptionsInnerPanel); export function SimpleApodizationOptionsPanel() { - const filter = useFilter(Filters.apodization.id); - return ; + const filter = useFilter(Filters1D.apodization.id); + if (isApodizationFilter(filter)) { + return ; + } +} + +function isApodizationFilter( + filter: Filter1D | null, +): filter is Extract { + return filter?.name === 'apodization'; } diff --git a/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx b/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx index fdd74034b..4c322a455 100644 --- a/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx +++ b/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx @@ -1,7 +1,6 @@ import { Checkbox } from '@blueprintjs/core'; import { Select } from '@blueprintjs/select'; -import type { Filter } from 'nmr-processing'; -import { Filters } from 'nmr-processing'; +import { Filter1D, Filters1D } from 'nmr-processing'; import { memo } from 'react'; import { Button } from 'react-science/ui'; @@ -19,7 +18,7 @@ import { headerLabelStyle } from './Header.js'; import { HeaderWrapper } from './HeaderWrapper.js'; interface BaseLineCorrectionInnerPanelProps { - filter: Filter | null; + filter: Extract; } function BaseLineCorrectionInnerPanel( props: BaseLineCorrectionInnerPanelProps, @@ -138,6 +137,15 @@ function BaseLineCorrectionInnerPanel( const MemoizedBaseLineCorrectionPanel = memo(BaseLineCorrectionInnerPanel); export function SimpleBaseLineCorrectionOptionsPanel() { - const filter = useFilter(Filters.baselineCorrection.id); - return ; + const filter = useFilter(Filters1D.baselineCorrection.id); + + if (isBaselineCorrectionFilter(filter)) { + return ; + } +} + +function isBaselineCorrectionFilter( + filter: Filter1D | null, +): filter is Extract { + return filter?.name === 'baselineCorrection'; } diff --git a/src/component/hooks/useFilter.ts b/src/component/hooks/useFilter.ts index de9839f5f..ee74d1be4 100644 --- a/src/component/hooks/useFilter.ts +++ b/src/component/hooks/useFilter.ts @@ -1,12 +1,12 @@ -import type { Spectrum1D } from 'nmr-load-save'; -import type { Filter } from 'nmr-processing'; +import { Spectrum1D } from 'nmr-load-save'; +import { Filter1D } from 'nmr-processing'; import { useMemo } from 'react'; import useSpectrum from './useSpectrum.js'; const emptyData = { filters: {} }; -export function useFilter(filterID: string): Filter | null { +export function useFilter(filterID: string): Filter1D | null { const { filters } = useSpectrum(emptyData) as Spectrum1D; return useMemo( diff --git a/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx b/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx index abad2c552..8c394b5f4 100644 --- a/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +++ b/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx @@ -1,8 +1,7 @@ import { Switch } from '@blueprintjs/core'; import styled from '@emotion/styled'; import { v4 } from '@lukeed/uuid'; -import type { Filter } from 'nmr-processing'; -import { Filters } from 'nmr-processing'; +import { Filter1D, Filter2D } from 'nmr-processing'; import { memo, useEffect, useRef, useState } from 'react'; import { FaRegEyeSlash, FaRegTrashAlt } from 'react-icons/fa'; import { ObjectInspector } from 'react-inspector'; @@ -24,12 +23,13 @@ const IconButton = styled(Button)` font-size: 16px; `; -interface FiltersProps extends Filter { - error?: any; -} +type FiltersProps = Filter1D & + Filter2D & { + error?: any; + }; interface FilterElementsProps { - filter: Filter; + filter: Filter1D | Filter2D; spectraCounter: number; onEnableChange: () => void; onFilterRestore: () => void; @@ -157,7 +157,7 @@ function FiltersInner(props: FiltersInnerProps) { const { toolOptions: { selectedTool }, } = useChartData(); - const [newFilter, setNewFilter] = useState(); + const [newFilter, setNewFilter] = useState(); const [selectedSection, openSection] = useState(''); const dispatch = useDispatch(); diff --git a/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx b/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx index 3be518fe8..7e279f195 100644 --- a/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx +++ b/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx @@ -1,5 +1,5 @@ import { yupResolver } from '@hookform/resolvers/yup'; -import type { Filter, BaselineCorrectionOptions } from 'nmr-processing'; +import { BaselineCorrectionOptions, Filter1D } from 'nmr-processing'; import { useCallback, useEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; import { useSelect } from 'react-science/ui'; @@ -37,7 +37,7 @@ export function getBaselineData( algorithm, filterValues: BaselineCorrectionOptions, ) { - const { zones, algorithm: baseAlgorithm, ...other } = filterValues; + const { algorithm: baseAlgorithm, ...other } = filterValues; switch (algorithm) { case 'airpls': { const validation = Yup.object().shape({ @@ -87,7 +87,9 @@ export function getBaselineData( } } -export function useBaselineCorrection(filter: Filter | null) { +export function useBaselineCorrection( + filter: Extract, +) { const dispatch = useDispatch(); const previousPreviewRef = useRef(true); const { algorithm: baseAlgorithm = 'polynomial' } = filter?.value || {}; @@ -100,10 +102,7 @@ export function useBaselineCorrection(filter: Filter | null) { itemTextKey: 'label', }); - const { resolver, values } = getBaselineData( - algorithm?.value, - filter?.value || {}, - ); + const { resolver, values } = getBaselineData(algorithm?.value, filter?.value); const { handleSubmit, reset, ...otherFormOptions } = useForm< AirplsOptions | PolynomialOptions diff --git a/src/component/panels/filtersPanel/Filters/index.tsx b/src/component/panels/filtersPanel/Filters/index.tsx index 8f3906e75..447f3491e 100644 --- a/src/component/panels/filtersPanel/Filters/index.tsx +++ b/src/component/panels/filtersPanel/Filters/index.tsx @@ -1,6 +1,5 @@ -import type { ButtonProps } from '@blueprintjs/core'; -import type { Filter } from 'nmr-processing'; -import { Filters } from 'nmr-processing'; +import { ButtonProps } from '@blueprintjs/core'; +import { Filter1D, Filters1D, Filters2D } from 'nmr-processing'; import type { LabelStyle } from '../../../elements/Label.js'; @@ -15,14 +14,14 @@ import ZeroFillingOptionsPanel from './ZeroFillingOptionsPanel.js'; const { apodization, phaseCorrection, - phaseCorrectionTwoDimensions, zeroFilling, baselineCorrection, shiftX, - shift2DX, - shift2DY, exclusionZones, -} = Filters; +} = Filters1D; + +const { shift2DX, shift2DY, phaseCorrectionTwoDimensions } = Filters2D; + export const filterOptionPanels = { [apodization.id]: ApodizationOptionsPanel, [phaseCorrection.id]: PhaseCorrectionOptionsPanel, @@ -36,7 +35,7 @@ export const filterOptionPanels = { }; export interface BaseFilterOptionsPanelProps { - filter: Filter; + filter: Extract; enableEdit: boolean; onConfirm: ButtonProps['onClick']; onCancel: ButtonProps['onClick']; diff --git a/src/component/reducer/actions/FiltersActions.ts b/src/component/reducer/actions/FiltersActions.ts index 0a3c2a2d8..97bf87142 100644 --- a/src/component/reducer/actions/FiltersActions.ts +++ b/src/component/reducer/actions/FiltersActions.ts @@ -11,9 +11,12 @@ import type { } from 'nmr-load-save'; import type { BaselineCorrectionOptions } from 'nmr-processing'; import { - Filters, - FiltersManager, + BaselineCorrectionOptions, getBaselineZonesByDietrich, + Filters1DManager, + Filters2DManager, + Filters1D, + Filters2D, } from 'nmr-processing'; import { defaultApodizationOptions } from '../../../data/constants/DefaultApodizationOptions.js'; @@ -53,22 +56,25 @@ import { activateTool, resetSelectedTool } from './ToolsActions.js'; const { fft, - fftDimension1, - fftDimension2, apodization, baselineCorrection, phaseCorrection, - phaseCorrectionTwoDimensions, zeroFilling, shiftX, - shift2DX, - shift2DY, + exclusionZones, signalProcessing, digitalFilter, - digitalFilter2D, -} = Filters; +} = Filters1D; +const { + fftDimension1, + fftDimension2, + phaseCorrectionTwoDimensions, + shift2DX, + shift2DY, + digitalFilter2D, +} = Filters2D; interface ShiftOneDimension { shift: number; } @@ -207,7 +213,7 @@ export type FiltersActions = function getFilterUpdateDomainRules( filterName: string, - defaultRule?: FiltersManager.FilterDomainUpdateRules, + defaultRule?: Filters1DManager.FilterDomainUpdateRules, ) { return ( Filters[filterName]?.DOMAIN_UPDATE_RULES || @@ -232,7 +238,7 @@ function getFilterDomain( options: { startIndex: number; lastIndex: number }, ) { const { startIndex, lastIndex } = options; - const updateDomainOptions: FiltersManager.FilterDomainUpdateRules = { + const updateDomainOptions: Filters1DManager.FilterDomainUpdateRules = { updateXDomain: false, updateYDomain: false, }; @@ -296,7 +302,11 @@ function rollbackSpectrumByFilter( lastIndex: Math.max(activeFilterIndex, filterIndex), }); - FiltersManager.reapplyFilters(datum, filters); + if (datum.info.dimension === 1) { + Filters1DManager.reapplyFilters(datum as Spectrum1D, filters); + } else { + Filters2DManager.reapplyFilters(datum as Spectrum2D, filters); + } draft.tempData = current(draft).data; // apply the current Filters @@ -319,7 +329,11 @@ function rollbackSpectrumByFilter( if (filterIndex === -1 || reset) { if (draft.tempData) { - FiltersManager.reapplyFilters(datum); + if (datum.info.dimension === 1) { + Filters1DManager.reapplyFilters(datum as Spectrum1D); + } else { + Filters2DManager.reapplyFilters(datum as Spectrum2D); + } } //if the filter is not exists, create a clone of the current data draft.tempData = current(draft).data; @@ -615,7 +629,7 @@ function handleShiftSpectrumAlongXAxis( if (isOneDimensionShift(options)) { const { shift } = options; - FiltersManager.applyFilter(draft.data[index], [ + FiltersManager.applyFilters(draft.data[index], [ { name: shiftX.id, value: { shift } }, ]); @@ -624,14 +638,14 @@ function handleShiftSpectrumAlongXAxis( const { shiftX, shiftY } = options; if (shiftX) { - FiltersManager.applyFilter(draft.data[index], [ + FiltersManager.applyFilters(draft.data[index], [ { name: shift2DX.id, value: { shift: shiftX } }, ]); updateView(draft, shift2DX.DOMAIN_UPDATE_RULES); } if (shiftY) { - FiltersManager.applyFilter(draft.data[index], [ + FiltersManager.applyFilters(draft.data[index], [ { name: shift2DY.id, value: { shift: shiftY } }, ]); @@ -658,7 +672,7 @@ function handleApplyZeroFillingFilter( value: action.payload.options, }, ]; - FiltersManager.applyFilter(draft.tempData[index], filters); + FiltersManager.applyFilters(draft.tempData[index], filters); draft.data[index] = draft.tempData[index]; updateView(draft, zeroFilling.DOMAIN_UPDATE_RULES); @@ -741,7 +755,7 @@ function handleApplyApodizationFilter( const index = activeSpectrum.index; - FiltersManager.applyFilter(draft.tempData[index], [ + Filters1DManager.applyFilters(draft.tempData[index], [ { name: apodization.id, value: action.payload.options, @@ -764,9 +778,9 @@ function handleApplyFFTFilter(draft: Draft) { const activeFilterIndex = getActiveFilterIndex(draft); //apply filter into the spectrum - FiltersManager.applyFilter( + Filters1DManager.applyFilters( activeFilterIndex !== -1 ? draft.tempData[index] : draft.data[index], - [{ name: fft.id, value: {} }], + [{ name: fft.id }], ); if (activeFilterIndex !== -1) { @@ -793,7 +807,7 @@ function handleApplyFFtDimension1Filter(draft: Draft) { const activeFilterIndex = getActiveFilterIndex(draft); //apply filter into the spectrum - FiltersManager.applyFilter( + Filters2DManager.applyFilters( activeFilterIndex !== -1 ? draft.tempData[index] : draft.data[index], [{ name: fftDimension1.id, value: {} }], ); @@ -822,7 +836,7 @@ function handleApplyFFtDimension2Filter(draft: Draft) { const activeFilterIndex = getActiveFilterIndex(draft); //apply filter into the spectrum - FiltersManager.applyFilter( + FiltersManager.applyFilters( activeFilterIndex !== -1 ? draft.tempData[index] : draft.data[index], [{ name: fftDimension2.id, value: {} }], ); @@ -855,7 +869,7 @@ function handleApplyManualPhaseCorrectionFilter( const { ph0, ph1 } = action.payload; draft.data = draft.tempData; - FiltersManager.applyFilter(draft.tempData[index], [ + FiltersManager.applyFilters(draft.tempData[index], [ { name: phaseCorrection.id, value: { ph0, ph1 }, @@ -994,7 +1008,7 @@ function handleApplyAbsoluteFilter(draft: Draft) { const { index } = activeSpectrum; - FiltersManager.applyFilter(draft.tempData[index], [ + FiltersManager.applyFilters(draft.tempData[index], [ { name: phaseCorrection.id, value: { absolute: true }, @@ -1015,7 +1029,7 @@ function handleApplyAutoPhaseCorrectionFilter(draft: Draft) { const { index } = activeSpectrum; - FiltersManager.applyFilter(draft.tempData[index], [ + FiltersManager.applyFilters(draft.tempData[index], [ { name: phaseCorrection.id, value: {}, @@ -1041,7 +1055,7 @@ function handleBaseLineCorrectionFilter( const { index } = activeSpectrum; const { zones } = draft.toolOptions.data.baselineCorrection; const { options } = action.payload; - FiltersManager.applyFilter(draft.tempData[index], [ + FiltersManager.applyFilters(draft.tempData[index], [ { name: baselineCorrection.id, value: { @@ -1206,7 +1220,7 @@ function handleSignalProcessingFilter( const spectra = getSpectraByNucleus(nucleus, data) as Spectrum1D[]; for (const spectrum of spectra) { - FiltersManager.applyFilter( + FiltersManager.applyFilters( spectrum, [ { @@ -1235,7 +1249,7 @@ function handleApplyExclusionZone( return; } - FiltersManager.applyFilter(draft.data[activeSpectrum.index], [ + FiltersManager.applyFilters(draft.data[activeSpectrum.index], [ { name: exclusionZones.id, value: zones, @@ -1268,7 +1282,7 @@ function handleAddExclusionZone( } for (const spectrum of spectra) { - FiltersManager.applyFilter(spectrum, [ + FiltersManager.applyFilters(spectrum, [ { name: exclusionZones.id, value: [ @@ -1457,7 +1471,7 @@ function handleApplyManualTowDimensionsPhaseCorrectionFilter( draft.data = draft.tempData; const filterOptions = getTwoDimensionsPhaseCorrectionOptions(draft); - FiltersManager.applyFilter(draft.tempData[index], [ + FiltersManager.applyFilters(draft.tempData[index], [ { name: phaseCorrectionTwoDimensions.id, value: filterOptions, @@ -1480,7 +1494,7 @@ function handleApplyAutoPhaseCorrectionTwoDimensionsFilter( const { index } = activeSpectrum; - FiltersManager.applyFilter(draft.tempData[index], [ + FiltersManager.applyFilters(draft.tempData[index], [ { name: phaseCorrectionTwoDimensions.id, value: {}, diff --git a/src/component/reducer/actions/RangesActions.ts b/src/component/reducer/actions/RangesActions.ts index 53a38b759..dec867da9 100644 --- a/src/component/reducer/actions/RangesActions.ts +++ b/src/component/reducer/actions/RangesActions.ts @@ -3,9 +3,8 @@ import type { Draft } from 'immer'; import { original } from 'immer'; import cloneDeep from 'lodash/cloneDeep.js'; import { xFindClosestIndex } from 'ml-spectra-processing'; -import type { RangesViewState, Spectrum, Spectrum1D } from 'nmr-load-save'; -import type { Signal1D, Range } from 'nmr-processing'; -import { Filters, FiltersManager } from 'nmr-processing'; +import { RangesViewState, Spectrum, Spectrum1D } from 'nmr-load-save'; +import { Signal1D, Range, Filters1DManager, Filters1D } from 'nmr-processing'; import { DATUM_KIND, @@ -551,8 +550,8 @@ function handleChangeRangeSignalValue( signalID, newSignalValue: value, }); - FiltersManager.applyFilter(draft.data[index], [ - { name: Filters.shiftX.id, value: { shift } }, + Filters1DManager.applyFilters(draft.data[index], [ + { name: Filters1D.shiftX.id, value: { shift } }, ]); handleUpdateCorrelations(draft); diff --git a/src/component/reducer/actions/SpectraActions.ts b/src/component/reducer/actions/SpectraActions.ts index 53440441a..b885d8907 100644 --- a/src/component/reducer/actions/SpectraActions.ts +++ b/src/component/reducer/actions/SpectraActions.ts @@ -169,7 +169,7 @@ export type SpectrumActions = | SimulateSpectrumAction | UpdateSpectrumMetaAction; -const { applyFilter } = FiltersManager; +const { applyFilters } = FiltersManager; function checkIsVisible2D(datum: Spectrum2D): boolean { if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) { return false; @@ -548,7 +548,7 @@ function handleAlignSpectraHandler( !datum.info?.isFid ) { const shift = getReferenceShift(datum, { ...action.payload }); - applyFilter(datum, [ + applyFilters(datum, [ { name: Filters.shiftX.id, value: { shift }, diff --git a/src/component/reducer/actions/ZonesActions.ts b/src/component/reducer/actions/ZonesActions.ts index 50466f9f4..9540ee955 100644 --- a/src/component/reducer/actions/ZonesActions.ts +++ b/src/component/reducer/actions/ZonesActions.ts @@ -242,7 +242,7 @@ function handleChangeZoneSignalDelta( filters.push({ name: Filters.shift2DY.id, value: { shift: yShift } }); } - FiltersManager.applyFilter(draft.data[index], filters); + FiltersManager.applyFilters(draft.data[index], filters); setDomain(draft); handleUpdateCorrelations(draft); diff --git a/src/data/constants/DefaultApodizationOptions.ts b/src/data/constants/DefaultApodizationOptions.ts index 756105f20..a3deec541 100644 --- a/src/data/constants/DefaultApodizationOptions.ts +++ b/src/data/constants/DefaultApodizationOptions.ts @@ -1,11 +1,11 @@ -export interface Apodization1DOptions { - lineBroadening: number; - gaussBroadening: number; - lineBroadeningCenter: number; -} +import { Shapes as Apodization1DOptions } from 'nmr-processing'; export const defaultApodizationOptions: Apodization1DOptions = { - lineBroadening: 1, - gaussBroadening: 0, - lineBroadeningCenter: 0, + lorentzToGauss: { + shape: { + lineBroadening: 1, + gaussBroadening: 0, + lineBroadeningCenter: 0, + }, + }, }; From 2f0814eb64e26cddc21f382bdd775be4fa9a5ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Fri, 1 Nov 2024 09:00:11 +0100 Subject: [PATCH 12/26] Update package.json Co-authored-by: Luc Patiny --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 16d61836c..e641829bb 100644 --- a/package.json +++ b/package.json @@ -150,4 +150,4 @@ "vite": "^5.4.9", "vitest": "^2.1.3" } -} \ No newline at end of file +} From 25636bf4596448a6bcac5822cbf12f32be936f99 Mon Sep 17 00:00:00 2001 From: jobo322 Date: Fri, 1 Nov 2024 11:15:38 -0500 Subject: [PATCH 13/26] chore: use pre release nmr-processing --- package-lock.json | 59 +++++++++++++++++++++++++++++++++++++++++++++-- package.json | 2 +- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6527cc04b..963baee79 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", "nmr-load-save": "^1.2.2", - "nmr-processing": "^13.0.2", + "nmr-processing": "13.0.3-pre.1730476792", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", @@ -10104,6 +10104,21 @@ "varian-converter": "^1.0.0" } }, + "node_modules/nmr-load-save/node_modules/d3-color": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", + "integrity": "sha512-SPXi0TSKPD4g9tw0NMZFnR95XVgUZiBH+uUTqQuDu1OsE2zomHU7ho0FISciaPvosimixwHFl3WHLGabv6dDgQ==", + "license": "BSD-3-Clause" + }, + "node_modules/nmr-load-save/node_modules/d3-interpolate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-2.0.1.tgz", + "integrity": "sha512-c5UhwwTs/yybcmTpAVqwSFl6vrQ8JZJoT5F7xNFK9pymv5C0Ymcc9/LIJHtYIggg/yS9YHw8i8O8tgb9pupjeQ==", + "license": "BSD-3-Clause", + "dependencies": { + "d3-color": "1 - 2" + } + }, "node_modules/nmr-load-save/node_modules/jcampconverter": { "version": "10.0.1", "resolved": "https://registry.npmjs.org/jcampconverter/-/jcampconverter-10.0.1.tgz", @@ -10117,7 +10132,7 @@ "ml-array-median": "^1.1.6" } }, - "node_modules/nmr-processing": { + "node_modules/nmr-load-save/node_modules/nmr-processing": { "version": "13.0.2", "resolved": "https://registry.npmjs.org/nmr-processing/-/nmr-processing-13.0.2.tgz", "integrity": "sha512-hLaObBnrIwV78nykfKdnDBw3sWU95dTbTFir7kwKFPWDTAEAoMC6LL22So0zDqAdU+8z9XzTyOWqi8qZjZZAfQ==", @@ -10157,6 +10172,46 @@ "spectrum-generator": "^8.0.11" } }, + "node_modules/nmr-processing": { + "version": "13.0.3-pre.1730476792", + "resolved": "https://registry.npmjs.org/nmr-processing/-/nmr-processing-13.0.3-pre.1730476792.tgz", + "integrity": "sha512-3HCMVQeWuiPpiGK/HKY8DRDKhipVxv12LYxFJD1mzgvOFFJxmJgt1zlrT6w54vsQUya/2Yb5K0m6Oh1eGIKPUw==", + "license": "MIT", + "dependencies": { + "@lukeed/uuid": "^2.0.1", + "@types/d3-color": "^3.1.3", + "@types/d3-interpolate": "^3.0.4", + "binary-search": "^1.3.6", + "d3-color": "^2.0.0", + "d3-interpolate": "^2.0.1", + "gyromagnetic-ratio": "^1.2.0", + "is-any-array": "^2.0.1", + "linear-sum-assignment": "^1.0.7", + "lodash.omit": "^4.5.0", + "ml-airpls": "^2.0.0", + "ml-direct": "^1.0.0", + "ml-gsd": "^12.1.8", + "ml-hclust": "^3.1.0", + "ml-levenberg-marquardt": "^4.1.3", + "ml-matrix": "^6.11.1", + "ml-matrix-convolution": "^1.0.0", + "ml-matrix-peaks-finder": "^1.0.0", + "ml-peak-shape-generator": "^4.1.4", + "ml-regression-base": "^4.0.0", + "ml-regression-exponential": "^3.0.1", + "ml-regression-polynomial": "^3.0.1", + "ml-savitzky-golay-generalized": "^4.2.0", + "ml-signal-processing": "^1.1.1", + "ml-simple-clustering": "^0.1.0", + "ml-sparse-matrix": "^2.1.0", + "ml-spectra-processing": "^14.6.0", + "ml-tree-set": "^0.1.1", + "nmr-correlation": "^2.3.3", + "numeral": "^2.0.6", + "openchemlib-utils": "^6.4.1", + "spectrum-generator": "^8.0.11" + } + }, "node_modules/nmr-processing/node_modules/d3-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-2.0.0.tgz", diff --git a/package.json b/package.json index e641829bb..2ed26956e 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "multiplet-analysis": "^2.1.2", "nmr-correlation": "^2.3.3", "nmr-load-save": "^1.2.2", - "nmr-processing": "^13.0.2", + "nmr-processing": "13.0.3-pre.1730476792", "nmredata": "^0.9.11", "numeral": "^2.0.6", "openchemlib": "^8.16.0", From cb2736ec3aac5adba39167e39b0e06bf46692b9d Mon Sep 17 00:00:00 2001 From: jobo322 Date: Fri, 1 Nov 2024 11:16:37 -0500 Subject: [PATCH 14/26] chore: work in progress refactor --- src/component/1d/ExclusionZoneAnnotation.tsx | 6 +++--- .../1d/ExclusionZonesAnnotations.tsx | 10 +++++----- src/component/1d/matrix/useMatrix.ts | 4 ++-- .../SpectrumPhaseTrace.tsx | 4 ++-- .../header/SimpleApodizationOptionsPanel.tsx | 18 +++++++----------- .../SimpleBaseLineCorrectionOptionsPanel.tsx | 19 ++++++++----------- .../SimplePhaseCorrectionOptionsPanel.tsx | 4 ++-- ...implePhaseCorrectionTwoDimensionsPanel.tsx | 4 ++-- src/component/hooks/useFilter.ts | 8 ++++---- .../Filters/FiltersSectionsPanel.tsx | 18 ++++++++++++------ .../Filters/hooks/useBaselineCorrection.tsx | 2 +- .../panels/filtersPanel/Filters/index.tsx | 4 +++- 12 files changed, 51 insertions(+), 50 deletions(-) diff --git a/src/component/1d/ExclusionZoneAnnotation.tsx b/src/component/1d/ExclusionZoneAnnotation.tsx index fccbb1f33..5cc41a234 100644 --- a/src/component/1d/ExclusionZoneAnnotation.tsx +++ b/src/component/1d/ExclusionZoneAnnotation.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource @emotion/react */ import { css } from '@emotion/react'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { memo } from 'react'; import type { ExclusionZone } from '../../data/types/data1d/ExclusionZone.js'; @@ -31,7 +31,7 @@ function ExclusionZoneAnnotation({ }: ExclusionZoneProps) { const { scaleX, scaleY } = useScaleChecked(); const type = - filterId === Filters.signalProcessing.id + filterId === Filters1D.signalProcessing.id ? HighlightEventSource.MATRIX_GENERATION_EXCLUSION_ZONE : HighlightEventSource.EXCLUSION_ZONE; const highlight = useHighlight([], { @@ -50,7 +50,7 @@ function ExclusionZoneAnnotation({ width={`${scaleX()(zone.from) - scaleX()(zone.to)}`} height="10px" style={{ - fill: filterId === Filters.signalProcessing.id ? 'gray' : color, + fill: filterId === Filters1D.signalProcessing.id ? 'gray' : color, opacity, }} {...highlight.onHover} diff --git a/src/component/1d/ExclusionZonesAnnotations.tsx b/src/component/1d/ExclusionZonesAnnotations.tsx index 43e0ae445..50c7e58c2 100644 --- a/src/component/1d/ExclusionZonesAnnotations.tsx +++ b/src/component/1d/ExclusionZonesAnnotations.tsx @@ -1,5 +1,5 @@ import type { Spectrum1D } from 'nmr-load-save'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { memo } from 'react'; import type { ExclusionZone } from '../../data/types/data1d/ExclusionZone.js'; @@ -76,11 +76,11 @@ function getExclusionZones( ): Array<{ id: string; zones: ExclusionZone[] }> { const zones: Array<{ id: string; zones: ExclusionZone[] }> = []; for (const filter of data.filters) { - if (filter.name === Filters.exclusionZones.id && filter.flag) { - zones.push({ id: Filters.exclusionZones.id, zones: filter.value }); - } else if (filter.name === Filters.signalProcessing.id && filter.flag) { + if (filter.name === Filters1D.exclusionZones.id && filter.flag) { + zones.push({ id: Filters1D.exclusionZones.id, zones: filter.value }); + } else if (filter.name === Filters1D.signalProcessing.id && filter.flag) { zones.push({ - id: Filters.signalProcessing.id, + id: Filters1D.signalProcessing.id, zones: filter.value.exclusionsZones, }); } diff --git a/src/component/1d/matrix/useMatrix.ts b/src/component/1d/matrix/useMatrix.ts index a6e5bb6cf..be8ab826b 100644 --- a/src/component/1d/matrix/useMatrix.ts +++ b/src/component/1d/matrix/useMatrix.ts @@ -1,13 +1,13 @@ import type { NumberArray } from 'cheminfo-types'; import type { Spectrum } from 'nmr-load-save'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { useMemo } from 'react'; import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.js'; import { useChartData } from '../../context/ChartContext.js'; import useSpectraByActiveNucleus from '../../hooks/useSpectraPerNucleus.js'; -const { signalProcessing } = Filters; +const { signalProcessing } = Filters1D; /** * This method will slice the array from the fromIndex to the toIndex and add the first and last element of the original array diff --git a/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx b/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx index c4cfb9435..32c85dba0 100644 --- a/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx +++ b/src/component/2d/1d-tracer/phase-correction-traces/SpectrumPhaseTrace.tsx @@ -1,5 +1,5 @@ import type { Spectrum1D, Spectrum2D } from 'nmr-load-save'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import type { ReactNode } from 'react'; import { getSlice } from '../../../../data/data2d/Spectrum2D/index.js'; @@ -143,7 +143,7 @@ function InnerSpectrumPhaseTrace(props: InnerSpectrumPhaseTraceProps) { info: { isComplex: true, isFid: false }, }; - Filters.phaseCorrection.apply(spectrum as unknown as Spectrum1D, { + Filters1D.phaseCorrection.apply(spectrum as unknown as Spectrum1D, { ph0, ph1, }); diff --git a/src/component/header/SimpleApodizationOptionsPanel.tsx b/src/component/header/SimpleApodizationOptionsPanel.tsx index 7bad6b4ab..4391cf501 100644 --- a/src/component/header/SimpleApodizationOptionsPanel.tsx +++ b/src/component/header/SimpleApodizationOptionsPanel.tsx @@ -1,5 +1,5 @@ import { Checkbox } from '@blueprintjs/core'; -import { Filter1D, Filters1D } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { memo } from 'react'; import ActionButtons from '../elements/ActionButtons.js'; @@ -11,6 +11,7 @@ import { useSharedApodization } from '../panels/filtersPanel/Filters/hooks/useSh import { headerLabelStyle } from './Header.js'; import { HeaderWrapper } from './HeaderWrapper.js'; +import type { Filter1D } from 'nmr-processing'; interface ApodizationOptionsInnerPanelProps { filter: Extract | null; } @@ -69,14 +70,9 @@ function ApodizationOptionsInnerPanel( const MemoizedApodizationPanel = memo(ApodizationOptionsInnerPanel); export function SimpleApodizationOptionsPanel() { - const filter = useFilter(Filters1D.apodization.id); - if (isApodizationFilter(filter)) { - return ; - } -} - -function isApodizationFilter( - filter: Filter1D | null, -): filter is Extract { - return filter?.name === 'apodization'; + const filter = useFilter(Filters1D.apodization.id) as Extract< + Filter1D, + { name: 'apodization' } + >; + return ; } diff --git a/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx b/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx index 4c322a455..8ef05dd3c 100644 --- a/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx +++ b/src/component/header/SimpleBaseLineCorrectionOptionsPanel.tsx @@ -1,6 +1,6 @@ import { Checkbox } from '@blueprintjs/core'; import { Select } from '@blueprintjs/select'; -import { Filter1D, Filters1D } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { memo } from 'react'; import { Button } from 'react-science/ui'; @@ -17,6 +17,8 @@ import { import { headerLabelStyle } from './Header.js'; import { HeaderWrapper } from './HeaderWrapper.js'; +import type { Filter1D } from 'nmr-processing'; + interface BaseLineCorrectionInnerPanelProps { filter: Extract; } @@ -137,15 +139,10 @@ function BaseLineCorrectionInnerPanel( const MemoizedBaseLineCorrectionPanel = memo(BaseLineCorrectionInnerPanel); export function SimpleBaseLineCorrectionOptionsPanel() { - const filter = useFilter(Filters1D.baselineCorrection.id); - - if (isBaselineCorrectionFilter(filter)) { - return ; - } -} + const filter = useFilter(Filters1D.baselineCorrection.id) as Extract< + Filter1D, + { name: 'baselineCorrection' } + >; -function isBaselineCorrectionFilter( - filter: Filter1D | null, -): filter is Extract { - return filter?.name === 'baselineCorrection'; + return ; } diff --git a/src/component/header/SimplePhaseCorrectionOptionsPanel.tsx b/src/component/header/SimplePhaseCorrectionOptionsPanel.tsx index c1619b4db..ef656a4d1 100644 --- a/src/component/header/SimplePhaseCorrectionOptionsPanel.tsx +++ b/src/component/header/SimplePhaseCorrectionOptionsPanel.tsx @@ -1,5 +1,5 @@ import { Select } from '@blueprintjs/select'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { Button } from 'react-science/ui'; import ActionButtons from '../elements/ActionButtons.js'; @@ -14,7 +14,7 @@ import { import { HeaderWrapper } from './HeaderWrapper.js'; export function SimplePhaseCorrectionOptionsPanel() { - const filter = useFilter(Filters.phaseCorrection.id); + const filter = useFilter(Filters1D.phaseCorrection.id); const { handleApplyFilter, diff --git a/src/component/header/SimplePhaseCorrectionTwoDimensionsPanel.tsx b/src/component/header/SimplePhaseCorrectionTwoDimensionsPanel.tsx index 5463c6dde..2f72af314 100644 --- a/src/component/header/SimplePhaseCorrectionTwoDimensionsPanel.tsx +++ b/src/component/header/SimplePhaseCorrectionTwoDimensionsPanel.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource @emotion/react */ import { Select } from '@blueprintjs/select'; -import { Filters } from 'nmr-processing'; +import { Filters2D } from 'nmr-processing'; import { FaRulerHorizontal, FaRulerVertical } from 'react-icons/fa'; import { MdLooksTwo } from 'react-icons/md'; import { Button, Toolbar } from 'react-science/ui'; @@ -19,7 +19,7 @@ import { headerLabelStyle } from './Header.js'; import { HeaderWrapper } from './HeaderWrapper.js'; export function SimplePhaseCorrectionTwoDimensionsPanel() { - const filter = useFilter(Filters.phaseCorrectionTwoDimensions.id); + const filter = useFilter(Filters2D.phaseCorrectionTwoDimensions.id); const { ph0Ref, ph1Ref, diff --git a/src/component/hooks/useFilter.ts b/src/component/hooks/useFilter.ts index ee74d1be4..d5d075c37 100644 --- a/src/component/hooks/useFilter.ts +++ b/src/component/hooks/useFilter.ts @@ -1,13 +1,13 @@ -import { Spectrum1D } from 'nmr-load-save'; -import { Filter1D } from 'nmr-processing'; +import type { Spectrum1D, Spectrum2D } from 'nmr-load-save'; +import type { Filter1D, Filter2D } from 'nmr-processing'; import { useMemo } from 'react'; import useSpectrum from './useSpectrum.js'; const emptyData = { filters: {} }; -export function useFilter(filterID: string): Filter1D | null { - const { filters } = useSpectrum(emptyData) as Spectrum1D; +export function useFilter(filterID: Filter1D['name'] | Filter2D['name']) { + const { filters } = useSpectrum(emptyData) as Spectrum1D | Spectrum2D; return useMemo( () => filters.find((filter) => filter.name === filterID) || null, diff --git a/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx b/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx index 8c394b5f4..2fbe4a799 100644 --- a/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx +++ b/src/component/panels/filtersPanel/Filters/FiltersSectionsPanel.tsx @@ -1,7 +1,12 @@ import { Switch } from '@blueprintjs/core'; import styled from '@emotion/styled'; import { v4 } from '@lukeed/uuid'; -import { Filter1D, Filter2D } from 'nmr-processing'; +import { + Filters1D, + Filters2D, + type Filter1D, + type Filter2D, +} from 'nmr-processing'; import { memo, useEffect, useRef, useState } from 'react'; import { FaRegEyeSlash, FaRegTrashAlt } from 'react-icons/fa'; import { ObjectInspector } from 'react-inspector'; @@ -23,11 +28,12 @@ const IconButton = styled(Button)` font-size: 16px; `; -type FiltersProps = Filter1D & - Filter2D & { - error?: any; - }; +type FiltersProps = Filter1D | Filter2D; +const Filters = { + ...Filters1D, + ...Filters2D, +}; interface FilterElementsProps { filter: Filter1D | Filter2D; spectraCounter: number; @@ -212,7 +218,7 @@ function FiltersInner(props: FiltersInnerProps) { id: v4(), name, label, - value: null, + value: {}, isDeleteAllow: true, }); } else { diff --git a/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx b/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx index 7e279f195..feb4622de 100644 --- a/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx +++ b/src/component/panels/filtersPanel/Filters/hooks/useBaselineCorrection.tsx @@ -1,5 +1,5 @@ import { yupResolver } from '@hookform/resolvers/yup'; -import { BaselineCorrectionOptions, Filter1D } from 'nmr-processing'; +import type { BaselineCorrectionOptions, Filter1D } from 'nmr-processing'; import { useCallback, useEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; import { useSelect } from 'react-science/ui'; diff --git a/src/component/panels/filtersPanel/Filters/index.tsx b/src/component/panels/filtersPanel/Filters/index.tsx index 447f3491e..365da7f3a 100644 --- a/src/component/panels/filtersPanel/Filters/index.tsx +++ b/src/component/panels/filtersPanel/Filters/index.tsx @@ -1,5 +1,7 @@ import { ButtonProps } from '@blueprintjs/core'; -import { Filter1D, Filters1D, Filters2D } from 'nmr-processing'; + +import type { Filter1D } from 'nmr-processing'; +import { Filters1D, Filters2D } from 'nmr-processing'; import type { LabelStyle } from '../../../elements/Label.js'; From 03729690fc5682e27622440f24babb60658c1d56 Mon Sep 17 00:00:00 2001 From: jobo322 Date: Mon, 4 Nov 2024 07:32:05 -0500 Subject: [PATCH 15/26] chore: adapt defaultApodizationOptions but there is a bug in nmr-processing --- src/data/constants/DefaultApodizationOptions.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/data/constants/DefaultApodizationOptions.ts b/src/data/constants/DefaultApodizationOptions.ts index a3deec541..de60a6fd3 100644 --- a/src/data/constants/DefaultApodizationOptions.ts +++ b/src/data/constants/DefaultApodizationOptions.ts @@ -1,11 +1,15 @@ -import { Shapes as Apodization1DOptions } from 'nmr-processing'; +import type { Shapes as Apodization1DOptions } from 'nmr-processing'; export const defaultApodizationOptions: Apodization1DOptions = { lorentzToGauss: { + apply: true, shape: { - lineBroadening: 1, - gaussBroadening: 0, - lineBroadeningCenter: 0, + kind: 'lorentzToGauss', + options: { + lineBroadening: 1, + gaussBroadening: 0, + lineBroadeningCenter: 0, + }, }, }, }; From 5aad9a69a9a8e865d42607425dc3526dcec79f1c Mon Sep 17 00:00:00 2001 From: jobo322 Date: Mon, 4 Nov 2024 11:28:51 -0500 Subject: [PATCH 16/26] chore: refactor to use both Filters1DManager n Filters2DManager --- .../header/SimpleZeroFillingOptionsPanel.tsx | 4 +- .../MatrixGenerationPanel.tsx | 4 +- ...aseCorrectionTwoDimensionsOptionsPanel.tsx | 4 +- .../Filters/ShiftOptionsPanel.tsx | 5 +- .../panels/filtersPanel/Filters/index.tsx | 4 +- .../reducer/actions/FiltersActions.ts | 103 ++++++++++++------ .../reducer/actions/SpectraActions.ts | 7 +- src/component/reducer/actions/ZonesActions.ts | 8 +- src/component/toolbar/ToolTypes.ts | 18 +-- .../workspaces/workspaceDefaultProperties.ts | 42 +++---- src/data/data2d/Spectrum2D/getShift.ts | 6 +- 11 files changed, 119 insertions(+), 86 deletions(-) diff --git a/src/component/header/SimpleZeroFillingOptionsPanel.tsx b/src/component/header/SimpleZeroFillingOptionsPanel.tsx index 704cb2cdf..a97d1778a 100644 --- a/src/component/header/SimpleZeroFillingOptionsPanel.tsx +++ b/src/component/header/SimpleZeroFillingOptionsPanel.tsx @@ -1,5 +1,5 @@ import { Checkbox } from '@blueprintjs/core'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import ActionButtons from '../elements/ActionButtons.js'; import Label from '../elements/Label.js'; @@ -14,7 +14,7 @@ import { headerLabelStyle } from './Header.js'; import { HeaderWrapper } from './HeaderWrapper.js'; export function SimpleZeroFillingOptionsPanel() { - const filter = useFilter(Filters.zeroFilling.id); + const filter = useFilter(Filters1D.zeroFilling.id); const { control, submitHandler, register, handleCancelFilter } = useZeroFilling(filter, { applyFilterOnload: true }); diff --git a/src/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.tsx b/src/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.tsx index 6a5b8ea69..2afc29310 100644 --- a/src/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.tsx +++ b/src/component/panels/MatrixGenerationPanel/MatrixGenerationPanel.tsx @@ -2,7 +2,7 @@ import styled from '@emotion/styled'; import { yupResolver } from '@hookform/resolvers/yup'; import { SvgNmrMultipleAnalysis } from 'cheminfo-font'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { useCallback, useEffect, useRef } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { Button, Toolbar } from 'react-science/ui'; @@ -31,7 +31,7 @@ import { ExclusionsZonesTable } from './ExclusionsZonesTable.js'; import { FiltersOptions } from './FiltersOptions.js'; import { MatrixGenerationPanelHeader } from './MatrixGenerationPanelHeader.js'; -const { signalProcessing } = Filters; +const { signalProcessing } = Filters1D; const StickyFooter = styled.div({ position: 'sticky', diff --git a/src/component/panels/filtersPanel/Filters/PhaseCorrectionTwoDimensionsOptionsPanel.tsx b/src/component/panels/filtersPanel/Filters/PhaseCorrectionTwoDimensionsOptionsPanel.tsx index 4fc960392..96d95f0c1 100644 --- a/src/component/panels/filtersPanel/Filters/PhaseCorrectionTwoDimensionsOptionsPanel.tsx +++ b/src/component/panels/filtersPanel/Filters/PhaseCorrectionTwoDimensionsOptionsPanel.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource @emotion/react */ import { Select } from '@blueprintjs/select'; -import { Filters } from 'nmr-processing'; +import { Filters2D } from 'nmr-processing'; import type { CSSProperties } from 'react'; import { FaRulerHorizontal, FaRulerVertical } from 'react-icons/fa'; import { MdLooksTwo } from 'react-icons/md'; @@ -46,7 +46,7 @@ export default function PhaseCorrectionTwoDimensionsOptionsPanel( ) { const { enableEdit = true, onCancel, onConfirm } = props; - const filter = useFilter(Filters.phaseCorrectionTwoDimensions.id); + const filter = useFilter(Filters2D.phaseCorrectionTwoDimensions.id); const { ph0Ref, ph1Ref, diff --git a/src/component/panels/filtersPanel/Filters/ShiftOptionsPanel.tsx b/src/component/panels/filtersPanel/Filters/ShiftOptionsPanel.tsx index 47ed02f4c..5e7b763af 100644 --- a/src/component/panels/filtersPanel/Filters/ShiftOptionsPanel.tsx +++ b/src/component/panels/filtersPanel/Filters/ShiftOptionsPanel.tsx @@ -1,4 +1,4 @@ -import { Filters } from 'nmr-processing'; +import { Filters1D, Filters2D } from 'nmr-processing'; import { useForm } from 'react-hook-form'; import { useDispatch } from '../../../context/DispatchContext.js'; @@ -13,7 +13,8 @@ import { HeaderContainer, StickyHeader } from './InnerFilterHeader.js'; import type { BaseFilterOptionsPanelProps } from './index.js'; import { formLabelStyle } from './index.js'; -const { shiftX, shift2DX, shift2DY } = Filters; +const { shiftX } = Filters1D; +const { shift2DX, shift2DY } = Filters2D; export default function ShiftOptionsPanel(props: BaseFilterOptionsPanelProps) { const { filter, enableEdit = true, onCancel, onConfirm } = props; diff --git a/src/component/panels/filtersPanel/Filters/index.tsx b/src/component/panels/filtersPanel/Filters/index.tsx index 365da7f3a..f8906cf1b 100644 --- a/src/component/panels/filtersPanel/Filters/index.tsx +++ b/src/component/panels/filtersPanel/Filters/index.tsx @@ -1,6 +1,6 @@ import { ButtonProps } from '@blueprintjs/core'; -import type { Filter1D } from 'nmr-processing'; +import type { Filter1DOptions, Filter2DOptions } from 'nmr-processing'; import { Filters1D, Filters2D } from 'nmr-processing'; import type { LabelStyle } from '../../../elements/Label.js'; @@ -37,7 +37,7 @@ export const filterOptionPanels = { }; export interface BaseFilterOptionsPanelProps { - filter: Extract; + filter: Filter1DOptions | Filter2DOptions; enableEdit: boolean; onConfirm: ButtonProps['onClick']; onCancel: ButtonProps['onClick']; diff --git a/src/component/reducer/actions/FiltersActions.ts b/src/component/reducer/actions/FiltersActions.ts index 97bf87142..ec81f5d79 100644 --- a/src/component/reducer/actions/FiltersActions.ts +++ b/src/component/reducer/actions/FiltersActions.ts @@ -11,7 +11,6 @@ import type { } from 'nmr-load-save'; import type { BaselineCorrectionOptions } from 'nmr-processing'; import { - BaselineCorrectionOptions, getBaselineZonesByDietrich, Filters1DManager, Filters2DManager, @@ -20,7 +19,7 @@ import { } from 'nmr-processing'; import { defaultApodizationOptions } from '../../../data/constants/DefaultApodizationOptions.js'; -import type { Apodization1DOptions } from '../../../data/constants/DefaultApodizationOptions.js'; +import type { Apodization1DOptions } from 'nmr-processing'; import { isSpectrum1D } from '../../../data/data1d/Spectrum1D/index.js'; import { getProjection } from '../../../data/data2d/Spectrum2D/getMissingProjection.js'; import { isSpectrum2D } from '../../../data/data2d/Spectrum2D/index.js'; @@ -216,7 +215,7 @@ function getFilterUpdateDomainRules( defaultRule?: Filters1DManager.FilterDomainUpdateRules, ) { return ( - Filters[filterName]?.DOMAIN_UPDATE_RULES || + Filters1D[filterName]?.DOMAIN_UPDATE_RULES || defaultRule || { updateXDomain: false, updateYDomain: false, @@ -273,7 +272,7 @@ function rollbackSpectrumByFilter( } = options || {}; const currentActiveSpectrum = activeSpectrum || getActiveSpectrum(draft); - let updateDomainOptions: Partial = { + let updateDomainOptions: Partial = { updateXDomain: false, updateYDomain: false, }; @@ -312,7 +311,11 @@ function rollbackSpectrumByFilter( // apply the current Filters if (applyFilter) { const { name, value } = datum.filters[filterIndex]; - Filters[name].apply(datum, value); + if (datum.info.dimension === 1) { + Filters1D[name].apply(datum, value); + } else { + Filters2D[name].apply(datum, value); + } } currentIsFid = datum.info.isFid; @@ -392,7 +395,7 @@ function rollbackSpectrum( signalProcessing.id, digitalFilter.id, digitalFilter2D.id, - ].includes(filterKey); + ].includes(filterKey as any); beforeRollback(draft, filterKey); @@ -569,7 +572,7 @@ function getActiveFilterIndex(draft: Draft) { function updateView( draft: Draft, - filterUpdateDomainRules: Readonly, + filterUpdateDomainRules: Readonly, ) { draft.tempData = null; const { updateXDomain, updateYDomain } = filterUpdateDomainRules; @@ -629,7 +632,7 @@ function handleShiftSpectrumAlongXAxis( if (isOneDimensionShift(options)) { const { shift } = options; - FiltersManager.applyFilters(draft.data[index], [ + Filters1DManager.applyFilters(draft.data[index] as Spectrum1D, [ { name: shiftX.id, value: { shift } }, ]); @@ -638,14 +641,14 @@ function handleShiftSpectrumAlongXAxis( const { shiftX, shiftY } = options; if (shiftX) { - FiltersManager.applyFilters(draft.data[index], [ + Filters2DManager.applyFilters(draft.data[index] as Spectrum2D, [ { name: shift2DX.id, value: { shift: shiftX } }, ]); updateView(draft, shift2DX.DOMAIN_UPDATE_RULES); } if (shiftY) { - FiltersManager.applyFilters(draft.data[index], [ + Filters2DManager.applyFilters(draft.data[index] as Spectrum2D, [ { name: shift2DY.id, value: { shift: shiftY } }, ]); @@ -672,7 +675,7 @@ function handleApplyZeroFillingFilter( value: action.payload.options, }, ]; - FiltersManager.applyFilters(draft.tempData[index], filters); + Filters1DManager.applyFilters(draft.tempData[index], filters); draft.data[index] = draft.tempData[index]; updateView(draft, zeroFilling.DOMAIN_UPDATE_RULES); @@ -780,7 +783,7 @@ function handleApplyFFTFilter(draft: Draft) { //apply filter into the spectrum Filters1DManager.applyFilters( activeFilterIndex !== -1 ? draft.tempData[index] : draft.data[index], - [{ name: fft.id }], + [{ name: fft.id, value: {} }], ); if (activeFilterIndex !== -1) { @@ -836,7 +839,7 @@ function handleApplyFFtDimension2Filter(draft: Draft) { const activeFilterIndex = getActiveFilterIndex(draft); //apply filter into the spectrum - FiltersManager.applyFilters( + Filters2DManager.applyFilters( activeFilterIndex !== -1 ? draft.tempData[index] : draft.data[index], [{ name: fftDimension2.id, value: {} }], ); @@ -869,7 +872,7 @@ function handleApplyManualPhaseCorrectionFilter( const { ph0, ph1 } = action.payload; draft.data = draft.tempData; - FiltersManager.applyFilters(draft.tempData[index], [ + Filters1DManager.applyFilters(draft.tempData[index], [ { name: phaseCorrection.id, value: { ph0, ph1 }, @@ -1008,7 +1011,7 @@ function handleApplyAbsoluteFilter(draft: Draft) { const { index } = activeSpectrum; - FiltersManager.applyFilters(draft.tempData[index], [ + Filters1DManager.applyFilters(draft.tempData[index], [ { name: phaseCorrection.id, value: { absolute: true }, @@ -1029,7 +1032,7 @@ function handleApplyAutoPhaseCorrectionFilter(draft: Draft) { const { index } = activeSpectrum; - FiltersManager.applyFilters(draft.tempData[index], [ + Filters1DManager.applyFilters(draft.tempData[index], [ { name: phaseCorrection.id, value: {}, @@ -1055,7 +1058,7 @@ function handleBaseLineCorrectionFilter( const { index } = activeSpectrum; const { zones } = draft.toolOptions.data.baselineCorrection; const { options } = action.payload; - FiltersManager.applyFilters(draft.tempData[index], [ + Filters1DManager.applyFilters(draft.tempData[index], [ { name: baselineCorrection.id, value: { @@ -1124,11 +1127,19 @@ function handleEnableFilter(draft: Draft, action: EnableFilterAction) { const { id: filterID, enabled } = action.payload; //apply filter into the spectrum - FiltersManager.enableFilter( - draft.data[activeSpectrum.index], - filterID, - enabled, - ); + if (draft.data[activeSpectrum.index].info.dimension === 1) { + Filters1DManager.enableFilter( + draft.data[activeSpectrum.index] as Spectrum1D, + filterID, + enabled, + ); + } else { + Filters2DManager.enableFilter( + draft.data[activeSpectrum.index] as Spectrum2D, + filterID, + enabled, + ); + } resetSelectedTool(draft); setDomain(draft); @@ -1157,7 +1168,17 @@ function handleDeleteFilter(draft: Draft, action: DeleteFilterAction) { const filterID = action?.payload?.id; //apply filter into the spectrum - FiltersManager.deleteFilter(draft.data[activeSpectrum.index], filterID); + if (draft.data[activeSpectrum.index].info.dimension === 1) { + Filters1DManager.deleteFilter( + draft.data[activeSpectrum.index] as Spectrum1D, + filterID, + ); + } else { + Filters2DManager.deleteFilter( + draft.data[activeSpectrum.index] as Spectrum2D, + filterID, + ); + } draft.toolOptions.data.activeFilterID = null; resetSelectedTool(draft); setDomain(draft); @@ -1180,7 +1201,11 @@ function handleDeleteSpectraFilter( datum.filters?.filter((filter) => filter.name === filterName) || []; for (const filter of filtersResult) { - FiltersManager.deleteFilter(datum, filter.id); + if (datum.info.dimension === 1) { + Filters1DManager.deleteFilter(datum as Spectrum1D, filter.id); + } else { + Filters2DManager.deleteFilter(datum as Spectrum2D, filter.id); + } } } } @@ -1220,7 +1245,7 @@ function handleSignalProcessingFilter( const spectra = getSpectraByNucleus(nucleus, data) as Spectrum1D[]; for (const spectrum of spectra) { - FiltersManager.applyFilters( + Filters1DManager.applyFilters( spectrum, [ { @@ -1249,12 +1274,15 @@ function handleApplyExclusionZone( return; } - FiltersManager.applyFilters(draft.data[activeSpectrum.index], [ - { - name: exclusionZones.id, - value: zones, - }, - ]); + Filters1DManager.applyFilters( + draft.data[activeSpectrum.index] as Spectrum1D, + [ + { + name: exclusionZones.id, + value: zones, + }, + ], + ); const { updateXDomain, updateYDomain } = exclusionZones.DOMAIN_UPDATE_RULES; @@ -1282,7 +1310,7 @@ function handleAddExclusionZone( } for (const spectrum of spectra) { - FiltersManager.applyFilters(spectrum, [ + Filters1DManager.applyFilters(spectrum, [ { name: exclusionZones.id, value: [ @@ -1318,10 +1346,15 @@ function handleDeleteExclusionZone( ); if (filter) { if (filter.value.length === 1) { - FiltersManager.deleteFilter(draft.data[spectrumIndex], filter.id); + Filters1DManager.deleteFilter( + draft.data[spectrumIndex] as Spectrum1D, + filter.id, + ); } else { filter.value = filter.value.filter((_zone) => _zone.id !== zone?.id); - FiltersManager.reapplyFilters(draft.data[spectrumIndex]); + Filters1DManager.reapplyFilters( + draft.data[spectrumIndex] as Spectrum1D, + ); } } } else { @@ -1333,7 +1366,7 @@ function handleDeleteExclusionZone( filter.value = filter.value.filter( (_zone) => zone.from !== _zone.from && zone.to !== _zone.to, ); - FiltersManager.reapplyFilters(datum); + Filters1DManager.reapplyFilters(datum as Spectrum1D); } } } diff --git a/src/component/reducer/actions/SpectraActions.ts b/src/component/reducer/actions/SpectraActions.ts index b885d8907..30ba765c5 100644 --- a/src/component/reducer/actions/SpectraActions.ts +++ b/src/component/reducer/actions/SpectraActions.ts @@ -12,7 +12,7 @@ import type { Spectrum2D, } from 'nmr-load-save'; import type { NMRRange } from 'nmr-processing'; -import { Filters, FiltersManager } from 'nmr-processing'; +import { Filters1D, Filters1DManager } from 'nmr-processing'; import { get1DColor, @@ -169,7 +169,6 @@ export type SpectrumActions = | SimulateSpectrumAction | UpdateSpectrumMetaAction; -const { applyFilters } = FiltersManager; function checkIsVisible2D(datum: Spectrum2D): boolean { if (!datum.display.isPositiveVisible && !datum.display.isNegativeVisible) { return false; @@ -548,9 +547,9 @@ function handleAlignSpectraHandler( !datum.info?.isFid ) { const shift = getReferenceShift(datum, { ...action.payload }); - applyFilters(datum, [ + Filters1DManager.applyFilters(datum as Spectrum1D, [ { - name: Filters.shiftX.id, + name: Filters1D.shiftX.id, value: { shift }, }, ]); diff --git a/src/component/reducer/actions/ZonesActions.ts b/src/component/reducer/actions/ZonesActions.ts index 9540ee955..66e89256f 100644 --- a/src/component/reducer/actions/ZonesActions.ts +++ b/src/component/reducer/actions/ZonesActions.ts @@ -5,7 +5,7 @@ import lodashCloneDeep from 'lodash/cloneDeep.js'; import { setPathLength } from 'nmr-correlation'; import type { Spectrum, Spectrum2D, ZonesViewState } from 'nmr-load-save'; import type { Signal2D, Zone } from 'nmr-processing'; -import { Filters, FiltersManager } from 'nmr-processing'; +import { Filters2D, Filters2DManager } from 'nmr-processing'; import { DATUM_KIND, @@ -236,13 +236,13 @@ function handleChangeZoneSignalDelta( ); const filters: any = []; if (xShift !== 0) { - filters.push({ name: Filters.shift2DX.id, value: { shift: xShift } }); + filters.push({ name: Filters2D.shift2DX.id, value: { shift: xShift } }); } if (yShift !== 0) { - filters.push({ name: Filters.shift2DY.id, value: { shift: yShift } }); + filters.push({ name: Filters2D.shift2DY.id, value: { shift: yShift } }); } - FiltersManager.applyFilters(draft.data[index], filters); + Filters2DManager.applyFilters(draft.data[index], filters); setDomain(draft); handleUpdateCorrelations(draft); diff --git a/src/component/toolbar/ToolTypes.ts b/src/component/toolbar/ToolTypes.ts index a5886bb1f..226c5db62 100644 --- a/src/component/toolbar/ToolTypes.ts +++ b/src/component/toolbar/ToolTypes.ts @@ -1,6 +1,6 @@ import type { NMRiumToolBarPreferences } from 'nmr-load-save'; import type { Info1D, Info2D } from 'nmr-processing'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import type { DisplayerMode } from '../reducer/Reducer.js'; @@ -140,8 +140,8 @@ export const options: RecordOptions = { isToggle: true, }, apodization: { - id: Filters.apodization.id, - label: Filters.apodization.name, + id: Filters1D.apodization.id, + label: Filters1D.apodization.name, hasOptionPanel: true, isFilter: true, mode: '1D', @@ -157,8 +157,8 @@ export const options: RecordOptions = { isToggle: true, }, zeroFilling: { - id: Filters.zeroFilling.id, - label: Filters.zeroFilling.name, + id: Filters1D.zeroFilling.id, + label: Filters1D.zeroFilling.name, hasOptionPanel: true, isFilter: true, mode: '1D', @@ -174,8 +174,8 @@ export const options: RecordOptions = { isToggle: true, }, phaseCorrection: { - id: Filters.phaseCorrection.id, - label: Filters.phaseCorrection.name, + id: Filters1D.phaseCorrection.id, + label: Filters1D.phaseCorrection.name, hasOptionPanel: true, isFilter: true, mode: '1D', @@ -191,8 +191,8 @@ export const options: RecordOptions = { isToggle: true, }, baselineCorrection: { - id: Filters.baselineCorrection.id, - label: Filters.baselineCorrection.name, + id: Filters1D.baselineCorrection.id, + label: Filters1D.baselineCorrection.name, hasOptionPanel: true, isFilter: true, mode: '1D', diff --git a/src/component/workspaces/workspaceDefaultProperties.ts b/src/component/workspaces/workspaceDefaultProperties.ts index 48936bdab..5408f13cf 100644 --- a/src/component/workspaces/workspaceDefaultProperties.ts +++ b/src/component/workspaces/workspaceDefaultProperties.ts @@ -1,5 +1,5 @@ import type { WorkspacePreferences } from 'nmr-load-save'; -import { Filters } from 'nmr-processing'; +import { Filters1D } from 'nmr-processing'; import { color2D } from '../../data/data2d/Spectrum2D/get2DColor.js'; @@ -129,34 +129,34 @@ export const workspaceDefaultProperties: Required = { filters: { '1H': [ { - name: Filters.digitalFilter.id, - label: Filters.digitalFilter.name, + name: Filters1D.digitalFilter.id, + label: Filters1D.digitalFilter.name, value: {}, flag: true, }, { - name: Filters.apodization.id, - label: Filters.apodization.name, + name: Filters1D.apodization.id, + label: Filters1D.apodization.name, value: {}, flag: false, }, { - name: Filters.zeroFilling.id, - label: Filters.zeroFilling.name, + name: Filters1D.zeroFilling.id, + label: Filters1D.zeroFilling.name, value: {}, flag: true, }, { - name: Filters.fft.id, - label: Filters.fft.name, + name: Filters1D.fft.id, + label: Filters1D.fft.name, value: {}, flag: true, }, { - name: Filters.phaseCorrection.id, - label: Filters.phaseCorrection.name, + name: Filters1D.phaseCorrection.id, + label: Filters1D.phaseCorrection.name, value: {}, flag: true, @@ -164,35 +164,35 @@ export const workspaceDefaultProperties: Required = { ], '13C': [ { - name: Filters.digitalFilter.id, - label: Filters.digitalFilter.name, + name: Filters1D.digitalFilter.id, + label: Filters1D.digitalFilter.name, value: {}, flag: true, }, { - name: Filters.apodization.id, - label: Filters.apodization.name, + name: Filters1D.apodization.id, + label: Filters1D.apodization.name, value: {}, flag: true, }, { - name: Filters.zeroFilling.id, - label: Filters.zeroFilling.name, + name: Filters1D.zeroFilling.id, + label: Filters1D.zeroFilling.name, value: {}, flag: true, }, { - name: Filters.fft.id, - label: Filters.fft.name, + name: Filters1D.fft.id, + label: Filters1D.fft.name, value: {}, flag: true, }, { - name: Filters.phaseCorrection.id, - label: Filters.phaseCorrection.name, + name: Filters1D.phaseCorrection.id, + label: Filters1D.phaseCorrection.name, value: {}, flag: true, diff --git a/src/data/data2d/Spectrum2D/getShift.ts b/src/data/data2d/Spectrum2D/getShift.ts index b3bfe1fb1..c116b2d36 100644 --- a/src/data/data2d/Spectrum2D/getShift.ts +++ b/src/data/data2d/Spectrum2D/getShift.ts @@ -1,5 +1,5 @@ import type { Spectrum2D } from 'nmr-load-save'; -import { Filters } from 'nmr-processing'; +import { Filters2D } from 'nmr-processing'; export interface Shift2D { x: number; @@ -10,10 +10,10 @@ export function getShift(spectrum: Spectrum2D): Shift2D { const shift = { x: 0, y: 0 }; if (spectrum?.filters) { for (const filter of spectrum.filters) { - if (filter.name === Filters.shift2DX.id) { + if (filter.name === Filters2D.shift2DX.id) { shift.x = filter?.flag ? filter.value.shift : 0; } - if (filter.name === Filters.shift2DY.id) { + if (filter.name === Filters2D.shift2DY.id) { shift.y = filter?.flag ? filter.value.shift : 0; } } From cb306f8d82fa67b433ff13d12626b343cffe8c68 Mon Sep 17 00:00:00 2001 From: hamed musallam Date: Thu, 24 Oct 2024 11:36:04 +0200 Subject: [PATCH 17/26] chore: update dependencies --- package-lock.json | 633 +++++++++++++++++++++++----------------------- package.json | 24 +- 2 files changed, 322 insertions(+), 335 deletions(-) diff --git a/package-lock.json b/package-lock.json index 963baee79..f782fef22 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,8 +53,8 @@ "re-resizable": "6.10.0", "react-d3-utils": "^2.0.0", "react-dropzone": "14.2.3", - "react-error-boundary": "^4.1.1", - "react-hook-form": "^7.53.0", + "react-error-boundary": "^4.1.2", + "react-hook-form": "^7.53.1", "react-icons": "^5.3.0", "react-inspector": "^6.0.2", "react-mf": "^2.0.3", @@ -70,23 +70,23 @@ "yup": "^1.4.0" }, "devDependencies": { - "@babel/plugin-transform-modules-commonjs": "^7.25.7", - "@babel/preset-react": "^7.25.7", - "@babel/preset-typescript": "^7.25.7", + "@babel/plugin-transform-modules-commonjs": "^7.25.9", + "@babel/preset-react": "^7.25.9", + "@babel/preset-typescript": "^7.25.9", "@playwright/test": "^1.48.1", "@simbathesailor/use-what-changed": "^2.0.0", "@types/d3": "^7.4.3", - "@types/lodash": "^4.17.10", - "@types/node": "^22.7.6", - "@types/papaparse": "^5.3.14", - "@types/react": "^18.3.11", + "@types/lodash": "^4.17.12", + "@types/node": "^22.7.9", + "@types/papaparse": "^5.3.15", + "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/react-table": "^7.7.20", "@vitejs/plugin-react-swc": "^3.7.1", "@vitest/coverage-v8": "^2.1.3", "cross-env": "^7.0.3", - "cspell": "^8.15.3", - "eslint": "^9.12.0", + "cspell": "^8.15.4", + "eslint": "^9.13.0", "eslint-config-cheminfo-react": "^14.0.0", "eslint-config-cheminfo-typescript": "^16.0.0", "modern-normalize": "^3.0.1", @@ -102,7 +102,7 @@ "stylelint": "^16.10.0", "stylelint-config-standard": "^36.0.1", "typescript": "^5.6.3", - "vite": "^5.4.9", + "vite": "^5.4.10", "vitest": "^2.1.3" }, "peerDependencies": { @@ -125,12 +125,12 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz", - "integrity": "sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.9.tgz", + "integrity": "sha512-z88xeGxnzehn2sqZ8UdGQEvYErF1odv2CftxInpSYJt6uHuPe9YjahKZITGs3l5LeI9d2ROG+obuDAoSlqbNfQ==", "license": "MIT", "dependencies": { - "@babel/highlight": "^7.25.7", + "@babel/highlight": "^7.25.9", "picocolors": "^1.0.0" }, "engines": { @@ -181,12 +181,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.7.tgz", - "integrity": "sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.25.9.tgz", + "integrity": "sha512-omlUGkr5EaoIJrhLf9CJ0TvjBRpd9+AXRG//0GEQ9THSo8wPiTlbpy1/Ow8ZTrbXpjd9FHXfbFQx32I04ht0FA==", "license": "MIT", "dependencies": { - "@babel/types": "^7.25.7", + "@babel/types": "^7.25.9", "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.25", "jsesc": "^3.0.2" @@ -196,13 +196,13 @@ } }, "node_modules/@babel/helper-annotate-as-pure": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.7.tgz", - "integrity": "sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz", + "integrity": "sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.7" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -227,18 +227,18 @@ } }, "node_modules/@babel/helper-create-class-features-plugin": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.7.tgz", - "integrity": "sha512-bD4WQhbkx80mAyj/WCm4ZHcF4rDxkoLFO6ph8/5/mQ3z4vAzltQXAmbc7GvVJx5H+lk5Mi5EmbTeox5nMGCsbw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz", + "integrity": "sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.7", - "@babel/helper-member-expression-to-functions": "^7.25.7", - "@babel/helper-optimise-call-expression": "^7.25.7", - "@babel/helper-replace-supers": "^7.25.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7", - "@babel/traverse": "^7.25.7", + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/helper-replace-supers": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/traverse": "^7.25.9", "semver": "^6.3.1" }, "engines": { @@ -249,43 +249,43 @@ } }, "node_modules/@babel/helper-member-expression-to-functions": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.7.tgz", - "integrity": "sha512-O31Ssjd5K6lPbTX9AAYpSKrZmLeagt9uwschJd+Ixo6QiRyfpvgtVQp8qrDR9UNFjZ8+DO34ZkdrN+BnPXemeA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz", + "integrity": "sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-imports": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.7.tgz", - "integrity": "sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz", + "integrity": "sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==", "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.7.tgz", - "integrity": "sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.25.9.tgz", + "integrity": "sha512-TvLZY/F3+GvdRYFZFyxMvnsKi+4oJdgZzU3BoGN9Uc2d9C6zfNwJcKKhjqLAhK8i46mv93jsO74fDh3ih6rpHA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-imports": "^7.25.7", - "@babel/helper-simple-access": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "@babel/traverse": "^7.25.7" + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-simple-access": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -295,22 +295,22 @@ } }, "node_modules/@babel/helper-optimise-call-expression": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.7.tgz", - "integrity": "sha512-VAwcwuYhv/AT+Vfr28c9y6SHzTan1ryqrydSTFGjU0uDJHw3uZ+PduI8plCLkRsDnqK2DMEDmwrOQRsK/Ykjng==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz", + "integrity": "sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.25.7" + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-plugin-utils": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.7.tgz", - "integrity": "sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz", + "integrity": "sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw==", "dev": true, "license": "MIT", "engines": { @@ -318,15 +318,15 @@ } }, "node_modules/@babel/helper-replace-supers": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.7.tgz", - "integrity": "sha512-iy8JhqlUW9PtZkd4pHM96v6BdJ66Ba9yWSE4z0W4TvSZwLBPkyDsiIU3ENe4SmrzRBs76F7rQXTy1lYC49n6Lw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz", + "integrity": "sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-member-expression-to-functions": "^7.25.7", - "@babel/helper-optimise-call-expression": "^7.25.7", - "@babel/traverse": "^7.25.7" + "@babel/helper-member-expression-to-functions": "^7.25.9", + "@babel/helper-optimise-call-expression": "^7.25.9", + "@babel/traverse": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -336,55 +336,55 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.7.tgz", - "integrity": "sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.25.9.tgz", + "integrity": "sha512-c6WHXuiaRsJTyHYLJV75t9IqsmTbItYfdj99PnzYGQZkYKvan5/2jKJ7gu31J3/BJ/A18grImSPModuyG/Eo0Q==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.7.tgz", - "integrity": "sha512-pPbNbchZBkPMD50K0p3JGcFMNLVUCuU/ABybm/PGNj4JiHrpmNyqqCphBk4i19xXtNV0JhldQJJtbSW5aUvbyA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz", + "integrity": "sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/traverse": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/traverse": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-string-parser": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz", - "integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz", + "integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz", - "integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz", + "integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==", "license": "MIT", "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-option": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.7.tgz", - "integrity": "sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.25.9.tgz", + "integrity": "sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==", "dev": true, "license": "MIT", "engines": { @@ -407,12 +407,12 @@ } }, "node_modules/@babel/highlight": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.7.tgz", - "integrity": "sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.25.9.tgz", + "integrity": "sha512-llL88JShoCsth8fF8R4SJnIn+WLvR6ccFxu1H3FlMhDontdcmZWf2HgIZ7AIqV3Xcck1idlohrN4EUBQz6klbw==", "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.25.7", + "@babel/helper-validator-identifier": "^7.25.9", "chalk": "^2.4.2", "js-tokens": "^4.0.0", "picocolors": "^1.0.0" @@ -422,12 +422,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.8.tgz", - "integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.9.tgz", + "integrity": "sha512-aI3jjAAO1fh7vY/pBGsn1i9LDbRP43+asrRlkPuTXW5yHXtd1NgTEMudbBoDDxrf1daEEfPJqR+JBMakzrR4Dg==", "license": "MIT", "dependencies": { - "@babel/types": "^7.25.8" + "@babel/types": "^7.25.9" }, "bin": { "parser": "bin/babel-parser.js" @@ -437,13 +437,13 @@ } }, "node_modules/@babel/plugin-syntax-jsx": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.7.tgz", - "integrity": "sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.25.9.tgz", + "integrity": "sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -453,13 +453,13 @@ } }, "node_modules/@babel/plugin-syntax-typescript": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.7.tgz", - "integrity": "sha512-rR+5FDjpCHqqZN2bzZm18bVYGaejGq5ZkpVCJLXor/+zlSrSoc4KWcHI0URVWjl/68Dyr1uwZUz/1njycEAv9g==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.25.9.tgz", + "integrity": "sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -469,15 +469,15 @@ } }, "node_modules/@babel/plugin-transform-modules-commonjs": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.7.tgz", - "integrity": "sha512-L9Gcahi0kKFYXvweO6n0wc3ZG1ChpSFdgG+eV1WYZ3/dGbJK7vvk91FgGgak8YwRgrCuihF8tE/Xg07EkL5COg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.25.9.tgz", + "integrity": "sha512-dwh2Ol1jWwL2MgkCzUSOvfmKElqQcuswAZypBSUsScMXvgdT8Ekq5YA6TtqpTVWH+4903NmboMuH1o9i8Rxlyg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-module-transforms": "^7.25.7", - "@babel/helper-plugin-utils": "^7.25.7", - "@babel/helper-simple-access": "^7.25.7" + "@babel/helper-module-transforms": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-simple-access": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -487,13 +487,13 @@ } }, "node_modules/@babel/plugin-transform-react-display-name": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.25.7.tgz", - "integrity": "sha512-r0QY7NVU8OnrwE+w2IWiRom0wwsTbjx4+xH2RTd7AVdof3uurXOF+/mXHQDRk+2jIvWgSaCHKMgggfvM4dyUGA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.25.9.tgz", + "integrity": "sha512-KJfMlYIUxQB1CJfO3e0+h0ZHWOTLCPP115Awhaz8U0Zpq36Gl/cXlpoyMRnUWlhNUBAzldnCiAZNvCDj7CrKxQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -503,17 +503,17 @@ } }, "node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.7.tgz", - "integrity": "sha512-vILAg5nwGlR9EXE8JIOX4NHXd49lrYbN8hnjffDtoULwpL9hUx/N55nqh2qd0q6FyNDfjl9V79ecKGvFbcSA0Q==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.25.9.tgz", + "integrity": "sha512-s5XwpQYCqGerXl+Pu6VDL3x0j2d82eiV77UJ8a2mDHAW7j9SWRqQ2y1fNo1Z74CdcYipl5Z41zvjj4Nfzq36rw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.7", - "@babel/helper-module-imports": "^7.25.7", - "@babel/helper-plugin-utils": "^7.25.7", - "@babel/plugin-syntax-jsx": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-module-imports": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/plugin-syntax-jsx": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -523,13 +523,13 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-development": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.25.7.tgz", - "integrity": "sha512-5yd3lH1PWxzW6IZj+p+Y4OLQzz0/LzlOG8vGqonHfVR3euf1vyzyMUJk9Ac+m97BH46mFc/98t9PmYLyvgL3qg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.25.9.tgz", + "integrity": "sha512-9mj6rm7XVYs4mdLIpbZnHOYdpW42uoiBCTVowg7sP1thUOiANgMb4UtpRivR0pp5iL+ocvUv7X4mZgFRpJEzGw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/plugin-transform-react-jsx": "^7.25.7" + "@babel/plugin-transform-react-jsx": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -539,14 +539,14 @@ } }, "node_modules/@babel/plugin-transform-react-pure-annotations": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.25.7.tgz", - "integrity": "sha512-6YTHJ7yjjgYqGc8S+CbEXhLICODk0Tn92j+vNJo07HFk9t3bjFgAKxPLFhHwF2NjmQVSI1zBRfBWUeVBa2osfA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.25.9.tgz", + "integrity": "sha512-KQ/Takk3T8Qzj5TppkS1be588lkbTp5uj7w6a0LeQaTMSckU/wK0oJ/pih+T690tkgI5jfmg2TqDJvd41Sj1Cg==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.7", - "@babel/helper-plugin-utils": "^7.25.7" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -556,17 +556,17 @@ } }, "node_modules/@babel/plugin-transform-typescript": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.7.tgz", - "integrity": "sha512-VKlgy2vBzj8AmEzunocMun2fF06bsSWV+FvVXohtL6FGve/+L217qhHxRTVGHEDO/YR8IANcjzgJsd04J8ge5Q==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.25.9.tgz", + "integrity": "sha512-7PbZQZP50tzv2KGGnhh82GSyMB01yKY9scIjf1a+GfZCtInOWqUH5+1EBU4t9fyR5Oykkkc9vFTs4OHrhHXljQ==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.25.7", - "@babel/helper-create-class-features-plugin": "^7.25.7", - "@babel/helper-plugin-utils": "^7.25.7", - "@babel/helper-skip-transparent-expression-wrappers": "^7.25.7", - "@babel/plugin-syntax-typescript": "^7.25.7" + "@babel/helper-annotate-as-pure": "^7.25.9", + "@babel/helper-create-class-features-plugin": "^7.25.9", + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-skip-transparent-expression-wrappers": "^7.25.9", + "@babel/plugin-syntax-typescript": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -576,18 +576,18 @@ } }, "node_modules/@babel/preset-react": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.25.7.tgz", - "integrity": "sha512-GjV0/mUEEXpi1U5ZgDprMRRgajGMRW3G5FjMr5KLKD8nT2fTG8+h/klV3+6Dm5739QE+K5+2e91qFKAYI3pmRg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.25.9.tgz", + "integrity": "sha512-D3to0uSPiWE7rBrdIICCd0tJSIGpLaaGptna2+w7Pft5xMqLpA1sz99DK5TZ1TjGbdQ/VI1eCSZ06dv3lT4JOw==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7", - "@babel/helper-validator-option": "^7.25.7", - "@babel/plugin-transform-react-display-name": "^7.25.7", - "@babel/plugin-transform-react-jsx": "^7.25.7", - "@babel/plugin-transform-react-jsx-development": "^7.25.7", - "@babel/plugin-transform-react-pure-annotations": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "@babel/plugin-transform-react-display-name": "^7.25.9", + "@babel/plugin-transform-react-jsx": "^7.25.9", + "@babel/plugin-transform-react-jsx-development": "^7.25.9", + "@babel/plugin-transform-react-pure-annotations": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -597,17 +597,17 @@ } }, "node_modules/@babel/preset-typescript": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.25.7.tgz", - "integrity": "sha512-rkkpaXJZOFN45Fb+Gki0c+KMIglk4+zZXOoMJuyEK8y8Kkc8Jd3BDmP7qPsz0zQMJj+UD7EprF+AqAXcILnexw==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/preset-typescript/-/preset-typescript-7.25.9.tgz", + "integrity": "sha512-XWxw1AcKk36kgxf4C//fl0ikjLeqGUWn062/Fd8GtpTfDJOX6Ud95FK+4JlDA36BX4bNGndXi3a6Vr4Jo5/61A==", "dev": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.25.7", - "@babel/helper-validator-option": "^7.25.7", - "@babel/plugin-syntax-jsx": "^7.25.7", - "@babel/plugin-transform-modules-commonjs": "^7.25.7", - "@babel/plugin-transform-typescript": "^7.25.7" + "@babel/helper-plugin-utils": "^7.25.9", + "@babel/helper-validator-option": "^7.25.9", + "@babel/plugin-syntax-jsx": "^7.25.9", + "@babel/plugin-transform-modules-commonjs": "^7.25.9", + "@babel/plugin-transform-typescript": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -629,30 +629,30 @@ } }, "node_modules/@babel/template": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.7.tgz", - "integrity": "sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz", + "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==", "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/types": "^7.25.7" + "@babel/code-frame": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/types": "^7.25.9" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/traverse": { - "version": "7.25.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.7.tgz", - "integrity": "sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.25.9.tgz", + "integrity": "sha512-ZCuvfwOwlz/bawvAuvcj8rrithP2/N55Tzz342AkTvq4qaWbGfmCk/tKhNaV2cthijKrPAA8SRJV5WWe7IBMJw==", "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.25.7", - "@babel/generator": "^7.25.7", - "@babel/parser": "^7.25.7", - "@babel/template": "^7.25.7", - "@babel/types": "^7.25.7", + "@babel/code-frame": "^7.25.9", + "@babel/generator": "^7.25.9", + "@babel/parser": "^7.25.9", + "@babel/template": "^7.25.9", + "@babel/types": "^7.25.9", "debug": "^4.3.1", "globals": "^11.1.0" }, @@ -661,14 +661,13 @@ } }, "node_modules/@babel/types": { - "version": "7.25.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.8.tgz", - "integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==", + "version": "7.25.9", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.9.tgz", + "integrity": "sha512-OwS2CM5KocvQ/k7dFJa8i5bNGJP0hXWfVCfDkqRFP1IreH1JDC7wG6eCYCi0+McbfT8OR/kNqsI0UU0xP9H6PQ==", "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.25.7", - "@babel/helper-validator-identifier": "^7.25.7", - "to-fast-properties": "^2.0.0" + "@babel/helper-string-parser": "^7.25.9", + "@babel/helper-validator-identifier": "^7.25.9" }, "engines": { "node": ">=6.9.0" @@ -766,9 +765,9 @@ } }, "node_modules/@cspell/cspell-bundled-dicts": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.3.tgz", - "integrity": "sha512-wIuJomJEJn60w+ts4dFBYEo3kkwdPe1R4qVn52hDq5CUzrNniSywCpeBQO8Sgy5ljk73ojENbMBCE8+Jrukk0Q==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-8.15.4.tgz", + "integrity": "sha512-t5b2JwGeUmzmjl319mCuaeKGxTvmzLLRmrpdHr+ZZGRO4nf7L48Lbe9A6uwNUvsZe0cXohiNXsrrsuzRVXswVA==", "dev": true, "license": "MIT", "dependencies": { @@ -782,7 +781,7 @@ "@cspell/dict-css": "^4.0.16", "@cspell/dict-dart": "^2.2.4", "@cspell/dict-django": "^4.1.3", - "@cspell/dict-docker": "^1.1.10", + "@cspell/dict-docker": "^1.1.11", "@cspell/dict-dotnet": "^5.0.8", "@cspell/dict-elixir": "^4.0.6", "@cspell/dict-en_us": "^4.3.26", @@ -813,17 +812,17 @@ "@cspell/dict-php": "^4.0.13", "@cspell/dict-powershell": "^5.0.13", "@cspell/dict-public-licenses": "^2.0.11", - "@cspell/dict-python": "^4.2.11", + "@cspell/dict-python": "^4.2.12", "@cspell/dict-r": "^2.0.4", "@cspell/dict-ruby": "^5.0.7", "@cspell/dict-rust": "^4.0.9", "@cspell/dict-scala": "^5.0.6", - "@cspell/dict-software-terms": "^4.1.10", + "@cspell/dict-software-terms": "^4.1.11", "@cspell/dict-sql": "^2.1.8", "@cspell/dict-svelte": "^1.0.5", "@cspell/dict-swift": "^2.0.4", "@cspell/dict-terraform": "^1.0.5", - "@cspell/dict-typescript": "^3.1.9", + "@cspell/dict-typescript": "^3.1.10", "@cspell/dict-vue": "^3.0.3" }, "engines": { @@ -831,22 +830,22 @@ } }, "node_modules/@cspell/cspell-json-reporter": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.3.tgz", - "integrity": "sha512-348UsYDdPTaGUvzdRY+Tj8rnN/1yLFkbEc6FkTejkBPwL0rpaJLp27N3Y8uZfrFGyMem/fYS+aHAvB3kTIzieQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-json-reporter/-/cspell-json-reporter-8.15.4.tgz", + "integrity": "sha512-solraYhZG4l++NeVCOtpc8DMvwHc46TmJt8DQbgvKtk6wOjTEcFrwKfA6Ei9YKbvyebJlpWMenO3goOll0loYg==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.15.3" + "@cspell/cspell-types": "8.15.4" }, "engines": { "node": ">=18" } }, "node_modules/@cspell/cspell-pipe": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.3.tgz", - "integrity": "sha512-Xodpkm1HJjGtmlL+V4B06PbeEsfhZtNwvPLTtaMExP4ED78VimBYlSz3lR+8jZgkHvZOhbQuHw7zwBqQd4u4Mg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-pipe/-/cspell-pipe-8.15.4.tgz", + "integrity": "sha512-WfCmZVFC6mX6vYlf02hWwelcSBTbDQgc5YqY+1miuMk+OHSUAHSACjZId6/a4IAID94xScvFfj7jgrdejUVvIQ==", "dev": true, "license": "MIT", "engines": { @@ -854,9 +853,9 @@ } }, "node_modules/@cspell/cspell-resolver": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.3.tgz", - "integrity": "sha512-KoSv9iGbItS1uGlXspTg9XQmbBnjR7wkW5Du9Q3pLYAjSwcmArOVqQnumNAPfTsIldn9WsBalwGSm/uwawxAPg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-resolver/-/cspell-resolver-8.15.4.tgz", + "integrity": "sha512-Zr428o+uUTqywrdKyjluJVnDPVAJEqZ1chQLKIrHggUah1cgs5aQ7rZ+0Rv5euYMlC2idZnP7IL6TDaIib80oA==", "dev": true, "license": "MIT", "dependencies": { @@ -867,9 +866,9 @@ } }, "node_modules/@cspell/cspell-service-bus": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.3.tgz", - "integrity": "sha512-BLAaAc9fWn/sdNo/Z7bPwHtQ+z7snUnjXoLHYY9Vg8N0K2nMYkuJqAm7xbeKDy64sLykpu+pubdMR3DqEQJo/g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-service-bus/-/cspell-service-bus-8.15.4.tgz", + "integrity": "sha512-pXYofnV/V9Y3LZdfFGbmhdxPX/ABjiD3wFjGHt5YhIU9hjVVuvjFlgY7pH2AvRjs4F8xKXv1ReWl44BJOL9gLA==", "dev": true, "license": "MIT", "engines": { @@ -877,9 +876,9 @@ } }, "node_modules/@cspell/cspell-types": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.3.tgz", - "integrity": "sha512-05xy2eeIQIHk2X6hUfBPBNbCnWcuSjE6D/F0XFTxLBl4ecUurSthJqvR3PrMjluETeZ71/cRIZMBnW+v7+yBgw==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/cspell-types/-/cspell-types-8.15.4.tgz", + "integrity": "sha512-1hDtgYDQVW11zgtrr12EmGW45Deoi7IjZOhzPFLb+3WkhZ46ggWdbrRalWwBolQPDDo6+B2Q6WXz5hdND+Tpwg==", "dev": true, "license": "MIT", "engines": { @@ -1006,9 +1005,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-filetypes": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.7.tgz", - "integrity": "sha512-/DN0Ujp9/EXvpTcgih9JmBaE8n+G0wtsspyNdvHT5luRfpfol1xm/CIQb6xloCXCiLkWX+EMPeLSiVIZq+24dA==", + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@cspell/dict-filetypes/-/dict-filetypes-3.0.8.tgz", + "integrity": "sha512-D3N8sm/iptzfVwsib/jvpX+K/++rM8SRpLDFUaM4jxm8EyGmSIYRbKZvdIv5BkAWmMlTWoRqlLn7Yb1b11jKJg==", "dev": true, "license": "MIT" }, @@ -1076,9 +1075,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-html": { - "version": "4.0.9", - "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.9.tgz", - "integrity": "sha512-BNp7w3m910K4qIVyOBOZxHuFNbVojUY6ES8Y8r7YjYgJkm2lCuQoVwwhPjurnomJ7BPmZTb+3LLJ58XIkgF7JQ==", + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.10.tgz", + "integrity": "sha512-I9uRAcdtHbh0wEtYZlgF0TTcgH0xaw1B54G2CW+tx4vHUwlde/+JBOfIzird4+WcMv4smZOfw+qHf7puFUbI5g==", "dev": true, "license": "MIT" }, @@ -1254,9 +1253,9 @@ "license": "MIT" }, "node_modules/@cspell/dict-typescript": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.10.tgz", - "integrity": "sha512-7Zek3w4Rh3ZYyhihJ34FdnUBwP3OmRldnEq3hZ+FgQ0PyYZjXv5ztEViRBBxXjiFx1nHozr6pLi74TxToD8xsg==", + "version": "3.1.11", + "resolved": "https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.1.11.tgz", + "integrity": "sha512-FwvK5sKbwrVpdw0e9+1lVTl8FPoHYvfHRuQRQz2Ql5XkC0gwPPkpoyD1zYImjIyZRoYXk3yp9j8ss4iz7A7zoQ==", "dev": true, "license": "MIT" }, @@ -1268,9 +1267,9 @@ "license": "MIT" }, "node_modules/@cspell/dynamic-import": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.3.tgz", - "integrity": "sha512-RG35KnoLSFRj9BwmDW3AmkEbh6NxkZrhRxCQ8s4ZfMl5QEkoYKdVpWYSPUBMlPqkq0U+SVggMvNbdMSqyITxxQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/dynamic-import/-/dynamic-import-8.15.4.tgz", + "integrity": "sha512-tr0F6EYN6qtniNvt1Uib+PgYQHeo4dQHXE2Optap+hYTOoQ2VoQ+SwBVjZ+Q2bmSAB0fmOyf0AvgsUtnWIpavw==", "dev": true, "license": "MIT", "dependencies": { @@ -1281,9 +1280,9 @@ } }, "node_modules/@cspell/filetypes": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.3.tgz", - "integrity": "sha512-2B22/c2/pVqS2p3latOj3zCHk7vUWsxwkhCKhOKMA2tKt2cc7MHKUKMfsX4XpfY/571S/TTy1YYeGXlAxUtF3g==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/filetypes/-/filetypes-8.15.4.tgz", + "integrity": "sha512-sNl6jr3ym/4151EY76qlI/00HHsiLZBqW7Vb1tqCzsgSg3EpL30ddjr74So6Sg2PN26Yf09hvxGTJzXn1R4aYw==", "dev": true, "license": "MIT", "engines": { @@ -1291,9 +1290,9 @@ } }, "node_modules/@cspell/strong-weak-map": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.3.tgz", - "integrity": "sha512-IhH+Reh2P+QXj8i5qGYsFI3Z01IWYMqUuN6CLnFXx5W0R8tWtxvmwWyT7j8lchV5foHSs8+mWaijKzwS6FSFVQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/strong-weak-map/-/strong-weak-map-8.15.4.tgz", + "integrity": "sha512-m5DeQksbhJFqcSYF8Q0Af/WXmXCMAJocCUShkzOXK+uZNXnvhBZN7VyQ9hL+GRzX8JTPEPdVcz2lFyVE5p+LzQ==", "dev": true, "license": "MIT", "engines": { @@ -1301,9 +1300,9 @@ } }, "node_modules/@cspell/url": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.3.tgz", - "integrity": "sha512-JuQdGHj+W5anXpc+2pYggoUd+LsbNac4Rc7PdUUTnzMxV1EvlQZs28jEK4y27i4RI5pNQmsUWGZTHeMuwdlgSQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/@cspell/url/-/url-8.15.4.tgz", + "integrity": "sha512-K2oZu/oLQPs5suRpLS8uu04O3YMUioSlEU1D66fRoOxzI5NzLt7i7yMg3HQHjChGa09N5bzqmrVdhmQrRZXwGg==", "dev": true, "license": "MIT", "engines": { @@ -2024,9 +2023,9 @@ } }, "node_modules/@eslint/core": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.6.0.tgz", - "integrity": "sha512-8I2Q8ykA4J0x0o7cg67FPVnehcqWTBehu/lmY+bolPFHGjh49YzGBMXTvpqVgEbBdvNCSxj6iFgiIyHzf03lzg==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.7.0.tgz", + "integrity": "sha512-xp5Jirz5DyPYlPiKat8jaq0EmYvDXKKpzTbxXMpT9eqlRJkRKIz9AGMdlvYjih+im+QlhWrpvVjl8IPC/lHlUw==", "dev": true, "license": "Apache-2.0", "engines": { @@ -2071,9 +2070,9 @@ } }, "node_modules/@eslint/js": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.12.0.tgz", - "integrity": "sha512-eohesHH8WFRUprDNyEREgqP6beG6htMeUYeCpkEgBCieCMme5r9zFWjzAJp//9S+Kub4rqE+jXe9Cp1a7IYIIA==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz", + "integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==", "dev": true, "license": "MIT", "engines": { @@ -3918,9 +3917,9 @@ "license": "MIT" }, "node_modules/@types/lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-YpS0zzoduEhuOWjAotS6A5AVCva7X4lVlYLF0FYHAY9sdraBfnatttHItlWeZdGhuEkf+OzMNg2ZYAx8t+52uQ==", + "version": "4.17.12", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.12.tgz", + "integrity": "sha512-sviUmCE8AYdaF/KIHLDJBQgeYzPBI0vf/17NaYehBJfYD1j6/L95Slh07NlyK2iNyBNaEkb3En2jRt+a8y3xZQ==", "license": "MIT" }, "node_modules/@types/lodash.merge": { @@ -3933,9 +3932,9 @@ } }, "node_modules/@types/node": { - "version": "22.7.6", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.6.tgz", - "integrity": "sha512-/d7Rnj0/ExXDMcioS78/kf1lMzYk4BZV8MZGTBKzTGZ6/406ukkbYlIsZmMPhcR5KlkunDHQLrtAVmSq7r+mSw==", + "version": "22.7.9", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.9.tgz", + "integrity": "sha512-jrTfRC7FM6nChvU7X2KqcrgquofrWLFDeYC1hKfwNWomVvrn7JIksqf344WN2X/y8xrgqBd2dJATZV4GbatBfg==", "dev": true, "license": "MIT", "dependencies": { @@ -3950,9 +3949,9 @@ "license": "MIT" }, "node_modules/@types/papaparse": { - "version": "5.3.14", - "resolved": "https://registry.npmjs.org/@types/papaparse/-/papaparse-5.3.14.tgz", - "integrity": "sha512-LxJ4iEFcpqc6METwp9f6BV6VVc43m6MfH0VqFosHvrUgfXiFe6ww7R3itkOQ+TCK6Y+Iv/+RnnvtRZnkc5Kc9g==", + "version": "5.3.15", + "resolved": "https://registry.npmjs.org/@types/papaparse/-/papaparse-5.3.15.tgz", + "integrity": "sha512-JHe6vF6x/8Z85nCX4yFdDslN11d+1pr12E526X8WAfhadOeaOTx5AuIkvDKIBopfvlzpzkdMx4YyvSKCM9oqtw==", "dev": true, "license": "MIT", "dependencies": { @@ -3972,9 +3971,9 @@ "license": "MIT" }, "node_modules/@types/react": { - "version": "18.3.11", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.11.tgz", - "integrity": "sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ==", + "version": "18.3.12", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.12.tgz", + "integrity": "sha512-D2wOSq/d6Agt28q7rSI3jhU7G6aiuzljDGZ2hTZHIkrTLUI+AF3WMeKkEZ9nN2fkBAlcktT6vcZjDFiIhMYEQw==", "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -5589,25 +5588,25 @@ } }, "node_modules/cspell": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.3.tgz", - "integrity": "sha512-diJiVBMunG3m7dYJpelSTsO4biLxVZ3glzLJF9jVs8n86dph04A9NXf29DKeAR0py62CFBKOrB1R4VGhxDxStg==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell/-/cspell-8.15.4.tgz", + "integrity": "sha512-hUOxcwmNWuHzVeGHyN5v/T9MkyCE5gi0mvatxsM794B2wOuR1ZORgjZH62P2HY1uBkXe/x5C6ITWrSyh0WgAcg==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-json-reporter": "8.15.3", - "@cspell/cspell-pipe": "8.15.3", - "@cspell/cspell-types": "8.15.3", - "@cspell/dynamic-import": "8.15.3", - "@cspell/url": "8.15.3", + "@cspell/cspell-json-reporter": "8.15.4", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "@cspell/dynamic-import": "8.15.4", + "@cspell/url": "8.15.4", "chalk": "^5.3.0", "chalk-template": "^1.1.0", "commander": "^12.1.0", - "cspell-dictionary": "8.15.3", - "cspell-gitignore": "8.15.3", - "cspell-glob": "8.15.3", - "cspell-io": "8.15.3", - "cspell-lib": "8.15.3", + "cspell-dictionary": "8.15.4", + "cspell-gitignore": "8.15.4", + "cspell-glob": "8.15.4", + "cspell-io": "8.15.4", + "cspell-lib": "8.15.4", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "get-stdin": "^9.0.0", @@ -5626,13 +5625,13 @@ } }, "node_modules/cspell-config-lib": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.3.tgz", - "integrity": "sha512-IMIvZ/2fzl628obiFhcgNsorcS4pimAgDi9M0k9GDA/zbLeweWZqjmSEN9tgUPvkRznQvJd0TZXJ0B5RkM5+2Q==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-config-lib/-/cspell-config-lib-8.15.4.tgz", + "integrity": "sha512-vUgikQTRkRMTdkZqSs7F2cTdPpX61cTjr/9L/VCkXkbW38ObCr4650ioiF1Wq3zDF3Gy2bc4ECTpD2PZUXX5SA==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-types": "8.15.3", + "@cspell/cspell-types": "8.15.4", "comment-json": "^4.2.5", "yaml": "^2.6.0" }, @@ -5654,15 +5653,15 @@ } }, "node_modules/cspell-dictionary": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.3.tgz", - "integrity": "sha512-FwYpDou0oyHmfjz70juVvIskZo1/+Xzq4s6eX2ZjUNQSp/jaykWNOiqIw5eVx0Z3sq3cWzCJ9zUuHcXxvFi7EQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-dictionary/-/cspell-dictionary-8.15.4.tgz", + "integrity": "sha512-8+p/l9Saac7qyCbqtELneDoT7CwHu9gYmnI8uXMu34/lPGjhVhy10ZeI0+t1djaO2YyASK400YFKq5uP/5KulA==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.15.3", - "@cspell/cspell-types": "8.15.3", - "cspell-trie-lib": "8.15.3", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "cspell-trie-lib": "8.15.4", "fast-equals": "^5.0.1" }, "engines": { @@ -5670,15 +5669,15 @@ } }, "node_modules/cspell-gitignore": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.3.tgz", - "integrity": "sha512-h1O9y3F81e8RyDE87Bv7m6Faz4FjkUhr72QqakbGuhRsjembST5YEw1B5Okc4BSUQhRER+dEh4xLp90EmNzZuw==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-gitignore/-/cspell-gitignore-8.15.4.tgz", + "integrity": "sha512-9n5PpQ8gEf8YcvEtoZGZ2Ma6wnqSFkD2GrmyjISy39DfIX/jNLN7GX2wJm6OD2P4FjXer95ypmIb/JWTlfmbTw==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/url": "8.15.3", - "cspell-glob": "8.15.3", - "cspell-io": "8.15.3", + "@cspell/url": "8.15.4", + "cspell-glob": "8.15.4", + "cspell-io": "8.15.4", "find-up-simple": "^1.0.0" }, "bin": { @@ -5689,13 +5688,13 @@ } }, "node_modules/cspell-glob": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.3.tgz", - "integrity": "sha512-nsxe1PCFZyOHxVeo3Bqi2MyVy2JASF9p1xSCZAFjiVjeRmeqDrS098UcoucXRDFScJ2RP8A62niC6P3m6qg5IA==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-glob/-/cspell-glob-8.15.4.tgz", + "integrity": "sha512-TTfRRHRAN+PN9drIz4MAEgKKYnPThBOlPMdFddyuisvU33Do1sPAnqkkOjTEFdi3jAA5KwnSva68SVH6IzzMBQ==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/url": "8.15.3", + "@cspell/url": "8.15.4", "micromatch": "^4.0.8" }, "engines": { @@ -5703,14 +5702,14 @@ } }, "node_modules/cspell-grammar": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.3.tgz", - "integrity": "sha512-HCtGzym6JsdrYjwGySxKFsLjvASAgftv7nEOTBFp/u3Y2zVPmoQaFmmlSWBbJRsNQa9elL0DyQOSC7WC6GbGSQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-grammar/-/cspell-grammar-8.15.4.tgz", + "integrity": "sha512-MKiKyYi05mRtXOxPoTv3Ksi0GwYLiK84Uq0C+5PaMrnIjXeed0bsddSFXCT+7ywFJc7PdjhTtz0M/9WWK3UgbA==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.15.3", - "@cspell/cspell-types": "8.15.3" + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4" }, "bin": { "cspell-grammar": "bin.mjs" @@ -5720,42 +5719,42 @@ } }, "node_modules/cspell-io": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.3.tgz", - "integrity": "sha512-ycKrfTSurfleQNR5x7QRmQ/qtMJ6JkBiqaq5qtCHNYUlOjrmQBNVXFpbmPJ3+qG+ObW+eQKEvZH5xr17F2BMjw==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-io/-/cspell-io-8.15.4.tgz", + "integrity": "sha512-rXIEREPTFV9dwwg4EKfvzqlCNOvT6910AYED5YrSt8Y68usRJ9lbqdx0BrDndVCd33bp1o+9JBfHuRiFIQC81g==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-service-bus": "8.15.3", - "@cspell/url": "8.15.3" + "@cspell/cspell-service-bus": "8.15.4", + "@cspell/url": "8.15.4" }, "engines": { "node": ">=18" } }, "node_modules/cspell-lib": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.3.tgz", - "integrity": "sha512-LJIEZ3E8ZCOAqcMwkonXH3NEa6ITTlp3nZ9nhmxHE0GbMUYP5/CmTCWSnJUjrINmhjl5dMj6Z7xzDTgEAu0K9Q==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-lib/-/cspell-lib-8.15.4.tgz", + "integrity": "sha512-iLp/625fvCyFFxSyZYLMgqHIKcrhN4hT7Hw5+ySa38Bp/OfA81ANqWHpsDQ0bGsALTRn/DHBpQYj4xCW/aN9tw==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-bundled-dicts": "8.15.3", - "@cspell/cspell-pipe": "8.15.3", - "@cspell/cspell-resolver": "8.15.3", - "@cspell/cspell-types": "8.15.3", - "@cspell/dynamic-import": "8.15.3", - "@cspell/filetypes": "8.15.3", - "@cspell/strong-weak-map": "8.15.3", - "@cspell/url": "8.15.3", + "@cspell/cspell-bundled-dicts": "8.15.4", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-resolver": "8.15.4", + "@cspell/cspell-types": "8.15.4", + "@cspell/dynamic-import": "8.15.4", + "@cspell/filetypes": "8.15.4", + "@cspell/strong-weak-map": "8.15.4", + "@cspell/url": "8.15.4", "clear-module": "^4.1.2", "comment-json": "^4.2.5", - "cspell-config-lib": "8.15.3", - "cspell-dictionary": "8.15.3", - "cspell-glob": "8.15.3", - "cspell-grammar": "8.15.3", - "cspell-io": "8.15.3", - "cspell-trie-lib": "8.15.3", + "cspell-config-lib": "8.15.4", + "cspell-dictionary": "8.15.4", + "cspell-glob": "8.15.4", + "cspell-grammar": "8.15.4", + "cspell-io": "8.15.4", + "cspell-trie-lib": "8.15.4", "env-paths": "^3.0.0", "fast-equals": "^5.0.1", "gensequence": "^7.0.0", @@ -5770,14 +5769,14 @@ } }, "node_modules/cspell-trie-lib": { - "version": "8.15.3", - "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.3.tgz", - "integrity": "sha512-sJwGFE3ymkL6UsnZbMOGcD+iDOdYo7gyVafMDUJvb4rnKqAhLJumiCPT4bPLQ7oWAti7swHBQrOJ/Wp3phQ+LQ==", + "version": "8.15.4", + "resolved": "https://registry.npmjs.org/cspell-trie-lib/-/cspell-trie-lib-8.15.4.tgz", + "integrity": "sha512-sg9klsNHyrfos0Boiio+qy5d6fI9cCNjBqFYrNxvpKpwZ4gEzDzjgEKdZY1C76RD2KoBQ8I1NF5YcGc0+hhhCw==", "dev": true, "license": "MIT", "dependencies": { - "@cspell/cspell-pipe": "8.15.3", - "@cspell/cspell-types": "8.15.3", + "@cspell/cspell-pipe": "8.15.4", + "@cspell/cspell-types": "8.15.4", "gensequence": "^7.0.0" }, "engines": { @@ -6770,18 +6769,18 @@ } }, "node_modules/eslint": { - "version": "9.12.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.12.0.tgz", - "integrity": "sha512-UVIOlTEWxwIopRL1wgSQYdnVDcEvs2wyaO6DGo5mXqe3r16IoCNWkR29iHhyaP4cICWjbgbmFUGAhh0GJRuGZw==", + "version": "9.13.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz", + "integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==", "dev": true, "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.11.0", "@eslint/config-array": "^0.18.0", - "@eslint/core": "^0.6.0", + "@eslint/core": "^0.7.0", "@eslint/eslintrc": "^3.1.0", - "@eslint/js": "9.12.0", + "@eslint/js": "9.13.0", "@eslint/plugin-kit": "^0.2.0", "@humanfs/node": "^0.16.5", "@humanwhocodes/module-importer": "^1.0.1", @@ -11223,16 +11222,13 @@ } }, "node_modules/react-error-boundary": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.1.1.tgz", - "integrity": "sha512-EOAEsbVm2EQD8zPS4m24SiaR/506RPC3CjMcjJ5JWKECsctyLsDTKxB26Hvl7jcz7KweSOkBYAcY/hmMpMn2jA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/react-error-boundary/-/react-error-boundary-4.1.2.tgz", + "integrity": "sha512-GQDxZ5Jd+Aq/qUxbCm1UtzmL/s++V7zKgE8yMktJiCQXCCFZnMZh9ng+6/Ne6PjNSXH0L9CjeOEREfRnq6Duag==", "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5" }, - "engines": { - "pnpm": "=9" - }, "peerDependencies": { "react": ">=16.13.1" } @@ -11244,9 +11240,9 @@ "license": "MIT" }, "node_modules/react-hook-form": { - "version": "7.53.0", - "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.53.0.tgz", - "integrity": "sha512-M1n3HhqCww6S2hxLxciEXy2oISPnAzxY7gvwVPrtlczTM/1dDadXgUxDpHMrMTblDOcm/AXtXxHwZ3jpg1mqKQ==", + "version": "7.53.1", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.53.1.tgz", + "integrity": "sha512-6aiQeBda4zjcuaugWvim9WsGqisoUk+etmFEsSUMm451/Ic8L/UAb7sRtMj3V+Hdzm6mMjU1VhiSzYUZeBm0Vg==", "license": "MIT", "engines": { "node": ">=18.0.0" @@ -13447,15 +13443,6 @@ "node": ">=14.0.0" } }, - "node_modules/to-fast-properties": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", - "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -13882,9 +13869,9 @@ } }, "node_modules/vite": { - "version": "5.4.9", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.9.tgz", - "integrity": "sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==", + "version": "5.4.10", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.10.tgz", + "integrity": "sha512-1hvaPshuPUtxeQ0hsVH3Mud0ZanOLwVTneA1EgbAM5LhaZEqyPWGRQ7BtaMvUrTDeEaC8pxtj6a6jku3x4z6SQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 2ed26956e..ca86fe508 100644 --- a/package.json +++ b/package.json @@ -98,8 +98,8 @@ "re-resizable": "6.10.0", "react-d3-utils": "^2.0.0", "react-dropzone": "14.2.3", - "react-error-boundary": "^4.1.1", - "react-hook-form": "^7.53.0", + "react-error-boundary": "^4.1.2", + "react-hook-form": "^7.53.1", "react-icons": "^5.3.0", "react-inspector": "^6.0.2", "react-mf": "^2.0.3", @@ -115,23 +115,23 @@ "yup": "^1.4.0" }, "devDependencies": { - "@babel/plugin-transform-modules-commonjs": "^7.25.7", - "@babel/preset-react": "^7.25.7", - "@babel/preset-typescript": "^7.25.7", + "@babel/plugin-transform-modules-commonjs": "^7.25.9", + "@babel/preset-react": "^7.25.9", + "@babel/preset-typescript": "^7.25.9", "@playwright/test": "^1.48.1", "@simbathesailor/use-what-changed": "^2.0.0", "@types/d3": "^7.4.3", - "@types/lodash": "^4.17.10", - "@types/node": "^22.7.6", - "@types/papaparse": "^5.3.14", - "@types/react": "^18.3.11", + "@types/lodash": "^4.17.12", + "@types/node": "^22.7.9", + "@types/papaparse": "^5.3.15", + "@types/react": "^18.3.12", "@types/react-dom": "^18.3.1", "@types/react-table": "^7.7.20", "@vitejs/plugin-react-swc": "^3.7.1", "@vitest/coverage-v8": "^2.1.3", "cross-env": "^7.0.3", - "cspell": "^8.15.3", - "eslint": "^9.12.0", + "cspell": "^8.15.4", + "eslint": "^9.13.0", "eslint-config-cheminfo-react": "^14.0.0", "eslint-config-cheminfo-typescript": "^16.0.0", "modern-normalize": "^3.0.1", @@ -147,7 +147,7 @@ "stylelint": "^16.10.0", "stylelint-config-standard": "^36.0.1", "typescript": "^5.6.3", - "vite": "^5.4.9", + "vite": "^5.4.10", "vitest": "^2.1.3" } } From efaaa1070e97d9473909d1ef2340dac980c12b10 Mon Sep 17 00:00:00 2001 From: hamed musallam Date: Fri, 25 Oct 2024 20:12:33 +0200 Subject: [PATCH 18/26] refactor: add auto highlights the entire content functionality to number input component --- src/component/elements/NumberInput2.tsx | 27 +++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/component/elements/NumberInput2.tsx b/src/component/elements/NumberInput2.tsx index a1a9a39ee..29d14cd64 100644 --- a/src/component/elements/NumberInput2.tsx +++ b/src/component/elements/NumberInput2.tsx @@ -8,20 +8,26 @@ import { useState, isValidElement, forwardRef, + useRef, } from 'react'; +import type { ForwardedRef } from 'react'; + +import useCombinedRefs from '../hooks/useCombinedRefs.js'; interface ValueProps extends Pick, 'name' | 'style'>, Pick { checkValue?: (element?: number) => boolean; debounceTime?: number; + autoSelect?: boolean; +} +interface UseInputProps extends Omit { + ref: ForwardedRef; } -type UseInputProps = Omit; export interface NumberInput2Props extends Omit, ValueProps { format?: () => (element: string) => number | string; - autoSelect?: boolean; } function useNumberInput(props: UseInputProps) { @@ -29,9 +35,13 @@ function useNumberInput(props: UseInputProps) { value: externalValue, debounceTime, onValueChange, + ref, + autoSelect, checkValue, } = props; const [internalValue, setValue] = useState(); + const localRef = useRef(); + const innerRef = useCombinedRefs([ref, localRef]); const value = debounceTime ? internalValue : externalValue; const [isDebounced, setDebouncedStatus] = useState(false); @@ -57,6 +67,12 @@ function useNumberInput(props: UseInputProps) { } }, [debounceTime, externalValue]); + useEffect(() => { + if (autoSelect) { + innerRef?.current?.select(); + } + }, [autoSelect, innerRef]); + function handleValueChange( valueAsNumber: number, valueAsString: string, @@ -79,6 +95,7 @@ function useNumberInput(props: UseInputProps) { debounceOnValueChange, isDebounced, value, + innerRef, }; } @@ -110,9 +127,11 @@ function InnerNumberInput(props: NumberInput2Props, ref) { ...otherInputProps } = props; - const { handleValueChange, isDebounced, value } = useNumberInput({ + const { handleValueChange, isDebounced, value, innerRef } = useNumberInput({ value: externalValue, debounceTime, + autoSelect, + ref, onValueChange, checkValue, }); @@ -124,7 +143,7 @@ function InnerNumberInput(props: NumberInput2Props, ref) { Date: Mon, 28 Oct 2024 11:23:37 +0100 Subject: [PATCH 19/26] refactor: improve editable input field component --- src/component/elements/EditableColumn.tsx | 247 ++++++++++++------ .../panels/IntegralsPanel/IntegralTable.tsx | 2 +- .../panels/MoleculesPanel/MoleculeHeader.tsx | 5 +- .../panels/PeaksPanel/PeaksTable.tsx | 2 +- .../TableColumns/RangeAssignmentColumn.tsx | 3 +- .../TableColumns/RelativeColumn.tsx | 2 +- .../TableColumns/SignalDeltaColumn.tsx | 2 +- .../CorrelationTable/CorrelationTableRow.tsx | 2 +- .../TableColumns/SignalDeltaColumn.tsx | 2 +- .../ZoneAssignmentLabelColumn.tsx | 3 +- test-e2e/panels/ranges.test.ts | 6 +- 11 files changed, 184 insertions(+), 92 deletions(-) diff --git a/src/component/elements/EditableColumn.tsx b/src/component/elements/EditableColumn.tsx index bf4e13eb2..f16ef1ab2 100644 --- a/src/component/elements/EditableColumn.tsx +++ b/src/component/elements/EditableColumn.tsx @@ -1,4 +1,6 @@ -import type { CSSProperties, ChangeEvent, KeyboardEvent } from 'react'; +import { Button } from '@blueprintjs/core'; +import styled from '@emotion/styled'; +import type { CSSProperties, KeyboardEvent } from 'react'; import { forwardRef, useCallback, @@ -7,8 +9,41 @@ import { useState, } from 'react'; -import type { InputProps } from './Input.js'; -import Input from './Input.js'; +import { Input2 } from './Input2.js'; +import { NumberInput2 } from './NumberInput2.js'; + +interface OverflowProps { + textOverflowEllipses: boolean; +} + +const Text = styled.span` + display: table-cell; + vertical-align: middle; + width: 100%; + height: 100%; + ${({ textOverflowEllipses }) => + textOverflowEllipses && + ` + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + `} +`; +const Container = styled.span` + display: table; + width: 100%; + min-height: 22px; + height: 100%; + ${({ textOverflowEllipses }) => + textOverflowEllipses && + ` + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + display: inline-flex; + align-items:end; + `} +`; function extractNumber(val: string | number, type: string) { if (type === 'number' && typeof val !== 'number') { @@ -18,37 +53,45 @@ function extractNumber(val: string | number, type: string) { return val; } -interface EditableColumnProps - extends Omit { +function handleMousedown(event) { + event.stopPropagation(); +} + +const style: CSSProperties = { minWidth: 60 }; +const className = 'editable-column'; + +interface BaseEditableColumnProps { + type: 'number' | 'text'; + value: number | string; + validate?: (value?: string | number) => boolean; +} + +interface EditableColumnProps extends BaseEditableColumnProps { onSave?: (element: KeyboardEvent) => void; onEditStart?: (element: boolean) => void; - type?: 'number' | 'text'; editStatus?: boolean; - value: string | number; style?: CSSProperties; - validate?: (value?: string | number) => boolean; - textOverFlowEllipses?: boolean; + textOverflowEllipses?: boolean; + clickType?: 'single' | 'double'; } -const EditableColumn = forwardRef(function EditableColumn( +export const EditableColumn = forwardRef(function EditableColumn( props: EditableColumnProps, ref: any, ) { const { - onSave = () => null, + onSave, value, - type = 'text', + type, style, - onEditStart = () => null, + onEditStart, editStatus = false, - validate = () => true, - textOverFlowEllipses = false, - ...InputProps + validate, + textOverflowEllipses = false, + clickType = 'single', } = props; const [enabled, enableEdit] = useState(); - const [isValid, setValid] = useState(true); - const [val, setVal] = useState(extractNumber(value, type)); useEffect(() => { enableEdit(editStatus); }, [editStatus]); @@ -71,85 +114,131 @@ const EditableColumn = forwardRef(function EditableColumn( function startEditHandler() { globalThis.addEventListener('mousedown', mouseClickCallback); - onEditStart(true); + onEditStart?.(true); enableEdit(true); } - function saveHandler(event: KeyboardEvent) { - const valid = validate(val); - setValid(valid); - // when press Enter or Tab - if (valid && ['Enter', 'Tab'].includes(event.key)) { - onSave(event); - enableEdit(false); - globalThis.removeEventListener('mousedown', mouseClickCallback); - } - // close edit mode if press Enter, Tab or Escape - if (['Escape'].includes(event.key)) { - enableEdit(false); - globalThis.removeEventListener('mousedown', mouseClickCallback); - } + function onConfirm(event: KeyboardEvent) { + onSave?.(event); + enableEdit(false); + globalThis.removeEventListener('mousedown', mouseClickCallback); + } + + function onCancel() { + enableEdit(false); + globalThis.removeEventListener('mousedown', mouseClickCallback); } - function handleChange(e: ChangeEvent) { - setVal(e.target.value); + let clickHandler = {}; + + if (clickType === 'single' && !enabled) { + clickHandler = { onClick: startEditHandler }; + } + + if (clickType === 'double' && !enabled) { + clickHandler = { onDoubleClick: startEditHandler }; } return ( -
{!enabled && ( - - {value}   - + + {value ?? ' '} + )} {enabled && (
- e.stopPropagation()} - {...InputProps} + onConfirm={onConfirm} + onCancel={onCancel} + validate={validate} />
)} -
+ ); }); -export default EditableColumn; +interface EditFiledProps extends BaseEditableColumnProps { + onConfirm: (event: KeyboardEvent) => void; + onCancel: (event?: KeyboardEvent) => void; +} + +function EditFiled(props: EditFiledProps) { + const { value: externalValue, type, onConfirm, onCancel, validate } = props; + + const [isValid, setValid] = useState(true); + const [value, setVal] = useState(extractNumber(externalValue, type)); + + function handleKeydown(event: KeyboardEvent) { + const valid = typeof validate === 'function' ? validate(value) : true; + setValid(valid); + // when press Enter or Tab + if (valid && ['Enter', 'Tab'].includes(event.key)) { + onConfirm(event); + } + // close edit mode if press Enter, Tab or Escape + if (['Escape'].includes(event.key)) { + onCancel(event); + } + } + + function handleChange(value: string | number) { + setVal(value); + } + + const intent = !isValid ? 'danger' : 'none'; + + const rightElement = ( +