@quantumwake/terminal-ux-dashboard-components 0.1.17 → 0.1.18
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/dist/index.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -1
- package/dist/index.d.ts +20 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -32,6 +32,12 @@ interface DashboardCapabilities {
|
|
|
32
32
|
removePanel?: (panelId: string) => void;
|
|
33
33
|
persistPanelData?: (panelId: string, rows: QueryResult['rows'], refreshedAt: string) => void;
|
|
34
34
|
persistLayout?: (items: PanelLayout[]) => void;
|
|
35
|
+
panelHeaderExtra?: (panel: PanelRef) => ReactNode;
|
|
36
|
+
}
|
|
37
|
+
interface PanelRef {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
title?: string;
|
|
35
41
|
}
|
|
36
42
|
interface PanelLayout {
|
|
37
43
|
id: string;
|
|
@@ -408,6 +414,19 @@ interface DashboardRendererProps {
|
|
|
408
414
|
records?: Row[];
|
|
409
415
|
columns?: ColumnDef[];
|
|
410
416
|
}
|
|
417
|
+
interface PanelContentProps {
|
|
418
|
+
panel: DashboardPanel$1;
|
|
419
|
+
records?: Row[];
|
|
420
|
+
columns?: ColumnDef[];
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Renders a single dashboard panel based on its type and config.
|
|
424
|
+
* Panels saved with a SQL query render server-side (full dataset); the rest
|
|
425
|
+
* fall back to client-side aggregation over the loaded records.
|
|
426
|
+
*/
|
|
427
|
+
declare function PanelContent({ panel, records, columns }: PanelContentProps): react.JSX.Element | null;
|
|
428
|
+
declare const PanelChart: typeof PanelContent;
|
|
429
|
+
type PanelChartProps = PanelContentProps;
|
|
411
430
|
/**
|
|
412
431
|
* DashboardRenderer — renders a grid of AI-generated or manually configured
|
|
413
432
|
* panels via react-grid-layout. Editing is capability-gated:
|
|
@@ -520,4 +539,4 @@ interface DataExplorerProps {
|
|
|
520
539
|
}
|
|
521
540
|
declare function DataExplorer({ records, columns, states, activeStateId, profile, dashboard, dashboardId, savedDashboards, loading, analyzing, defaultMode, tabs, onSelectState, onRefreshStates, }: DataExplorerProps): react.JSX.Element;
|
|
522
541
|
|
|
523
|
-
export { type AggFn, type BarDatum, BarView, type BarViewProps, ChartBuilder, type ChartBuilderColumn, type ChartBuilderProps, type ChartConfig, type ChartField, type ChartFilter, type ChartPanel, type ChartStyle, ChartStyleControls, type ChartStyleControlsProps, type ChartType, DEFAULT_CHART_STYLE, type Dashboard$1 as Dashboard, type DashboardCapabilities, type DashboardContextValue, type DashboardPanel$1 as DashboardPanel, DashboardProvider, type DashboardProviderProps, DashboardRenderer, type DashboardRendererProps, type DashboardTheme, DataExplorer, type DataExplorerProps, type HeatmapSerie, HeatmapView, type HeatmapViewProps, type InsightConfig, InsightView, type InsightViewProps, LEGEND_ANCHORS, type LegendAnchor, type LegendPosition, type LineSerie, LineView, type LineViewProps, type MetricConfig, MetricView, type MetricViewProps, type PanelInput, type PanelLayout, type PieDatum, PieView, type PieViewProps, PivotView, type PivotViewProps, type QueryResult, type Row, type SavedDashboard, type ScatterSerie, ScatterView, type ScatterViewProps, SqlConsole, type SqlConsoleColumn, type SqlConsoleProps, type TitleAlign, aggExpr, aggregate, axisLegend, buildChartSQL, buildNivoTheme, compileWhere, groupBy, legendConfig, qIdent, qLit, shapeChartData, useCapabilities, useDashboard, withStyleDefaults };
|
|
542
|
+
export { type AggFn, type BarDatum, BarView, type BarViewProps, ChartBuilder, type ChartBuilderColumn, type ChartBuilderProps, type ChartConfig, type ChartField, type ChartFilter, type ChartPanel, type ChartStyle, ChartStyleControls, type ChartStyleControlsProps, type ChartType, DEFAULT_CHART_STYLE, type Dashboard$1 as Dashboard, type DashboardCapabilities, type DashboardContextValue, type DashboardPanel$1 as DashboardPanel, DashboardProvider, type DashboardProviderProps, DashboardRenderer, type DashboardRendererProps, type DashboardTheme, DataExplorer, type DataExplorerProps, type HeatmapSerie, HeatmapView, type HeatmapViewProps, type InsightConfig, InsightView, type InsightViewProps, LEGEND_ANCHORS, type LegendAnchor, type LegendPosition, type LineSerie, LineView, type LineViewProps, type MetricConfig, MetricView, type MetricViewProps, PanelChart, type PanelChartProps, type PanelInput, type PanelLayout, type PanelRef, type PieDatum, PieView, type PieViewProps, PivotView, type PivotViewProps, type QueryResult, type Row, type SavedDashboard, type ScatterSerie, ScatterView, type ScatterViewProps, SqlConsole, type SqlConsoleColumn, type SqlConsoleProps, type TitleAlign, aggExpr, aggregate, axisLegend, buildChartSQL, buildNivoTheme, compileWhere, groupBy, legendConfig, qIdent, qLit, shapeChartData, useCapabilities, useDashboard, withStyleDefaults };
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ interface DashboardCapabilities {
|
|
|
32
32
|
removePanel?: (panelId: string) => void;
|
|
33
33
|
persistPanelData?: (panelId: string, rows: QueryResult['rows'], refreshedAt: string) => void;
|
|
34
34
|
persistLayout?: (items: PanelLayout[]) => void;
|
|
35
|
+
panelHeaderExtra?: (panel: PanelRef) => ReactNode;
|
|
36
|
+
}
|
|
37
|
+
interface PanelRef {
|
|
38
|
+
id: string;
|
|
39
|
+
type: string;
|
|
40
|
+
title?: string;
|
|
35
41
|
}
|
|
36
42
|
interface PanelLayout {
|
|
37
43
|
id: string;
|
|
@@ -408,6 +414,19 @@ interface DashboardRendererProps {
|
|
|
408
414
|
records?: Row[];
|
|
409
415
|
columns?: ColumnDef[];
|
|
410
416
|
}
|
|
417
|
+
interface PanelContentProps {
|
|
418
|
+
panel: DashboardPanel$1;
|
|
419
|
+
records?: Row[];
|
|
420
|
+
columns?: ColumnDef[];
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* Renders a single dashboard panel based on its type and config.
|
|
424
|
+
* Panels saved with a SQL query render server-side (full dataset); the rest
|
|
425
|
+
* fall back to client-side aggregation over the loaded records.
|
|
426
|
+
*/
|
|
427
|
+
declare function PanelContent({ panel, records, columns }: PanelContentProps): react.JSX.Element | null;
|
|
428
|
+
declare const PanelChart: typeof PanelContent;
|
|
429
|
+
type PanelChartProps = PanelContentProps;
|
|
411
430
|
/**
|
|
412
431
|
* DashboardRenderer — renders a grid of AI-generated or manually configured
|
|
413
432
|
* panels via react-grid-layout. Editing is capability-gated:
|
|
@@ -520,4 +539,4 @@ interface DataExplorerProps {
|
|
|
520
539
|
}
|
|
521
540
|
declare function DataExplorer({ records, columns, states, activeStateId, profile, dashboard, dashboardId, savedDashboards, loading, analyzing, defaultMode, tabs, onSelectState, onRefreshStates, }: DataExplorerProps): react.JSX.Element;
|
|
522
541
|
|
|
523
|
-
export { type AggFn, type BarDatum, BarView, type BarViewProps, ChartBuilder, type ChartBuilderColumn, type ChartBuilderProps, type ChartConfig, type ChartField, type ChartFilter, type ChartPanel, type ChartStyle, ChartStyleControls, type ChartStyleControlsProps, type ChartType, DEFAULT_CHART_STYLE, type Dashboard$1 as Dashboard, type DashboardCapabilities, type DashboardContextValue, type DashboardPanel$1 as DashboardPanel, DashboardProvider, type DashboardProviderProps, DashboardRenderer, type DashboardRendererProps, type DashboardTheme, DataExplorer, type DataExplorerProps, type HeatmapSerie, HeatmapView, type HeatmapViewProps, type InsightConfig, InsightView, type InsightViewProps, LEGEND_ANCHORS, type LegendAnchor, type LegendPosition, type LineSerie, LineView, type LineViewProps, type MetricConfig, MetricView, type MetricViewProps, type PanelInput, type PanelLayout, type PieDatum, PieView, type PieViewProps, PivotView, type PivotViewProps, type QueryResult, type Row, type SavedDashboard, type ScatterSerie, ScatterView, type ScatterViewProps, SqlConsole, type SqlConsoleColumn, type SqlConsoleProps, type TitleAlign, aggExpr, aggregate, axisLegend, buildChartSQL, buildNivoTheme, compileWhere, groupBy, legendConfig, qIdent, qLit, shapeChartData, useCapabilities, useDashboard, withStyleDefaults };
|
|
542
|
+
export { type AggFn, type BarDatum, BarView, type BarViewProps, ChartBuilder, type ChartBuilderColumn, type ChartBuilderProps, type ChartConfig, type ChartField, type ChartFilter, type ChartPanel, type ChartStyle, ChartStyleControls, type ChartStyleControlsProps, type ChartType, DEFAULT_CHART_STYLE, type Dashboard$1 as Dashboard, type DashboardCapabilities, type DashboardContextValue, type DashboardPanel$1 as DashboardPanel, DashboardProvider, type DashboardProviderProps, DashboardRenderer, type DashboardRendererProps, type DashboardTheme, DataExplorer, type DataExplorerProps, type HeatmapSerie, HeatmapView, type HeatmapViewProps, type InsightConfig, InsightView, type InsightViewProps, LEGEND_ANCHORS, type LegendAnchor, type LegendPosition, type LineSerie, LineView, type LineViewProps, type MetricConfig, MetricView, type MetricViewProps, PanelChart, type PanelChartProps, type PanelInput, type PanelLayout, type PanelRef, type PieDatum, PieView, type PieViewProps, PivotView, type PivotViewProps, type QueryResult, type Row, type SavedDashboard, type ScatterSerie, ScatterView, type ScatterViewProps, SqlConsole, type SqlConsoleColumn, type SqlConsoleProps, type TitleAlign, aggExpr, aggregate, axisLegend, buildChartSQL, buildNivoTheme, compileWhere, groupBy, legendConfig, qIdent, qLit, shapeChartData, useCapabilities, useDashboard, withStyleDefaults };
|
package/dist/index.js
CHANGED
|
@@ -2053,6 +2053,7 @@ function PanelContent({ panel, records, columns }) {
|
|
|
2053
2053
|
] });
|
|
2054
2054
|
}
|
|
2055
2055
|
}
|
|
2056
|
+
var PanelChart = PanelContent;
|
|
2056
2057
|
var GRID_COLS = 12;
|
|
2057
2058
|
var ROW_HEIGHT = 80;
|
|
2058
2059
|
var GRID_MARGIN = 10;
|
|
@@ -2102,7 +2103,7 @@ function buildLayout(panels) {
|
|
|
2102
2103
|
});
|
|
2103
2104
|
}
|
|
2104
2105
|
function DashboardRenderer({ dashboard, records, columns }) {
|
|
2105
|
-
const { theme, removePanel, persistLayout } = useDashboard();
|
|
2106
|
+
const { theme, removePanel, persistLayout, panelHeaderExtra } = useDashboard();
|
|
2106
2107
|
const { canEditPanels, canEditLayout } = useCapabilities();
|
|
2107
2108
|
useInjectRglCss();
|
|
2108
2109
|
const panels = dashboard?.panels ?? [];
|
|
@@ -2127,6 +2128,9 @@ function DashboardRenderer({ dashboard, records, columns }) {
|
|
|
2127
2128
|
children: panel.title || panel.type
|
|
2128
2129
|
}
|
|
2129
2130
|
),
|
|
2131
|
+
panelHeaderExtra && // Host-injected per-panel affordance (e.g. the viewer's
|
|
2132
|
+
// copy-embed-link icon). Stop drag from hijacking the click.
|
|
2133
|
+
/* @__PURE__ */ jsx("span", { onMouseDown: (e) => e.stopPropagation(), className: "flex items-center", children: panelHeaderExtra(panel) }),
|
|
2130
2134
|
canEditPanels && removePanel && /* @__PURE__ */ jsx(
|
|
2131
2135
|
"button",
|
|
2132
2136
|
{
|
|
@@ -2493,6 +2497,6 @@ function DataExplorer({
|
|
|
2493
2497
|
] });
|
|
2494
2498
|
}
|
|
2495
2499
|
|
|
2496
|
-
export { BarView, ChartBuilder, ChartStyleControls, DEFAULT_CHART_STYLE, DashboardProvider, DashboardRenderer, DataExplorer, HeatmapView, InsightView, LEGEND_ANCHORS, LineView, MetricView, PieView, PivotView, ScatterView, SqlConsole, aggExpr, aggregate, axisLegend, buildChartSQL, buildNivoTheme, compileWhere, groupBy, legendConfig, qIdent, qLit, shapeChartData, useCapabilities, useDashboard, withStyleDefaults };
|
|
2500
|
+
export { BarView, ChartBuilder, ChartStyleControls, DEFAULT_CHART_STYLE, DashboardProvider, DashboardRenderer, DataExplorer, HeatmapView, InsightView, LEGEND_ANCHORS, LineView, MetricView, PanelChart, PieView, PivotView, ScatterView, SqlConsole, aggExpr, aggregate, axisLegend, buildChartSQL, buildNivoTheme, compileWhere, groupBy, legendConfig, qIdent, qLit, shapeChartData, useCapabilities, useDashboard, withStyleDefaults };
|
|
2497
2501
|
//# sourceMappingURL=index.js.map
|
|
2498
2502
|
//# sourceMappingURL=index.js.map
|