@akohn/dashql-react 0.0.0-stage → 0.0.20-dev.1001.g5e5121808
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +373 -0
- package/NOTICE +118 -0
- package/README.md +133 -2
- package/dist/_virtual/_vite/preload-helper.js +100 -0
- package/dist/brand/brand.d.ts +13 -0
- package/dist/brand/brand.js +14 -0
- package/dist/brand/landing_backdrop.d.ts +56 -0
- package/dist/brand/landing_backdrop.js +1019 -0
- package/dist/brand/wobble_morph.d.ts +54 -0
- package/dist/brand/wobble_morph.js +439 -0
- package/dist/components/action_list.d.ts +31 -0
- package/dist/components/action_list.js +63 -0
- package/dist/components/action_list.module.js +11 -0
- package/dist/components/anchored_overlay.d.ts +28 -0
- package/dist/components/anchored_overlay.js +93 -0
- package/dist/components/button.d.ts +42 -0
- package/dist/components/button.js +97 -0
- package/dist/components/button.module.js +20 -0
- package/dist/components/button_group.d.ts +7 -0
- package/dist/components/button_group.js +18 -0
- package/dist/components/button_group.module.js +3 -0
- package/dist/components/card_placeholder.d.ts +9 -0
- package/dist/components/card_placeholder.js +39 -0
- package/dist/components/card_placeholder.module.js +6 -0
- package/dist/components/clipboard.d.ts +19 -0
- package/dist/components/clipboard.js +54 -0
- package/dist/components/data_table/computation_tables.d.ts +12 -0
- package/dist/components/data_table/computation_tables.js +42 -0
- package/dist/components/data_table/data_table.d.ts +39 -0
- package/dist/components/data_table/data_table.js +415 -0
- package/dist/components/data_table/data_table.module.js +41 -0
- package/dist/components/data_table/data_table_cell.d.ts +7 -0
- package/dist/components/data_table/data_table_cell.js +9 -0
- package/dist/components/data_table/data_table_cell_data.d.ts +22 -0
- package/dist/components/data_table/data_table_cell_data.js +103 -0
- package/dist/components/data_table/data_table_cell_header_name.d.ts +17 -0
- package/dist/components/data_table/data_table_cell_header_name.js +73 -0
- package/dist/components/data_table/data_table_cell_header_plots.d.ts +29 -0
- package/dist/components/data_table/data_table_cell_header_plots.js +120 -0
- package/dist/components/data_table/data_table_colors.d.ts +19 -0
- package/dist/components/data_table/data_table_colors.js +27 -0
- package/dist/components/data_table/data_table_column_resize.d.ts +21 -0
- package/dist/components/data_table/data_table_column_resize.js +121 -0
- package/dist/components/data_table/data_table_focus.d.ts +15 -0
- package/dist/components/data_table/data_table_focus.js +53 -0
- package/dist/components/data_table/data_table_layout.d.ts +18 -0
- package/dist/components/data_table/data_table_layout.js +103 -0
- package/dist/components/data_table/data_table_ordering.d.ts +9 -0
- package/dist/components/data_table/data_table_ordering.js +39 -0
- package/dist/components/data_table/data_table_portals.d.ts +9 -0
- package/dist/components/data_table/data_table_portals.js +29 -0
- package/dist/components/data_table/data_table_row_detail.d.ts +22 -0
- package/dist/components/data_table/data_table_row_detail.js +68 -0
- package/dist/components/data_table/data_table_row_detail.module.js +7 -0
- package/dist/components/data_table/data_table_sticky_views.d.ts +35 -0
- package/dist/components/data_table/data_table_sticky_views.js +161 -0
- package/dist/components/data_table/data_table_window.d.ts +18 -0
- package/dist/components/data_table/data_table_window.js +118 -0
- package/dist/components/data_table/format_peek.d.ts +2 -0
- package/dist/components/data_table/format_peek.js +17 -0
- package/dist/components/data_table/histogram_bars.d.ts +36 -0
- package/dist/components/data_table/histogram_bars.js +100 -0
- package/dist/components/data_table/histogram_brush.d.ts +22 -0
- package/dist/components/data_table/histogram_brush.js +105 -0
- package/dist/components/data_table/histogram_cell.d.ts +17 -0
- package/dist/components/data_table/histogram_cell.js +324 -0
- package/dist/components/data_table/histogram_cell.module.js +9 -0
- package/dist/components/data_table/histogram_label.d.ts +1 -0
- package/dist/components/data_table/histogram_label.js +7 -0
- package/dist/components/data_table/memo_props.d.ts +1 -0
- package/dist/components/data_table/memo_props.js +17 -0
- package/dist/components/data_table/mostfrequent_cell.d.ts +17 -0
- package/dist/components/data_table/mostfrequent_cell.js +316 -0
- package/dist/components/data_table/mostfrequent_cell.module.js +10 -0
- package/dist/components/data_table/use_cross_filters.d.ts +14 -0
- package/dist/components/data_table/use_cross_filters.js +47 -0
- package/dist/components/deferred.d.ts +11 -0
- package/dist/components/deferred.js +41 -0
- package/dist/components/deferred.module.js +5 -0
- package/dist/components/error_boundary.d.ts +18 -0
- package/dist/components/error_boundary.js +15 -0
- package/dist/components/graph.module.js +15 -0
- package/dist/components/graph_port.d.ts +10 -0
- package/dist/components/graph_port.js +34 -0
- package/dist/components/inspector_overlay.d.ts +32 -0
- package/dist/components/inspector_overlay.js +72 -0
- package/dist/components/inspector_overlay.module.js +18 -0
- package/dist/components/json/json_arrow_symbol.d.ts +4 -0
- package/dist/components/json/json_arrow_symbol.js +25 -0
- package/dist/components/json/json_copy_button.d.ts +11 -0
- package/dist/components/json/json_copy_button.js +61 -0
- package/dist/components/json/json_ellipsis_symbol.d.ts +7 -0
- package/dist/components/json/json_ellipsis_symbol.js +11 -0
- package/dist/components/json/json_item_count.d.ts +5 -0
- package/dist/components/json/json_item_count.js +12 -0
- package/dist/components/json/json_key_name.d.ts +6 -0
- package/dist/components/json/json_key_name.js +40 -0
- package/dist/components/json/json_key_values.d.ts +12 -0
- package/dist/components/json/json_key_values.js +99 -0
- package/dist/components/json/json_literal.d.ts +8 -0
- package/dist/components/json/json_literal.js +140 -0
- package/dist/components/json/json_nested_close.d.ts +11 -0
- package/dist/components/json/json_nested_close.js +31 -0
- package/dist/components/json/json_nested_open.d.ts +18 -0
- package/dist/components/json/json_nested_open.js +150 -0
- package/dist/components/json/json_nested_state.d.ts +14 -0
- package/dist/components/json/json_nested_state.js +28 -0
- package/dist/components/json/json_tool_state.d.ts +18 -0
- package/dist/components/json/json_tool_state.js +46 -0
- package/dist/components/json/json_value.d.ts +10 -0
- package/dist/components/json/json_value.js +46 -0
- package/dist/components/json/json_view.d.ts +14 -0
- package/dist/components/json/json_view.js +37 -0
- package/dist/components/json/json_view.module.js +41 -0
- package/dist/components/json/json_view_state.d.ts +14 -0
- package/dist/components/json/json_view_state.js +32 -0
- package/dist/components/json/unique_key.d.ts +1 -0
- package/dist/components/json/unique_key.js +8 -0
- package/dist/components/keyvalue_list.d.ts +25 -0
- package/dist/components/keyvalue_list.js +106 -0
- package/dist/components/keyvalue_list.module.js +15 -0
- package/dist/components/name_input.d.ts +12 -0
- package/dist/components/name_input.js +63 -0
- package/dist/components/overlay.d.ts +53 -0
- package/dist/components/overlay.js +183 -0
- package/dist/components/overlay.module.js +32 -0
- package/dist/components/panel_resize_handle.d.ts +12 -0
- package/dist/components/panel_resize_handle.js +39 -0
- package/dist/components/portal.d.ts +8 -0
- package/dist/components/portal.js +53 -0
- package/dist/components/progress_bar.d.ts +7 -0
- package/dist/components/progress_bar.js +21 -0
- package/dist/components/progress_bar.module.js +3 -0
- package/dist/components/query_history_viewer.d.ts +31 -0
- package/dist/components/query_history_viewer.js +271 -0
- package/dist/components/query_history_viewer.module.js +7 -0
- package/dist/components/query_profile/engine_profile_view.d.ts +19 -0
- package/dist/components/query_profile/engine_profile_view.js +94 -0
- package/dist/components/query_profile/numeric_limits.d.ts +1 -0
- package/dist/components/query_profile/numeric_limits.js +2 -0
- package/dist/components/query_profile/profile_execution_controller.d.ts +12 -0
- package/dist/components/query_profile/profile_execution_controller.js +44 -0
- package/dist/components/query_profile/profile_fit.d.ts +24 -0
- package/dist/components/query_profile/profile_fit.js +22 -0
- package/dist/components/query_profile/profile_navigation.d.ts +3 -0
- package/dist/components/query_profile/profile_navigation.js +34 -0
- package/dist/components/query_profile/profile_scene.d.ts +64 -0
- package/dist/components/query_profile/profile_scene.js +422 -0
- package/dist/components/query_profile/query_profile_view.d.ts +36 -0
- package/dist/components/query_profile/query_profile_view.js +953 -0
- package/dist/components/query_profile/query_profile_view.module.js +23 -0
- package/dist/components/query_progress/query_profile_overlay.d.ts +7 -0
- package/dist/components/query_progress/query_profile_overlay.js +67 -0
- package/dist/components/query_progress/query_profile_overlay.module.js +6 -0
- package/dist/components/query_progress/query_progress_panel.d.ts +14 -0
- package/dist/components/query_progress/query_progress_panel.js +255 -0
- package/dist/components/query_progress/query_progress_panel.module.js +10 -0
- package/dist/components/query_result/cell_detail_overlay.d.ts +34 -0
- package/dist/components/query_result/cell_detail_overlay.js +277 -0
- package/dist/components/query_result/cell_detail_overlay.module.js +21 -0
- package/dist/components/query_result/query_result_action_menu.d.ts +12 -0
- package/dist/components/query_result/query_result_action_menu.js +62 -0
- package/dist/components/query_result/query_result_action_menu.module.js +2 -0
- package/dist/components/query_result/query_result_details.d.ts +17 -0
- package/dist/components/query_result/query_result_details.js +46 -0
- package/dist/components/query_result/query_result_details.module.js +5 -0
- package/dist/components/query_result/query_result_download_button.d.ts +8 -0
- package/dist/components/query_result/query_result_download_button.js +38 -0
- package/dist/components/query_result/query_result_header.d.ts +21 -0
- package/dist/components/query_result/query_result_header.js +72 -0
- package/dist/components/query_result/query_result_header.module.js +3 -0
- package/dist/components/query_result/query_result_search_controls.d.ts +12 -0
- package/dist/components/query_result/query_result_search_controls.js +141 -0
- package/dist/components/query_result/query_result_search_controls.module.js +7 -0
- package/dist/components/query_result/query_result_toolbar.d.ts +21 -0
- package/dist/components/query_result/query_result_toolbar.js +74 -0
- package/dist/components/query_result/result_table_overlay.d.ts +9 -0
- package/dist/components/query_result/result_table_overlay.js +73 -0
- package/dist/components/query_result/result_table_overlay.module.js +6 -0
- package/dist/components/query_result/use_query_result_search.d.ts +8 -0
- package/dist/components/query_result/use_query_result_search.js +28 -0
- package/dist/components/segmented_control.d.ts +58 -0
- package/dist/components/segmented_control.js +116 -0
- package/dist/components/segmented_control.module.js +17 -0
- package/dist/components/separator.d.ts +21 -0
- package/dist/components/separator.js +79 -0
- package/dist/components/separator.module.js +7 -0
- package/dist/components/sheet.d.ts +11 -0
- package/dist/components/sheet.js +65 -0
- package/dist/components/sheet.module.js +7 -0
- package/dist/components/size_observer.d.ts +7 -0
- package/dist/components/size_observer.js +57 -0
- package/dist/components/skeleton.d.ts +2 -0
- package/dist/components/skeleton.js +14 -0
- package/dist/components/skeleton.module.js +2 -0
- package/dist/components/spinners.d.ts +8 -0
- package/dist/components/spinners.js +33 -0
- package/dist/components/spinners.module.js +8 -0
- package/dist/components/status_indicator.d.ts +36 -0
- package/dist/components/status_indicator.js +182 -0
- package/dist/components/status_indicator.module.js +3 -0
- package/dist/components/symbol_icon.d.ts +65 -0
- package/dist/components/symbol_icon.js +213 -0
- package/dist/components/tab_header.d.ts +11 -0
- package/dist/components/tab_header.js +55 -0
- package/dist/components/tab_header.module.js +7 -0
- package/dist/components/tag.d.ts +10 -0
- package/dist/components/tag.js +17 -0
- package/dist/components/tag.module.js +4 -0
- package/dist/components/text_field.d.ts +44 -0
- package/dist/components/text_field.js +159 -0
- package/dist/components/text_field.module.js +15 -0
- package/dist/components/text_input.d.ts +25 -0
- package/dist/components/text_input.js +90 -0
- package/dist/components/text_input.module.js +13 -0
- package/dist/components/text_input_action.d.ts +19 -0
- package/dist/components/text_input_action.js +33 -0
- package/dist/components/text_input_action.module.js +2 -0
- package/dist/components/toggle_switch.d.ts +7 -0
- package/dist/components/toggle_switch.js +22 -0
- package/dist/components/toggle_switch.module.js +6 -0
- package/dist/components/tooltip.d.ts +22 -0
- package/dist/components/tooltip.js +139 -0
- package/dist/components/tooltip.module.js +2 -0
- package/dist/components/tree_entry.d.ts +17 -0
- package/dist/components/tree_entry.js +48 -0
- package/dist/components/tree_entry.module.js +9 -0
- package/dist/components/value_list.d.ts +17 -0
- package/dist/components/value_list.js +70 -0
- package/dist/components/value_list.module.js +8 -0
- package/dist/components/vegalite_chart.d.ts +16 -0
- package/dist/components/vegalite_chart.js +149 -0
- package/dist/components/vegalite_chart.module.js +3 -0
- package/dist/components/vegalite_view.d.ts +26 -0
- package/dist/components/vegalite_view.js +239 -0
- package/dist/components/vegalite_view.module.js +5 -0
- package/dist/components/vertical_scroll_shadows.d.ts +14 -0
- package/dist/components/vertical_scroll_shadows.js +55 -0
- package/dist/components/vertical_scroll_shadows.module.js +5 -0
- package/dist/components/vertical_split.d.ts +15 -0
- package/dist/components/vertical_split.js +112 -0
- package/dist/components/vertical_split.module.js +5 -0
- package/dist/components/vertical_tabs.d.ts +36 -0
- package/dist/components/vertical_tabs.js +169 -0
- package/dist/components/vertical_tabs.module.js +23 -0
- package/dist/components/visualization/capped_rows.d.ts +9 -0
- package/dist/components/visualization/capped_rows.js +23 -0
- package/dist/components/visualization/capped_rows.module.js +3 -0
- package/dist/components/visualization/chart_download_button.d.ts +12 -0
- package/dist/components/visualization/chart_download_button.js +41 -0
- package/dist/components/visualization/kpi_view.d.ts +10 -0
- package/dist/components/visualization/kpi_view.js +215 -0
- package/dist/components/visualization/kpi_view.module.js +17 -0
- package/dist/components/visualization/markdown_view.d.ts +17 -0
- package/dist/components/visualization/markdown_view.js +154 -0
- package/dist/components/visualization/markdown_view.module.js +4 -0
- package/dist/components/visualization/result_rows.d.ts +17 -0
- package/dist/components/visualization/result_rows.js +82 -0
- package/dist/components/visualization/vegalite_preview.d.ts +8 -0
- package/dist/components/visualization/vegalite_preview.js +17 -0
- package/dist/components/visualization/vegalite_preview.module.js +2 -0
- package/dist/components/visualization/visualization_dispatch.d.ts +13 -0
- package/dist/components/visualization/visualization_dispatch.js +40 -0
- package/dist/components/visualization/visualization_panel.d.ts +10 -0
- package/dist/components/visualization/visualization_panel.js +36 -0
- package/dist/components/visualization/visualization_panel.module.js +3 -0
- package/dist/dom/anchored_position.d.ts +42 -0
- package/dist/dom/anchored_position.js +255 -0
- package/dist/dom/app_host.d.ts +2 -0
- package/dist/dom/app_host.js +7 -0
- package/dist/dom/calm_frames.d.ts +29 -0
- package/dist/dom/calm_frames.js +120 -0
- package/dist/dom/classnames.d.ts +8 -0
- package/dist/dom/classnames.js +20 -0
- package/dist/dom/download_file.d.ts +1 -0
- package/dist/dom/download_file.js +12 -0
- package/dist/dom/focus.d.ts +29 -0
- package/dist/dom/focus.js +84 -0
- package/dist/dom/graph_edges.d.ts +53 -0
- package/dist/dom/graph_edges.js +450 -0
- package/dist/dom/key_events.d.ts +9 -0
- package/dist/dom/key_events.js +33 -0
- package/dist/dom/media_query.d.ts +5 -0
- package/dist/dom/media_query.js +18 -0
- package/dist/dom/outside_click.d.ts +8 -0
- package/dist/dom/outside_click.js +32 -0
- package/dist/dom/rerender_ref.d.ts +2 -0
- package/dist/dom/rerender_ref.js +11 -0
- package/dist/dom/row_context_menu.d.ts +7 -0
- package/dist/dom/row_context_menu.js +32 -0
- package/dist/dom/scrollbar.d.ts +3 -0
- package/dist/dom/scrollbar.js +23 -0
- package/dist/format/format.d.ts +11 -0
- package/dist/format/format.js +72 -0
- package/dist/format/query_progress_format.d.ts +17 -0
- package/dist/format/query_progress_format.js +69 -0
- package/dist/format/time_format.d.ts +5 -0
- package/dist/format/time_format.js +45 -0
- package/dist/hooks.d.ts +72 -0
- package/dist/hooks.js +305 -0
- package/dist/host.d.ts +10 -0
- package/dist/host.js +12 -0
- package/dist/logger.d.ts +4 -0
- package/dist/logger.js +13 -0
- package/dist/models/computation_model.d.ts +14 -0
- package/dist/models/computation_model.js +27 -0
- package/dist/models/query_model.d.ts +12 -0
- package/dist/models/query_model.js +27 -0
- package/dist/models/script_model.d.ts +17 -0
- package/dist/models/script_model.js +59 -0
- package/dist/platform/content_length.d.ts +1 -0
- package/dist/platform/content_length.js +7 -0
- package/dist/platform/core_provider.d.ts +18 -0
- package/dist/platform/core_provider.js +106 -0
- package/dist/platform/embedded_database_provider.d.ts +19 -0
- package/dist/platform/embedded_database_provider.js +53 -0
- package/dist/platform/page_runtime.d.ts +3 -0
- package/dist/platform/page_runtime.js +29 -0
- package/dist/style.css +4386 -0
- package/dist/svg_symbols.d.ts +2 -0
- package/dist/svg_symbols.js +2 -0
- package/dist/symbols.svg +1197 -0
- package/dist/theme/color_scheme.d.ts +4 -0
- package/dist/theme/color_scheme.js +28 -0
- package/dist/theme/xcode_palette.d.ts +22 -0
- package/dist/theme/xcode_palette.js +4 -0
- package/dist/theme/xcode_palettes.js +41 -0
- package/dist/utils/plan_engine.d.ts +2 -0
- package/dist/utils/plan_engine.js +13 -0
- package/dist/vegalite/vegalite_check.d.ts +1 -0
- package/dist/vegalite/vegalite_check.js +7 -0
- package/dist/vegalite/vegalite_crossfilter.d.ts +54 -0
- package/dist/vegalite/vegalite_crossfilter.js +187 -0
- package/dist/vegalite/vegalite_image.d.ts +14 -0
- package/dist/vegalite/vegalite_image.js +28 -0
- package/dist/vegalite/vegalite_loader.d.ts +7 -0
- package/dist/vegalite/vegalite_loader.js +15 -0
- package/dist/vegalite/vegalite_rows.d.ts +3 -0
- package/dist/vegalite/vegalite_rows.js +23 -0
- package/dist/vegalite/vegalite_theme.d.ts +13 -0
- package/dist/vegalite/vegalite_theme.js +141 -0
- package/fonts/InstrumentSans-Bold.ttf +0 -0
- package/fonts/InstrumentSans-Medium.ttf +0 -0
- package/fonts/InstrumentSans-OFL.txt +93 -0
- package/fonts/InstrumentSans-Regular.ttf +0 -0
- package/fonts/InstrumentSans-SemiBold.ttf +0 -0
- package/fonts/JetBrainsMono-Bold.ttf +0 -0
- package/fonts/JetBrainsMono-Medium.ttf +0 -0
- package/fonts/JetBrainsMono-OFL.txt +93 -0
- package/fonts/JetBrainsMono-Regular.ttf +0 -0
- package/fonts/JetBrainsMono-SemiBold.ttf +0 -0
- package/fonts/fonts.css +61 -0
- package/package.json +403 -4
- package/styles/colors.css +110 -0
- package/styles/flavors/dbcom.css +48 -0
- package/styles/tokens.css +192 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type InitialState = {
|
|
3
|
+
[key: string]: boolean;
|
|
4
|
+
};
|
|
5
|
+
type Dispatch = React.Dispatch<InitialState>;
|
|
6
|
+
export declare const useNestedExpansionState: () => InitialState;
|
|
7
|
+
export declare function useNestedExpansionReducer(): [InitialState, React.ActionDispatch<[action: InitialState]>];
|
|
8
|
+
export declare function useNestedExpansionDispatch(): Dispatch;
|
|
9
|
+
interface ExpandsProps {
|
|
10
|
+
initial: InitialState;
|
|
11
|
+
dispatch: Dispatch;
|
|
12
|
+
}
|
|
13
|
+
export declare const NestedExpansionStateProvider: React.FC<React.PropsWithChildren<ExpandsProps>>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var initialState = {};
|
|
4
|
+
var Context = React.createContext(initialState);
|
|
5
|
+
var reducer = (state, action) => ({
|
|
6
|
+
...state,
|
|
7
|
+
...action
|
|
8
|
+
});
|
|
9
|
+
var useNestedExpansionState = () => {
|
|
10
|
+
return React.useContext(Context);
|
|
11
|
+
};
|
|
12
|
+
var DispatchExpands = React.createContext(() => {});
|
|
13
|
+
function useNestedExpansionReducer() {
|
|
14
|
+
return React.useReducer(reducer, initialState);
|
|
15
|
+
}
|
|
16
|
+
function useNestedExpansionDispatch() {
|
|
17
|
+
return React.useContext(DispatchExpands);
|
|
18
|
+
}
|
|
19
|
+
var NestedExpansionStateProvider = ({ initial, dispatch, children }) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
21
|
+
value: initial,
|
|
22
|
+
children: /* @__PURE__ */ jsx(DispatchExpands.Provider, {
|
|
23
|
+
value: dispatch,
|
|
24
|
+
children
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { NestedExpansionStateProvider, useNestedExpansionDispatch, useNestedExpansionReducer, useNestedExpansionState };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type Action = Record<string, boolean>;
|
|
3
|
+
type Dispatch = (action: Action) => void;
|
|
4
|
+
type Listener = () => void;
|
|
5
|
+
export declare class ToolVisibilityStore {
|
|
6
|
+
protected visible: Map<string, boolean>;
|
|
7
|
+
protected listeners: Map<string, Set<Listener>>;
|
|
8
|
+
dispatch: Dispatch;
|
|
9
|
+
subscribe(key: string, listener: Listener): () => void;
|
|
10
|
+
isVisible(key: string): boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function useToolVisibility(key: string): boolean;
|
|
13
|
+
export declare function useToolVisibilityDispatch(): Dispatch;
|
|
14
|
+
interface ShowToolsProps {
|
|
15
|
+
store: ToolVisibilityStore;
|
|
16
|
+
}
|
|
17
|
+
export declare const ToolVisibilityStateProvider: React.FC<React.PropsWithChildren<ShowToolsProps>>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var ToolVisibilityStore = class {
|
|
4
|
+
visible = /* @__PURE__ */ new Map();
|
|
5
|
+
listeners = /* @__PURE__ */ new Map();
|
|
6
|
+
dispatch = (action) => {
|
|
7
|
+
for (const [key, value] of Object.entries(action)) {
|
|
8
|
+
if ((this.visible.get(key) ?? false) === value) continue;
|
|
9
|
+
this.visible.set(key, value);
|
|
10
|
+
for (const listener of this.listeners.get(key) ?? []) listener();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
subscribe(key, listener) {
|
|
14
|
+
let listeners = this.listeners.get(key);
|
|
15
|
+
if (!listeners) {
|
|
16
|
+
listeners = /* @__PURE__ */ new Set();
|
|
17
|
+
this.listeners.set(key, listeners);
|
|
18
|
+
}
|
|
19
|
+
listeners.add(listener);
|
|
20
|
+
return () => {
|
|
21
|
+
listeners.delete(listener);
|
|
22
|
+
if (listeners.size == 0) this.listeners.delete(key);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
isVisible(key) {
|
|
26
|
+
return this.visible.get(key) ?? false;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var Context = React.createContext(null);
|
|
30
|
+
function useToolVisibility(key) {
|
|
31
|
+
const store = React.useContext(Context);
|
|
32
|
+
const subscribe = React.useCallback((listener) => store?.subscribe(key, listener) ?? (() => {}), [store, key]);
|
|
33
|
+
const getSnapshot = React.useCallback(() => store?.isVisible(key) ?? false, [store, key]);
|
|
34
|
+
return React.useSyncExternalStore(subscribe, getSnapshot);
|
|
35
|
+
}
|
|
36
|
+
var noopDispatch = () => {};
|
|
37
|
+
function useToolVisibilityDispatch() {
|
|
38
|
+
return React.useContext(Context)?.dispatch ?? noopDispatch;
|
|
39
|
+
}
|
|
40
|
+
var ToolVisibilityStateProvider = ({ store, children }) => {
|
|
41
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
42
|
+
value: store,
|
|
43
|
+
children
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
export { ToolVisibilityStateProvider, ToolVisibilityStore, useToolVisibility, useToolVisibilityDispatch };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface JsonValueProps {
|
|
3
|
+
level: number;
|
|
4
|
+
keyName?: (string | number);
|
|
5
|
+
keyPath: (string | number)[];
|
|
6
|
+
value: object;
|
|
7
|
+
initialValue: object;
|
|
8
|
+
parentValue?: object;
|
|
9
|
+
}
|
|
10
|
+
export declare const JsonValue: React.ForwardRefExoticComponent<JsonValueProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { value_container } from "./json_view.module.js";
|
|
2
|
+
import { JsonNestedClose } from "./json_nested_close.js";
|
|
3
|
+
import { JsonNestedOpen } from "./json_nested_open.js";
|
|
4
|
+
import { JsonKeyValues } from "./json_key_values.js";
|
|
5
|
+
import { useUniqueKey } from "./unique_key.js";
|
|
6
|
+
import { useToolVisibilityDispatch } from "./json_tool_state.js";
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var JsonValue = React.forwardRef((props, ref) => {
|
|
10
|
+
const dispatch = useToolVisibilityDispatch();
|
|
11
|
+
const subkeyid = useUniqueKey();
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
className: value_container,
|
|
14
|
+
ref,
|
|
15
|
+
onMouseEnter: () => dispatch({ [subkeyid]: true }),
|
|
16
|
+
onMouseLeave: () => dispatch({ [subkeyid]: false }),
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ jsx(JsonNestedOpen, {
|
|
19
|
+
expandKey: subkeyid,
|
|
20
|
+
level: props.level,
|
|
21
|
+
keyPath: props.keyPath,
|
|
22
|
+
keyName: props.keyName,
|
|
23
|
+
value: props.value,
|
|
24
|
+
initialValue: props.initialValue,
|
|
25
|
+
parentValue: props.parentValue
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsx(JsonKeyValues, {
|
|
28
|
+
expandKey: subkeyid,
|
|
29
|
+
level: props.level,
|
|
30
|
+
keyPath: props.keyPath,
|
|
31
|
+
keyName: props.keyName,
|
|
32
|
+
value: props.value,
|
|
33
|
+
parentValue: props.parentValue
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ jsx(JsonNestedClose, {
|
|
36
|
+
expandKey: subkeyid,
|
|
37
|
+
level: props.level,
|
|
38
|
+
keyPath: props.keyPath,
|
|
39
|
+
keyName: props.keyName,
|
|
40
|
+
value: props.value,
|
|
41
|
+
parentValue: props.parentValue
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
export { JsonValue };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export * from './json_arrow_symbol.js';
|
|
3
|
+
export type JsonViewVariant = 'json' | 'explorer';
|
|
4
|
+
export interface JsonViewProps {
|
|
5
|
+
value: object;
|
|
6
|
+
variant?: JsonViewVariant;
|
|
7
|
+
arrayPageSize?: number;
|
|
8
|
+
collapsed?: boolean | number;
|
|
9
|
+
shortenTextAfterLength?: number;
|
|
10
|
+
beforeCopy?: (copyText: string, keyName?: string | number, value?: object, parentValue?: object, expandKey?: string, keyPath?: (number | string)[]) => string;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const JsonView: React.MemoExoticComponent<(props: JsonViewProps) => React.JSX.Element>;
|
|
14
|
+
export default JsonView;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { viewer, viewer_explorer } from "./json_view.module.js";
|
|
2
|
+
import { JsonViewerStateProvider } from "./json_view_state.js";
|
|
3
|
+
import { JsonValue } from "./json_value.js";
|
|
4
|
+
import { JsonArrowSymbol } from "./json_arrow_symbol.js";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var JsonView = React.memo(function JsonView(props) {
|
|
8
|
+
const { value, variant, arrayPageSize, collapsed, shortenTextAfterLength, beforeCopy, className } = props;
|
|
9
|
+
const state = React.useMemo(() => ({
|
|
10
|
+
variant: variant ?? "json",
|
|
11
|
+
arrayPageSize: arrayPageSize ?? 0,
|
|
12
|
+
collapsed: collapsed ?? false,
|
|
13
|
+
shortenTextAfterLength: shortenTextAfterLength ?? 30,
|
|
14
|
+
beforeCopy
|
|
15
|
+
}), [
|
|
16
|
+
variant,
|
|
17
|
+
arrayPageSize,
|
|
18
|
+
collapsed,
|
|
19
|
+
shortenTextAfterLength,
|
|
20
|
+
beforeCopy
|
|
21
|
+
]);
|
|
22
|
+
return /* @__PURE__ */ jsx(JsonViewerStateProvider, {
|
|
23
|
+
state,
|
|
24
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
25
|
+
className: `${viewer}${variant === "explorer" ? ` ${viewer_explorer}` : ""}${className ? ` ${className}` : ""}`,
|
|
26
|
+
"data-electron-drag-region": "false",
|
|
27
|
+
children: /* @__PURE__ */ jsx(JsonValue, {
|
|
28
|
+
value,
|
|
29
|
+
initialValue: value,
|
|
30
|
+
level: 0,
|
|
31
|
+
keyName: void 0,
|
|
32
|
+
keyPath: []
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
export { JsonArrowSymbol, JsonView, JsonView as default };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var literal_quotes = "dashql_literal_quotes_R0yxxy";
|
|
2
|
+
var literal_true = "dashql_literal_true_jbQ0gC";
|
|
3
|
+
var literal_false = "dashql_literal_false_7Rn264";
|
|
4
|
+
var literal_string = "dashql_literal_string_W-qcgr";
|
|
5
|
+
var literal_string_short = "dashql_literal_string_short_IjqB-R";
|
|
6
|
+
var literal_float = "dashql_literal_float_foNo13";
|
|
7
|
+
var literal_int = "dashql_literal_int_ZxDmA7";
|
|
8
|
+
var literal_bigint = "dashql_literal_bigint_gtCpAh";
|
|
9
|
+
var literal_url = "dashql_literal_url_EbwKlr";
|
|
10
|
+
var literal_date = "dashql_literal_date_acKxRT";
|
|
11
|
+
var literal_undefined = "dashql_literal_undefined_ehxjVQ";
|
|
12
|
+
var literal_null = "dashql_literal_null_hwnWDw";
|
|
13
|
+
var literal_nan = "dashql_literal_nan_QrvodF";
|
|
14
|
+
var symbol_ellipsis = "dashql_symbol_ellipsis_z-x5cp";
|
|
15
|
+
var symbol_arrow_container = "dashql_symbol_arrow_container_ih8hKg";
|
|
16
|
+
var symbol_arrow = "dashql_symbol_arrow_qvk8wO";
|
|
17
|
+
var item_count = "dashql_item_count_I7_Jjg";
|
|
18
|
+
var object_key_name_number = "dashql_object_key_name_number_uV9Bp1";
|
|
19
|
+
var object_key_name_string = "dashql_object_key_name_string_y8Z_3K";
|
|
20
|
+
var object_key_quotes = "dashql_object_key_quotes_HpVned";
|
|
21
|
+
var object_key_colon = "dashql_object_key_colon_tAwe_U";
|
|
22
|
+
var object_entries_line = "dashql_object_entries_line_Oh68Ha";
|
|
23
|
+
var object_close = "dashql_object_close_lbKtut";
|
|
24
|
+
var object_square_brackets_open = "dashql_object_square_brackets_open_qRmAT0";
|
|
25
|
+
var object_curly_brackets_open = "dashql_object_curly_brackets_open_cduUQe";
|
|
26
|
+
var object_curly_brackets_close = "dashql_object_curly_brackets_close_CUAeCC";
|
|
27
|
+
var object_header_set = "dashql_object_header_set_t4nBQ-";
|
|
28
|
+
var copy_button = "dashql_copy_button_cR1-Fs";
|
|
29
|
+
var copy_button_copied = "dashql_copy_button_copied_RNU0Si";
|
|
30
|
+
var viewer = "dashql_viewer_rVMRjg";
|
|
31
|
+
var value_container = "dashql_value_container_bJjg68";
|
|
32
|
+
var expand_button = "dashql_expand_button_KeYcWC";
|
|
33
|
+
var array_load_more = "dashql_array_load_more_SEHnAA";
|
|
34
|
+
var viewer_explorer = "dashql_viewer_explorer_ppYBeT";
|
|
35
|
+
var explorer_row = "dashql_explorer_row_XFzIVu";
|
|
36
|
+
var explorer_arrow_spacer = "dashql_explorer_arrow_spacer_cd1tpA";
|
|
37
|
+
var explorer_key = "dashql_explorer_key_wrOlnl";
|
|
38
|
+
var explorer_key_number = "dashql_explorer_key_number_I-H8zg";
|
|
39
|
+
var explorer_summary = "dashql_explorer_summary_16ET45";
|
|
40
|
+
var explorer_placeholder = "dashql_explorer_placeholder_4omxqs";
|
|
41
|
+
export { array_load_more, copy_button, copy_button_copied, expand_button, explorer_arrow_spacer, explorer_key, explorer_key_number, explorer_placeholder, explorer_row, explorer_summary, item_count, 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, object_close, object_curly_brackets_close, object_curly_brackets_open, object_entries_line, object_header_set, object_key_colon, object_key_name_number, object_key_name_string, object_key_quotes, object_square_brackets_open, symbol_arrow, symbol_arrow_container, symbol_ellipsis, value_container, viewer, viewer_explorer };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type JsonViewProps } from './json_view.js';
|
|
3
|
+
export interface JsonViewerState {
|
|
4
|
+
variant: NonNullable<JsonViewProps['variant']>;
|
|
5
|
+
arrayPageSize: number;
|
|
6
|
+
collapsed: boolean | number;
|
|
7
|
+
shortenTextAfterLength: number;
|
|
8
|
+
beforeCopy?: JsonViewProps['beforeCopy'];
|
|
9
|
+
}
|
|
10
|
+
export declare const useJsonViewerState: () => JsonViewerState;
|
|
11
|
+
export declare function expandedInitially(collapsed: boolean | number, level: number): boolean;
|
|
12
|
+
export declare const JsonViewerStateProvider: ({ children, state }: React.PropsWithChildren<{
|
|
13
|
+
state: JsonViewerState;
|
|
14
|
+
}>) => React.JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ToolVisibilityStateProvider, ToolVisibilityStore } from "./json_tool_state.js";
|
|
2
|
+
import { NestedExpansionStateProvider, useNestedExpansionReducer } from "./json_nested_state.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
var Context = React.createContext({
|
|
6
|
+
variant: "json",
|
|
7
|
+
arrayPageSize: 0,
|
|
8
|
+
collapsed: false,
|
|
9
|
+
shortenTextAfterLength: 30
|
|
10
|
+
});
|
|
11
|
+
var useJsonViewerState = () => {
|
|
12
|
+
return React.useContext(Context);
|
|
13
|
+
};
|
|
14
|
+
function expandedInitially(collapsed, level) {
|
|
15
|
+
return typeof collapsed === "number" ? level <= collapsed : !collapsed;
|
|
16
|
+
}
|
|
17
|
+
var JsonViewerStateProvider = ({ children, state }) => {
|
|
18
|
+
const [toolStore] = React.useState(() => new ToolVisibilityStore());
|
|
19
|
+
const [expands, expandsDispatch] = useNestedExpansionReducer();
|
|
20
|
+
return /* @__PURE__ */ jsx(Context.Provider, {
|
|
21
|
+
value: state,
|
|
22
|
+
children: /* @__PURE__ */ jsx(ToolVisibilityStateProvider, {
|
|
23
|
+
store: toolStore,
|
|
24
|
+
children: /* @__PURE__ */ jsx(NestedExpansionStateProvider, {
|
|
25
|
+
initial: expands,
|
|
26
|
+
dispatch: expandsDispatch,
|
|
27
|
+
children
|
|
28
|
+
})
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
export { JsonViewerStateProvider, expandedInitially, useJsonViewerState };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useUniqueKey(): string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Dispatch } from '@akohn/dashql/platform/utils/variant';
|
|
3
|
+
export interface KeyValueListElement {
|
|
4
|
+
key: string;
|
|
5
|
+
value: string;
|
|
6
|
+
}
|
|
7
|
+
export type UpdateKeyValueList = (prev: KeyValueListElement[]) => KeyValueListElement[];
|
|
8
|
+
interface Props {
|
|
9
|
+
className?: string;
|
|
10
|
+
title: string;
|
|
11
|
+
caption: string;
|
|
12
|
+
keyIcon: React.ElementType;
|
|
13
|
+
valueIcon: React.ElementType;
|
|
14
|
+
addButtonLabel: string;
|
|
15
|
+
elements: readonly KeyValueListElement[];
|
|
16
|
+
modifyElements: Dispatch<UpdateKeyValueList>;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
readOnly?: boolean;
|
|
19
|
+
sideBySide?: boolean;
|
|
20
|
+
copyValue?: (element: KeyValueListElement) => string;
|
|
21
|
+
copyLogContext?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const KeyValueListBuilder: React.FC<Props>;
|
|
24
|
+
export declare function flattenKeyValueList(list: KeyValueListElement[]): Record<string, string>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { alias, alias_side_by_side, element, element_side_by_side, list, list_caption, list_elements, list_name, list_side_by_side, path, path_side_by_side } from "./keyvalue_list.module.js";
|
|
2
|
+
import { PlusIcon, XIcon } from "./symbol_icon.js";
|
|
3
|
+
import { classNames } from "../dom/classnames.js";
|
|
4
|
+
import { TextInput } from "./text_input.js";
|
|
5
|
+
import { TextInputAction } from "./text_input_action.js";
|
|
6
|
+
import { ButtonSize, ButtonVariant, IconButton } from "./button.js";
|
|
7
|
+
import { CopyToClipboardButton } from "./clipboard.js";
|
|
8
|
+
import "react";
|
|
9
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
var KeyValueListBuilder = (props) => {
|
|
11
|
+
const appendElement = () => props.modifyElements((list) => {
|
|
12
|
+
const copy = [...list];
|
|
13
|
+
copy.push({
|
|
14
|
+
key: "",
|
|
15
|
+
value: ""
|
|
16
|
+
});
|
|
17
|
+
return copy;
|
|
18
|
+
});
|
|
19
|
+
const deleteIndex = (index) => props.modifyElements((list) => {
|
|
20
|
+
const copy = [...list];
|
|
21
|
+
copy.splice(index, 1);
|
|
22
|
+
return copy;
|
|
23
|
+
});
|
|
24
|
+
const modifyElement = (index, key, value) => props.modifyElements((list) => {
|
|
25
|
+
const copy = [...list];
|
|
26
|
+
copy[index] = {
|
|
27
|
+
key,
|
|
28
|
+
value
|
|
29
|
+
};
|
|
30
|
+
return copy;
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
33
|
+
className: classNames(props.className, list, { [list_side_by_side]: props.sideBySide }),
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsx("div", {
|
|
36
|
+
className: list_name,
|
|
37
|
+
children: props.title
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx("div", {
|
|
40
|
+
className: list_caption,
|
|
41
|
+
children: props.caption
|
|
42
|
+
}),
|
|
43
|
+
!props.readOnly && /* @__PURE__ */ jsx(IconButton, {
|
|
44
|
+
className: "dashql_add_button_GKnxGQ",
|
|
45
|
+
"aria-label": props.addButtonLabel,
|
|
46
|
+
onClick: appendElement,
|
|
47
|
+
disabled: props.disabled,
|
|
48
|
+
size: ButtonSize.Small,
|
|
49
|
+
children: /* @__PURE__ */ jsx(PlusIcon, {})
|
|
50
|
+
}),
|
|
51
|
+
/* @__PURE__ */ jsx("div", {
|
|
52
|
+
className: list_elements,
|
|
53
|
+
role: "list",
|
|
54
|
+
children: props.elements.map((elem, i) => /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
className: classNames(element, { [element_side_by_side]: props.sideBySide }),
|
|
56
|
+
role: "listitem",
|
|
57
|
+
children: [
|
|
58
|
+
/* @__PURE__ */ jsx(TextInput, {
|
|
59
|
+
block: true,
|
|
60
|
+
className: classNames(path, { [path_side_by_side]: props.sideBySide }),
|
|
61
|
+
value: elem.key,
|
|
62
|
+
onChange: (ev) => modifyElement(i, ev.target.value, elem.value),
|
|
63
|
+
"aria-label": `${props.title} name ${i + 1}`,
|
|
64
|
+
leadingVisual: props.keyIcon,
|
|
65
|
+
trailingAction: !props.readOnly ? /* @__PURE__ */ jsx(TextInputAction, {
|
|
66
|
+
"aria-label": "Clear input",
|
|
67
|
+
"aria-labelledby": "",
|
|
68
|
+
onClick: () => deleteIndex(i),
|
|
69
|
+
children: /* @__PURE__ */ jsx(XIcon, {})
|
|
70
|
+
}) : void 0,
|
|
71
|
+
disabled: props.disabled,
|
|
72
|
+
readOnly: props.readOnly || props.disabled
|
|
73
|
+
}),
|
|
74
|
+
!props.sideBySide && /* @__PURE__ */ jsx("div", { className: "dashql_aliaslink_tMuBMB" }),
|
|
75
|
+
/* @__PURE__ */ jsx(TextInput, {
|
|
76
|
+
block: true,
|
|
77
|
+
className: classNames(alias, { [alias_side_by_side]: props.sideBySide }),
|
|
78
|
+
value: elem.value,
|
|
79
|
+
onChange: (ev) => modifyElement(i, elem.key, ev.target.value),
|
|
80
|
+
"aria-label": `${props.title} value ${i + 1}`,
|
|
81
|
+
leadingVisual: props.valueIcon,
|
|
82
|
+
disabled: props.disabled,
|
|
83
|
+
readOnly: props.readOnly || props.disabled
|
|
84
|
+
}),
|
|
85
|
+
props.copyValue && props.copyLogContext && /* @__PURE__ */ jsx(CopyToClipboardButton, {
|
|
86
|
+
className: "dashql_copy_action_fGgkgj",
|
|
87
|
+
"aria-label": `Copy ${props.title} ${i + 1}`,
|
|
88
|
+
"aria-labelledby": "",
|
|
89
|
+
"data-testid": "keyvalue-copy",
|
|
90
|
+
value: props.copyValue(elem),
|
|
91
|
+
logContext: props.copyLogContext,
|
|
92
|
+
variant: ButtonVariant.Invisible,
|
|
93
|
+
size: ButtonSize.Small
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}, i))
|
|
97
|
+
})
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
function flattenKeyValueList(list) {
|
|
102
|
+
const out = {};
|
|
103
|
+
for (const kv of list) out[kv.key] = kv.value;
|
|
104
|
+
return out;
|
|
105
|
+
}
|
|
106
|
+
export { KeyValueListBuilder, flattenKeyValueList };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
var list = "dashql_list_tK1_WI";
|
|
2
|
+
var list_name = "dashql_list_name_TIP4q4";
|
|
3
|
+
var list_caption = "dashql_list_caption_IswnXD";
|
|
4
|
+
var add_button = "dashql_add_button_GKnxGQ";
|
|
5
|
+
var list_elements = "dashql_list_elements_j3m_yA";
|
|
6
|
+
var list_side_by_side = "dashql_list_side_by_side_o6lXnq";
|
|
7
|
+
var element = "dashql_element_1F4a9s";
|
|
8
|
+
var path = "dashql_path_3pGmPz";
|
|
9
|
+
var alias = "dashql_alias_V53iai";
|
|
10
|
+
var aliaslink = "dashql_aliaslink_tMuBMB";
|
|
11
|
+
var element_side_by_side = "dashql_element_side_by_side_r10b2q";
|
|
12
|
+
var path_side_by_side = "dashql_path_side_by_side_2S_yE3";
|
|
13
|
+
var alias_side_by_side = "dashql_alias_side_by_side_VqVRa8";
|
|
14
|
+
var copy_action = "dashql_copy_action_fGgkgj";
|
|
15
|
+
export { add_button, alias, alias_side_by_side, aliaslink, copy_action, element, element_side_by_side, list, list_caption, list_elements, list_name, list_side_by_side, path, path_side_by_side };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
name: string | null;
|
|
4
|
+
onCommit: (name: string) => void;
|
|
5
|
+
onCancel?: () => void;
|
|
6
|
+
ariaLabel: string;
|
|
7
|
+
placeholder: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
autoSelect?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const NameInput: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var NameInput = React.forwardRef((props, forwardedRef) => {
|
|
4
|
+
const inputRef = React.useRef(null);
|
|
5
|
+
const skipBlurCommitRef = React.useRef(false);
|
|
6
|
+
const { name, onCommit, onCancel, autoSelect } = props;
|
|
7
|
+
React.useImperativeHandle(forwardedRef, () => inputRef.current, []);
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
if (!autoSelect) return;
|
|
10
|
+
const select = () => {
|
|
11
|
+
inputRef.current?.focus();
|
|
12
|
+
inputRef.current?.select();
|
|
13
|
+
};
|
|
14
|
+
select();
|
|
15
|
+
const frame = requestAnimationFrame(() => {
|
|
16
|
+
if (document.activeElement !== inputRef.current) select();
|
|
17
|
+
});
|
|
18
|
+
return () => cancelAnimationFrame(frame);
|
|
19
|
+
}, [autoSelect]);
|
|
20
|
+
React.useEffect(() => {
|
|
21
|
+
if (inputRef.current != null) inputRef.current.value = name ?? "";
|
|
22
|
+
}, [name]);
|
|
23
|
+
const commitOnBlur = React.useCallback((e) => {
|
|
24
|
+
if (!skipBlurCommitRef.current) onCommit(e.currentTarget.value);
|
|
25
|
+
}, [onCommit]);
|
|
26
|
+
const blurWithoutCommit = React.useCallback((input) => {
|
|
27
|
+
skipBlurCommitRef.current = true;
|
|
28
|
+
input.blur();
|
|
29
|
+
skipBlurCommitRef.current = false;
|
|
30
|
+
}, []);
|
|
31
|
+
const onKeyDown = React.useCallback((e) => {
|
|
32
|
+
if (e.key === "Enter") {
|
|
33
|
+
onCommit(e.currentTarget.value);
|
|
34
|
+
blurWithoutCommit(e.currentTarget);
|
|
35
|
+
} else if (e.key === "Escape") {
|
|
36
|
+
e.currentTarget.value = name ?? "";
|
|
37
|
+
blurWithoutCommit(e.currentTarget);
|
|
38
|
+
onCancel?.();
|
|
39
|
+
}
|
|
40
|
+
e.stopPropagation();
|
|
41
|
+
}, [
|
|
42
|
+
name,
|
|
43
|
+
onCommit,
|
|
44
|
+
onCancel,
|
|
45
|
+
blurWithoutCommit
|
|
46
|
+
]);
|
|
47
|
+
const onPointerDown = React.useCallback((e) => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
}, []);
|
|
50
|
+
return /* @__PURE__ */ jsx("input", {
|
|
51
|
+
ref: inputRef,
|
|
52
|
+
className: props.className,
|
|
53
|
+
type: "text",
|
|
54
|
+
"aria-label": props.ariaLabel,
|
|
55
|
+
defaultValue: name ?? "",
|
|
56
|
+
placeholder: props.placeholder,
|
|
57
|
+
spellCheck: false,
|
|
58
|
+
onBlur: commitOnBlur,
|
|
59
|
+
onKeyDown,
|
|
60
|
+
onPointerDown
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
export { NameInput };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { AnchorSide } from '../dom/anchored_position.js';
|
|
3
|
+
interface UseOverlayArgs {
|
|
4
|
+
ignoreClickRefs?: React.RefObject<Element | null>[];
|
|
5
|
+
initialFocusRef?: React.RefObject<HTMLElement | null>;
|
|
6
|
+
returnFocusRef?: React.RefObject<HTMLElement | null>;
|
|
7
|
+
onEscape: (e: KeyboardEvent) => void;
|
|
8
|
+
onClickOutside: (e: TouchEvent | MouseEvent) => void;
|
|
9
|
+
overlayRef?: React.RefObject<HTMLDivElement | null>;
|
|
10
|
+
preventFocusOnOpen?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function useOverlay(args: UseOverlayArgs): React.RefObject<HTMLDivElement | null>;
|
|
13
|
+
export declare enum OverlaySize {
|
|
14
|
+
UNSPECIFIED = 0,
|
|
15
|
+
AUTO = 1,
|
|
16
|
+
XS = 2,
|
|
17
|
+
S = 3,
|
|
18
|
+
M = 4,
|
|
19
|
+
L = 5,
|
|
20
|
+
XL = 6,
|
|
21
|
+
XXL = 7
|
|
22
|
+
}
|
|
23
|
+
export declare enum OverlayVisibility {
|
|
24
|
+
Hidden = 0,
|
|
25
|
+
Visible = 1
|
|
26
|
+
}
|
|
27
|
+
export interface OverlayProps {
|
|
28
|
+
ignoreClickRefs?: React.RefObject<Element | null>[];
|
|
29
|
+
initialFocusRef?: React.RefObject<HTMLElement | null>;
|
|
30
|
+
returnFocusRef?: React.RefObject<HTMLElement | null>;
|
|
31
|
+
onClickOutside: (e: MouseEvent | TouchEvent) => void;
|
|
32
|
+
onEscape: (e: KeyboardEvent) => void;
|
|
33
|
+
visibility?: OverlayVisibility;
|
|
34
|
+
preventFocusOnOpen?: boolean;
|
|
35
|
+
portalContainerName?: string;
|
|
36
|
+
top?: React.CSSProperties['top'];
|
|
37
|
+
left?: React.CSSProperties['left'];
|
|
38
|
+
right?: React.CSSProperties['right'];
|
|
39
|
+
bottom?: React.CSSProperties['bottom'];
|
|
40
|
+
position?: React.CSSProperties['position'];
|
|
41
|
+
width?: OverlaySize;
|
|
42
|
+
height?: OverlaySize;
|
|
43
|
+
minWidth?: OverlaySize;
|
|
44
|
+
maxWidth?: OverlaySize;
|
|
45
|
+
maxHeight?: OverlaySize;
|
|
46
|
+
anchorSide?: AnchorSide;
|
|
47
|
+
centered?: boolean;
|
|
48
|
+
expanded?: boolean;
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
role?: React.AriaRole;
|
|
51
|
+
}
|
|
52
|
+
export declare const Overlay: React.ForwardRefExoticComponent<OverlayProps & React.RefAttributes<HTMLDivElement>>;
|
|
53
|
+
export {};
|