@quantumwake/terminal-ux-dashboard-components 0.1.18 → 0.1.19
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/README.md +10 -11
- package/dist/index.cjs +419 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +75 -8
- package/dist/index.d.ts +75 -8
- package/dist/index.js +416 -13
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -6,18 +6,18 @@ These components are **capability-injected**: they never import a store or an AP
|
|
|
6
6
|
client. The host wires concrete functions (query / save / load / search / …) via
|
|
7
7
|
`<DashboardProvider>`, and the components call them through `useDashboard()`.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
A **full-capability host** (the studio) wires every verb and gets full CRUD. A
|
|
10
|
+
**read-only host** (a published viewer) provides only `theme` + `runQuery`
|
|
11
|
+
(e.g. DuckDB-WASM), so the logged-in-only verbs — **save, edit, load, search,
|
|
12
|
+
AI analyze/refine** — are simply not wired and their affordances disappear. One
|
|
13
|
+
component tree, any number of hosts, differences injected.
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { DashboardProvider } from '@quantumwake/terminal-ux-dashboard-components';
|
|
19
19
|
|
|
20
|
-
//
|
|
20
|
+
// Full-capability host (studio): wire everything.
|
|
21
21
|
<DashboardProvider
|
|
22
22
|
theme={theme}
|
|
23
23
|
runQuery={(sql, stateId) => store.runStateFsQuery(sql, undefined, stateId)}
|
|
@@ -32,21 +32,21 @@ import { DashboardProvider } from '@quantumwake/terminal-ux-dashboard-components
|
|
|
32
32
|
{/* ChartBuilder, DashboardRenderer, SqlConsole, DataExplorer */}
|
|
33
33
|
</DashboardProvider>
|
|
34
34
|
|
|
35
|
-
//
|
|
35
|
+
// Read-only host (viewer): theme + runQuery only.
|
|
36
36
|
<DashboardProvider theme={theme} runQuery={(sql, stateId) => runQuery(shareId, stateId!, sql)}>
|
|
37
37
|
{/* same components, no save/edit/load affordances */}
|
|
38
38
|
</DashboardProvider>
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
`runQuery(sql, stateId)` must return `{ columns, rows }`, executing `sql` against
|
|
42
|
-
a view named `data` over the state's dataset (
|
|
43
|
-
|
|
42
|
+
a view named `data` over the state's dataset (a full host might run it against a
|
|
43
|
+
SQL service `/query`; a read-only host against DuckDB-WASM `read_parquet`).
|
|
44
44
|
|
|
45
45
|
## Status
|
|
46
46
|
|
|
47
47
|
- ✅ Capability contract (`DashboardProvider` / `useDashboard` / `useCapabilities`)
|
|
48
48
|
- ✅ Pure utilities: `sqlgen`, `chartStyle`
|
|
49
|
-
- ⏳ Components (
|
|
49
|
+
- ⏳ Components (landing in tranches): views/, `SqlConsole`,
|
|
50
50
|
`ChartBuilder`, `DashboardRenderer`, `DataExplorer`
|
|
51
51
|
|
|
52
52
|
## Build
|
|
@@ -56,4 +56,3 @@ npm install
|
|
|
56
56
|
npm run build # tsup → dist (esm + cjs + d.ts)
|
|
57
57
|
npm run lint # tsc --noEmit
|
|
58
58
|
```
|
|
59
|
-
# terminal-ux-dashboard-components
|