@quantumwake/terminal-ux-dashboard-components 0.1.13 → 0.1.17
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 +286 -160
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -9
- package/dist/index.d.ts +25 -9
- package/dist/index.js +287 -162
- package/dist/index.js.map +1 -1
- package/package.json +6 -2
package/dist/index.d.cts
CHANGED
|
@@ -31,6 +31,14 @@ interface DashboardCapabilities {
|
|
|
31
31
|
addPanel?: (panel: PanelInput) => void;
|
|
32
32
|
removePanel?: (panelId: string) => void;
|
|
33
33
|
persistPanelData?: (panelId: string, rows: QueryResult['rows'], refreshedAt: string) => void;
|
|
34
|
+
persistLayout?: (items: PanelLayout[]) => void;
|
|
35
|
+
}
|
|
36
|
+
interface PanelLayout {
|
|
37
|
+
id: string;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
w: number;
|
|
41
|
+
h: number;
|
|
34
42
|
}
|
|
35
43
|
interface DashboardContextValue extends DashboardCapabilities {
|
|
36
44
|
theme: DashboardTheme;
|
|
@@ -54,6 +62,7 @@ declare function useCapabilities(): {
|
|
|
54
62
|
canAddPanel: boolean;
|
|
55
63
|
canEditPanels: boolean;
|
|
56
64
|
canRefresh: boolean;
|
|
65
|
+
canEditLayout: boolean;
|
|
57
66
|
};
|
|
58
67
|
|
|
59
68
|
type ChartType = 'bar' | 'grouped-bar' | 'pie' | 'line' | 'scatter' | 'heatmap';
|
|
@@ -105,7 +114,13 @@ interface ChartStyle {
|
|
|
105
114
|
legendBold: boolean;
|
|
106
115
|
legendHighlight: string;
|
|
107
116
|
xTickRotation: number;
|
|
117
|
+
yTickRotation: number;
|
|
108
118
|
tickTruncate: number;
|
|
119
|
+
tickWrap: boolean;
|
|
120
|
+
tickWrapWidth: number;
|
|
121
|
+
cellWrap: boolean;
|
|
122
|
+
cellPrecision: number;
|
|
123
|
+
cellTruncate: number;
|
|
109
124
|
legendAnchor: LegendAnchor;
|
|
110
125
|
titleAlign: TitleAlign;
|
|
111
126
|
titleBold: boolean;
|
|
@@ -325,12 +340,6 @@ interface ChartStyleControlsProps {
|
|
|
325
340
|
style?: Partial<ChartStyle> | null;
|
|
326
341
|
onChange: (next: ChartStyle) => void;
|
|
327
342
|
}
|
|
328
|
-
/**
|
|
329
|
-
* ChartStyleControls — the standardized appearance editor used across all
|
|
330
|
-
* charts. Edits a plain style object (see chartStyle.ts); theme-aware via the
|
|
331
|
-
* host-injected DashboardContext theme. Parent persists the style and passes it
|
|
332
|
-
* to the views.
|
|
333
|
-
*/
|
|
334
343
|
declare function ChartStyleControls({ style, onChange }: ChartStyleControlsProps): react.JSX.Element;
|
|
335
344
|
|
|
336
345
|
interface SqlConsoleColumn {
|
|
@@ -372,6 +381,7 @@ interface PanelConfig {
|
|
|
372
381
|
text?: string;
|
|
373
382
|
label?: string;
|
|
374
383
|
column?: string;
|
|
384
|
+
fill?: boolean;
|
|
375
385
|
data?: Row[];
|
|
376
386
|
refreshedAt?: string;
|
|
377
387
|
[key: string]: unknown;
|
|
@@ -382,6 +392,8 @@ interface DashboardPanel$1 {
|
|
|
382
392
|
title?: string;
|
|
383
393
|
width?: number;
|
|
384
394
|
height?: number;
|
|
395
|
+
x?: number;
|
|
396
|
+
y?: number;
|
|
385
397
|
config?: PanelConfig;
|
|
386
398
|
}
|
|
387
399
|
interface Dashboard$1 {
|
|
@@ -398,8 +410,12 @@ interface DashboardRendererProps {
|
|
|
398
410
|
}
|
|
399
411
|
/**
|
|
400
412
|
* DashboardRenderer — renders a grid of AI-generated or manually configured
|
|
401
|
-
* panels
|
|
402
|
-
*
|
|
413
|
+
* panels via react-grid-layout. Editing is capability-gated:
|
|
414
|
+
* - studio (persistLayout wired) ⇒ panels drag (by their header) + resize, and
|
|
415
|
+
* the new geometry is persisted back to the host.
|
|
416
|
+
* - published viewer (no persistLayout) ⇒ a static grid, rendered exactly where
|
|
417
|
+
* the studio left the panels.
|
|
418
|
+
* The per-panel remove button is similarly gated behind canEditPanels.
|
|
403
419
|
*/
|
|
404
420
|
declare function DashboardRenderer({ dashboard, records, columns }: DashboardRendererProps): react.JSX.Element | null;
|
|
405
421
|
|
|
@@ -504,4 +520,4 @@ interface DataExplorerProps {
|
|
|
504
520
|
}
|
|
505
521
|
declare function DataExplorer({ records, columns, states, activeStateId, profile, dashboard, dashboardId, savedDashboards, loading, analyzing, defaultMode, tabs, onSelectState, onRefreshStates, }: DataExplorerProps): react.JSX.Element;
|
|
506
522
|
|
|
507
|
-
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 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,14 @@ interface DashboardCapabilities {
|
|
|
31
31
|
addPanel?: (panel: PanelInput) => void;
|
|
32
32
|
removePanel?: (panelId: string) => void;
|
|
33
33
|
persistPanelData?: (panelId: string, rows: QueryResult['rows'], refreshedAt: string) => void;
|
|
34
|
+
persistLayout?: (items: PanelLayout[]) => void;
|
|
35
|
+
}
|
|
36
|
+
interface PanelLayout {
|
|
37
|
+
id: string;
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
w: number;
|
|
41
|
+
h: number;
|
|
34
42
|
}
|
|
35
43
|
interface DashboardContextValue extends DashboardCapabilities {
|
|
36
44
|
theme: DashboardTheme;
|
|
@@ -54,6 +62,7 @@ declare function useCapabilities(): {
|
|
|
54
62
|
canAddPanel: boolean;
|
|
55
63
|
canEditPanels: boolean;
|
|
56
64
|
canRefresh: boolean;
|
|
65
|
+
canEditLayout: boolean;
|
|
57
66
|
};
|
|
58
67
|
|
|
59
68
|
type ChartType = 'bar' | 'grouped-bar' | 'pie' | 'line' | 'scatter' | 'heatmap';
|
|
@@ -105,7 +114,13 @@ interface ChartStyle {
|
|
|
105
114
|
legendBold: boolean;
|
|
106
115
|
legendHighlight: string;
|
|
107
116
|
xTickRotation: number;
|
|
117
|
+
yTickRotation: number;
|
|
108
118
|
tickTruncate: number;
|
|
119
|
+
tickWrap: boolean;
|
|
120
|
+
tickWrapWidth: number;
|
|
121
|
+
cellWrap: boolean;
|
|
122
|
+
cellPrecision: number;
|
|
123
|
+
cellTruncate: number;
|
|
109
124
|
legendAnchor: LegendAnchor;
|
|
110
125
|
titleAlign: TitleAlign;
|
|
111
126
|
titleBold: boolean;
|
|
@@ -325,12 +340,6 @@ interface ChartStyleControlsProps {
|
|
|
325
340
|
style?: Partial<ChartStyle> | null;
|
|
326
341
|
onChange: (next: ChartStyle) => void;
|
|
327
342
|
}
|
|
328
|
-
/**
|
|
329
|
-
* ChartStyleControls — the standardized appearance editor used across all
|
|
330
|
-
* charts. Edits a plain style object (see chartStyle.ts); theme-aware via the
|
|
331
|
-
* host-injected DashboardContext theme. Parent persists the style and passes it
|
|
332
|
-
* to the views.
|
|
333
|
-
*/
|
|
334
343
|
declare function ChartStyleControls({ style, onChange }: ChartStyleControlsProps): react.JSX.Element;
|
|
335
344
|
|
|
336
345
|
interface SqlConsoleColumn {
|
|
@@ -372,6 +381,7 @@ interface PanelConfig {
|
|
|
372
381
|
text?: string;
|
|
373
382
|
label?: string;
|
|
374
383
|
column?: string;
|
|
384
|
+
fill?: boolean;
|
|
375
385
|
data?: Row[];
|
|
376
386
|
refreshedAt?: string;
|
|
377
387
|
[key: string]: unknown;
|
|
@@ -382,6 +392,8 @@ interface DashboardPanel$1 {
|
|
|
382
392
|
title?: string;
|
|
383
393
|
width?: number;
|
|
384
394
|
height?: number;
|
|
395
|
+
x?: number;
|
|
396
|
+
y?: number;
|
|
385
397
|
config?: PanelConfig;
|
|
386
398
|
}
|
|
387
399
|
interface Dashboard$1 {
|
|
@@ -398,8 +410,12 @@ interface DashboardRendererProps {
|
|
|
398
410
|
}
|
|
399
411
|
/**
|
|
400
412
|
* DashboardRenderer — renders a grid of AI-generated or manually configured
|
|
401
|
-
* panels
|
|
402
|
-
*
|
|
413
|
+
* panels via react-grid-layout. Editing is capability-gated:
|
|
414
|
+
* - studio (persistLayout wired) ⇒ panels drag (by their header) + resize, and
|
|
415
|
+
* the new geometry is persisted back to the host.
|
|
416
|
+
* - published viewer (no persistLayout) ⇒ a static grid, rendered exactly where
|
|
417
|
+
* the studio left the panels.
|
|
418
|
+
* The per-panel remove button is similarly gated behind canEditPanels.
|
|
403
419
|
*/
|
|
404
420
|
declare function DashboardRenderer({ dashboard, records, columns }: DashboardRendererProps): react.JSX.Element | null;
|
|
405
421
|
|
|
@@ -504,4 +520,4 @@ interface DataExplorerProps {
|
|
|
504
520
|
}
|
|
505
521
|
declare function DataExplorer({ records, columns, states, activeStateId, profile, dashboard, dashboardId, savedDashboards, loading, analyzing, defaultMode, tabs, onSelectState, onRefreshStates, }: DataExplorerProps): react.JSX.Element;
|
|
506
522
|
|
|
507
|
-
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 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 };
|
|
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 };
|