@akohn/dashql-react 0.0.0-stage → 0.0.20-dev.661.gda3ac9a7e

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 (342) hide show
  1. package/LICENSE +373 -0
  2. package/NOTICE +66 -0
  3. package/README.md +46 -2
  4. package/dist/_virtual/_vite/preload-helper.js +100 -0
  5. package/dist/brand/brand.d.ts +13 -0
  6. package/dist/brand/brand.js +14 -0
  7. package/dist/brand/landing_backdrop.d.ts +56 -0
  8. package/dist/brand/landing_backdrop.js +1019 -0
  9. package/dist/brand/wobble_morph.d.ts +54 -0
  10. package/dist/brand/wobble_morph.js +439 -0
  11. package/dist/components/action_list.d.ts +31 -0
  12. package/dist/components/action_list.js +63 -0
  13. package/dist/components/action_list.module.js +11 -0
  14. package/dist/components/anchored_overlay.d.ts +28 -0
  15. package/dist/components/anchored_overlay.js +93 -0
  16. package/dist/components/button.d.ts +42 -0
  17. package/dist/components/button.js +97 -0
  18. package/dist/components/button.module.js +20 -0
  19. package/dist/components/button_group.d.ts +7 -0
  20. package/dist/components/button_group.js +18 -0
  21. package/dist/components/button_group.module.js +3 -0
  22. package/dist/components/card_placeholder.d.ts +9 -0
  23. package/dist/components/card_placeholder.js +39 -0
  24. package/dist/components/card_placeholder.module.js +6 -0
  25. package/dist/components/clipboard.d.ts +19 -0
  26. package/dist/components/clipboard.js +54 -0
  27. package/dist/components/data_table/computation_tables.d.ts +12 -0
  28. package/dist/components/data_table/computation_tables.js +42 -0
  29. package/dist/components/data_table/data_table.d.ts +38 -0
  30. package/dist/components/data_table/data_table.js +378 -0
  31. package/dist/components/data_table/data_table.module.js +41 -0
  32. package/dist/components/data_table/data_table_cell.d.ts +7 -0
  33. package/dist/components/data_table/data_table_cell.js +9 -0
  34. package/dist/components/data_table/data_table_cell_data.d.ts +21 -0
  35. package/dist/components/data_table/data_table_cell_data.js +99 -0
  36. package/dist/components/data_table/data_table_cell_header_name.d.ts +17 -0
  37. package/dist/components/data_table/data_table_cell_header_name.js +73 -0
  38. package/dist/components/data_table/data_table_cell_header_plots.d.ts +31 -0
  39. package/dist/components/data_table/data_table_cell_header_plots.js +122 -0
  40. package/dist/components/data_table/data_table_colors.d.ts +19 -0
  41. package/dist/components/data_table/data_table_colors.js +27 -0
  42. package/dist/components/data_table/data_table_column_resize.d.ts +21 -0
  43. package/dist/components/data_table/data_table_column_resize.js +121 -0
  44. package/dist/components/data_table/data_table_focus.d.ts +15 -0
  45. package/dist/components/data_table/data_table_focus.js +53 -0
  46. package/dist/components/data_table/data_table_layout.d.ts +18 -0
  47. package/dist/components/data_table/data_table_layout.js +103 -0
  48. package/dist/components/data_table/data_table_ordering.d.ts +9 -0
  49. package/dist/components/data_table/data_table_ordering.js +39 -0
  50. package/dist/components/data_table/data_table_portals.d.ts +9 -0
  51. package/dist/components/data_table/data_table_portals.js +29 -0
  52. package/dist/components/data_table/data_table_sticky_views.d.ts +34 -0
  53. package/dist/components/data_table/data_table_sticky_views.js +161 -0
  54. package/dist/components/data_table/data_table_window.d.ts +18 -0
  55. package/dist/components/data_table/data_table_window.js +118 -0
  56. package/dist/components/data_table/format_peek.d.ts +2 -0
  57. package/dist/components/data_table/format_peek.js +17 -0
  58. package/dist/components/data_table/histogram_bars.d.ts +36 -0
  59. package/dist/components/data_table/histogram_bars.js +100 -0
  60. package/dist/components/data_table/histogram_brush.d.ts +23 -0
  61. package/dist/components/data_table/histogram_brush.js +107 -0
  62. package/dist/components/data_table/histogram_cell.d.ts +19 -0
  63. package/dist/components/data_table/histogram_cell.js +325 -0
  64. package/dist/components/data_table/histogram_cell.module.js +9 -0
  65. package/dist/components/data_table/histogram_label.d.ts +1 -0
  66. package/dist/components/data_table/histogram_label.js +7 -0
  67. package/dist/components/data_table/memo_props.d.ts +1 -0
  68. package/dist/components/data_table/memo_props.js +17 -0
  69. package/dist/components/data_table/mostfrequent_cell.d.ts +17 -0
  70. package/dist/components/data_table/mostfrequent_cell.js +316 -0
  71. package/dist/components/data_table/mostfrequent_cell.module.js +10 -0
  72. package/dist/components/data_table/use_cross_filters.d.ts +14 -0
  73. package/dist/components/data_table/use_cross_filters.js +47 -0
  74. package/dist/components/deferred.d.ts +11 -0
  75. package/dist/components/deferred.js +41 -0
  76. package/dist/components/deferred.module.js +5 -0
  77. package/dist/components/error_boundary.d.ts +18 -0
  78. package/dist/components/error_boundary.js +15 -0
  79. package/dist/components/graph.module.js +15 -0
  80. package/dist/components/graph_port.d.ts +10 -0
  81. package/dist/components/graph_port.js +34 -0
  82. package/dist/components/inspector_overlay.d.ts +32 -0
  83. package/dist/components/inspector_overlay.js +72 -0
  84. package/dist/components/inspector_overlay.module.js +18 -0
  85. package/dist/components/json/json_arrow_symbol.d.ts +4 -0
  86. package/dist/components/json/json_arrow_symbol.js +25 -0
  87. package/dist/components/json/json_copy_button.d.ts +11 -0
  88. package/dist/components/json/json_copy_button.js +61 -0
  89. package/dist/components/json/json_ellipsis_symbol.d.ts +7 -0
  90. package/dist/components/json/json_ellipsis_symbol.js +11 -0
  91. package/dist/components/json/json_item_count.d.ts +5 -0
  92. package/dist/components/json/json_item_count.js +12 -0
  93. package/dist/components/json/json_key_name.d.ts +6 -0
  94. package/dist/components/json/json_key_name.js +40 -0
  95. package/dist/components/json/json_key_values.d.ts +12 -0
  96. package/dist/components/json/json_key_values.js +99 -0
  97. package/dist/components/json/json_literal.d.ts +8 -0
  98. package/dist/components/json/json_literal.js +140 -0
  99. package/dist/components/json/json_nested_close.d.ts +11 -0
  100. package/dist/components/json/json_nested_close.js +31 -0
  101. package/dist/components/json/json_nested_open.d.ts +18 -0
  102. package/dist/components/json/json_nested_open.js +150 -0
  103. package/dist/components/json/json_nested_state.d.ts +14 -0
  104. package/dist/components/json/json_nested_state.js +28 -0
  105. package/dist/components/json/json_tool_state.d.ts +18 -0
  106. package/dist/components/json/json_tool_state.js +46 -0
  107. package/dist/components/json/json_value.d.ts +10 -0
  108. package/dist/components/json/json_value.js +46 -0
  109. package/dist/components/json/json_view.d.ts +14 -0
  110. package/dist/components/json/json_view.js +37 -0
  111. package/dist/components/json/json_view.module.js +41 -0
  112. package/dist/components/json/json_view_state.d.ts +14 -0
  113. package/dist/components/json/json_view_state.js +32 -0
  114. package/dist/components/json/unique_key.d.ts +1 -0
  115. package/dist/components/json/unique_key.js +8 -0
  116. package/dist/components/keyvalue_list.d.ts +25 -0
  117. package/dist/components/keyvalue_list.js +106 -0
  118. package/dist/components/keyvalue_list.module.js +15 -0
  119. package/dist/components/name_input.d.ts +11 -0
  120. package/dist/components/name_input.js +51 -0
  121. package/dist/components/overlay.d.ts +53 -0
  122. package/dist/components/overlay.js +183 -0
  123. package/dist/components/overlay.module.js +32 -0
  124. package/dist/components/panel_resize_handle.d.ts +12 -0
  125. package/dist/components/panel_resize_handle.js +39 -0
  126. package/dist/components/portal.d.ts +8 -0
  127. package/dist/components/portal.js +53 -0
  128. package/dist/components/progress_bar.d.ts +7 -0
  129. package/dist/components/progress_bar.js +21 -0
  130. package/dist/components/progress_bar.module.js +3 -0
  131. package/dist/components/query_history_viewer.d.ts +33 -0
  132. package/dist/components/query_history_viewer.js +268 -0
  133. package/dist/components/query_history_viewer.module.js +7 -0
  134. package/dist/components/query_profile/engine_profile_view.d.ts +19 -0
  135. package/dist/components/query_profile/engine_profile_view.js +94 -0
  136. package/dist/components/query_profile/numeric_limits.d.ts +1 -0
  137. package/dist/components/query_profile/numeric_limits.js +2 -0
  138. package/dist/components/query_profile/profile_execution_controller.d.ts +14 -0
  139. package/dist/components/query_profile/profile_execution_controller.js +56 -0
  140. package/dist/components/query_profile/profile_fit.d.ts +24 -0
  141. package/dist/components/query_profile/profile_fit.js +22 -0
  142. package/dist/components/query_profile/profile_navigation.d.ts +3 -0
  143. package/dist/components/query_profile/profile_navigation.js +34 -0
  144. package/dist/components/query_profile/profile_scene.d.ts +64 -0
  145. package/dist/components/query_profile/profile_scene.js +422 -0
  146. package/dist/components/query_profile/query_profile_view.d.ts +44 -0
  147. package/dist/components/query_profile/query_profile_view.js +961 -0
  148. package/dist/components/query_profile/query_profile_view.module.js +23 -0
  149. package/dist/components/query_progress/query_profile_overlay.d.ts +7 -0
  150. package/dist/components/query_progress/query_profile_overlay.js +67 -0
  151. package/dist/components/query_progress/query_profile_overlay.module.js +6 -0
  152. package/dist/components/query_progress/query_progress_panel.d.ts +14 -0
  153. package/dist/components/query_progress/query_progress_panel.js +255 -0
  154. package/dist/components/query_progress/query_progress_panel.module.js +10 -0
  155. package/dist/components/query_result/cell_detail_overlay.d.ts +34 -0
  156. package/dist/components/query_result/cell_detail_overlay.js +277 -0
  157. package/dist/components/query_result/cell_detail_overlay.module.js +21 -0
  158. package/dist/components/query_result/query_result_action_menu.d.ts +12 -0
  159. package/dist/components/query_result/query_result_action_menu.js +62 -0
  160. package/dist/components/query_result/query_result_action_menu.module.js +2 -0
  161. package/dist/components/query_result/query_result_details.d.ts +17 -0
  162. package/dist/components/query_result/query_result_details.js +46 -0
  163. package/dist/components/query_result/query_result_details.module.js +5 -0
  164. package/dist/components/query_result/query_result_download_button.d.ts +8 -0
  165. package/dist/components/query_result/query_result_download_button.js +38 -0
  166. package/dist/components/query_result/query_result_header.d.ts +21 -0
  167. package/dist/components/query_result/query_result_header.js +71 -0
  168. package/dist/components/query_result/query_result_header.module.js +3 -0
  169. package/dist/components/query_result/query_result_search_controls.d.ts +12 -0
  170. package/dist/components/query_result/query_result_search_controls.js +141 -0
  171. package/dist/components/query_result/query_result_search_controls.module.js +7 -0
  172. package/dist/components/query_result/query_result_toolbar.d.ts +21 -0
  173. package/dist/components/query_result/query_result_toolbar.js +74 -0
  174. package/dist/components/query_result/result_table_overlay.d.ts +9 -0
  175. package/dist/components/query_result/result_table_overlay.js +73 -0
  176. package/dist/components/query_result/result_table_overlay.module.js +6 -0
  177. package/dist/components/query_result/use_query_result_search.d.ts +8 -0
  178. package/dist/components/query_result/use_query_result_search.js +28 -0
  179. package/dist/components/segmented_control.d.ts +58 -0
  180. package/dist/components/segmented_control.js +116 -0
  181. package/dist/components/segmented_control.module.js +17 -0
  182. package/dist/components/separator.d.ts +21 -0
  183. package/dist/components/separator.js +79 -0
  184. package/dist/components/separator.module.js +7 -0
  185. package/dist/components/size_observer.d.ts +7 -0
  186. package/dist/components/size_observer.js +57 -0
  187. package/dist/components/skeleton.d.ts +2 -0
  188. package/dist/components/skeleton.js +14 -0
  189. package/dist/components/skeleton.module.js +2 -0
  190. package/dist/components/spinners.d.ts +8 -0
  191. package/dist/components/spinners.js +33 -0
  192. package/dist/components/spinners.module.js +8 -0
  193. package/dist/components/status_indicator.d.ts +36 -0
  194. package/dist/components/status_indicator.js +182 -0
  195. package/dist/components/status_indicator.module.js +3 -0
  196. package/dist/components/symbol_icon.d.ts +65 -0
  197. package/dist/components/symbol_icon.js +213 -0
  198. package/dist/components/tab_header.d.ts +11 -0
  199. package/dist/components/tab_header.js +55 -0
  200. package/dist/components/tab_header.module.js +7 -0
  201. package/dist/components/tag.d.ts +10 -0
  202. package/dist/components/tag.js +17 -0
  203. package/dist/components/tag.module.js +4 -0
  204. package/dist/components/text_field.d.ts +44 -0
  205. package/dist/components/text_field.js +159 -0
  206. package/dist/components/text_field.module.js +15 -0
  207. package/dist/components/text_input.d.ts +25 -0
  208. package/dist/components/text_input.js +90 -0
  209. package/dist/components/text_input.module.js +13 -0
  210. package/dist/components/text_input_action.d.ts +19 -0
  211. package/dist/components/text_input_action.js +33 -0
  212. package/dist/components/text_input_action.module.js +2 -0
  213. package/dist/components/toggle_switch.d.ts +7 -0
  214. package/dist/components/toggle_switch.js +22 -0
  215. package/dist/components/toggle_switch.module.js +6 -0
  216. package/dist/components/tooltip.d.ts +22 -0
  217. package/dist/components/tooltip.js +139 -0
  218. package/dist/components/tooltip.module.js +2 -0
  219. package/dist/components/tree_entry.d.ts +17 -0
  220. package/dist/components/tree_entry.js +48 -0
  221. package/dist/components/tree_entry.module.js +9 -0
  222. package/dist/components/value_list.d.ts +17 -0
  223. package/dist/components/value_list.js +70 -0
  224. package/dist/components/value_list.module.js +8 -0
  225. package/dist/components/vegalite_chart.d.ts +18 -0
  226. package/dist/components/vegalite_chart.js +151 -0
  227. package/dist/components/vegalite_chart.module.js +3 -0
  228. package/dist/components/vegalite_view.d.ts +27 -0
  229. package/dist/components/vegalite_view.js +248 -0
  230. package/dist/components/vegalite_view.module.js +5 -0
  231. package/dist/components/vertical_scroll_shadows.d.ts +14 -0
  232. package/dist/components/vertical_scroll_shadows.js +55 -0
  233. package/dist/components/vertical_scroll_shadows.module.js +5 -0
  234. package/dist/components/vertical_split.d.ts +15 -0
  235. package/dist/components/vertical_split.js +112 -0
  236. package/dist/components/vertical_split.module.js +5 -0
  237. package/dist/components/vertical_tabs.d.ts +36 -0
  238. package/dist/components/vertical_tabs.js +169 -0
  239. package/dist/components/vertical_tabs.module.js +23 -0
  240. package/dist/components/visualization/capped_rows.d.ts +9 -0
  241. package/dist/components/visualization/capped_rows.js +23 -0
  242. package/dist/components/visualization/capped_rows.module.js +3 -0
  243. package/dist/components/visualization/chart_download_button.d.ts +12 -0
  244. package/dist/components/visualization/chart_download_button.js +41 -0
  245. package/dist/components/visualization/kpi_view.d.ts +10 -0
  246. package/dist/components/visualization/kpi_view.js +215 -0
  247. package/dist/components/visualization/kpi_view.module.js +17 -0
  248. package/dist/components/visualization/markdown_view.d.ts +17 -0
  249. package/dist/components/visualization/markdown_view.js +154 -0
  250. package/dist/components/visualization/markdown_view.module.js +4 -0
  251. package/dist/components/visualization/result_rows.d.ts +17 -0
  252. package/dist/components/visualization/result_rows.js +82 -0
  253. package/dist/components/visualization/vegalite_preview.d.ts +8 -0
  254. package/dist/components/visualization/vegalite_preview.js +17 -0
  255. package/dist/components/visualization/vegalite_preview.module.js +2 -0
  256. package/dist/components/visualization/visualization_dispatch.d.ts +14 -0
  257. package/dist/components/visualization/visualization_dispatch.js +41 -0
  258. package/dist/components/visualization/visualization_panel.d.ts +10 -0
  259. package/dist/components/visualization/visualization_panel.js +37 -0
  260. package/dist/components/visualization/visualization_panel.module.js +3 -0
  261. package/dist/dom/anchored_position.d.ts +42 -0
  262. package/dist/dom/anchored_position.js +255 -0
  263. package/dist/dom/app_host.d.ts +6 -0
  264. package/dist/dom/app_host.js +13 -0
  265. package/dist/dom/calm_frames.d.ts +24 -0
  266. package/dist/dom/calm_frames.js +96 -0
  267. package/dist/dom/classnames.d.ts +8 -0
  268. package/dist/dom/classnames.js +20 -0
  269. package/dist/dom/download_file.d.ts +1 -0
  270. package/dist/dom/download_file.js +12 -0
  271. package/dist/dom/focus.d.ts +29 -0
  272. package/dist/dom/focus.js +84 -0
  273. package/dist/dom/graph_edges.d.ts +53 -0
  274. package/dist/dom/graph_edges.js +450 -0
  275. package/dist/dom/key_events.d.ts +9 -0
  276. package/dist/dom/key_events.js +33 -0
  277. package/dist/dom/media_query.d.ts +2 -0
  278. package/dist/dom/media_query.js +15 -0
  279. package/dist/dom/outside_click.d.ts +8 -0
  280. package/dist/dom/outside_click.js +32 -0
  281. package/dist/dom/rerender_ref.d.ts +2 -0
  282. package/dist/dom/rerender_ref.js +11 -0
  283. package/dist/dom/row_context_menu.d.ts +7 -0
  284. package/dist/dom/row_context_menu.js +32 -0
  285. package/dist/dom/scrollbar.d.ts +3 -0
  286. package/dist/dom/scrollbar.js +23 -0
  287. package/dist/format/format.d.ts +11 -0
  288. package/dist/format/format.js +72 -0
  289. package/dist/format/query_progress_format.d.ts +17 -0
  290. package/dist/format/query_progress_format.js +69 -0
  291. package/dist/format/time_format.d.ts +5 -0
  292. package/dist/format/time_format.js +45 -0
  293. package/dist/hooks.d.ts +71 -0
  294. package/dist/hooks.js +302 -0
  295. package/dist/host.d.ts +10 -0
  296. package/dist/host.js +12 -0
  297. package/dist/logger.d.ts +4 -0
  298. package/dist/logger.js +6 -0
  299. package/dist/models/computation_model.d.ts +14 -0
  300. package/dist/models/computation_model.js +27 -0
  301. package/dist/models/query_model.d.ts +12 -0
  302. package/dist/models/query_model.js +27 -0
  303. package/dist/models/script_model.d.ts +17 -0
  304. package/dist/models/script_model.js +69 -0
  305. package/dist/style.css +4226 -0
  306. package/dist/svg_symbols.d.ts +2 -0
  307. package/dist/svg_symbols.js +2 -0
  308. package/dist/symbols.svg +1197 -0
  309. package/dist/theme/color_scheme.d.ts +4 -0
  310. package/dist/theme/color_scheme.js +28 -0
  311. package/dist/theme/xcode_palette.d.ts +22 -0
  312. package/dist/theme/xcode_palette.js +4 -0
  313. package/dist/theme/xcode_palettes.js +41 -0
  314. package/dist/utils/plan_engine.d.ts +2 -0
  315. package/dist/utils/plan_engine.js +13 -0
  316. package/dist/vegalite/vegalite_check.d.ts +1 -0
  317. package/dist/vegalite/vegalite_check.js +7 -0
  318. package/dist/vegalite/vegalite_crossfilter.d.ts +54 -0
  319. package/dist/vegalite/vegalite_crossfilter.js +187 -0
  320. package/dist/vegalite/vegalite_image.d.ts +16 -0
  321. package/dist/vegalite/vegalite_image.js +28 -0
  322. package/dist/vegalite/vegalite_loader.d.ts +7 -0
  323. package/dist/vegalite/vegalite_loader.js +15 -0
  324. package/dist/vegalite/vegalite_rows.d.ts +3 -0
  325. package/dist/vegalite/vegalite_rows.js +17 -0
  326. package/dist/vegalite/vegalite_theme.d.ts +11 -0
  327. package/dist/vegalite/vegalite_theme.js +125 -0
  328. package/fonts/InstrumentSans-Bold.ttf +0 -0
  329. package/fonts/InstrumentSans-Medium.ttf +0 -0
  330. package/fonts/InstrumentSans-OFL.txt +93 -0
  331. package/fonts/InstrumentSans-Regular.ttf +0 -0
  332. package/fonts/InstrumentSans-SemiBold.ttf +0 -0
  333. package/fonts/JetBrainsMono-Bold.ttf +0 -0
  334. package/fonts/JetBrainsMono-Medium.ttf +0 -0
  335. package/fonts/JetBrainsMono-OFL.txt +93 -0
  336. package/fonts/JetBrainsMono-Regular.ttf +0 -0
  337. package/fonts/JetBrainsMono-SemiBold.ttf +0 -0
  338. package/fonts/fonts.css +61 -0
  339. package/package.json +43 -4
  340. package/styles/colors.css +110 -0
  341. package/styles/flavors/dbcom.css +48 -0
  342. package/styles/tokens.css +192 -0
@@ -0,0 +1,183 @@
1
+ import { Portal } from "./portal.js";
2
+ import { classNames } from "../dom/classnames.js";
3
+ import { useOpenAndCloseFocus } from "../dom/focus.js";
4
+ import { useOnOutsideClick } from "../dom/outside_click.js";
5
+ import { useKeyEvents } from "../dom/key_events.js";
6
+ import { AnchorSide } from "../dom/anchored_position.js";
7
+ import { centered_container, expanded, height_auto, height_l, height_m, height_s, height_xl, height_xs, max_height_l, max_height_m, max_height_s, max_height_xl, max_height_xs, max_width_l, max_width_m, max_width_s, max_width_xl, max_width_xxl, min_width_l, min_width_m, min_width_s, min_width_xl, min_width_xxl, overlay, width_auto, width_l, width_m, width_s, width_xl, width_xxl } from "./overlay.module.js";
8
+ import * as React from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ function useOverlay(args) {
11
+ const ownOverlayRef = React.useRef(null);
12
+ const overlayRef = args.overlayRef ?? ownOverlayRef;
13
+ useOpenAndCloseFocus({
14
+ containerRef: overlayRef,
15
+ returnFocusRef: args.returnFocusRef,
16
+ initialFocusRef: args.initialFocusRef,
17
+ preventFocusOnOpen: args.preventFocusOnOpen
18
+ });
19
+ useOnOutsideClick({
20
+ containerRef: overlayRef,
21
+ ignoreClickRefs: args.ignoreClickRefs,
22
+ onClickOutside: args.onClickOutside
23
+ });
24
+ useKeyEvents([{
25
+ key: "Escape",
26
+ ctrlKey: false,
27
+ callback: (e) => {
28
+ args.onEscape(e);
29
+ e.stopPropagation();
30
+ e.preventDefault();
31
+ }
32
+ }]);
33
+ return overlayRef;
34
+ }
35
+ var OverlaySize = /* @__PURE__ */ function(OverlaySize) {
36
+ OverlaySize[OverlaySize["UNSPECIFIED"] = 0] = "UNSPECIFIED";
37
+ OverlaySize[OverlaySize["AUTO"] = 1] = "AUTO";
38
+ OverlaySize[OverlaySize["XS"] = 2] = "XS";
39
+ OverlaySize[OverlaySize["S"] = 3] = "S";
40
+ OverlaySize[OverlaySize["M"] = 4] = "M";
41
+ OverlaySize[OverlaySize["L"] = 5] = "L";
42
+ OverlaySize[OverlaySize["XL"] = 6] = "XL";
43
+ OverlaySize[OverlaySize["XXL"] = 7] = "XXL";
44
+ return OverlaySize;
45
+ }({});
46
+ var HEIGHT_STYLES = [
47
+ null,
48
+ height_auto,
49
+ height_xs,
50
+ height_s,
51
+ height_m,
52
+ height_l,
53
+ height_xl,
54
+ null
55
+ ];
56
+ var MAX_HEIGHT_STYLES = [
57
+ null,
58
+ null,
59
+ max_height_xs,
60
+ max_height_s,
61
+ max_height_m,
62
+ max_height_l,
63
+ max_height_xl,
64
+ null
65
+ ];
66
+ var WIDTH_STYLES = [
67
+ null,
68
+ width_auto,
69
+ null,
70
+ width_s,
71
+ width_m,
72
+ width_l,
73
+ width_xl,
74
+ width_xxl
75
+ ];
76
+ var MIN_WIDTH_STYLES = [
77
+ null,
78
+ null,
79
+ null,
80
+ min_width_s,
81
+ min_width_m,
82
+ min_width_l,
83
+ min_width_xl,
84
+ min_width_xxl
85
+ ];
86
+ var MAX_WIDTH_STYLES = [
87
+ null,
88
+ null,
89
+ null,
90
+ max_width_s,
91
+ max_width_m,
92
+ max_width_l,
93
+ max_width_xl,
94
+ max_width_xxl
95
+ ];
96
+ var OverlayVisibility = /* @__PURE__ */ function(OverlayVisibility) {
97
+ OverlayVisibility[OverlayVisibility["Hidden"] = 0] = "Hidden";
98
+ OverlayVisibility[OverlayVisibility["Visible"] = 1] = "Visible";
99
+ return OverlayVisibility;
100
+ }({});
101
+ function getSlideAnimationStartingVector(anchorSide) {
102
+ switch (anchorSide) {
103
+ case AnchorSide.OutsideTop:
104
+ case AnchorSide.InsideTop: return {
105
+ x: 0,
106
+ y: 1
107
+ };
108
+ case AnchorSide.OutsideRight:
109
+ case AnchorSide.InsideRight: return {
110
+ x: -1,
111
+ y: 0
112
+ };
113
+ case AnchorSide.OutsideLeft:
114
+ case AnchorSide.InsideLeft: return {
115
+ x: 1,
116
+ y: 0
117
+ };
118
+ case AnchorSide.OutsideBottom:
119
+ case AnchorSide.InsideBottom: return {
120
+ x: 0,
121
+ y: -1
122
+ };
123
+ }
124
+ return {
125
+ x: 0,
126
+ y: 0
127
+ };
128
+ }
129
+ var SLIDE_ANIMATION_DISTANCE = 8;
130
+ var INSIDE_OVERLAY = React.createContext(false);
131
+ var Overlay = React.forwardRef((props, forwardedRef) => {
132
+ const overlayRef = React.useRef(null);
133
+ React.useImperativeHandle(forwardedRef, () => overlayRef.current);
134
+ const width = WIDTH_STYLES[props.width ?? OverlaySize.UNSPECIFIED];
135
+ const height = props.height ? HEIGHT_STYLES[props.height] : null;
136
+ const minWidth = props.minWidth ? MIN_WIDTH_STYLES[props.minWidth] : null;
137
+ const maxWidth = props.maxWidth ? MAX_WIDTH_STYLES[props.maxWidth] : null;
138
+ const maxHeight = props.maxHeight ? MAX_HEIGHT_STYLES[props.maxHeight] : null;
139
+ useOverlay({
140
+ overlayRef,
141
+ returnFocusRef: props.returnFocusRef,
142
+ onEscape: props.onEscape,
143
+ ignoreClickRefs: props.ignoreClickRefs,
144
+ onClickOutside: props.onClickOutside,
145
+ initialFocusRef: props.initialFocusRef,
146
+ preventFocusOnOpen: props.preventFocusOnOpen
147
+ });
148
+ const shaded = !React.useContext(INSIDE_OVERLAY);
149
+ React.useLayoutEffect(() => {
150
+ if (!overlayRef.current?.animate || props.visibility === OverlayVisibility.Hidden) return;
151
+ const { x, y } = getSlideAnimationStartingVector(props.anchorSide);
152
+ if (x || y) overlayRef.current.animate({ transform: [`translate(${SLIDE_ANIMATION_DISTANCE * x}px, ${SLIDE_ANIMATION_DISTANCE * y}px)`, `translate(0, 0)`] }, {
153
+ duration: 200,
154
+ easing: "cubic-bezier(0.33, 1, 0.68, 1)"
155
+ });
156
+ }, [props.anchorSide, props.visibility]);
157
+ const overlay$1 = /* @__PURE__ */ jsx("div", {
158
+ className: classNames(overlay, width, height, minWidth, maxWidth, maxHeight, { [expanded]: props.expanded === true }),
159
+ ref: overlayRef,
160
+ role: props.role,
161
+ "data-expanded": props.expanded === true,
162
+ "data-electron-drag-region": "false",
163
+ style: props.centered ? void 0 : {
164
+ position: props.position,
165
+ top: props.top,
166
+ right: props.right,
167
+ bottom: props.bottom,
168
+ left: props.left
169
+ },
170
+ children: props.children
171
+ });
172
+ return /* @__PURE__ */ jsx(Portal, {
173
+ containerName: props.portalContainerName,
174
+ children: /* @__PURE__ */ jsxs(INSIDE_OVERLAY.Provider, {
175
+ value: true,
176
+ children: [shaded && /* @__PURE__ */ jsx("div", { className: "dashql_backdrop_E1GccU" }), props.centered ? /* @__PURE__ */ jsx("div", {
177
+ className: centered_container,
178
+ children: overlay$1
179
+ }) : overlay$1]
180
+ })
181
+ });
182
+ });
183
+ export { Overlay, OverlaySize, OverlayVisibility, useOverlay };
@@ -0,0 +1,32 @@
1
+ var overlay = "dashql_overlay_TjPFFF";
2
+ var centered_container = "dashql_centered_container_kCmUfa";
3
+ var backdrop = "dashql_backdrop_E1GccU";
4
+ var width_s = "dashql_width_s_lAANA5";
5
+ var width_m = "dashql_width_m_87BkEs";
6
+ var width_l = "dashql_width_l_zZHAkA";
7
+ var width_xl = "dashql_width_xl_bx--11";
8
+ var width_xxl = "dashql_width_xxl_jtzxUn";
9
+ var width_auto = "dashql_width_auto_PW1uQy";
10
+ var min_width_s = "dashql_min_width_s_zoHSCz";
11
+ var min_width_m = "dashql_min_width_m_vOByyc";
12
+ var min_width_l = "dashql_min_width_l_FQBOzy";
13
+ var min_width_xl = "dashql_min_width_xl_CBPJK_";
14
+ var min_width_xxl = "dashql_min_width_xxl_VwB9te";
15
+ var max_width_s = "dashql_max_width_s_Aruuis";
16
+ var max_width_m = "dashql_max_width_m_qzeRjc";
17
+ var max_width_l = "dashql_max_width_l_mNRMiK";
18
+ var max_width_xl = "dashql_max_width_xl_TRk66s";
19
+ var max_width_xxl = "dashql_max_width_xxl_UTOoF8";
20
+ var height_xs = "dashql_height_xs_0SVCWF";
21
+ var height_s = "dashql_height_s_Mbvv7x";
22
+ var height_m = "dashql_height_m_dOvVI5";
23
+ var height_l = "dashql_height_l_Nk0ed3";
24
+ var height_xl = "dashql_height_xl_YllXoz";
25
+ var height_auto = "dashql_height_auto_yQwje0";
26
+ var max_height_xs = "dashql_max_height_xs_5z9cb4";
27
+ var max_height_s = "dashql_max_height_s_3u-Zso";
28
+ var max_height_m = "dashql_max_height_m_MFK050";
29
+ var max_height_l = "dashql_max_height_l_pyw6gm";
30
+ var max_height_xl = "dashql_max_height_xl_HbNCxf";
31
+ var expanded = "dashql_expanded_M5TUAX";
32
+ export { backdrop, centered_container, expanded, height_auto, height_l, height_m, height_s, height_xl, height_xs, max_height_l, max_height_m, max_height_s, max_height_xl, max_height_xs, max_width_l, max_width_m, max_width_s, max_width_xl, max_width_xxl, min_width_l, min_width_m, min_width_s, min_width_xl, min_width_xxl, overlay, width_auto, width_l, width_m, width_s, width_xl, width_xxl };
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ export declare const KEYBOARD_STEP = 16;
3
+ export interface PanelResizeHandleProps {
4
+ size: number;
5
+ minSize: number;
6
+ maxSize: number;
7
+ onResize: (size: number) => void;
8
+ onDragStart?: () => () => void;
9
+ label?: string;
10
+ className?: string;
11
+ }
12
+ export declare const PanelResizeHandle: React.FC<PanelResizeHandleProps>;
@@ -0,0 +1,39 @@
1
+ import { classNames } from "../dom/classnames.js";
2
+ import { SEPARATOR_CLASSES, useSeparatorDrag } from "./separator.js";
3
+ import "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ var KEYBOARD_STEP = 16;
6
+ function clamp(value, minimum, maximum) {
7
+ return Math.min(maximum, Math.max(minimum, value));
8
+ }
9
+ var PanelResizeHandle = (props) => {
10
+ const { size, minSize, maxSize, onResize } = props;
11
+ const resize = (next) => onResize(clamp(next, minSize, maxSize));
12
+ const drag = useSeparatorDrag("x", {
13
+ onMove: (position, start) => resize(size + position - start),
14
+ onCancel: () => onResize(size),
15
+ onDragStart: props.onDragStart,
16
+ onKey: (key) => resize(key === "decrease" ? size - 16 : key === "increase" ? size + 16 : key === "min" ? minSize : maxSize)
17
+ });
18
+ const roundedSize = Math.round(size);
19
+ return /* @__PURE__ */ jsx("div", {
20
+ className: classNames(SEPARATOR_CLASSES.x, props.className, { [SEPARATOR_CLASSES.dragging]: drag.dragging }),
21
+ role: "separator",
22
+ "data-electron-drag-region": "false",
23
+ tabIndex: 0,
24
+ "aria-label": props.label ?? "Resize panel",
25
+ "aria-orientation": "vertical",
26
+ "aria-valuemin": Math.round(minSize),
27
+ "aria-valuemax": Math.round(maxSize),
28
+ "aria-valuenow": roundedSize,
29
+ "aria-valuetext": `${roundedSize} pixels`,
30
+ title: "Drag to resize",
31
+ onPointerDown: drag.onPointerDown,
32
+ onKeyDown: drag.onKeyDown,
33
+ children: /* @__PURE__ */ jsx("span", {
34
+ className: SEPARATOR_CLASSES.handle,
35
+ "aria-hidden": "true"
36
+ })
37
+ });
38
+ };
39
+ export { KEYBOARD_STEP, PanelResizeHandle };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export declare function registerPortalRoot(root: Element, name?: string): void;
3
+ export interface PortalProps {
4
+ onMount?: () => void;
5
+ containerName?: string;
6
+ children?: React.ReactElement;
7
+ }
8
+ export declare function Portal(props: PortalProps): React.ReactPortal;
@@ -0,0 +1,53 @@
1
+ import * as React from "react";
2
+ import { createPortal } from "react-dom";
3
+ var DASHQL_PORTAL_ROOT_ID = "__dashqlPortalRoot__";
4
+ var DEFAULT_PORTAL_CONTAINER_NAME = "__default__";
5
+ var portalRootRegistry = {};
6
+ function registerPortalRoot(root, name = DEFAULT_PORTAL_CONTAINER_NAME) {
7
+ portalRootRegistry[name] = root;
8
+ }
9
+ function ensureDefaultPortal() {
10
+ const existingDefaultContainer = portalRootRegistry[DEFAULT_PORTAL_CONTAINER_NAME];
11
+ if (!existingDefaultContainer || !document.body.contains(existingDefaultContainer)) {
12
+ let defaultContainer = document.getElementById(DASHQL_PORTAL_ROOT_ID);
13
+ if (!(defaultContainer instanceof Element)) {
14
+ defaultContainer = document.createElement("div");
15
+ defaultContainer.setAttribute("id", DASHQL_PORTAL_ROOT_ID);
16
+ defaultContainer.style.position = "absolute";
17
+ defaultContainer.style.top = "0";
18
+ defaultContainer.style.left = "0";
19
+ const suitablePortalRoot = document.querySelector("[data-portal-root]");
20
+ if (suitablePortalRoot) suitablePortalRoot.appendChild(defaultContainer);
21
+ else document.body.appendChild(defaultContainer);
22
+ }
23
+ registerPortalRoot(defaultContainer);
24
+ }
25
+ }
26
+ function Portal(props) {
27
+ const elementRef = React.useRef(null);
28
+ if (!elementRef.current) {
29
+ const div = document.createElement("div");
30
+ div.style.position = "relative";
31
+ div.style.zIndex = "1000";
32
+ elementRef.current = div;
33
+ }
34
+ const element = elementRef.current;
35
+ const containerName = props.containerName;
36
+ const onMount = React.useEffectEvent(() => props.onMount?.());
37
+ React.useLayoutEffect(() => {
38
+ let parentName = containerName;
39
+ if (parentName === void 0) {
40
+ parentName = DEFAULT_PORTAL_CONTAINER_NAME;
41
+ ensureDefaultPortal();
42
+ }
43
+ const parentElement = portalRootRegistry[parentName];
44
+ if (!parentElement) throw new Error(`Portal container '${containerName}' is not yet registered. Container must be registered with registerPortal before use.`);
45
+ parentElement.appendChild(element);
46
+ onMount();
47
+ return () => {
48
+ parentElement.removeChild(element);
49
+ };
50
+ }, [element, containerName]);
51
+ return createPortal(props.children, element);
52
+ }
53
+ export { Portal, registerPortalRoot };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ interface ProgressBarProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ progress: number;
4
+ className?: string;
5
+ }
6
+ export declare function ProgressBar(props: ProgressBarProps): React.ReactElement;
7
+ export {};
@@ -0,0 +1,21 @@
1
+ import { fill, root } from "./progress_bar.module.js";
2
+ import { classNames } from "../dom/classnames.js";
3
+ import "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ function ProgressBar(props) {
6
+ const { className, progress, ...rest } = props;
7
+ const clampedProgress = Math.max(0, Math.min(progress, 100));
8
+ return /* @__PURE__ */ jsx("div", {
9
+ ...rest,
10
+ className: classNames(root, className),
11
+ role: "progressbar",
12
+ "aria-valuemin": 0,
13
+ "aria-valuemax": 100,
14
+ "aria-valuenow": Math.round(clampedProgress),
15
+ children: /* @__PURE__ */ jsx("div", {
16
+ className: fill,
17
+ style: { width: `${clampedProgress}%` }
18
+ })
19
+ });
20
+ }
21
+ export { ProgressBar };
@@ -0,0 +1,3 @@
1
+ var root = "dashql_root_Q4Jb0_";
2
+ var fill = "dashql_fill_LZS3c3";
3
+ export { fill, root };
@@ -0,0 +1,33 @@
1
+ import * as React from 'react';
2
+ import { List } from 'react-window';
3
+ import type { ListImperativeAPI, RowComponentProps } from 'react-window';
4
+ import { QueryExecutionState } from '@akohn/dashql/platform/query/query_execution_state';
5
+ export declare const ROW_HEIGHT = 32;
6
+ export declare enum QueryTarget {
7
+ CONNECTION = "Attached",
8
+ MEMORY = "Memory"
9
+ }
10
+ export declare function getQueryTarget(query: QueryExecutionState): QueryTarget;
11
+ export interface QueryEntry {
12
+ connectionId: string;
13
+ sourceName: string;
14
+ target: QueryTarget;
15
+ queryId: number;
16
+ query: QueryExecutionState;
17
+ }
18
+ interface QueryRowProps {
19
+ entries: QueryEntry[];
20
+ showDetail: (index: number) => void;
21
+ selectedIndex: number;
22
+ }
23
+ export declare const QueryRow: (props: RowComponentProps<QueryRowProps>) => React.JSX.Element;
24
+ export interface QueryHistoryViewerDependencies {
25
+ List: typeof List;
26
+ useListCallbackRef(initialValue: ListImperativeAPI | null): [ListImperativeAPI | null, React.Dispatch<React.SetStateAction<ListImperativeAPI | null>>];
27
+ }
28
+ export declare function QueryHistoryViewer(props: {
29
+ entries: QueryEntry[];
30
+ onClose: () => void;
31
+ dependencies?: QueryHistoryViewerDependencies;
32
+ }): React.JSX.Element;
33
+ export {};
@@ -0,0 +1,268 @@
1
+ import { query_cell, query_cell_status, query_cell_title, query_header_main, query_list, query_row_main } from "./query_history_viewer.module.js";
2
+ import { ChevronDownIcon, ChevronUpIcon, XIcon } from "./symbol_icon.js";
3
+ import { ButtonVariant, IconButton } from "./button.js";
4
+ import { AnchoredOverlay } from "./anchored_overlay.js";
5
+ import { OverlaySize } from "./overlay.js";
6
+ import { AnchorAlignment, AnchorSide } from "../dom/anchored_position.js";
7
+ import { JsonView } from "./json/json_view.js";
8
+ import { useObservedSize } from "./size_observer.js";
9
+ import { useKeyEvents } from "../dom/key_events.js";
10
+ import { VerticalScrollShadows } from "./vertical_scroll_shadows.js";
11
+ import { InspectorDetail, InspectorEmpty, InspectorOverlay, inspectorRowClassName } from "./inspector_overlay.js";
12
+ import * as React from "react";
13
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
14
+ import { QueryExecutionStatus } from "@akohn/dashql/platform/query/query_execution_state";
15
+ import { List, useListCallbackRef } from "react-window";
16
+ var ROW_HEIGHT = 32;
17
+ var QueryTarget = /* @__PURE__ */ function(QueryTarget) {
18
+ QueryTarget["CONNECTION"] = "Attached";
19
+ QueryTarget["MEMORY"] = "Memory";
20
+ return QueryTarget;
21
+ }({});
22
+ function getQueryTarget(query) {
23
+ return query.queryMetadata.userProvided ? QueryTarget.CONNECTION : QueryTarget.MEMORY;
24
+ }
25
+ function getStatusLabel(status) {
26
+ switch (status) {
27
+ case QueryExecutionStatus.REQUESTED: return "requested";
28
+ case QueryExecutionStatus.SENDING: return "sending";
29
+ case QueryExecutionStatus.QUEUED: return "queued";
30
+ case QueryExecutionStatus.RUNNING: return "running";
31
+ case QueryExecutionStatus.RECEIVED_FIRST_BATCH: return "receiving";
32
+ case QueryExecutionStatus.RECEIVED_ALL_BATCHES: return "received";
33
+ case QueryExecutionStatus.SUCCEEDED: return "succeeded";
34
+ case QueryExecutionStatus.FAILED: return "failed";
35
+ case QueryExecutionStatus.CANCELLED: return "cancelled";
36
+ default: return "unknown";
37
+ }
38
+ }
39
+ var iso = (ms) => ms == null ? null : new Date(ms).toISOString();
40
+ function entryToObject(entry) {
41
+ const q = entry.query;
42
+ const m = q.metrics;
43
+ return {
44
+ queryId: q.queryId,
45
+ traceId: q.traceId,
46
+ status: QueryExecutionStatus[q.status],
47
+ source: entry.sourceName,
48
+ target: entry.target,
49
+ queryText: q.queryText,
50
+ metadata: q.queryMetadata,
51
+ metrics: {
52
+ queryRequestedAt: iso(m.queryRequestedAt),
53
+ querySendingStartedAt: iso(m.querySendingStartedAt),
54
+ queryQueuedStartedAt: iso(m.queryQueuedStartedAt),
55
+ queryRunningStartedAt: iso(m.queryRunningStartedAt),
56
+ receivedFirstBatchAt: iso(m.receivedFirstBatchAt),
57
+ receivedLastBatchAt: iso(m.receivedLastBatchAt),
58
+ receivedAllBatchesAt: iso(m.receivedAllBatchesAt),
59
+ querySucceededAt: iso(m.querySucceededAt),
60
+ queryFailedAt: iso(m.queryFailedAt),
61
+ queryCancelledAt: iso(m.queryCancelledAt),
62
+ durationMs: m.queryDurationMs,
63
+ progressUpdatesReceived: m.progressUpdatesReceived
64
+ },
65
+ error: q.error?.message ?? null
66
+ };
67
+ }
68
+ var QueryRow = (props) => {
69
+ const { entries, showDetail, selectedIndex } = props;
70
+ const rowIndex = props.index;
71
+ const entry = entries[rowIndex];
72
+ if (!entry) return /* @__PURE__ */ jsx("div", { style: props.style });
73
+ const isSelected = rowIndex === selectedIndex;
74
+ const lastUpdatedAt = entry.query.metrics.lastUpdatedAt;
75
+ const time = lastUpdatedAt != null ? new Date(lastUpdatedAt).toLocaleTimeString("en-GB", { hour12: false }) : "—";
76
+ return /* @__PURE__ */ jsx("div", {
77
+ className: inspectorRowClassName(isSelected),
78
+ style: props.style,
79
+ onClick: () => showDetail(rowIndex),
80
+ "data-testid": "query-history-row",
81
+ children: /* @__PURE__ */ jsxs("div", {
82
+ className: query_row_main,
83
+ children: [
84
+ /* @__PURE__ */ jsx("div", {
85
+ className: query_cell,
86
+ children: time
87
+ }),
88
+ /* @__PURE__ */ jsx("div", {
89
+ className: query_cell,
90
+ children: entry.sourceName
91
+ }),
92
+ /* @__PURE__ */ jsx("div", {
93
+ className: query_cell,
94
+ children: entry.target
95
+ }),
96
+ /* @__PURE__ */ jsx("div", {
97
+ className: query_cell_status,
98
+ children: getStatusLabel(entry.query.status)
99
+ }),
100
+ /* @__PURE__ */ jsx("div", {
101
+ className: query_cell_title,
102
+ title: entry.query.queryMetadata.title ?? "",
103
+ children: entry.query.queryMetadata.title ?? "—"
104
+ })
105
+ ]
106
+ })
107
+ });
108
+ };
109
+ var DEFAULT_DEPENDENCIES = {
110
+ List,
111
+ useListCallbackRef
112
+ };
113
+ function QueryHistoryViewer(props) {
114
+ const { entries } = props;
115
+ const dependencies = props.dependencies ?? DEFAULT_DEPENDENCIES;
116
+ const ListComponent = dependencies.List;
117
+ const containerRef = React.useRef(null);
118
+ const containerSize = useObservedSize(containerRef);
119
+ const containerWidth = containerSize?.width ?? 200;
120
+ const containerHeight = containerSize?.height ?? 100;
121
+ const [modalState, setModalState] = React.useState([null, -1]);
122
+ const [modalEntry, modalIndex] = modalState;
123
+ const closeRef = React.useRef(null);
124
+ const closeModal = React.useCallback(() => setModalState([null, -1]), []);
125
+ const showDetail = React.useCallback((index) => {
126
+ const entry = entries[index] ?? null;
127
+ if (entry) setModalState([entry, index]);
128
+ }, [entries]);
129
+ const showPrevious = React.useCallback(() => {
130
+ if (modalIndex <= 0) return;
131
+ showDetail(modalIndex - 1);
132
+ }, [modalIndex, showDetail]);
133
+ const showNext = React.useCallback(() => {
134
+ if (modalIndex >= entries.length - 1) return;
135
+ showDetail(modalIndex + 1);
136
+ }, [
137
+ modalIndex,
138
+ entries.length,
139
+ showDetail
140
+ ]);
141
+ useKeyEvents(modalEntry ? [{
142
+ key: "ArrowUp",
143
+ callback: (e) => {
144
+ e.preventDefault();
145
+ e.stopPropagation();
146
+ showPrevious();
147
+ },
148
+ capture: true
149
+ }, {
150
+ key: "ArrowDown",
151
+ callback: (e) => {
152
+ e.preventDefault();
153
+ e.stopPropagation();
154
+ showNext();
155
+ },
156
+ capture: true
157
+ }] : []);
158
+ const [listApi, setListApi] = dependencies.useListCallbackRef(null);
159
+ const getScrollElement = React.useCallback(() => listApi?.element ?? null, [listApi]);
160
+ React.useEffect(() => {
161
+ if (modalIndex >= 0 && listApi) listApi.scrollToRow({
162
+ index: modalIndex,
163
+ align: "center"
164
+ });
165
+ else if (listApi && entries.length > 0) listApi.scrollToRow({
166
+ index: entries.length - 1,
167
+ align: "end"
168
+ });
169
+ }, [
170
+ entries,
171
+ modalIndex,
172
+ listApi
173
+ ]);
174
+ const rowProps = React.useMemo(() => ({
175
+ entries,
176
+ showDetail,
177
+ selectedIndex: modalIndex
178
+ }), [
179
+ entries,
180
+ showDetail,
181
+ modalIndex
182
+ ]);
183
+ const modalObject = React.useMemo(() => modalEntry ? entryToObject(modalEntry) : null, [modalEntry]);
184
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(InspectorOverlay, {
185
+ title: "Queries",
186
+ actions: /* @__PURE__ */ jsx(IconButton, {
187
+ ref: closeRef,
188
+ variant: ButtonVariant.Invisible,
189
+ "aria-label": "close-overlay",
190
+ onClick: props.onClose,
191
+ children: /* @__PURE__ */ jsx(XIcon, {})
192
+ }),
193
+ columns: /* @__PURE__ */ jsxs("div", {
194
+ className: query_header_main,
195
+ children: [
196
+ /* @__PURE__ */ jsx("div", {
197
+ className: query_cell,
198
+ children: "Time"
199
+ }),
200
+ /* @__PURE__ */ jsx("div", {
201
+ className: query_cell,
202
+ children: "Source"
203
+ }),
204
+ /* @__PURE__ */ jsx("div", {
205
+ className: query_cell,
206
+ children: "Target"
207
+ }),
208
+ /* @__PURE__ */ jsx("div", {
209
+ className: query_cell,
210
+ children: "Status"
211
+ }),
212
+ /* @__PURE__ */ jsx("div", {
213
+ className: query_cell,
214
+ children: "Title"
215
+ })
216
+ ]
217
+ }),
218
+ columnsClassName: query_list,
219
+ bodyClassName: query_list,
220
+ bodyRef: containerRef,
221
+ children: [entries.length === 0 ? /* @__PURE__ */ jsx(InspectorEmpty, { children: "Nothing to see here" }) : /* @__PURE__ */ jsx(ListComponent, {
222
+ listRef: setListApi,
223
+ style: {
224
+ width: containerWidth,
225
+ height: containerHeight
226
+ },
227
+ rowCount: entries.length,
228
+ rowHeight: 32,
229
+ rowComponent: QueryRow,
230
+ rowProps
231
+ }), /* @__PURE__ */ jsx(VerticalScrollShadows, {
232
+ getScrollElement,
233
+ refreshKey: entries.length
234
+ })]
235
+ }), /* @__PURE__ */ jsx(AnchoredOverlay, {
236
+ renderAnchor: null,
237
+ anchorRef: containerRef,
238
+ returnFocusRef: closeRef,
239
+ open: modalEntry !== null,
240
+ onClose: closeModal,
241
+ width: OverlaySize.L,
242
+ align: AnchorAlignment.Start,
243
+ side: AnchorSide.OutsideLeft,
244
+ children: /* @__PURE__ */ jsx(InspectorDetail, {
245
+ sidebarTop: /* @__PURE__ */ jsx(IconButton, {
246
+ variant: ButtonVariant.Invisible,
247
+ "aria-label": "Close",
248
+ onClick: closeModal,
249
+ children: /* @__PURE__ */ jsx(XIcon, {})
250
+ }),
251
+ sidebarBottom: /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(IconButton, {
252
+ variant: ButtonVariant.Invisible,
253
+ "aria-label": "Previous entry",
254
+ onClick: showPrevious,
255
+ disabled: modalIndex <= 0,
256
+ children: /* @__PURE__ */ jsx(ChevronUpIcon, {})
257
+ }), /* @__PURE__ */ jsx(IconButton, {
258
+ variant: ButtonVariant.Invisible,
259
+ "aria-label": "Next entry",
260
+ onClick: showNext,
261
+ disabled: modalIndex >= entries.length - 1,
262
+ children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
263
+ })] }),
264
+ children: modalObject && /* @__PURE__ */ jsx(JsonView, { value: modalObject })
265
+ })
266
+ })] });
267
+ }
268
+ export { QueryHistoryViewer, QueryRow, QueryTarget, ROW_HEIGHT, getQueryTarget };
@@ -0,0 +1,7 @@
1
+ var query_list = "dashql_query_list_RVRI7W";
2
+ var query_header_main = "dashql_query_header_main_jsUAk7";
3
+ var query_row_main = "dashql_query_row_main_ZxzwOG";
4
+ var query_cell = "dashql_query_cell_pOYdAv";
5
+ var query_cell_status = "dashql_query_cell_status_y4xqgl";
6
+ var query_cell_title = "dashql_query_cell_title_W1ubdn";
7
+ export { query_cell, query_cell_status, query_cell_title, query_header_main, query_list, query_row_main };