@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,4 @@
1
+ import * as React from 'react';
2
+ export declare function JsonArrowSymbol(props: {
3
+ isExpanded: boolean;
4
+ }): React.JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { symbol_arrow, symbol_arrow_container } from "./json_view.module.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import symbols from "../../svg_symbols.js";
5
+ function JsonArrowSymbol(props) {
6
+ const style = {
7
+ transform: `rotate(${props.isExpanded ? "0" : "-90"}deg)`,
8
+ transition: "all 0.3s"
9
+ };
10
+ return /* @__PURE__ */ jsx("span", {
11
+ className: symbol_arrow_container,
12
+ "data-expanded": props.isExpanded,
13
+ style: {
14
+ transform: "rotate(0deg)",
15
+ transition: "all 0.3s",
16
+ ...style
17
+ },
18
+ children: /* @__PURE__ */ jsx("svg", {
19
+ className: symbol_arrow,
20
+ fill: "currentColor",
21
+ children: /* @__PURE__ */ jsx("use", { xlinkHref: `${symbols}#chevron_down_24` })
22
+ })
23
+ });
24
+ }
25
+ export { JsonArrowSymbol };
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ export interface SectionElementResult<T extends object, K = string | number> {
3
+ value?: T;
4
+ parentValue?: T;
5
+ keyName?: K;
6
+ keyPath?: K[];
7
+ }
8
+ export interface JsonCopyButtonProps<T extends object> extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'value'>, SectionElementResult<T> {
9
+ expandKey: string;
10
+ }
11
+ export declare function JsonCopyButton<T extends object>(props: JsonCopyButtonProps<T>): React.JSX.Element | null;
@@ -0,0 +1,61 @@
1
+ import { copy_button, copy_button_copied } from "./json_view.module.js";
2
+ import { useJsonViewerState } from "./json_view_state.js";
3
+ import { useToolVisibility } from "./json_tool_state.js";
4
+ import { bigIntToString } from "./json_literal.js";
5
+ import { classNames } from "../../dom/classnames.js";
6
+ import * as React from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import symbols from "../../svg_symbols.js";
9
+ function JsonCopyButton(props) {
10
+ const { keyName, value, parentValue, expandKey, keyPath, ...other } = props;
11
+ const { beforeCopy } = useJsonViewerState();
12
+ const isShowTools = useToolVisibility(expandKey);
13
+ const [copied, setCopied] = React.useState(false);
14
+ if (!isShowTools) return null;
15
+ const click = (event) => {
16
+ event.stopPropagation();
17
+ let copyText;
18
+ if (typeof value === "string") copyText = value;
19
+ else if (typeof value === "number" && value === Infinity) copyText = "Infinity";
20
+ else if (typeof value === "number" && isNaN(value)) copyText = "NaN";
21
+ else if (typeof value === "bigint") copyText = bigIntToString(value);
22
+ else if (value instanceof Date) copyText = value.toLocaleString();
23
+ else copyText = JSON.stringify(value, (_, v) => typeof v === "bigint" ? bigIntToString(v) : v, 2);
24
+ if (beforeCopy) copyText = beforeCopy(copyText, keyName, value, parentValue, expandKey, keyPath);
25
+ setCopied(true);
26
+ (navigator.clipboard || { writeText(text) {
27
+ return new Promise((reslove, reject) => {
28
+ const textarea = document.createElement("textarea");
29
+ textarea.style.position = "absolute";
30
+ textarea.style.opacity = "0";
31
+ textarea.style.left = "-99999999px";
32
+ textarea.value = text;
33
+ document.body.appendChild(textarea);
34
+ textarea.select();
35
+ if (!document.execCommand("copy")) reject();
36
+ else reslove();
37
+ textarea.remove();
38
+ });
39
+ } }).writeText(copyText).then(() => {
40
+ const timer = setTimeout(() => {
41
+ setCopied(false);
42
+ clearTimeout(timer);
43
+ }, 3e3);
44
+ }).catch((_error) => {});
45
+ };
46
+ const sym = copied ? "clipboard_copied" : "clipboard_copy";
47
+ return /* @__PURE__ */ jsx("button", {
48
+ ...other,
49
+ type: "button",
50
+ "aria-label": copied ? "JSON copied" : "Copy JSON value",
51
+ "data-testid": "json-copy-value",
52
+ className: classNames(copy_button, { [copy_button_copied]: copied }),
53
+ onClick: click,
54
+ children: /* @__PURE__ */ jsx("svg", {
55
+ viewBox: "0 0 32 36",
56
+ "aria-hidden": "true",
57
+ children: /* @__PURE__ */ jsx("use", { xlinkHref: `${symbols}#${sym}` })
58
+ })
59
+ });
60
+ }
61
+ export { JsonCopyButton };
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ export interface EllipsisCompProps<T extends object> {
3
+ value?: T;
4
+ keyName: string | number;
5
+ isExpanded: boolean;
6
+ }
7
+ export declare function JsonEllipsisSymbol<T extends object>({ isExpanded, value }: EllipsisCompProps<T>): React.JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ import { symbol_ellipsis } from "./json_view.module.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ function JsonEllipsisSymbol({ isExpanded, value }) {
5
+ if (isExpanded || typeof value === "object" && Object.keys(value).length == 0) return null;
6
+ return /* @__PURE__ */ jsx("span", {
7
+ className: symbol_ellipsis,
8
+ children: "..."
9
+ });
10
+ }
11
+ export { JsonEllipsisSymbol };
@@ -0,0 +1,5 @@
1
+ import * as React from 'react';
2
+ export interface CountInfoCompProps<T extends object> {
3
+ value?: T;
4
+ }
5
+ export declare function JsonItemCount<T extends object>(props: CountInfoCompProps<T> & React.HTMLAttributes<HTMLElement>): React.JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { item_count } from "./json_view.module.js";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ function JsonItemCount(props) {
5
+ const len = Object.keys(props.value ?? {}).length;
6
+ const children = `${len} item${len === 1 ? "" : "s"}`;
7
+ return /* @__PURE__ */ jsx("span", {
8
+ className: item_count,
9
+ children
10
+ });
11
+ }
12
+ export { JsonItemCount };
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface KeyNameCompProps {
3
+ keyName?: (string | number);
4
+ keyPath: (string | number)[];
5
+ }
6
+ export declare function JsonKeyName(props: React.PropsWithChildren<KeyNameCompProps>): React.JSX.Element;
@@ -0,0 +1,40 @@
1
+ import { explorer_key, explorer_key_number, object_key_colon, object_key_name_number, object_key_name_string, object_key_quotes } from "./json_view.module.js";
2
+ import { useJsonViewerState } from "./json_view_state.js";
3
+ import * as React from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ function JsonKeyName(props) {
6
+ const { variant } = useJsonViewerState();
7
+ const isNumber = typeof props.keyName === "number";
8
+ if (variant === "explorer") return /* @__PURE__ */ jsx("span", {
9
+ className: isNumber ? explorer_key_number : explorer_key,
10
+ children: props.keyName
11
+ });
12
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsxs("span", { children: [
13
+ /* @__PURE__ */ jsx(Quote, {
14
+ isNumber,
15
+ "data-placement": "left"
16
+ }),
17
+ /* @__PURE__ */ jsx("span", {
18
+ className: isNumber ? object_key_name_number : object_key_name_string,
19
+ children: props.keyName
20
+ }),
21
+ /* @__PURE__ */ jsx(Quote, {
22
+ isNumber,
23
+ "data-placement": "right"
24
+ })
25
+ ] }), /* @__PURE__ */ jsx(Colon, {})] });
26
+ }
27
+ function Quote(props) {
28
+ if (props.isNumber) return null;
29
+ return /* @__PURE__ */ jsx("span", {
30
+ className: object_key_quotes,
31
+ children: "\""
32
+ });
33
+ }
34
+ function Colon() {
35
+ return /* @__PURE__ */ jsx("span", {
36
+ className: object_key_colon,
37
+ children: ":"
38
+ });
39
+ }
40
+ export { JsonKeyName };
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+ interface KeyValuesProps<T extends object> {
3
+ expandKey?: string;
4
+ level: number;
5
+ value: T;
6
+ parentValue?: T;
7
+ keyName?: (string | number);
8
+ keyPath: (string | number)[];
9
+ }
10
+ export declare function JsonKeyValues<T extends object>(props: KeyValuesProps<T>): React.JSX.Element | null;
11
+ export declare function KeyValuesItem<T extends object>(props: KeyValuesProps<T>): React.JSX.Element;
12
+ export {};
@@ -0,0 +1,99 @@
1
+ import { object_entries_line } from "./json_view.module.js";
2
+ import { expandedInitially, useJsonViewerState } from "./json_view_state.js";
3
+ import { useNestedExpansionState } from "./json_nested_state.js";
4
+ import { useToolVisibilityDispatch } from "./json_tool_state.js";
5
+ import { JsonLiteral } from "./json_literal.js";
6
+ import { JsonKeyName } from "./json_key_name.js";
7
+ import { JsonValue } from "./json_value.js";
8
+ import { JsonCopyButton } from "./json_copy_button.js";
9
+ import { useUniqueKey } from "./unique_key.js";
10
+ import * as React from "react";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
12
+ function JsonKeyValues(props) {
13
+ const value = props.value ?? {};
14
+ const { expandKey = "", level, keyPath = [] } = props;
15
+ const { arrayPageSize, collapsed } = useJsonViewerState();
16
+ const [arrayPage, setArrayPage] = React.useState({
17
+ value,
18
+ itemCount: arrayPageSize
19
+ });
20
+ if (!(useNestedExpansionState()[expandKey] ?? expandedInitially(collapsed, level))) return null;
21
+ const isMyArray = Array.isArray(value);
22
+ let entries = isMyArray ? Object.entries(value).map((m) => [Number(m[0]), m[1]]) : Object.entries(value);
23
+ const visibleItemCount = arrayPage.value === value ? arrayPage.itemCount : arrayPageSize;
24
+ const hiddenItemCount = isMyArray && arrayPageSize > 0 ? Math.max(0, entries.length - visibleItemCount) : 0;
25
+ if (hiddenItemCount > 0) entries = entries.slice(0, visibleItemCount);
26
+ return /* @__PURE__ */ jsxs("div", {
27
+ className: "w-rjv-wrap",
28
+ style: {
29
+ borderLeft: "var(--w-rjv-border-left-width, 1px) var(--w-rjv-line-style, solid) var(--w-rjv-line-color, #ebebeb)",
30
+ paddingLeft: 15,
31
+ marginLeft: 6
32
+ },
33
+ children: [entries.map(([key, val], idx) => {
34
+ return /* @__PURE__ */ jsx(KeyValuesItem, {
35
+ parentValue: value,
36
+ keyName: key,
37
+ keyPath: [...keyPath, key],
38
+ value: val,
39
+ level
40
+ }, idx);
41
+ }), hiddenItemCount > 0 && /* @__PURE__ */ jsxs("button", {
42
+ type: "button",
43
+ className: "dashql_array_load_more_SEHnAA",
44
+ "data-testid": "json-array-load-more",
45
+ onClick: () => setArrayPage({
46
+ value,
47
+ itemCount: visibleItemCount + arrayPageSize
48
+ }),
49
+ children: [
50
+ "Show ",
51
+ Math.min(arrayPageSize, hiddenItemCount),
52
+ " more (",
53
+ hiddenItemCount,
54
+ " remaining)"
55
+ ]
56
+ })]
57
+ });
58
+ }
59
+ function KeyValuesItem(props) {
60
+ const dispatch = useToolVisibilityDispatch();
61
+ const subkeyid = useUniqueKey();
62
+ const isMyArray = Array.isArray(props.value);
63
+ const isMySet = props.value instanceof Set;
64
+ const isMyMap = props.value instanceof Map;
65
+ const isDate = props.value instanceof Date;
66
+ const isUrl = props.value instanceof URL;
67
+ if (props.value && typeof props.value === "object" && !isMyArray && !isMySet && !isMyMap && !isDate && !isUrl || isMyArray || isMySet || isMyMap) {
68
+ const mappedValue = isMySet ? Array.from(props.value) : isMyMap ? Object.fromEntries(props.value) : props.value;
69
+ return /* @__PURE__ */ jsx(JsonValue, {
70
+ keyName: props.keyName,
71
+ keyPath: props.keyPath,
72
+ value: mappedValue,
73
+ parentValue: props.parentValue,
74
+ initialValue: props.value,
75
+ level: props.level + 1
76
+ });
77
+ }
78
+ return /* @__PURE__ */ jsxs("div", {
79
+ className: object_entries_line,
80
+ "data-testid": "json-entry-line",
81
+ onMouseEnter: () => dispatch({ [subkeyid]: true }),
82
+ onMouseLeave: () => dispatch({ [subkeyid]: false }),
83
+ children: [
84
+ /* @__PURE__ */ jsx(JsonKeyName, {
85
+ keyName: props.keyName,
86
+ keyPath: props.keyPath
87
+ }),
88
+ /* @__PURE__ */ jsx(JsonLiteral, { value: props.value }),
89
+ /* @__PURE__ */ jsx(JsonCopyButton, {
90
+ keyName: props.keyName,
91
+ keyPath: props.keyPath,
92
+ value: props.value,
93
+ parentValue: props.parentValue,
94
+ expandKey: subkeyid
95
+ })
96
+ ]
97
+ });
98
+ }
99
+ export { JsonKeyValues, KeyValuesItem };
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ export declare function isFloat(n: number): boolean;
3
+ interface ValueProps {
4
+ value: unknown;
5
+ }
6
+ export declare function JsonLiteral(props: ValueProps): React.JSX.Element | null;
7
+ export declare function bigIntToString(bi?: bigint | string): string;
8
+ export {};
@@ -0,0 +1,140 @@
1
+ import { explorer_placeholder, literal_bigint, literal_date, literal_false, literal_float, literal_int, literal_nan, literal_null, literal_quotes, literal_string, literal_string_short, literal_true, literal_undefined, literal_url } from "./json_view.module.js";
2
+ import { useJsonViewerState } from "./json_view_state.js";
3
+ import * as React from "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ function isFloat(n) {
6
+ return Number(n) === n && n % 1 !== 0 || isNaN(n);
7
+ }
8
+ function JsonLiteral(props) {
9
+ const { value } = props;
10
+ if (value instanceof URL) return /* @__PURE__ */ jsx(UrlLiteral, { children: value });
11
+ if (typeof value === "string") return /* @__PURE__ */ jsx(StringLiteral, { children: value });
12
+ if (value === true) return /* @__PURE__ */ jsx(TrueLiteral, {});
13
+ if (value === false) return /* @__PURE__ */ jsx(FalseLiteral, {});
14
+ if (value === null) return /* @__PURE__ */ jsx(NullLiteral, {});
15
+ if (value === void 0) return /* @__PURE__ */ jsx(UndefinedLiteral, {});
16
+ if (value instanceof Date) return /* @__PURE__ */ jsx(DateLiteral, { children: value });
17
+ if (typeof value === "number" && isNaN(value)) return /* @__PURE__ */ jsx(NanLiteral, {});
18
+ else if (typeof value === "number" && isFloat(value)) return /* @__PURE__ */ jsx(FloatLiteral, { children: value });
19
+ else if (typeof value === "bigint") return /* @__PURE__ */ jsx(BigintLiteral, { children: value });
20
+ else if (typeof value === "number") return /* @__PURE__ */ jsx(IntLiteral, { children: value });
21
+ return null;
22
+ }
23
+ function bigIntToString(bi) {
24
+ if (bi === void 0) return "0n";
25
+ else if (typeof bi === "string") try {
26
+ bi = BigInt(bi);
27
+ } catch {
28
+ return "0n";
29
+ }
30
+ return bi ? bi.toString() + "n" : "0n";
31
+ }
32
+ function StringLiteral(props) {
33
+ const { variant, shortenTextAfterLength: length } = useJsonViewerState();
34
+ const childrenStr = props.children;
35
+ const [shorten, setShorten] = React.useState(length && childrenStr.length > length);
36
+ React.useEffect(() => setShorten(length && childrenStr.length > length), [length, childrenStr.length]);
37
+ const style = length > 0 ? { cursor: childrenStr.length <= length ? "initial" : "pointer" } : {};
38
+ const onClick = length > 0 && childrenStr.length > length ? () => setShorten(!shorten) : void 0;
39
+ const text = shorten ? `${childrenStr.slice(0, length)}...` : childrenStr;
40
+ const cls = shorten ? literal_string_short : literal_string;
41
+ if (variant === "explorer") {
42
+ if (childrenStr.length === 0) return /* @__PURE__ */ jsx("span", {
43
+ className: explorer_placeholder,
44
+ children: "empty"
45
+ });
46
+ return /* @__PURE__ */ jsx("span", {
47
+ className: cls,
48
+ style,
49
+ onClick,
50
+ children: text
51
+ });
52
+ }
53
+ return /* @__PURE__ */ jsxs(React.Fragment, { children: [
54
+ /* @__PURE__ */ jsx(LiteralQuotes, {}),
55
+ /* @__PURE__ */ jsx("span", {
56
+ className: cls,
57
+ style,
58
+ onClick,
59
+ children: text
60
+ }),
61
+ /* @__PURE__ */ jsx(LiteralQuotes, {})
62
+ ] });
63
+ }
64
+ function LiteralQuotes() {
65
+ const { variant } = useJsonViewerState();
66
+ if (variant === "explorer") return null;
67
+ return /* @__PURE__ */ jsx("span", {
68
+ className: literal_quotes,
69
+ children: "\""
70
+ });
71
+ }
72
+ function TrueLiteral() {
73
+ return /* @__PURE__ */ jsx("span", {
74
+ className: literal_true,
75
+ children: true.toString()
76
+ });
77
+ }
78
+ function FalseLiteral() {
79
+ return /* @__PURE__ */ jsx("span", {
80
+ className: literal_false,
81
+ children: false.toString()
82
+ });
83
+ }
84
+ function FloatLiteral(props) {
85
+ return /* @__PURE__ */ jsx("span", {
86
+ className: literal_float,
87
+ children: props.children.toString()
88
+ });
89
+ }
90
+ function IntLiteral(props) {
91
+ return /* @__PURE__ */ jsx("span", {
92
+ className: literal_int,
93
+ children: props.children.toString()
94
+ });
95
+ }
96
+ function BigintLiteral(props) {
97
+ return /* @__PURE__ */ jsx("span", {
98
+ className: literal_bigint,
99
+ children: bigIntToString(props.children.toString())
100
+ });
101
+ }
102
+ function UrlLiteral(props) {
103
+ return /* @__PURE__ */ jsxs("a", {
104
+ className: literal_url,
105
+ href: props.children?.href,
106
+ target: "_blank",
107
+ rel: "noopener noreferrer",
108
+ children: [
109
+ /* @__PURE__ */ jsx(LiteralQuotes, {}),
110
+ props.children?.href,
111
+ /* @__PURE__ */ jsx(LiteralQuotes, {})
112
+ ]
113
+ });
114
+ }
115
+ function DateLiteral(props) {
116
+ const childStr = props.children instanceof Date ? props.children.toLocaleString() : props.children;
117
+ return /* @__PURE__ */ jsx("span", {
118
+ className: literal_date,
119
+ children: childStr
120
+ });
121
+ }
122
+ function UndefinedLiteral() {
123
+ return /* @__PURE__ */ jsx("span", {
124
+ className: literal_undefined,
125
+ children: "undefined"
126
+ });
127
+ }
128
+ function NullLiteral() {
129
+ return /* @__PURE__ */ jsx("span", {
130
+ className: literal_null,
131
+ children: "null"
132
+ });
133
+ }
134
+ function NanLiteral() {
135
+ return /* @__PURE__ */ jsx("span", {
136
+ className: literal_nan,
137
+ children: "nan"
138
+ });
139
+ }
140
+ export { JsonLiteral, bigIntToString, isFloat };
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ interface JsonNestedCloseProps {
3
+ expandKey: string;
4
+ level: number;
5
+ parentValue?: object;
6
+ value: object;
7
+ keyName?: (string | number);
8
+ keyPath: (string | number)[];
9
+ }
10
+ export declare function JsonNestedClose(props: JsonNestedCloseProps): React.JSX.Element | null;
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import { object_close } from "./json_view.module.js";
2
+ import { expandedInitially, useJsonViewerState } from "./json_view_state.js";
3
+ import { useNestedExpansionState } from "./json_nested_state.js";
4
+ import { JsonBracketsClose } from "./json_nested_open.js";
5
+ import "react";
6
+ import { jsx } from "react/jsx-runtime";
7
+ function JsonNestedClose(props) {
8
+ const expands = useNestedExpansionState();
9
+ const { variant, collapsed } = useJsonViewerState();
10
+ const isExpanded = expands[props.expandKey] ?? expandedInitially(collapsed, props.level);
11
+ if (variant === "explorer") return null;
12
+ const len = Object.keys(props.value).length;
13
+ if (!isExpanded || len === 0) return null;
14
+ const compProps = {
15
+ keyName: props.keyName,
16
+ keyPath: props.keyPath,
17
+ value: props.value,
18
+ parentValue: props.parentValue
19
+ };
20
+ const isArray = Array.isArray(props.value);
21
+ const isMySet = props.value instanceof Set;
22
+ return /* @__PURE__ */ jsx("div", {
23
+ className: object_close,
24
+ children: /* @__PURE__ */ jsx(JsonBracketsClose, {
25
+ isBrackets: isArray || isMySet,
26
+ ...compProps,
27
+ isVisible: true
28
+ })
29
+ });
30
+ }
31
+ export { JsonNestedClose };
@@ -0,0 +1,18 @@
1
+ import * as React from 'react';
2
+ export interface NestedOpenProps {
3
+ expandKey: string;
4
+ keyName?: (string | number);
5
+ keyPath: (string | number)[];
6
+ level: number;
7
+ value: object;
8
+ initialValue: object;
9
+ parentValue?: object;
10
+ }
11
+ export declare function JsonNestedOpen(props: NestedOpenProps): React.JSX.Element;
12
+ export declare function JsonBracketsOpen(props: {
13
+ isBrackets: boolean;
14
+ }): React.JSX.Element;
15
+ export declare function JsonBracketsClose(props: {
16
+ isBrackets: boolean;
17
+ isVisible: boolean;
18
+ }): React.JSX.Element | null;
@@ -0,0 +1,150 @@
1
+ import { expand_button, explorer_arrow_spacer, explorer_placeholder, explorer_row, explorer_summary, object_curly_brackets_close, object_curly_brackets_open, object_header_set, object_square_brackets_open } from "./json_view.module.js";
2
+ import { useNestedExpansionDispatch, useNestedExpansionState } from "./json_nested_state.js";
3
+ import { expandedInitially, useJsonViewerState } from "./json_view_state.js";
4
+ import { JsonCopyButton } from "./json_copy_button.js";
5
+ import { JsonItemCount } from "./json_item_count.js";
6
+ import { JsonArrowSymbol } from "./json_arrow_symbol.js";
7
+ import { JsonEllipsisSymbol } from "./json_ellipsis_symbol.js";
8
+ import { JsonKeyName } from "./json_key_name.js";
9
+ import "react";
10
+ import { jsx, jsxs } from "react/jsx-runtime";
11
+ function JsonNestedOpen(props) {
12
+ const nodeExpansions = useNestedExpansionState();
13
+ const dispatchExpands = useNestedExpansionDispatch();
14
+ const { variant, collapsed } = useJsonViewerState();
15
+ const isExpanded = nodeExpansions[props.expandKey] ?? expandedInitially(collapsed, props.level);
16
+ const click = () => dispatchExpands({ [props.expandKey]: !isExpanded });
17
+ const style = {
18
+ display: "inline-flex",
19
+ alignItems: "center"
20
+ };
21
+ const len = Object.keys(props.value ?? {}).length;
22
+ const isObject = typeof props.value === "object";
23
+ const isArray = Array.isArray(props.value);
24
+ const isMySet = props.value instanceof Set;
25
+ const showArrow = len !== 0 && (isArray || isMySet || isObject);
26
+ const childProps = {
27
+ keyName: props.keyName,
28
+ keyPath: props.keyPath,
29
+ value: props.value,
30
+ parentValue: props.parentValue
31
+ };
32
+ if (variant === "explorer") return /* @__PURE__ */ jsxs("div", {
33
+ className: explorer_row,
34
+ onClick: showArrow ? click : void 0,
35
+ children: [
36
+ showArrow ? /* @__PURE__ */ jsx("button", {
37
+ type: "button",
38
+ className: expand_button,
39
+ "aria-label": isExpanded ? "Collapse value" : "Expand value",
40
+ "aria-expanded": isExpanded,
41
+ onClick: (e) => {
42
+ e.stopPropagation();
43
+ click();
44
+ },
45
+ children: /* @__PURE__ */ jsx(JsonArrowSymbol, { isExpanded })
46
+ }) : /* @__PURE__ */ jsx("span", { className: explorer_arrow_spacer }),
47
+ (props.keyName || typeof props.keyName === "number") && /* @__PURE__ */ jsx(JsonKeyName, { ...childProps }),
48
+ /* @__PURE__ */ jsx(ExplorerSummary, {
49
+ value: props.value,
50
+ initialValue: props.initialValue
51
+ }),
52
+ /* @__PURE__ */ jsx(JsonCopyButton, {
53
+ keyName: props.keyName,
54
+ value: props.value,
55
+ expandKey: props.expandKey,
56
+ parentValue: props.parentValue,
57
+ keyPath: props.keyPath
58
+ })
59
+ ]
60
+ });
61
+ return /* @__PURE__ */ jsxs("span", {
62
+ style,
63
+ children: [
64
+ showArrow && /* @__PURE__ */ jsx("button", {
65
+ type: "button",
66
+ className: "dashql_expand_button_KeYcWC",
67
+ "aria-label": isExpanded ? "Collapse JSON value" : "Expand JSON value",
68
+ "aria-expanded": isExpanded,
69
+ onClick: click,
70
+ children: /* @__PURE__ */ jsx(JsonArrowSymbol, { isExpanded })
71
+ }),
72
+ (props.keyName || typeof props.keyName === "number") && /* @__PURE__ */ jsx(JsonKeyName, { ...childProps }),
73
+ /* @__PURE__ */ jsx(SetHeader, { value: props.initialValue }),
74
+ /* @__PURE__ */ jsx(MapHeader, { value: props.initialValue }),
75
+ /* @__PURE__ */ jsx(JsonBracketsOpen, { isBrackets: isArray || isMySet }),
76
+ /* @__PURE__ */ jsx(JsonEllipsisSymbol, {
77
+ keyName: props.keyName,
78
+ value: props.value,
79
+ isExpanded
80
+ }),
81
+ /* @__PURE__ */ jsx(JsonBracketsClose, {
82
+ isVisible: !isExpanded || !showArrow,
83
+ isBrackets: isArray || isMySet
84
+ }),
85
+ /* @__PURE__ */ jsx(JsonItemCount, { value: props.value }),
86
+ /* @__PURE__ */ jsx(JsonCopyButton, {
87
+ keyName: props.keyName,
88
+ value: props.value,
89
+ expandKey: props.expandKey,
90
+ parentValue: props.parentValue,
91
+ keyPath: props.keyPath
92
+ })
93
+ ]
94
+ });
95
+ }
96
+ function ExplorerSummary(props) {
97
+ const len = Object.keys(props.value ?? {}).length;
98
+ if (len === 0) return /* @__PURE__ */ jsx("span", {
99
+ className: explorer_placeholder,
100
+ children: "empty"
101
+ });
102
+ let noun;
103
+ if (props.initialValue instanceof Map) noun = len === 1 ? "entry" : "entries";
104
+ else if (Array.isArray(props.value) || props.initialValue instanceof Set) noun = len === 1 ? "item" : "items";
105
+ else noun = len === 1 ? "field" : "fields";
106
+ return /* @__PURE__ */ jsxs("span", {
107
+ className: explorer_summary,
108
+ children: [
109
+ len,
110
+ " ",
111
+ noun
112
+ ]
113
+ });
114
+ }
115
+ function SetHeader(props) {
116
+ if (!(props.value instanceof Set)) return null;
117
+ return /* @__PURE__ */ jsx("span", {
118
+ className: object_header_set,
119
+ "data-type": "set",
120
+ children: "Set"
121
+ });
122
+ }
123
+ function MapHeader(props) {
124
+ if (!(props.value instanceof Map)) return null;
125
+ return /* @__PURE__ */ jsx("span", {
126
+ className: object_header_set,
127
+ "data-type": "map",
128
+ children: "Map"
129
+ });
130
+ }
131
+ function JsonBracketsOpen(props) {
132
+ return props.isBrackets ? /* @__PURE__ */ jsx("span", {
133
+ className: object_square_brackets_open,
134
+ children: "["
135
+ }) : /* @__PURE__ */ jsx("span", {
136
+ className: object_curly_brackets_open,
137
+ children: "{"
138
+ });
139
+ }
140
+ function JsonBracketsClose(props) {
141
+ if (!props.isVisible) return null;
142
+ return props.isBrackets ? /* @__PURE__ */ jsx("span", {
143
+ className: object_curly_brackets_open,
144
+ children: "]"
145
+ }) : /* @__PURE__ */ jsx("span", {
146
+ className: object_curly_brackets_close,
147
+ children: "}"
148
+ });
149
+ }
150
+ export { JsonBracketsClose, JsonBracketsOpen, JsonNestedOpen };