nmrium 2.7.0 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (268) hide show
  1. package/lib/component/1d/BrushTracker1D.d.ts.map +1 -1
  2. package/lib/component/1d/BrushTracker1D.js +15 -14
  3. package/lib/component/1d/BrushTracker1D.js.map +1 -1
  4. package/lib/component/1d/Viewer1D.d.ts.map +1 -1
  5. package/lib/component/1d/Viewer1D.js +2 -1
  6. package/lib/component/1d/Viewer1D.js.map +1 -1
  7. package/lib/component/1d/plugin_chart_brush_tracker.d.ts +2 -0
  8. package/lib/component/1d/plugin_chart_brush_tracker.d.ts.map +1 -0
  9. package/lib/component/1d/plugin_chart_brush_tracker.js +41 -0
  10. package/lib/component/1d/plugin_chart_brush_tracker.js.map +1 -0
  11. package/lib/component/1d-2d/tools/BrushXY.d.ts +1 -1
  12. package/lib/component/1d-2d/tools/BrushXY.d.ts.map +1 -1
  13. package/lib/component/1d-2d/tools/BrushXY.js.map +1 -1
  14. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts +1 -1
  15. package/lib/component/1d-2d/tools/CrossLinePointer.d.ts.map +1 -1
  16. package/lib/component/1d-2d/tools/CrossLinePointer.js.map +1 -1
  17. package/lib/component/2d/BrushTracker2D.js.map +1 -1
  18. package/lib/component/2d/utilities/DimensionLayout.d.ts +1 -1
  19. package/lib/component/2d/utilities/DimensionLayout.d.ts.map +1 -1
  20. package/lib/component/EventsTrackers/BrushTracker.d.ts +1 -84
  21. package/lib/component/EventsTrackers/BrushTracker.d.ts.map +1 -1
  22. package/lib/component/EventsTrackers/BrushTracker.js +70 -3
  23. package/lib/component/EventsTrackers/BrushTracker.js.map +1 -1
  24. package/lib/component/EventsTrackers/brush_tracker.types.d.ts +93 -0
  25. package/lib/component/EventsTrackers/brush_tracker.types.d.ts.map +1 -0
  26. package/lib/component/EventsTrackers/brush_tracker.types.js +2 -0
  27. package/lib/component/EventsTrackers/brush_tracker.types.js.map +1 -0
  28. package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts +7 -0
  29. package/lib/component/EventsTrackers/brush_tracker_events_listeners.d.ts.map +1 -0
  30. package/lib/component/EventsTrackers/brush_tracker_events_listeners.js +15 -0
  31. package/lib/component/EventsTrackers/brush_tracker_events_listeners.js.map +1 -0
  32. package/lib/component/elements/tanstack_table/create_action_column.d.ts +11 -0
  33. package/lib/component/elements/tanstack_table/create_action_column.d.ts.map +1 -0
  34. package/lib/component/elements/tanstack_table/create_action_column.js +24 -0
  35. package/lib/component/elements/tanstack_table/create_action_column.js.map +1 -0
  36. package/lib/component/elements/tanstack_table/create_column_helper.d.ts +5 -0
  37. package/lib/component/elements/tanstack_table/create_column_helper.d.ts.map +1 -0
  38. package/lib/component/elements/tanstack_table/create_column_helper.js +5 -0
  39. package/lib/component/elements/tanstack_table/create_column_helper.js.map +1 -0
  40. package/lib/component/elements/{ReactTable/BaseReactTable.d.ts → tanstack_table/elements/base_react_table.d.ts} +1 -1
  41. package/lib/component/elements/tanstack_table/elements/base_react_table.d.ts.map +1 -0
  42. package/lib/component/elements/{ReactTable/BaseReactTable.js → tanstack_table/elements/base_react_table.js} +1 -1
  43. package/lib/component/elements/tanstack_table/elements/base_react_table.js.map +1 -0
  44. package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.d.ts → tanstack_table/elements/empty_data_row.d.ts} +1 -1
  45. package/lib/component/elements/tanstack_table/elements/empty_data_row.d.ts.map +1 -0
  46. package/lib/component/elements/{ReactTable/Elements/EmptyDataRow.js → tanstack_table/elements/empty_data_row.js} +1 -1
  47. package/lib/component/elements/tanstack_table/elements/empty_data_row.js.map +1 -0
  48. package/lib/component/elements/tanstack_table/elements/table_context.d.ts +4 -0
  49. package/lib/component/elements/tanstack_table/elements/table_context.d.ts.map +1 -0
  50. package/lib/component/elements/tanstack_table/elements/table_context.js +11 -0
  51. package/lib/component/elements/tanstack_table/elements/table_context.js.map +1 -0
  52. package/lib/component/elements/tanstack_table/elements/table_header.d.ts +12 -0
  53. package/lib/component/elements/tanstack_table/elements/table_header.d.ts.map +1 -0
  54. package/lib/component/elements/tanstack_table/elements/table_header.js +42 -0
  55. package/lib/component/elements/tanstack_table/elements/table_header.js.map +1 -0
  56. package/lib/component/elements/tanstack_table/elements/table_row.d.ts +12 -0
  57. package/lib/component/elements/tanstack_table/elements/table_row.d.ts.map +1 -0
  58. package/lib/component/elements/{ReactTable/Elements/ReactTableRow.js → tanstack_table/elements/table_row.js} +18 -17
  59. package/lib/component/elements/tanstack_table/elements/table_row.js.map +1 -0
  60. package/lib/component/elements/tanstack_table/features.d.ts +21 -0
  61. package/lib/component/elements/tanstack_table/features.d.ts.map +1 -0
  62. package/lib/component/elements/tanstack_table/features.js +14 -0
  63. package/lib/component/elements/tanstack_table/features.js.map +1 -0
  64. package/lib/component/elements/tanstack_table/index.d.ts +6 -0
  65. package/lib/component/elements/tanstack_table/index.d.ts.map +1 -0
  66. package/lib/component/elements/tanstack_table/index.js +6 -0
  67. package/lib/component/elements/tanstack_table/index.js.map +1 -0
  68. package/lib/component/elements/tanstack_table/table.d.ts +26 -0
  69. package/lib/component/elements/tanstack_table/table.d.ts.map +1 -0
  70. package/lib/component/elements/{ReactTable/ReactTable.js → tanstack_table/table.js} +29 -37
  71. package/lib/component/elements/tanstack_table/table.js.map +1 -0
  72. package/lib/component/elements/tanstack_table/types.d.ts +47 -0
  73. package/lib/component/elements/tanstack_table/types.d.ts.map +1 -0
  74. package/lib/component/elements/tanstack_table/types.js +2 -0
  75. package/lib/component/elements/tanstack_table/types.js.map +1 -0
  76. package/lib/component/header/AutoPeakPickingOptionPanel.js +1 -1
  77. package/lib/component/header/AutoPeakPickingOptionPanel.js.map +1 -1
  78. package/lib/component/modal/ImportPublicationStringModal.d.ts.map +1 -1
  79. package/lib/component/modal/ImportPublicationStringModal.js +91 -73
  80. package/lib/component/modal/ImportPublicationStringModal.js.map +1 -1
  81. package/lib/component/modal/LogsHistoryModal.d.ts.map +1 -1
  82. package/lib/component/modal/LogsHistoryModal.js +44 -40
  83. package/lib/component/modal/LogsHistoryModal.js.map +1 -1
  84. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.d.ts.map +1 -1
  85. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js +48 -44
  86. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.js.map +1 -1
  87. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.d.ts.map +1 -1
  88. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js +36 -32
  89. package/lib/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.js.map +1 -1
  90. package/lib/component/modal/metaImportation/MetaImportationModal.d.ts.map +1 -1
  91. package/lib/component/modal/metaImportation/MetaImportationModal.js +15 -14
  92. package/lib/component/modal/metaImportation/MetaImportationModal.js.map +1 -1
  93. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts +1 -1
  94. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.d.ts.map +1 -1
  95. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js +29 -26
  96. package/lib/component/panels/AutomaticAssignment/AutomaticAssignmentTable.js.map +1 -1
  97. package/lib/component/panels/IntegralsPanel/IntegralTable.d.ts.map +1 -1
  98. package/lib/component/panels/IntegralsPanel/IntegralTable.js +70 -76
  99. package/lib/component/panels/IntegralsPanel/IntegralTable.js.map +1 -1
  100. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.d.ts.map +1 -1
  101. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js +33 -29
  102. package/lib/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.js.map +1 -1
  103. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts +8 -6
  104. package/lib/component/panels/PeaksPanel/PeaksTable.d.ts.map +1 -1
  105. package/lib/component/panels/PeaksPanel/PeaksTable.js +116 -126
  106. package/lib/component/panels/PeaksPanel/PeaksTable.js.map +1 -1
  107. package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts +2 -2
  108. package/lib/component/panels/PeaksPanel/peaksToTSV.d.ts.map +1 -1
  109. package/lib/component/panels/PeaksPanel/peaksToTSV.js +9 -11
  110. package/lib/component/panels/PeaksPanel/peaksToTSV.js.map +1 -1
  111. package/lib/component/panels/RangesPanel/RangesTable.d.ts +3 -2
  112. package/lib/component/panels/RangesPanel/RangesTable.d.ts.map +1 -1
  113. package/lib/component/panels/RangesPanel/RangesTable.js.map +1 -1
  114. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts +2 -2
  115. package/lib/component/panels/RangesPanel/RangesTableRow.d.ts.map +1 -1
  116. package/lib/component/panels/SpectraPanel/SpectraTable.d.ts.map +1 -1
  117. package/lib/component/panels/SpectraPanel/SpectraTable.js +37 -26
  118. package/lib/component/panels/SpectraPanel/SpectraTable.js.map +1 -1
  119. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts +1 -1
  120. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.d.ts.map +1 -1
  121. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js +56 -52
  122. package/lib/component/panels/SpectraPanel/base/SpectraColumnsManager.js.map +1 -1
  123. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.d.ts.map +1 -1
  124. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js +23 -20
  125. package/lib/component/panels/SummaryPanel/SetShiftTolerancesModal.js.map +1 -1
  126. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts +2 -2
  127. package/lib/component/panels/ZonesPanel/ZonesTableRow.d.ts.map +1 -1
  128. package/lib/component/panels/databasePanel/DatabaseTable.d.ts +1 -1
  129. package/lib/component/panels/databasePanel/DatabaseTable.d.ts.map +1 -1
  130. package/lib/component/panels/databasePanel/DatabaseTable.js +171 -153
  131. package/lib/component/panels/databasePanel/DatabaseTable.js.map +1 -1
  132. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.d.ts.map +1 -1
  133. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js +27 -24
  134. package/lib/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.js.map +1 -1
  135. package/lib/component/panels/informationPanel/InformationEditionModal.d.ts.map +1 -1
  136. package/lib/component/panels/informationPanel/InformationEditionModal.js +69 -64
  137. package/lib/component/panels/informationPanel/InformationEditionModal.js.map +1 -1
  138. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.d.ts.map +1 -1
  139. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js +17 -20
  140. package/lib/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.js.map +1 -1
  141. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.d.ts.map +1 -1
  142. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js +25 -20
  143. package/lib/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.js.map +1 -1
  144. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.d.ts.map +1 -1
  145. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js +41 -36
  146. package/lib/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.js.map +1 -1
  147. package/lib/component/panels/spectrumSimulation/SpinSystemTable.d.ts.map +1 -1
  148. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js +14 -15
  149. package/lib/component/panels/spectrumSimulation/SpinSystemTable.js.map +1 -1
  150. package/lib/component/reducer/actions/DatabaseActions.d.ts.map +1 -1
  151. package/lib/component/reducer/actions/DatabaseActions.js +3 -2
  152. package/lib/component/reducer/actions/DatabaseActions.js.map +1 -1
  153. package/lib/component/reducer/actions/InsetActions.d.ts +1 -1
  154. package/lib/component/reducer/actions/InsetActions.d.ts.map +1 -1
  155. package/lib/component/reducer/actions/ToolsActions.d.ts +1 -1
  156. package/lib/component/reducer/actions/ToolsActions.d.ts.map +1 -1
  157. package/lib/component/reducer/helper/Zoom1DManager.d.ts +1 -1
  158. package/lib/component/reducer/helper/Zoom1DManager.d.ts.map +1 -1
  159. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts +1 -1
  160. package/lib/component/reducer/helper/ZoomHistoryManager.d.ts.map +1 -1
  161. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts +1 -1
  162. package/lib/component/reducer/preferences/actions/matrixGeneration.d.ts.map +1 -1
  163. package/lib/component/utility/Events.d.ts +1 -1
  164. package/lib/component/utility/Events.d.ts.map +1 -1
  165. package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts +9 -0
  166. package/lib/component/utility/core_slots/core_operator_brush.commons.d.ts.map +1 -0
  167. package/lib/component/utility/core_slots/core_operator_brush.commons.js +15 -0
  168. package/lib/component/utility/core_slots/core_operator_brush.commons.js.map +1 -0
  169. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts +7 -0
  170. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.d.ts.map +1 -0
  171. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js +82 -0
  172. package/lib/component/utility/core_slots/core_operator_chart_brush.commons.js.map +1 -0
  173. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts +8 -0
  174. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.d.ts.map +1 -0
  175. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js +11 -0
  176. package/lib/component/utility/core_slots/core_operator_chart_brush_tracker.js.map +1 -0
  177. package/lib/component/utility/core_slots/core_operator_chart_svg.js +1 -13
  178. package/lib/component/utility/core_slots/core_operator_chart_svg.js.map +1 -1
  179. package/lib/versionInfo.js +1 -1
  180. package/package.json +5 -6
  181. package/src/component/1d/BrushTracker1D.tsx +19 -21
  182. package/src/component/1d/Viewer1D.tsx +2 -0
  183. package/src/component/1d/plugin_chart_brush_tracker.tsx +63 -0
  184. package/src/component/1d-2d/tools/BrushXY.tsx +1 -1
  185. package/src/component/1d-2d/tools/CrossLinePointer.tsx +1 -1
  186. package/src/component/2d/BrushTracker2D.tsx +5 -5
  187. package/src/component/2d/utilities/DimensionLayout.ts +1 -1
  188. package/src/component/EventsTrackers/BrushTracker.tsx +118 -115
  189. package/src/component/EventsTrackers/brush_tracker.types.ts +111 -0
  190. package/src/component/EventsTrackers/brush_tracker_events_listeners.ts +32 -0
  191. package/src/component/elements/tanstack_table/create_action_column.tsx +43 -0
  192. package/src/component/elements/tanstack_table/create_column_helper.ts +11 -0
  193. package/src/component/elements/tanstack_table/elements/table_context.ts +15 -0
  194. package/src/component/elements/tanstack_table/elements/table_header.tsx +111 -0
  195. package/src/component/elements/{ReactTable/Elements/ReactTableRow.tsx → tanstack_table/elements/table_row.tsx} +51 -50
  196. package/src/component/elements/tanstack_table/features.ts +33 -0
  197. package/src/component/elements/tanstack_table/index.ts +5 -0
  198. package/src/component/elements/{ReactTable/ReactTable.tsx → tanstack_table/table.tsx} +78 -157
  199. package/src/component/elements/tanstack_table/types.ts +86 -0
  200. package/src/component/header/AutoPeakPickingOptionPanel.tsx +1 -1
  201. package/src/component/modal/ImportPublicationStringModal.tsx +160 -136
  202. package/src/component/modal/LogsHistoryModal.tsx +32 -25
  203. package/src/component/modal/editRange/forms/components/signal-tabs/SignalJCouplingsTable.tsx +28 -24
  204. package/src/component/modal/editRange/forms/components/signal-tabs/SignalPeaksTable.tsx +27 -25
  205. package/src/component/modal/metaImportation/MetaImportationModal.tsx +19 -15
  206. package/src/component/panels/AutomaticAssignment/AutomaticAssignmentTable.tsx +27 -25
  207. package/src/component/panels/IntegralsPanel/IntegralTable.tsx +75 -89
  208. package/src/component/panels/MatrixGenerationPanel/ExclusionsZonesTable.tsx +68 -60
  209. package/src/component/panels/PeaksPanel/PeaksTable.tsx +126 -124
  210. package/src/component/panels/PeaksPanel/peaksToTSV.ts +14 -15
  211. package/src/component/panels/RangesPanel/RangesTable.tsx +3 -2
  212. package/src/component/panels/RangesPanel/RangesTableRow.tsx +2 -2
  213. package/src/component/panels/SpectraPanel/SpectraTable.tsx +58 -36
  214. package/src/component/panels/SpectraPanel/base/SpectraColumnsManager.tsx +31 -35
  215. package/src/component/panels/SummaryPanel/SetShiftTolerancesModal.tsx +25 -20
  216. package/src/component/panels/ZonesPanel/ZonesTableRow.tsx +2 -2
  217. package/src/component/panels/databasePanel/DatabasePanel.tsx +1 -1
  218. package/src/component/panels/databasePanel/DatabaseTable.tsx +189 -183
  219. package/src/component/panels/filtersPanel/Filters/ExclusionZonesOptionsPanel.tsx +20 -20
  220. package/src/component/panels/informationPanel/InformationEditionModal.tsx +40 -37
  221. package/src/component/panels/multipleAnalysisPanel/MultipleSpectraAnalysisTable.tsx +23 -24
  222. package/src/component/panels/multipleAnalysisPanel/preferences/AnalysisTablePreferences.tsx +33 -24
  223. package/src/component/panels/multipleAnalysisPanel/preferences/LegendsPreferences.tsx +34 -31
  224. package/src/component/panels/spectrumSimulation/SpinSystemTable.tsx +19 -18
  225. package/src/component/reducer/actions/DatabaseActions.ts +4 -3
  226. package/src/component/reducer/actions/InsetActions.ts +1 -1
  227. package/src/component/reducer/actions/ToolsActions.ts +1 -1
  228. package/src/component/reducer/helper/Zoom1DManager.ts +1 -1
  229. package/src/component/reducer/helper/ZoomHistoryManager.ts +1 -1
  230. package/src/component/reducer/preferences/actions/matrixGeneration.ts +1 -1
  231. package/src/component/utility/Events.tsx +1 -1
  232. package/src/component/utility/core_slots/core_operator_brush.commons.ts +18 -0
  233. package/src/component/utility/core_slots/core_operator_chart_brush.commons.ts +138 -0
  234. package/src/component/utility/core_slots/core_operator_chart_brush_tracker.tsx +27 -0
  235. package/src/component/utility/core_slots/core_operator_chart_svg.tsx +2 -17
  236. package/src/versionInfo.ts +1 -1
  237. package/lib/component/elements/ReactTable/BaseReactTable.d.ts.map +0 -1
  238. package/lib/component/elements/ReactTable/BaseReactTable.js.map +0 -1
  239. package/lib/component/elements/ReactTable/Elements/EmptyDataRow.d.ts.map +0 -1
  240. package/lib/component/elements/ReactTable/Elements/EmptyDataRow.js.map +0 -1
  241. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts +0 -10
  242. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.d.ts.map +0 -1
  243. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js +0 -27
  244. package/lib/component/elements/ReactTable/Elements/ReactTableHeader.js.map +0 -1
  245. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts +0 -16
  246. package/lib/component/elements/ReactTable/Elements/ReactTableRow.d.ts.map +0 -1
  247. package/lib/component/elements/ReactTable/Elements/ReactTableRow.js.map +0 -1
  248. package/lib/component/elements/ReactTable/ReactTable.d.ts +0 -64
  249. package/lib/component/elements/ReactTable/ReactTable.d.ts.map +0 -1
  250. package/lib/component/elements/ReactTable/ReactTable.js.map +0 -1
  251. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts +0 -4
  252. package/lib/component/elements/ReactTable/utility/ReactTableContext.d.ts.map +0 -1
  253. package/lib/component/elements/ReactTable/utility/ReactTableContext.js +0 -11
  254. package/lib/component/elements/ReactTable/utility/ReactTableContext.js.map +0 -1
  255. package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts +0 -19
  256. package/lib/component/elements/ReactTable/utility/addCustomColumn.d.ts.map +0 -1
  257. package/lib/component/elements/ReactTable/utility/addCustomColumn.js +0 -36
  258. package/lib/component/elements/ReactTable/utility/addCustomColumn.js.map +0 -1
  259. package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts +0 -9
  260. package/lib/component/elements/ReactTable/utility/useRowSpan.d.ts.map +0 -1
  261. package/lib/component/elements/ReactTable/utility/useRowSpan.js +0 -40
  262. package/lib/component/elements/ReactTable/utility/useRowSpan.js.map +0 -1
  263. package/src/component/elements/ReactTable/Elements/ReactTableHeader.tsx +0 -81
  264. package/src/component/elements/ReactTable/utility/ReactTableContext.ts +0 -14
  265. package/src/component/elements/ReactTable/utility/addCustomColumn.tsx +0 -75
  266. package/src/component/elements/ReactTable/utility/useRowSpan.ts +0 -61
  267. /package/src/component/elements/{ReactTable/BaseReactTable.tsx → tanstack_table/elements/base_react_table.tsx} +0 -0
  268. /package/src/component/elements/{ReactTable/Elements/EmptyDataRow.tsx → tanstack_table/elements/empty_data_row.tsx} +0 -0
@@ -0,0 +1,63 @@
1
+ import { useMemo } from 'react';
2
+
3
+ import { useChartData } from '../context/ChartContext.tsx';
4
+ import { useCore } from '../context/CoreContext.tsx';
5
+ import { useScaleChecked } from '../context/ScaleContext.tsx';
6
+ import { useProcessingsMutations } from '../context/processings_mutations_context.tsx';
7
+ import { useIndicatorLineColor } from '../hooks/useIndicatorLineColor.ts';
8
+ import { useStableSpectrum } from '../hooks/useSpectrum.ts';
9
+ import { useLiveEdit } from '../panels/filtersPanel/processings/use_live_edit.ts';
10
+ import { useLiveOperation } from '../panels/filtersPanel/processings/use_live_operation.ts';
11
+ import { useBrushTrackerEvent } from '../utility/core_slots/core_operator_chart_brush.commons.ts';
12
+ import { CoreOperatorChartBrushTracker } from '../utility/core_slots/core_operator_chart_brush_tracker.tsx';
13
+
14
+ export function PluginChartBrushTracker() {
15
+ const core = useCore();
16
+ const spectrum = useStableSpectrum();
17
+ const { height, width, margin } = useChartData();
18
+
19
+ const { scaleX: scaleXBuilder, scaleY: scaleYBuilder } = useScaleChecked();
20
+ const indicatorLineColor = useIndicatorLineColor();
21
+
22
+ const [liveOperation, setLiveOperation] = useLiveOperation();
23
+ const liveEdit = useLiveEdit(liveOperation);
24
+ const processingsMutations = useProcessingsMutations();
25
+
26
+ const scaleX = useMemo(() => scaleXBuilder(), [scaleXBuilder]);
27
+ const scaleY = useMemo(() => scaleYBuilder(), [scaleYBuilder]);
28
+
29
+ if (!liveOperation) return null;
30
+ if (!spectrum) return null;
31
+
32
+ const operatorUI = core.slotOperator(liveOperation.operatorId);
33
+ if (!operatorUI) return null;
34
+
35
+ const isLiveEditable = operatorUI?.isLiveEditable ?? false;
36
+
37
+ return (
38
+ <CoreOperatorChartBrushTracker
39
+ core={core}
40
+ operatorUI={operatorUI}
41
+ spectrum={spectrum}
42
+ operation={liveOperation}
43
+ height={height}
44
+ width={width}
45
+ margin={margin}
46
+ scaleX={scaleX}
47
+ scaleY={scaleY}
48
+ indicatorLineColor={indicatorLineColor}
49
+ useBrushTrackerEvent={useBrushTrackerEvent}
50
+ onChange={(liveOperation) => {
51
+ liveOperation = setLiveOperation(liveOperation);
52
+
53
+ if (!isLiveEditable) return;
54
+ if (!liveEdit.value?.checked) return;
55
+
56
+ void processingsMutations.applyLiveChange(
57
+ liveOperation,
58
+ liveEdit.value?.shouldProcessNext ?? false,
59
+ );
60
+ }}
61
+ />
62
+ );
63
+ }
@@ -3,12 +3,12 @@ import { isSpectrum1D, isSpectrum2D } from '@zakodium/nmrium-core';
3
3
  import type { CSSProperties } from 'react';
4
4
 
5
5
  import { useScale2DX } from '../../2d/utilities/scale.js';
6
- import type { BrushAxis } from '../../EventsTrackers/BrushTracker.js';
7
6
  import {
8
7
  detectBrushing,
9
8
  useBrushDetectionOptions,
10
9
  useBrushTracker,
11
10
  } from '../../EventsTrackers/BrushTracker.js';
11
+ import type { BrushAxis } from '../../EventsTrackers/brush_tracker.types.ts';
12
12
  import { useChartData } from '../../context/ChartContext.js';
13
13
  import { useKeyModifiers } from '../../context/KeyModifierContext.tsx';
14
14
  import { useScaleChecked } from '../../context/ScaleContext.js';
@@ -1,8 +1,8 @@
1
1
  import styled from '@emotion/styled';
2
2
 
3
- import type { BrushAxis } from '../../EventsTrackers/BrushTracker.js';
4
3
  import { useBrushTracker } from '../../EventsTrackers/BrushTracker.js';
5
4
  import { useMouseTracker } from '../../EventsTrackers/MouseTracker.js';
5
+ import type { BrushAxis } from '../../EventsTrackers/brush_tracker.types.ts';
6
6
  import { useChartData } from '../../context/ChartContext.js';
7
7
  import type { Margin } from '../../reducer/Reducer.js';
8
8
  import type { Tool } from '../../toolbar/ToolTypes.js';
@@ -2,6 +2,10 @@ import type { PropsWithChildren } from 'react';
2
2
  import { useCallback, useRef } from 'react';
3
3
 
4
4
  import { getAlignedPoint } from '../1d-2d/tools/DistanceLine.tsx';
5
+ import {
6
+ BrushTracker,
7
+ detectBrushing,
8
+ } from '../EventsTrackers/BrushTracker.js';
5
9
  import type {
6
10
  BaseDetectBrushingOptions,
7
11
  BrushAxis,
@@ -10,11 +14,7 @@ import type {
10
14
  OnClick,
11
15
  OnDoubleClick,
12
16
  OnZoom,
13
- } from '../EventsTrackers/BrushTracker.js';
14
- import {
15
- BrushTracker,
16
- detectBrushing,
17
- } from '../EventsTrackers/BrushTracker.js';
17
+ } from '../EventsTrackers/brush_tracker.types.ts';
18
18
  import { useChartData } from '../context/ChartContext.js';
19
19
  import { useDispatch } from '../context/DispatchContext.js';
20
20
  import { useMapKeyModifiers } from '../context/KeyModifierContext.js';
@@ -1,4 +1,4 @@
1
- import type { BrushCoordination } from '../../EventsTrackers/BrushTracker.js';
1
+ import type { BrushCoordination } from '../../EventsTrackers/brush_tracker.types.ts';
2
2
 
3
3
  export const LAYOUT = {
4
4
  main: 'MAIN',
@@ -1,10 +1,8 @@
1
- import { assert } from '@zakodium/utils';
1
+ import { assert, noop } from '@zakodium/utils';
2
2
  import type {
3
- CSSProperties,
4
3
  KeyboardEvent,
5
4
  MouseEvent,
6
5
  PointerEvent,
7
- ReactNode,
8
6
  Reducer,
9
7
  WheelEvent,
10
8
  } from 'react';
@@ -16,54 +14,32 @@ import {
16
14
  useReducer,
17
15
  useRef,
18
16
  } from 'react';
17
+ import { useEventCallback } from 'usehooks-ts';
19
18
 
20
- import type { EventModifierKeys } from '../context/KeyModifierContext.js';
21
19
  import type { ActionType } from '../reducer/types/ActionType.js';
22
20
 
23
- type AdvanceOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
24
-
25
- export type BaseDetectBrushingOptions = AdvanceOmit<
21
+ import type {
22
+ BaseDetectBrushingOptions,
23
+ BrushCoordination,
24
+ BrushTrackerData,
25
+ BrushTrackerProps,
26
+ BrushTrackerState,
26
27
  DetectBrushingOptions,
27
- 'width' | 'height'
28
- >;
29
- type Step = 'initial' | 'start' | 'end' | 'brushing';
30
-
31
- export type BrushAxis = 'X' | 'Y' | 'XY';
32
- export interface BrushTrackerData extends EventModifierKeys {
33
- step: Step;
34
- startX: number;
35
- endX: number;
36
- startY: number;
37
- endY: number;
38
- mouseButton: MouseButton;
39
- }
40
-
41
- type MouseButton = 'main' | 'secondary' | 'unknown';
28
+ DetectBrushingResult,
29
+ MouseButton,
30
+ Position,
31
+ } from './brush_tracker.types.ts';
32
+ import type { BrushTrackerEventEmitter } from './brush_tracker_events_listeners.ts';
33
+ import {
34
+ BrushTrackerEventEmitterProvider,
35
+ useInitBrushTrackerEventEmitter,
36
+ } from './brush_tracker_events_listeners.ts';
42
37
 
43
38
  const MouseButtons: Record<number, MouseButton> = {
44
39
  0: 'main',
45
40
  2: 'secondary',
46
41
  } as const;
47
42
 
48
- export interface BrushCoordination {
49
- startX: number;
50
- endX: number;
51
- startY: number;
52
- endY: number;
53
- }
54
- interface BrushScreenCoordination {
55
- startScreenX: number;
56
- startScreenY: number;
57
- startClientX: number;
58
- startClientY: number;
59
- }
60
-
61
- interface BrushTrackerState
62
- extends BrushTrackerData, BrushCoordination, BrushScreenCoordination {
63
- step: Step;
64
- boundingRect: DOMRect | null;
65
- }
66
-
67
43
  const initialState: BrushTrackerState = {
68
44
  step: 'initial',
69
45
  mouseButton: 'unknown',
@@ -105,35 +81,6 @@ export function useBrushTracker() {
105
81
  return useContext(BrushContext);
106
82
  }
107
83
 
108
- interface Position {
109
- x: number;
110
- y: number;
111
- }
112
-
113
- export type ClickOptions = MouseEvent & Position;
114
- export type OnClick = (element: ClickOptions) => void;
115
- export type { OnClick as OnDoubleClick };
116
- export type ZoomOptions = Pick<
117
- WheelEvent,
118
- 'deltaY' | 'shiftKey' | 'deltaMode' | 'altKey' | 'deltaX' | 'ctrlKey'
119
- > &
120
- Position & { invertScroll?: boolean; isBidirectionalZoom: boolean };
121
- export type OnZoom = (options: ZoomOptions) => void;
122
- export type OnBrush = (state: BrushTrackerData) => void;
123
-
124
- interface BrushTrackerProps {
125
- children: ReactNode;
126
- className?: string;
127
- style?: CSSProperties;
128
- onBrushEnd?: OnBrush;
129
- onBrush?: OnBrush;
130
- onZoom?: OnZoom;
131
- onDoubleClick?: OnClick;
132
- onClick?: OnClick;
133
- noPropagation?: boolean;
134
- brushDetectionOptions?: BaseDetectBrushingOptions;
135
- clickTriggerMode?: 'native' | 'debounced';
136
- }
137
84
  function isSelfControlledTarget(target: EventTarget) {
138
85
  return (target as Element).closest('[data-self-control="true"]') !== null;
139
86
  }
@@ -151,11 +98,6 @@ export function BrushTracker(options: BrushTrackerProps) {
151
98
  children,
152
99
  className,
153
100
  style,
154
- onBrushEnd,
155
- onBrush,
156
- onZoom = () => null,
157
- onDoubleClick = () => null,
158
- onClick = () => null,
159
101
  noPropagation,
160
102
  brushDetectionOptions = { thresholdFormat: 'fixed' },
161
103
  clickTriggerMode = 'native',
@@ -173,6 +115,9 @@ export function BrushTracker(options: BrushTrackerProps) {
173
115
  const lastRef = useRef<Position>({ x: 0, y: 0 });
174
116
  const isSelfControlledRef = useRef(false);
175
117
 
118
+ const { onClick, onDoubleClick, onBrush, onBrushEnd, onZoom, emitter } =
119
+ useWrappedEvents(options);
120
+
176
121
  const handleClickWithDebounce = useCallback(
177
122
  (event: MouseEvent, currentTarget: Element) => {
178
123
  const { x, y } = getMouseXY(event, currentTarget);
@@ -425,7 +370,9 @@ export function BrushTracker(options: BrushTrackerProps) {
425
370
  window.removeEventListener('wheel', stopPageScrolling);
426
371
  }}
427
372
  >
428
- {children}
373
+ <BrushTrackerEventEmitterProvider value={emitter}>
374
+ {children}
375
+ </BrushTrackerEventEmitterProvider>
429
376
  </div>
430
377
  </BrushContext.Provider>
431
378
  </BrushDetectionOptionsContext.Provider>
@@ -517,45 +464,6 @@ function reducer(
517
464
  }
518
465
  }
519
466
 
520
- interface DetectBrushingResult extends BrushCoordination {
521
- type: BrushAxis;
522
- scaleX: number;
523
- scaleY: number;
524
- directionX: number;
525
- directionY: number;
526
- xThreshold: number;
527
- yThreshold: number;
528
- }
529
- interface DetectBrushingThreshold {
530
- /** Width in pixels */
531
- width: number;
532
- /** Height in pixels */
533
- height: number;
534
- /**
535
- * Threshold as a percentage of width and height (value between 0 and 1).
536
- * @default 0.02
537
- */
538
- threshold?: number;
539
- thresholdFormat: 'relative';
540
- }
541
- interface DetectBrushingThresholdSize {
542
- /** Width in pixels */
543
- width: number;
544
- /** Height in pixels */
545
- height: number;
546
- /**
547
- * Threshold size in pixels.
548
- * @default 80
549
- */
550
- thresholdSize?: number;
551
- thresholdFormat: 'fixed';
552
- }
553
- type BrushDetectionThresholdAxis = 'both' | 'x' | 'y';
554
-
555
- type DetectBrushingOptions = { thresholdAxis?: BrushDetectionThresholdAxis } & (
556
- DetectBrushingThreshold | DetectBrushingThresholdSize
557
- );
558
-
559
467
  export function detectBrushing(
560
468
  coordination: BrushCoordination,
561
469
  options: DetectBrushingOptions,
@@ -682,3 +590,98 @@ export function detectBrushing(
682
590
  ...common,
683
591
  };
684
592
  }
593
+
594
+ type UseWrappedEventsProps = Pick<
595
+ BrushTrackerProps,
596
+ 'onBrush' | 'onBrushEnd' | 'onClick' | 'onDoubleClick' | 'onZoom'
597
+ >;
598
+
599
+ interface UseWrappedEvents extends Required<UseWrappedEventsProps> {
600
+ emitter: BrushTrackerEventEmitter;
601
+ }
602
+
603
+ /**
604
+ * Wrap events to forward them to props AND an emitter.
605
+ * So `ProcessingOperatorUI.ChartBrushTracker` can listen on events.
606
+ *
607
+ * @param props
608
+ */
609
+ function useWrappedEvents(props: UseWrappedEventsProps): UseWrappedEvents {
610
+ const {
611
+ onBrushEnd: onBrushEndProp = noop,
612
+ onBrush: onBrushProp = noop,
613
+ onZoom: onZoomProp = noop,
614
+ onDoubleClick: onDoubleClickProp = noop,
615
+ onClick: onClickProp = noop,
616
+ } = props;
617
+ const emitter = useInitBrushTrackerEventEmitter();
618
+
619
+ const onClick = useEventCallback<Parameters<typeof onClickProp>, void>(
620
+ (event) => {
621
+ try {
622
+ emitter.emit('click', event);
623
+ } catch (error) {
624
+ reportError(error);
625
+ }
626
+
627
+ if (event.isPropagationStopped()) return;
628
+ if (event.isDefaultPrevented()) return;
629
+
630
+ onClickProp(event);
631
+ },
632
+ );
633
+
634
+ const onDoubleClick = useEventCallback<
635
+ Parameters<typeof onDoubleClickProp>,
636
+ void
637
+ >((event) => {
638
+ try {
639
+ emitter.emit('click-double', event);
640
+ } catch (error) {
641
+ reportError(error);
642
+ }
643
+
644
+ if (event.isPropagationStopped()) return;
645
+ if (event.isDefaultPrevented()) return;
646
+
647
+ onDoubleClickProp(event);
648
+ });
649
+
650
+ const onZoom = useEventCallback<Parameters<typeof onZoomProp>, void>(
651
+ (event) => {
652
+ try {
653
+ emitter.emit('zoom', event);
654
+ } catch (error) {
655
+ reportError(error);
656
+ }
657
+
658
+ onZoomProp(event);
659
+ },
660
+ );
661
+
662
+ const onBrush = useEventCallback<Parameters<typeof onBrushProp>, void>(
663
+ (event) => {
664
+ try {
665
+ emitter.emit('brush', event);
666
+ } catch (error) {
667
+ reportError(error);
668
+ }
669
+
670
+ onBrushProp(event);
671
+ },
672
+ );
673
+
674
+ const onBrushEnd = useEventCallback<Parameters<typeof onBrushEndProp>, void>(
675
+ (event) => {
676
+ try {
677
+ emitter.emit('brush-end', event);
678
+ } catch (error) {
679
+ reportError(error);
680
+ }
681
+
682
+ onBrushEndProp(event);
683
+ },
684
+ );
685
+
686
+ return { onClick, onDoubleClick, onBrush, onBrushEnd, onZoom, emitter };
687
+ }
@@ -0,0 +1,111 @@
1
+ import type { CSSProperties, MouseEvent, ReactNode, WheelEvent } from 'react';
2
+
3
+ import type { EventModifierKeys } from '../context/KeyModifierContext.tsx';
4
+
5
+ type AdvanceOmit<T, K extends keyof any> = T extends any ? Omit<T, K> : never;
6
+ type Step = 'initial' | 'start' | 'end' | 'brushing';
7
+
8
+ export interface BrushCoordination {
9
+ startX: number;
10
+ endX: number;
11
+ startY: number;
12
+ endY: number;
13
+ }
14
+
15
+ export interface BrushTrackerData extends EventModifierKeys, BrushCoordination {
16
+ step: Step;
17
+ mouseButton: MouseButton;
18
+ }
19
+
20
+ export type MouseButton = 'main' | 'secondary' | 'unknown';
21
+
22
+ interface BrushScreenCoordination {
23
+ startScreenX: number;
24
+ startScreenY: number;
25
+ startClientX: number;
26
+ startClientY: number;
27
+ }
28
+
29
+ export interface BrushTrackerState
30
+ extends BrushTrackerData, BrushScreenCoordination {
31
+ step: Step;
32
+ boundingRect: DOMRect | null;
33
+ }
34
+
35
+ export interface Position {
36
+ x: number;
37
+ y: number;
38
+ }
39
+
40
+ export type ClickOptions = MouseEvent & Position;
41
+ export type OnClick = (element: ClickOptions) => void;
42
+ export type OnDoubleClick = OnClick;
43
+ export type ZoomOptions = Pick<
44
+ WheelEvent,
45
+ 'deltaY' | 'shiftKey' | 'deltaMode' | 'altKey' | 'deltaX' | 'ctrlKey'
46
+ > &
47
+ Position & { invertScroll?: boolean; isBidirectionalZoom: boolean };
48
+ export type OnZoom = (options: ZoomOptions) => void;
49
+ export type OnBrush = (state: BrushTrackerData) => void;
50
+ type OnBrushEnd = OnBrush;
51
+
52
+ export type BaseDetectBrushingOptions = AdvanceOmit<
53
+ DetectBrushingOptions,
54
+ 'width' | 'height'
55
+ >;
56
+
57
+ export interface BrushTrackerProps {
58
+ children: ReactNode;
59
+ className?: string;
60
+ style?: CSSProperties;
61
+ onBrushEnd?: OnBrushEnd;
62
+ onBrush?: OnBrush;
63
+ onZoom?: OnZoom;
64
+ onDoubleClick?: OnDoubleClick;
65
+ onClick?: OnClick;
66
+ noPropagation?: boolean;
67
+ brushDetectionOptions?: BaseDetectBrushingOptions;
68
+ clickTriggerMode?: 'native' | 'debounced';
69
+ }
70
+
71
+ export type BrushAxis = 'X' | 'Y' | 'XY';
72
+ export type DetectBrushingOptions = {
73
+ thresholdAxis?: BrushDetectionThresholdAxis;
74
+ } & (DetectBrushingThreshold | DetectBrushingThresholdSize);
75
+ export interface DetectBrushingResult extends BrushCoordination {
76
+ type: BrushAxis;
77
+ scaleX: number;
78
+ scaleY: number;
79
+ directionX: number;
80
+ directionY: number;
81
+ xThreshold: number;
82
+ yThreshold: number;
83
+ }
84
+
85
+ interface DetectBrushingThreshold {
86
+ /** Width in pixels */
87
+ width: number;
88
+ /** Height in pixels */
89
+ height: number;
90
+ /**
91
+ * Threshold as a percentage of width and height (value between 0 and 1).
92
+ * @default 0.02
93
+ */
94
+ threshold?: number;
95
+ thresholdFormat: 'relative';
96
+ }
97
+
98
+ interface DetectBrushingThresholdSize {
99
+ /** Width in pixels */
100
+ width: number;
101
+ /** Height in pixels */
102
+ height: number;
103
+ /**
104
+ * Threshold size in pixels.
105
+ * @default 80
106
+ */
107
+ thresholdSize?: number;
108
+ thresholdFormat: 'fixed';
109
+ }
110
+
111
+ type BrushDetectionThresholdAxis = 'both' | 'x' | 'y';
@@ -0,0 +1,32 @@
1
+ import { assert } from '@zakodium/utils';
2
+ import { EventEmitter } from 'eventemitter3';
3
+ import { createContext, useContext, useState } from 'react';
4
+
5
+ export type BrushTrackerEventEmitterSupportedEvents =
6
+ 'click' | 'click-double' | 'zoom' | 'brush' | 'brush-end';
7
+ export type BrushTrackerEventEmitter =
8
+ EventEmitter<BrushTrackerEventEmitterSupportedEvents>;
9
+
10
+ const BrushTrackerEventEmitterContext =
11
+ createContext<BrushTrackerEventEmitter | null>(null);
12
+
13
+ export const BrushTrackerEventEmitterProvider =
14
+ BrushTrackerEventEmitterContext.Provider;
15
+
16
+ export function useBrushTrackerEventEmitter() {
17
+ const context = useContext(BrushTrackerEventEmitterContext);
18
+ assert(
19
+ context,
20
+ 'useBrushTrackerEventEmitter hook must be use within a BrushTrackerEventEmitterProvider tree',
21
+ );
22
+
23
+ return context;
24
+ }
25
+
26
+ export function useInitBrushTrackerEventEmitter() {
27
+ const [emitter] = useState(
28
+ () => new EventEmitter<BrushTrackerEventEmitterSupportedEvents>(),
29
+ );
30
+
31
+ return emitter;
32
+ }
@@ -0,0 +1,43 @@
1
+ import type { CSSProperties, MouseEvent, ReactNode } from 'react';
2
+
3
+ import type { TanStackRowData, TanStackTableColumn } from './types.ts';
4
+
5
+ interface CreateActionColumnOptions<TData extends TanStackRowData> {
6
+ onClick: (row: TData, event?: MouseEvent<HTMLButtonElement>) => void;
7
+ icon: ReactNode;
8
+ style?: CSSProperties;
9
+ id?: string;
10
+ }
11
+
12
+ export function createActionColumn<TData extends TanStackRowData>(
13
+ options: CreateActionColumnOptions<TData>,
14
+ ): TanStackTableColumn<TData> {
15
+ const { onClick, icon, style = {}, id } = options;
16
+
17
+ return {
18
+ id,
19
+ header: '',
20
+ meta: {
21
+ style: {
22
+ width: '1%',
23
+ maxWidth: '20px',
24
+ minWidth: '20px',
25
+ padding: '0px',
26
+ textAlign: 'center',
27
+ ...style,
28
+ },
29
+ },
30
+ cell: ({ row }) => (
31
+ <button
32
+ type="button"
33
+ onClick={(event) => {
34
+ event.preventDefault();
35
+ event.stopPropagation();
36
+ onClick(row.original, event);
37
+ }}
38
+ >
39
+ {icon}
40
+ </button>
41
+ ),
42
+ };
43
+ }
@@ -0,0 +1,11 @@
1
+ import type { ColumnHelper } from '@tanstack/react-table';
2
+ import { createColumnHelper } from '@tanstack/react-table';
3
+
4
+ import type { TanStackTableFeatures } from './features.ts';
5
+ import type { TanStackRowData } from './types.ts';
6
+
7
+ export function createTanStackColumnHelper<
8
+ TData extends TanStackRowData,
9
+ >(): ColumnHelper<TanStackTableFeatures, TData> {
10
+ return createColumnHelper<TanStackTableFeatures, TData>();
11
+ }
@@ -0,0 +1,15 @@
1
+ import { createContext, useContext } from 'react';
2
+
3
+ import type { TanStackTableVirtualBoundary } from '../types.ts';
4
+
5
+ const reactContext = createContext<TanStackTableVirtualBoundary | null>(null);
6
+
7
+ export const TanStackTableProvider = reactContext.Provider;
8
+
9
+ export function useTanStackTableContext() {
10
+ const context = useContext(reactContext);
11
+ if (!context) {
12
+ throw new Error('table context was not found');
13
+ }
14
+ return context;
15
+ }