nmrium 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component/1d/peaks/PeakEditionManager.d.ts +1 -1
- package/lib/component/1d-2d/tools/BrushXY.js +6 -6
- package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
- package/lib/component/2d/1d-tracer/Left1DChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Left1DChart.js +6 -2
- package/lib/component/2d/1d-tracer/Left1DChart.js.map +1 -1
- package/lib/component/2d/1d-tracer/Ranges1D.d.ts +9 -0
- package/lib/component/2d/1d-tracer/Ranges1D.d.ts.map +1 -0
- package/lib/component/2d/1d-tracer/Ranges1D.js +76 -0
- package/lib/component/2d/1d-tracer/Ranges1D.js.map +1 -0
- package/lib/component/2d/1d-tracer/Signals1D.d.ts +11 -0
- package/lib/component/2d/1d-tracer/Signals1D.d.ts.map +1 -0
- package/lib/component/2d/1d-tracer/Signals1D.js +90 -0
- package/lib/component/2d/1d-tracer/Signals1D.js.map +1 -0
- package/lib/component/2d/1d-tracer/Top1DChart.d.ts.map +1 -1
- package/lib/component/2d/1d-tracer/Top1DChart.js +6 -2
- package/lib/component/2d/1d-tracer/Top1DChart.js.map +1 -1
- package/lib/component/2d/ft/FTContainer.d.ts.map +1 -1
- package/lib/component/2d/ft/FTContainer.js.map +1 -1
- package/lib/component/AnchorSVG.d.ts +37 -0
- package/lib/component/AnchorSVG.d.ts.map +1 -0
- package/lib/component/AnchorSVG.js +137 -0
- package/lib/component/AnchorSVG.js.map +1 -0
- package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
- package/lib/component/EventsTrackers/BrushTracker.js +4 -0
- package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
- package/lib/component/context/KeyModifierContext.d.ts +1 -0
- package/lib/component/context/KeyModifierContext.d.ts.map +1 -1
- package/lib/component/context/KeyModifierContext.js +4 -0
- package/lib/component/context/KeyModifierContext.js.map +1 -1
- package/lib/component/elements/DraggableDialog.d.ts.map +1 -1
- package/lib/component/elements/DraggableDialog.js +1 -2
- package/lib/component/elements/DraggableDialog.js.map +1 -1
- package/lib/component/elements/Sections.d.ts +3 -3
- package/lib/component/elements/Sections.d.ts.map +1 -1
- package/lib/component/elements/Sections.js +1 -1
- package/lib/component/elements/Sections.js.map +1 -1
- package/lib/component/elements/export/ExportOptionsModal.js +2 -5
- package/lib/component/elements/export/ExportOptionsModal.js.map +1 -1
- package/lib/component/header/Header.d.ts.map +1 -1
- package/lib/component/header/Header.js +2 -4
- package/lib/component/header/Header.js.map +1 -1
- package/lib/component/hooks/useSaveSettings.d.ts.map +1 -1
- package/lib/component/hooks/useSaveSettings.js +3 -6
- package/lib/component/hooks/useSaveSettings.js.map +1 -1
- package/lib/component/modal/PublicationStringModal.d.ts.map +1 -1
- package/lib/component/modal/PublicationStringModal.js +2 -6
- package/lib/component/modal/PublicationStringModal.js.map +1 -1
- package/lib/component/modal/SaveAsModal.js +3 -6
- package/lib/component/modal/SaveAsModal.js.map +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.d.ts.map +1 -1
- package/lib/component/modal/aboutUs/AboutUsModal.js +2 -4
- package/lib/component/modal/aboutUs/AboutUsModal.js.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.d.ts.map +1 -1
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js +38 -36
- package/lib/component/modal/editRange/forms/components/NewSignalTab.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/errors/context.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/errors/renderer.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.d.ts.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js +9 -12
- package/lib/component/modal/setting/tanstack_general_settings/general_settings.js.map +1 -1
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_body.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_footer.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/general_settings_dialog_header.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/hooks/use_safe_workspace.d.ts +4 -4
- package/lib/component/modal/setting/tanstack_general_settings/tabs/auto_processing_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/axis_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/database_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/export_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/external_api_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/general_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/import_filters_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/nuclei_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/panels_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_colors_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/spectra_label_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/title_block_tab.d.ts +24 -24
- package/lib/component/modal/setting/tanstack_general_settings/tabs/tools_tab.d.ts +24 -24
- package/lib/component/panels/PeaksPanel/PeaksPanel.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPanel.js +1 -9
- package/lib/component/panels/PeaksPanel/PeaksPanel.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js +1 -1
- package/lib/component/panels/PeaksPanel/PeaksPreferences.js.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
- package/lib/component/panels/PeaksPanel/PeaksTable.js +9 -9
- package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.d.ts.map +1 -1
- package/lib/component/panels/SummaryPanel/SummaryPanel.js +7 -0
- package/lib/component/panels/SummaryPanel/SummaryPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/FilterPanel.d.ts.map +1 -1
- package/lib/component/panels/filtersPanel/FilterPanel.js +5 -2
- package/lib/component/panels/filtersPanel/FilterPanel.js.map +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js +1 -1
- package/lib/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.js.map +1 -1
- package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts +2 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.d.ts.map +1 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.js +144 -0
- package/lib/component/panels/filtersPanel/processings_sections_panel.js.map +1 -0
- package/lib/component/reducer/Reducer.d.ts.map +1 -1
- package/lib/component/reducer/Reducer.js +2 -0
- package/lib/component/reducer/Reducer.js.map +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js +1 -1
- package/lib/component/reducer/actions/CorrelationsActions.js.map +1 -1
- package/lib/component/reducer/actions/MoleculeActions.d.ts +9 -0
- package/lib/component/reducer/actions/MoleculeActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.d.ts +11 -2
- package/lib/component/reducer/actions/RangesActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/RangesActions.js +23 -5
- package/lib/component/reducer/actions/RangesActions.js.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
- package/lib/component/reducer/actions/ToolsActions.js +5 -17
- package/lib/component/reducer/actions/ToolsActions.js.map +1 -1
- package/lib/component/reducer/helper/getTraceSpectrumID.d.ts +5 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.d.ts.map +1 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.js +14 -0
- package/lib/component/reducer/helper/getTraceSpectrumID.js.map +1 -0
- package/lib/component/toolbar/nmr_toolbar.d.ts.map +1 -1
- package/lib/component/toolbar/nmr_toolbar.js +3 -1
- package/lib/component/toolbar/nmr_toolbar.js.map +1 -1
- package/lib/component/utility/CoreSlot.d.ts +27 -0
- package/lib/component/utility/CoreSlot.d.ts.map +1 -0
- package/lib/component/utility/CoreSlot.js +56 -0
- package/lib/component/utility/CoreSlot.js.map +1 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js +1 -0
- package/lib/data/data1d/Spectrum1D/peaks/autoPeakPicking.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js +35 -30
- package/lib/data/data1d/Spectrum1D/peaks/optimizePeaks.js.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.d.ts.map +1 -1
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js +1 -0
- package/lib/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.js.map +1 -1
- package/lib/versionInfo.js +1 -1
- package/package.json +25 -24
- package/src/component/1d-2d/tools/BrushXY.tsx +8 -8
- package/src/component/2d/1d-tracer/Left1DChart.tsx +24 -1
- package/src/component/2d/1d-tracer/Ranges1D.tsx +134 -0
- package/src/component/2d/1d-tracer/Signals1D.tsx +145 -0
- package/src/component/2d/1d-tracer/Top1DChart.tsx +29 -2
- package/src/component/2d/ft/FTContainer.tsx +1 -0
- package/src/component/AnchorSVG.tsx +370 -0
- package/src/component/EventsTrackers/BrushTracker.tsx +6 -0
- package/src/component/context/KeyModifierContext.tsx +5 -0
- package/src/component/elements/DraggableDialog.tsx +1 -2
- package/src/component/elements/Sections.tsx +4 -4
- package/src/component/elements/export/ExportOptionsModal.tsx +22 -31
- package/src/component/header/Header.tsx +2 -4
- package/src/component/hooks/useSaveSettings.tsx +4 -15
- package/src/component/modal/PublicationStringModal.tsx +5 -11
- package/src/component/modal/SaveAsModal.tsx +41 -50
- package/src/component/modal/aboutUs/AboutUsModal.tsx +5 -4
- package/src/component/modal/editRange/forms/components/NewSignalTab.tsx +57 -57
- package/src/component/modal/setting/tanstack_general_settings/general_settings.tsx +23 -29
- package/src/component/panels/PeaksPanel/PeaksPanel.tsx +1 -8
- package/src/component/panels/PeaksPanel/PeaksPreferences.tsx +1 -1
- package/src/component/panels/PeaksPanel/PeaksTable.tsx +11 -9
- package/src/component/panels/SummaryPanel/SummaryPanel.tsx +13 -11
- package/src/component/panels/filtersPanel/FilterPanel.tsx +10 -0
- package/src/component/panels/filtersPanel/Filters/base/BaseApodizationOptions.tsx +1 -0
- package/src/component/panels/filtersPanel/processings_sections_panel.tsx +324 -0
- package/src/component/reducer/Reducer.ts +2 -0
- package/src/component/reducer/actions/CorrelationsActions.ts +1 -1
- package/src/component/reducer/actions/RangesActions.ts +39 -5
- package/src/component/reducer/actions/ToolsActions.ts +5 -21
- package/src/component/reducer/helper/getTraceSpectrumID.tsx +25 -0
- package/src/component/toolbar/nmr_toolbar.tsx +3 -2
- package/src/component/utility/CoreSlot.tsx +126 -0
- package/src/data/data1d/Spectrum1D/peaks/autoPeakPicking.ts +1 -0
- package/src/data/data1d/Spectrum1D/peaks/optimizePeaks.ts +35 -30
- package/src/data/data1d/Spectrum1D/ranges/detectSignalsByMultipletAnalysis.ts +1 -0
- package/src/versionInfo.ts +1 -1
- package/lib/component/utility/renderCoreSlot.d.ts +0 -11
- package/lib/component/utility/renderCoreSlot.d.ts.map +0 -1
- package/lib/component/utility/renderCoreSlot.js +0 -13
- package/lib/component/utility/renderCoreSlot.js.map +0 -1
- package/src/component/utility/renderCoreSlot.tsx +0 -21
|
@@ -36,6 +36,9 @@ export function optimizePeaks(
|
|
|
36
36
|
groupingFactor: 10,
|
|
37
37
|
stages: [
|
|
38
38
|
{
|
|
39
|
+
// Stage 1: local stabilization
|
|
40
|
+
factorLimits: 2,
|
|
41
|
+
maxNumberOfPeaks: 40,
|
|
39
42
|
optimization: {
|
|
40
43
|
kind: 'lm',
|
|
41
44
|
options: { maxIterations: 20, errorTolerance: 1e-3 },
|
|
@@ -43,98 +46,100 @@ export function optimizePeaks(
|
|
|
43
46
|
parameters: {
|
|
44
47
|
fwhm: {
|
|
45
48
|
optimize: true,
|
|
46
|
-
min: (peak: any) => (peak.shape?.fwhm ?? 0)
|
|
49
|
+
min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
|
|
47
50
|
max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
|
|
48
51
|
},
|
|
49
52
|
mu: { optimize: false },
|
|
50
53
|
x: { optimize: false },
|
|
51
54
|
y: {
|
|
52
55
|
optimize: true,
|
|
53
|
-
init: (peak: any) => peak.y
|
|
56
|
+
init: (peak: any) => peak.y,
|
|
54
57
|
},
|
|
55
58
|
},
|
|
56
59
|
},
|
|
57
60
|
{
|
|
61
|
+
factorLimits: 2,
|
|
62
|
+
maxNumberOfPeaks: 40,
|
|
58
63
|
optimization: {
|
|
59
64
|
kind: 'lm',
|
|
60
|
-
options: { maxIterations: 20, errorTolerance:
|
|
65
|
+
options: { maxIterations: 20, errorTolerance: 1e-3 },
|
|
61
66
|
},
|
|
62
67
|
parameters: {
|
|
63
68
|
fwhm: {
|
|
64
69
|
optimize: true,
|
|
65
|
-
min: (peak: any) => (peak.shape?.fwhm ?? 0)
|
|
70
|
+
min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
|
|
66
71
|
max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
|
|
67
72
|
},
|
|
68
73
|
mu: { optimize: false },
|
|
69
74
|
x: { optimize: false },
|
|
70
75
|
y: {
|
|
71
76
|
optimize: true,
|
|
77
|
+
init: (peak: any) => peak.y,
|
|
72
78
|
},
|
|
73
79
|
},
|
|
74
80
|
},
|
|
75
81
|
{
|
|
82
|
+
// Stage 2: regroup into the real overlapping cluster
|
|
83
|
+
factorLimits: 2,
|
|
84
|
+
maxNumberOfPeaks: 40,
|
|
76
85
|
optimization: {
|
|
77
86
|
kind: 'lm',
|
|
78
|
-
options: { maxIterations:
|
|
87
|
+
options: { maxIterations: 25, errorTolerance: 1e-4 },
|
|
79
88
|
},
|
|
80
89
|
parameters: {
|
|
81
90
|
fwhm: {
|
|
82
91
|
optimize: true,
|
|
83
|
-
min: (peak: any) => (peak.shape?.fwhm ?? 0)
|
|
92
|
+
min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
|
|
84
93
|
max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
|
|
85
94
|
},
|
|
86
95
|
mu: { optimize: true },
|
|
87
96
|
x: { optimize: false },
|
|
88
|
-
y: {
|
|
89
|
-
optimize: true,
|
|
90
|
-
},
|
|
97
|
+
y: { optimize: true },
|
|
91
98
|
},
|
|
92
99
|
},
|
|
93
100
|
{
|
|
101
|
+
// Stage 3: final polish
|
|
102
|
+
factorLimits: 2,
|
|
103
|
+
maxNumberOfPeaks: 40,
|
|
94
104
|
optimization: {
|
|
95
105
|
kind: 'lm',
|
|
96
|
-
options: { maxIterations:
|
|
106
|
+
options: { maxIterations: 30, errorTolerance: 1e-5 },
|
|
97
107
|
},
|
|
98
108
|
parameters: {
|
|
99
109
|
fwhm: {
|
|
100
110
|
optimize: true,
|
|
101
|
-
min: (peak: any) => (peak.shape?.fwhm ?? 0)
|
|
102
|
-
max: (peak: any) => (peak.shape?.fwhm ?? 0) *
|
|
111
|
+
min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
|
|
112
|
+
max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
|
|
103
113
|
},
|
|
104
114
|
mu: { optimize: true },
|
|
105
|
-
x: {
|
|
106
|
-
y: { optimize: true },
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
optimization: {
|
|
111
|
-
kind: 'lm',
|
|
112
|
-
options: { maxIterations: 20, errorTolerance: 1e-4 },
|
|
113
|
-
},
|
|
114
|
-
parameters: {
|
|
115
|
-
fwhm: {
|
|
115
|
+
x: {
|
|
116
116
|
optimize: true,
|
|
117
|
-
min: (peak: any) => (peak.shape?.fwhm ?? 0) /
|
|
118
|
-
max: (peak: any) => (peak.shape?.fwhm ?? 0)
|
|
117
|
+
min: (peak: any) => peak.x - (peak.shape?.fwhm ?? 0) / 4,
|
|
118
|
+
max: (peak: any) => peak.x + (peak.shape?.fwhm ?? 0) / 4,
|
|
119
119
|
},
|
|
120
|
-
mu: { optimize: false },
|
|
121
|
-
x: { optimize: true },
|
|
122
120
|
y: { optimize: true },
|
|
123
121
|
},
|
|
124
122
|
},
|
|
125
123
|
{
|
|
124
|
+
// Stage 3: final polish
|
|
125
|
+
factorLimits: 2,
|
|
126
|
+
maxNumberOfPeaks: 40,
|
|
126
127
|
optimization: {
|
|
127
128
|
kind: 'lm',
|
|
128
|
-
options: { maxIterations:
|
|
129
|
+
options: { maxIterations: 30, errorTolerance: 1e-5 },
|
|
129
130
|
},
|
|
130
131
|
parameters: {
|
|
131
132
|
fwhm: {
|
|
132
133
|
optimize: true,
|
|
133
|
-
min: (peak: any) => (peak.shape?.fwhm ?? 0)
|
|
134
|
+
min: (peak: any) => (peak.shape?.fwhm ?? 0) * 0.5,
|
|
134
135
|
max: (peak: any) => (peak.shape?.fwhm ?? 0) * 2,
|
|
135
136
|
},
|
|
136
137
|
mu: { optimize: true },
|
|
137
|
-
x: {
|
|
138
|
+
x: {
|
|
139
|
+
optimize: true,
|
|
140
|
+
min: (peak: any) => peak.x - (peak.shape?.fwhm ?? 0) / 4,
|
|
141
|
+
max: (peak: any) => peak.x + (peak.shape?.fwhm ?? 0) / 4,
|
|
142
|
+
},
|
|
138
143
|
y: { optimize: true },
|
|
139
144
|
},
|
|
140
145
|
},
|
package/src/versionInfo.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default { version: 'v2.
|
|
1
|
+
export default { version: 'v2.4.0' };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { NMRiumCore, SupportedUISlot } from '@zakodium/nmrium-core';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
/**
|
|
4
|
-
* Render all components registered in the given slot.
|
|
5
|
-
*
|
|
6
|
-
* @param core
|
|
7
|
-
* @param slot
|
|
8
|
-
* @param fallback - return fallback if no component is registered in the slot
|
|
9
|
-
*/
|
|
10
|
-
export declare function renderCoreSlot(core: NMRiumCore, slot: SupportedUISlot, fallback?: ReactNode): ReactNode;
|
|
11
|
-
//# sourceMappingURL=renderCoreSlot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderCoreSlot.d.ts","sourceRoot":"","sources":["../../../src/component/utility/renderCoreSlot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;GAMG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,eAAe,EACrB,QAAQ,CAAC,EAAE,SAAS,GACnB,SAAS,CAMX"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Render all components registered in the given slot.
|
|
4
|
-
*
|
|
5
|
-
* @param core
|
|
6
|
-
* @param slot
|
|
7
|
-
* @param fallback - return fallback if no component is registered in the slot
|
|
8
|
-
*/
|
|
9
|
-
export function renderCoreSlot(core, slot, fallback) {
|
|
10
|
-
const jsx = Array.from(core.slot(slot), ([key, Component]) => (_jsx(Component, { slot: slot }, key)));
|
|
11
|
-
return jsx.length > 0 ? jsx : fallback;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=renderCoreSlot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"renderCoreSlot.js","sourceRoot":"","sources":["../../../src/component/utility/renderCoreSlot.tsx"],"names":[],"mappings":";AAGA;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAC5B,IAAgB,EAChB,IAAqB,EACrB,QAAoB;IAEpB,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAC5D,KAAC,SAAS,IAAW,IAAI,EAAE,IAAI,IAAf,GAAG,CAAgB,CACpC,CAAC,CAAC;IAEH,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC;AACzC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { NMRiumCore, SupportedUISlot } from '@zakodium/nmrium-core';
|
|
2
|
-
import type { ReactNode } from 'react';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Render all components registered in the given slot.
|
|
6
|
-
*
|
|
7
|
-
* @param core
|
|
8
|
-
* @param slot
|
|
9
|
-
* @param fallback - return fallback if no component is registered in the slot
|
|
10
|
-
*/
|
|
11
|
-
export function renderCoreSlot(
|
|
12
|
-
core: NMRiumCore,
|
|
13
|
-
slot: SupportedUISlot,
|
|
14
|
-
fallback?: ReactNode,
|
|
15
|
-
): ReactNode {
|
|
16
|
-
const jsx = Array.from(core.slot(slot), ([key, Component]) => (
|
|
17
|
-
<Component key={key} slot={slot} />
|
|
18
|
-
));
|
|
19
|
-
|
|
20
|
-
return jsx.length > 0 ? jsx : fallback;
|
|
21
|
-
}
|