@akohn/dashql-react 0.0.0-stage → 0.0.20-dev.664.g9e89b805d

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,2 @@
1
+ import type { RefObject } from 'react';
2
+ export declare function useRenderForcingRef<TRef>(value?: TRef): readonly [RefObject<TRef>, (newRef: TRef | null) => void];
@@ -0,0 +1,11 @@
1
+ import { useCallback, useRef, useState } from "react";
2
+ function useRenderForcingRef(value) {
3
+ const [refCurrent, setRefCurrent] = useState(value || null);
4
+ const ref = useRef(null);
5
+ ref.current = refCurrent;
6
+ return [ref, useCallback((newRef) => {
7
+ ref.current = newRef;
8
+ setRefCurrent(newRef);
9
+ }, [ref])];
10
+ }
11
+ export { useRenderForcingRef };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export interface RowContextMenu {
3
+ onContextMenu: (event: React.MouseEvent<HTMLElement>) => void;
4
+ openerRef: React.RefObject<(() => void) | null>;
5
+ }
6
+ export declare function useRowContextMenu(): RowContextMenu;
7
+ export declare function useRowContextMenuOpener(menu: RowContextMenu | undefined, open: () => void): void;
@@ -0,0 +1,32 @@
1
+ import * as React from "react";
2
+ function useRowContextMenu() {
3
+ const openerRef = React.useRef(null);
4
+ const onContextMenu = React.useCallback((event) => {
5
+ const open = openerRef.current;
6
+ if (open == null || !opensRowContextMenu(event)) return;
7
+ event.preventDefault();
8
+ open();
9
+ }, []);
10
+ return React.useMemo(() => ({
11
+ onContextMenu,
12
+ openerRef
13
+ }), [onContextMenu]);
14
+ }
15
+ function useRowContextMenuOpener(menu, open) {
16
+ const openRef = React.useRef(open);
17
+ openRef.current = open;
18
+ React.useEffect(() => {
19
+ if (menu == null) return;
20
+ const opener = () => openRef.current();
21
+ menu.openerRef.current = opener;
22
+ return () => {
23
+ if (menu.openerRef.current === opener) menu.openerRef.current = null;
24
+ };
25
+ }, [menu]);
26
+ }
27
+ function opensRowContextMenu(event) {
28
+ const target = event.target;
29
+ if (!(target instanceof Element) || !event.currentTarget.contains(target)) return false;
30
+ return target.closest("input, textarea, select, [contenteditable]:not([contenteditable=\"false\"])") == null;
31
+ }
32
+ export { useRowContextMenu, useRowContextMenuOpener };
@@ -0,0 +1,3 @@
1
+ export declare const useScrollbarWidth: () => number;
2
+ export declare const useScrollbarHeight: () => number;
3
+ export declare const useScrollbarsOverlay: () => boolean;
@@ -0,0 +1,23 @@
1
+ var SCROLLBAR_LAYOUT = null;
2
+ var OVERLAY_SCROLLBAR_WIDTH = 12;
3
+ var OVERLAY_SCROLLBAR_HEIGHT = 12;
4
+ function measureScrollbarLayout() {
5
+ if (SCROLLBAR_LAYOUT !== null) return SCROLLBAR_LAYOUT;
6
+ const outer = document.createElement("div");
7
+ outer.style.visibility = "hidden";
8
+ outer.style.overflow = "scroll";
9
+ outer.style.msOverflowStyle = "scrollbar";
10
+ document.body.appendChild(outer);
11
+ const inner = document.createElement("div");
12
+ outer.appendChild(inner);
13
+ SCROLLBAR_LAYOUT = {
14
+ width: outer.offsetWidth - inner.offsetWidth,
15
+ height: outer.offsetHeight - inner.offsetHeight
16
+ };
17
+ outer.parentNode?.removeChild(outer);
18
+ return SCROLLBAR_LAYOUT;
19
+ }
20
+ var useScrollbarWidth = () => Math.max(measureScrollbarLayout().width, OVERLAY_SCROLLBAR_WIDTH);
21
+ var useScrollbarHeight = () => Math.max(measureScrollbarLayout().height, OVERLAY_SCROLLBAR_HEIGHT);
22
+ var useScrollbarsOverlay = () => measureScrollbarLayout().height === 0;
23
+ export { useScrollbarHeight, useScrollbarWidth, useScrollbarsOverlay };
@@ -0,0 +1,11 @@
1
+ export declare enum ByteFormat {
2
+ SI = 0,
3
+ IEC = 1
4
+ }
5
+ export declare function formatBytes(value: number, format?: ByteFormat): string;
6
+ export declare function formatThousands(value: number): string;
7
+ export declare function formatNanoseconds(value: number): string;
8
+ export declare function formatMilliseconds(value: number): string;
9
+ export declare function formatHHMMSS(secs: number): string;
10
+ export declare function formatTimeDifference(to: Date, from?: Date): string;
11
+ export declare function quoteIfAnyUpper(text: string): string;
@@ -0,0 +1,72 @@
1
+ var ByteFormat = /* @__PURE__ */ function(ByteFormat) {
2
+ ByteFormat[ByteFormat["SI"] = 0] = "SI";
3
+ ByteFormat[ByteFormat["IEC"] = 1] = "IEC";
4
+ return ByteFormat;
5
+ }({});
6
+ function formatBytes(value, format = ByteFormat.SI) {
7
+ const [multiple, k, suffix] = format === ByteFormat.SI ? [
8
+ 1e3,
9
+ "k",
10
+ "B"
11
+ ] : [
12
+ 1024,
13
+ "K",
14
+ "iB"
15
+ ];
16
+ const exp = Math.log(value) / Math.log(multiple) | 0;
17
+ const size = Number((value / Math.pow(multiple, exp)).toFixed(2));
18
+ return `${size} ${exp ? `${k}MGTPEZY`[exp - 1] + suffix : `byte${size !== 1 ? "s" : ""}`}`;
19
+ }
20
+ function formatThousands(value) {
21
+ const [multiple, k] = [1e3, "k"];
22
+ const exp = Math.log(value) / Math.log(multiple) | 0;
23
+ return Number((value / Math.pow(multiple, exp)).toFixed(2)) + (exp ? ` ${`${k}MGTPEZY`[exp - 1]}` : "");
24
+ }
25
+ function formatNanoseconds(value) {
26
+ const suffix = "ns";
27
+ if (value >= 1e9) {
28
+ value /= 1e9;
29
+ return `${value.toFixed(1)} s`;
30
+ }
31
+ if (value >= 1e6) {
32
+ value /= 1e6;
33
+ return `${value.toFixed(2)} ms`;
34
+ }
35
+ if (value >= 1e3) {
36
+ value /= 1e3;
37
+ return `${value.toFixed(0)} us`;
38
+ }
39
+ return `${value.toFixed(1)} ${suffix}`;
40
+ }
41
+ function formatMilliseconds(value) {
42
+ const suffix = "ms";
43
+ if (value >= 1e3) {
44
+ value /= 1e3;
45
+ return `${value.toFixed(2)} s`;
46
+ }
47
+ return `${value.toFixed(0)} ${suffix}`;
48
+ }
49
+ function formatHHMMSS(secs) {
50
+ const hours = Math.floor(secs / 3600);
51
+ const minutes = Math.floor((secs - hours * 3600) / 60);
52
+ const seconds = Math.floor(secs - hours * 3600 - minutes * 60);
53
+ return `${hours < 10 ? `0${hours}` : hours.toString()}:${minutes < 10 ? `0${minutes}` : minutes.toString()}:${seconds < 10 ? `0${seconds}` : seconds.toString()}`;
54
+ }
55
+ var TIME_UNITS = [
56
+ ["year", 31536e6],
57
+ ["month", 2628e6],
58
+ ["day", 864e5],
59
+ ["hour", 36e5],
60
+ ["minute", 6e4],
61
+ ["second", 1e3]
62
+ ];
63
+ var rtf = new Intl.RelativeTimeFormat("en", { numeric: "auto" });
64
+ function formatTimeDifference(to, from = /* @__PURE__ */ new Date()) {
65
+ const elapsed = to.getTime() - from.getTime();
66
+ for (const [unitName, unitInMs] of TIME_UNITS) if (Math.abs(elapsed) > unitInMs || unitName == "second") return rtf.format(Math.round(elapsed / unitInMs), unitName);
67
+ return "";
68
+ }
69
+ function quoteIfAnyUpper(text) {
70
+ return /[A-Z]/.test(text) ? `"${text}"` : text;
71
+ }
72
+ export { ByteFormat, formatBytes, formatHHMMSS, formatMilliseconds, formatNanoseconds, formatThousands, formatTimeDifference, quoteIfAnyUpper };
@@ -0,0 +1,17 @@
1
+ import * as dashql from '@akohn/dashql';
2
+ import { type ProfileEntityState } from '@akohn/dashql/platform/query/profile_execution_state';
3
+ import type { QueryExecutionProgress } from '@akohn/dashql/platform/query/query_execution_state';
4
+ type ProfileStatsT = dashql.buffers.profile.ProfileStatsT;
5
+ export declare function stat(state: ProfileEntityState | null | undefined, field: dashql.buffers.profile.ProfileStatsField, value: (stats: ProfileStatsT) => bigint): number | null;
6
+ export interface ProgressWork {
7
+ done: number;
8
+ total: number;
9
+ }
10
+ export declare function workOf(state: ProfileEntityState | null | undefined): ProgressWork | null;
11
+ export declare function formatPhase(phase: string): string;
12
+ export declare function formatCompactCount(count: number): string;
13
+ export declare function formatElapsed(ms: number): string;
14
+ export declare function formatCompactBytes(bytes: number): string;
15
+ export declare function summarizeQueryProgress(progress: QueryExecutionProgress | null): string | null;
16
+ export declare function monotonicFraction(previous: number, work: ProgressWork | null): number;
17
+ export {};
@@ -0,0 +1,69 @@
1
+ import * as dashql from "@akohn/dashql";
2
+ import { isStatReported } from "@akohn/dashql/platform/query/profile_execution_state";
3
+ var view = dashql.buffers.profile;
4
+ function stat(state, field, value) {
5
+ if (state == null || !isStatReported(state.stats, field)) return null;
6
+ return Number(value(state.stats));
7
+ }
8
+ function workOf(state) {
9
+ const done = stat(state, view.ProfileStatsField.WORK_DONE, (s) => s.workDone);
10
+ const total = stat(state, view.ProfileStatsField.WORK_TOTAL, (s) => s.workTotal);
11
+ if (done == null || total == null || total === 0) return null;
12
+ return {
13
+ done: Math.min(done, total),
14
+ total
15
+ };
16
+ }
17
+ function formatPhase(phase) {
18
+ const words = phase.toLowerCase().replace(/_/g, " ");
19
+ return words.charAt(0).toUpperCase() + words.slice(1);
20
+ }
21
+ function formatCompactCount(count) {
22
+ if (count < 1e3) return Math.round(count).toString();
23
+ if (count < 1e6) return `${Number((count / 1e3).toPrecision(3))}K`;
24
+ if (count < 1e9) return `${Number((count / 1e6).toPrecision(3))}M`;
25
+ return `${Number((count / 1e9).toPrecision(3))}B`;
26
+ }
27
+ function formatElapsed(ms) {
28
+ if (ms < 1e3) return `${Math.round(ms)} ms`;
29
+ const seconds = ms / 1e3;
30
+ if (seconds < 60) return `${Number(seconds.toPrecision(3))} s`;
31
+ const minutes = Math.floor(seconds / 60);
32
+ if (minutes < 60) return `${minutes}m ${Math.floor(seconds - minutes * 60).toString().padStart(2, "0")}s`;
33
+ const hours = Math.floor(minutes / 60);
34
+ return `${hours}h ${(minutes - hours * 60).toString().padStart(2, "0")}m`;
35
+ }
36
+ function formatCompactBytes(bytes) {
37
+ if (bytes < 1e3) return `${Math.round(bytes)} B`;
38
+ const units = [
39
+ "kB",
40
+ "MB",
41
+ "GB",
42
+ "TB",
43
+ "PB"
44
+ ];
45
+ let value = bytes / 1e3;
46
+ let unit = 0;
47
+ while (value >= 1e3 && unit < units.length - 1) {
48
+ value /= 1e3;
49
+ unit += 1;
50
+ }
51
+ return `${Number(value.toPrecision(3))} ${units[unit]}`;
52
+ }
53
+ function summarizeQueryProgress(progress) {
54
+ const execution = progress?.profileProgress?.execution;
55
+ if (progress == null || execution == null) return null;
56
+ const parts = [];
57
+ if (progress.phase != null && progress.phase !== "RUNNING") parts.push(formatPhase(progress.phase));
58
+ const work = workOf(execution.query);
59
+ if (work != null) parts.push(`${Math.floor(work.done / work.total * 100)}%`);
60
+ const rows = stat(execution.query, view.ProfileStatsField.TUPLES_IN, (s) => s.tuplesIn);
61
+ const seconds = (progress.executionTimeMs ?? 0) / 1e3;
62
+ if (rows != null && rows > 0 && seconds >= 1) parts.push(`${formatCompactCount(rows / seconds)} rows/s`);
63
+ return parts.length === 0 ? null : parts.join(" · ");
64
+ }
65
+ function monotonicFraction(previous, work) {
66
+ if (work == null) return previous;
67
+ return Math.max(previous, Math.min(1, work.done / work.total));
68
+ }
69
+ export { formatCompactBytes, formatCompactCount, formatElapsed, formatPhase, monotonicFraction, stat, summarizeQueryProgress, workOf };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Format a timestamp as relative time (e.g., "2 hours ago", "Yesterday")
3
+ */
4
+ export declare function formatRelativeTime(date: Date | string | null | undefined): string;
5
+ export declare function useRelativeTime(timestamp: number | null, intervalMs?: number): string | null;
@@ -0,0 +1,45 @@
1
+ import * as React from "react";
2
+ /**
3
+ * Format a timestamp as relative time (e.g., "2 hours ago", "Yesterday")
4
+ */
5
+ function formatRelativeTime(date) {
6
+ if (!date) return "Never";
7
+ const timestamp = date instanceof Date ? date : new Date(date);
8
+ const diffMs = (/* @__PURE__ */ new Date()).getTime() - timestamp.getTime();
9
+ const diffSec = Math.floor(diffMs / 1e3);
10
+ const diffMin = Math.floor(diffSec / 60);
11
+ const diffHour = Math.floor(diffMin / 60);
12
+ const diffDay = Math.floor(diffHour / 24);
13
+ if (diffSec < 10) return "Just now";
14
+ else if (diffSec < 60) return `${diffSec} seconds ago`;
15
+ else if (diffMin === 1) return "1 minute ago";
16
+ else if (diffMin < 60) return `${diffMin} minutes ago`;
17
+ else if (diffHour === 1) return "1 hour ago";
18
+ else if (diffHour < 24) return `${diffHour} hours ago`;
19
+ else if (diffDay === 1) return "Yesterday";
20
+ else if (diffDay < 7) return `${diffDay} days ago`;
21
+ else if (diffDay < 30) {
22
+ const weeks = Math.floor(diffDay / 7);
23
+ return weeks === 1 ? "1 week ago" : `${weeks} weeks ago`;
24
+ } else if (diffDay < 365) {
25
+ const months = Math.floor(diffDay / 30);
26
+ return months === 1 ? "1 month ago" : `${months} months ago`;
27
+ } else {
28
+ const years = Math.floor(diffDay / 365);
29
+ return years === 1 ? "1 year ago" : `${years} years ago`;
30
+ }
31
+ }
32
+ function useRelativeTime(timestamp, intervalMs = 15e3) {
33
+ const [label, setLabel] = React.useState(() => timestamp != null ? formatRelativeTime(new Date(timestamp)) : null);
34
+ React.useEffect(() => {
35
+ if (timestamp == null) {
36
+ setLabel(null);
37
+ return;
38
+ }
39
+ setLabel(formatRelativeTime(new Date(timestamp)));
40
+ const id = setInterval(() => setLabel(formatRelativeTime(new Date(timestamp))), intervalMs);
41
+ return () => clearInterval(id);
42
+ }, [timestamp, intervalMs]);
43
+ return label;
44
+ }
45
+ export { formatRelativeTime, useRelativeTime };
@@ -0,0 +1,71 @@
1
+ import * as React from 'react';
2
+ import type * as arrow from 'apache-arrow';
3
+ import type * as core from '@akohn/dashql';
4
+ import type { Runtime, Settled } from '@akohn/dashql/runtime/runtime';
5
+ import type { StoreView } from '@akohn/dashql/runtime/store/runtime_store';
6
+ import type { ConnectionState } from '@akohn/dashql/platform/connections/connection_state';
7
+ import type { EmbeddedClientContext, EmbeddedComputeDatabase } from '@akohn/dashql/platform/embedded_database';
8
+ import type { QueryExecutionState } from '@akohn/dashql/platform/query/query_execution_state';
9
+ import type { ScriptReferenceReport } from '@akohn/dashql/platform/workbook/script_reference_check';
10
+ import type { WorkbookInput } from '@akohn/dashql/platform/workbook/workbook_inputs';
11
+ import type { ScriptData, ScriptDataMap, WorkbookDerived, WorkbookScripts } from '@akohn/dashql/platform/workbook/workbook_scripts';
12
+ export declare const RuntimeContextProvider: React.Provider<Runtime | null>;
13
+ export declare function useRuntime(): Runtime;
14
+ export declare function useOptionalRuntime(): Runtime | null;
15
+ export declare function useOwnedRuntime(create: () => Runtime): Runtime;
16
+ export declare function useViewSelector<K extends core.ViewKind, T>(kind: K, id: core.ViewId<K> | null | undefined, select: (view: StoreView<K> | null) => T): T;
17
+ export declare function useView<K extends core.ViewKind>(kind: K, id: core.ViewId<K> | null | undefined): StoreView<K> | null;
18
+ export type ViewReader = <K extends core.ViewKind>(kind: K, id: core.ViewId<K>) => StoreView<K> | null;
19
+ export declare function useViewReader(): ViewReader;
20
+ export declare function useDispatch<T extends core.Target>(target: T | null): (action: core.ActionOf<T>) => Settled;
21
+ export declare function useTable(handle: number | null | undefined): arrow.Table | null;
22
+ export declare const useWorkbook: (workbookId: string | null | undefined) => WorkbookScripts | null;
23
+ export declare function useWorkbookShown(workbookId: string | null | undefined): void;
24
+ export declare const useScript: (scriptKey: number | null | undefined) => ScriptData | null;
25
+ export declare const useWorkbookDerived: (workbookId: string | null | undefined) => WorkbookDerived | null;
26
+ export declare function useScriptReferences(workbookId: string | null | undefined, scriptKey: number | null | undefined): ScriptReferenceReport | null;
27
+ export declare const useWorkbookInputs: (workbookId: string | null | undefined) => WorkbookInput[] | null;
28
+ export declare const useWorkbookList: () => core.WorkbookListView | null;
29
+ export declare const useWorkbooks: () => ReadonlyMap<string, WorkbookScripts>;
30
+ export declare function useWorkbookScriptMap(workbookId: string | null | undefined): ScriptDataMap;
31
+ export declare const useConnection: (connectionId: string | null | undefined) => ConnectionState | null;
32
+ export declare function useCatalog(connectionId: string | null | undefined): core.DashQLCatalog | null;
33
+ export declare const useConnectionList: () => core.ConnectionListView | null;
34
+ export declare const useConnections: () => ReadonlyMap<string, ConnectionState>;
35
+ export declare function useConnectionViews(connectionIds: readonly string[] | null | undefined): ConnectionState[] | null;
36
+ export declare const useQuery: (queryId: number | null | undefined) => QueryExecutionState | null;
37
+ export declare const useAllQueries: () => ReadonlyMap<number, QueryExecutionState>;
38
+ export declare function useQueryResultTable(query: QueryExecutionState | null | undefined): arrow.Table | null;
39
+ export declare function useQueryProfileDetail(queryId: number | null, enabled?: boolean): void;
40
+ export declare const useComputation: (tableId: number | null | undefined) => core.ComputationView | null;
41
+ export declare const useComputationDispatch: (tableId: number | null | undefined) => (action: core.ComputationAction) => Settled;
42
+ export type TableComputationState = {
43
+ status: 'idle';
44
+ } | {
45
+ status: 'loading';
46
+ } | {
47
+ status: 'failed';
48
+ error: string;
49
+ } | {
50
+ status: 'ready';
51
+ tableId: number;
52
+ table: arrow.Table;
53
+ };
54
+ export declare function useTableComputation(load: (() => Promise<arrow.Table>) | null, clientContext?: EmbeddedClientContext | null): TableComputationState;
55
+ export interface WorkbookExecutionOptions {
56
+ inputs?: readonly string[];
57
+ }
58
+ export declare function useComputeReady(): boolean;
59
+ export declare function useComputeDatabase(): EmbeddedComputeDatabase | null;
60
+ export declare function useWorkbookExecution(workbookId: string): {
61
+ state: core.WorkbookRunState | null;
62
+ busy: boolean;
63
+ ready: boolean;
64
+ runActive: boolean;
65
+ start: (options?: WorkbookExecutionOptions) => void;
66
+ stop: () => void | undefined;
67
+ };
68
+ export type ScriptRun = (workbookId: string, scriptKey: number, options?: {
69
+ refresh?: boolean;
70
+ }) => Promise<void>;
71
+ export declare function useScriptRun(): ScriptRun | null;