@hachej/boring-data-catalog 0.1.59 → 0.1.60
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 +6 -6
- package/dist/front/index.d.ts +10 -2
- package/dist/front/index.js +18 -15
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
A configurable data-catalog plugin **builder** for the workbench. One call to
|
|
4
4
|
`createDataCatalogPlugin(options)` binds your `ExplorerDataSource` adapter and
|
|
5
|
-
returns a configured front plugin that contributes a
|
|
5
|
+
returns a configured front plugin that contributes a workspace page, a
|
|
6
6
|
visualization panel, a catalog entry, and a surface resolver. Built on
|
|
7
7
|
[`@hachej/boring-data-explorer`](../data-explorer/README.md).
|
|
8
8
|
|
|
9
9
|
## What it does
|
|
10
10
|
|
|
11
|
-
- Adds a
|
|
12
|
-
- Opens a
|
|
11
|
+
- Adds a workspace page listing rows from your adapter, with search + facets.
|
|
12
|
+
- Opens a shared Dockview "visualization" panel when a row is activated (default panel
|
|
13
13
|
shows another explorer scoped to the row; swap in your own component).
|
|
14
14
|
- Lets the agent search the catalog and open a specific row in a panel.
|
|
15
15
|
|
|
@@ -20,8 +20,8 @@ contributions, each opt-out via an `include*` flag:
|
|
|
20
20
|
|
|
21
21
|
| Contribution | What | Flag (default) |
|
|
22
22
|
|--------------|------|----------------|
|
|
23
|
-
|
|
|
24
|
-
| Visualization panel |
|
|
23
|
+
| Workspace page | searchable, faceted row list | `includeWorkspacePage` (true) |
|
|
24
|
+
| Visualization panel | shared Dockview panel for the selected row | `includeVisualizationPanel` (true) |
|
|
25
25
|
| Catalog | command-palette-searchable catalog entry | `includeCatalog` (true) |
|
|
26
26
|
| Surface resolver | maps `openSurface` → opens the panel | `includeSurfaceResolver` (true if panel on and no custom `onSelect`) |
|
|
27
27
|
|
|
@@ -82,7 +82,7 @@ openSurface({
|
|
|
82
82
|
- `id`, `label`, `pluginId`, `source` — identity / panel attribution.
|
|
83
83
|
- `facets`, `groupBy`, `getDragPayload`, `onSelect(row, ctx)`, `emptyState`,
|
|
84
84
|
`searchPlaceholder`, `pageSize`, `debounceMs` — explorer behavior.
|
|
85
|
-
- `
|
|
85
|
+
- `workspacePageId` / `workspacePageTitle` / `workspacePageIcon`,
|
|
86
86
|
`catalogId` / `catalogLabel`,
|
|
87
87
|
`visualizationPanelId` / `visualizationTitle` / `visualizationIcon` /
|
|
88
88
|
`visualizationComponent` — per-contribution overrides.
|
package/dist/front/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ interface DataCatalogSelectContext {
|
|
|
21
21
|
}
|
|
22
22
|
interface CreateDataCatalogContributionsOptions {
|
|
23
23
|
/**
|
|
24
|
-
* Base contribution id. Defaults catalog id to this value and
|
|
24
|
+
* Base contribution id. Defaults catalog id to this value and workspace page /
|
|
25
25
|
* visualization panel ids to derived names.
|
|
26
26
|
*/
|
|
27
27
|
id?: string;
|
|
@@ -35,9 +35,17 @@ interface CreateDataCatalogContributionsOptions {
|
|
|
35
35
|
searchPlaceholder?: string;
|
|
36
36
|
pageSize?: number;
|
|
37
37
|
debounceMs?: number;
|
|
38
|
+
workspacePageId?: string;
|
|
39
|
+
workspacePageTitle?: string;
|
|
40
|
+
workspacePageIcon?: PanelConfig["icon"];
|
|
41
|
+
includeWorkspacePage?: boolean;
|
|
42
|
+
/** @deprecated use workspacePageId */
|
|
38
43
|
leftTabId?: string;
|
|
44
|
+
/** @deprecated use workspacePageTitle */
|
|
39
45
|
leftTabTitle?: string;
|
|
46
|
+
/** @deprecated use workspacePageIcon */
|
|
40
47
|
leftTabIcon?: PanelConfig["icon"];
|
|
48
|
+
/** @deprecated use includeWorkspacePage */
|
|
41
49
|
includeLeftTab?: boolean;
|
|
42
50
|
catalogId?: string;
|
|
43
51
|
catalogLabel?: string;
|
|
@@ -91,7 +99,7 @@ declare function useDataCatalogOpenVisualization(options: OpenDataCatalogVisuali
|
|
|
91
99
|
/**
|
|
92
100
|
* Builds a `BoringFrontFactoryWithId` for the data-catalog plugin.
|
|
93
101
|
* The factory captures `options` in a closure and registers the
|
|
94
|
-
* configured
|
|
102
|
+
* configured workspace source, visualization panel, catalog entry, and
|
|
95
103
|
* surface resolver imperatively when the workspace calls it.
|
|
96
104
|
*
|
|
97
105
|
* Each contribution is opt-out via the `include*` flags so host apps
|
package/dist/front/index.js
CHANGED
|
@@ -73,6 +73,10 @@ function createDataCatalogSurfaceResolver(options) {
|
|
|
73
73
|
return {
|
|
74
74
|
id: options.surfaceResolverId ?? `${options.id}-row`,
|
|
75
75
|
kind,
|
|
76
|
+
title: "Open data catalog row",
|
|
77
|
+
description: "Open or focus a data catalog row using the host catalog resolver.",
|
|
78
|
+
targetHint: "catalog row id or query string",
|
|
79
|
+
examples: [{ target: "orders_daily" }],
|
|
76
80
|
source: options.source,
|
|
77
81
|
resolve(request) {
|
|
78
82
|
if (request.kind !== kind) return void 0;
|
|
@@ -154,22 +158,22 @@ function createDataCatalogPlugin(options) {
|
|
|
154
158
|
const label = options.label ?? "Data";
|
|
155
159
|
const catalogId = options.catalogId ?? id;
|
|
156
160
|
const catalogLabel = options.catalogLabel ?? label;
|
|
157
|
-
const
|
|
158
|
-
const
|
|
159
|
-
const
|
|
161
|
+
const workspaceSourceId = options.workspacePageId ?? options.leftTabId ?? `${id}-page`;
|
|
162
|
+
const workspaceSourceTitle = options.workspacePageTitle ?? options.leftTabTitle ?? label;
|
|
163
|
+
const workspaceSourceIcon = options.workspacePageIcon ?? options.leftTabIcon ?? Database;
|
|
160
164
|
const visualizationPanelId = options.visualizationPanelId ?? `${id}-visualization`;
|
|
161
165
|
const visualizationTitle = options.visualizationTitle ?? `${label} View`;
|
|
162
166
|
const surfaceKind = options.surfaceKind ?? DATA_CATALOG_ROW_SURFACE_KIND;
|
|
163
167
|
const source = options.source ?? "app";
|
|
164
168
|
const includeVisualizationPanel = options.includeVisualizationPanel ?? true;
|
|
165
|
-
const
|
|
169
|
+
const includeWorkspaceSource = options.includeWorkspacePage ?? options.includeLeftTab ?? true;
|
|
166
170
|
const includeCatalog = options.includeCatalog ?? true;
|
|
167
171
|
const includeSurfaceResolver = options.includeSurfaceResolver ?? (includeVisualizationPanel && !options.onSelect);
|
|
168
172
|
const emptyState = options.emptyState ?? "No data found";
|
|
169
173
|
const searchPlaceholder = options.searchPlaceholder ?? `Search ${label.toLowerCase()}...`;
|
|
170
174
|
const onSelect = options.onSelect ?? (includeVisualizationPanel ? createDataCatalogOpenHandler({ catalogId, surfaceKind }) : () => {
|
|
171
175
|
});
|
|
172
|
-
function
|
|
176
|
+
function DataCatalogWorkspaceSource({ params, className }) {
|
|
173
177
|
const { query, controlled } = useDataCatalogQuery(params);
|
|
174
178
|
const bridge = params?.bridge;
|
|
175
179
|
const handleSelect = (row) => onSelect(row, { params, bridge });
|
|
@@ -184,8 +188,8 @@ function createDataCatalogPlugin(options) {
|
|
|
184
188
|
getDragPayload: options.getDragPayload,
|
|
185
189
|
emptyState,
|
|
186
190
|
searchPlaceholder,
|
|
187
|
-
toolbarTitle: usesOuterChromeSearch ? void 0 :
|
|
188
|
-
toolbarIcon: usesOuterChromeSearch ? void 0 :
|
|
191
|
+
toolbarTitle: usesOuterChromeSearch ? void 0 : workspaceSourceTitle,
|
|
192
|
+
toolbarIcon: usesOuterChromeSearch ? void 0 : workspaceSourceIcon,
|
|
189
193
|
query: usesOuterChromeSearch ? query : void 0,
|
|
190
194
|
searchable: !usesOuterChromeSearch,
|
|
191
195
|
toolbarPortalElement: usesOuterChromeSearch ? params?.chromeActionsElement : void 0,
|
|
@@ -238,13 +242,12 @@ function createDataCatalogPlugin(options) {
|
|
|
238
242
|
}
|
|
239
243
|
);
|
|
240
244
|
}
|
|
241
|
-
const
|
|
242
|
-
id:
|
|
243
|
-
|
|
244
|
-
icon:
|
|
245
|
-
component:
|
|
246
|
-
source
|
|
247
|
-
panelId: leftTabId
|
|
245
|
+
const workspaceSource = includeWorkspaceSource ? {
|
|
246
|
+
id: workspaceSourceId,
|
|
247
|
+
label: workspaceSourceTitle,
|
|
248
|
+
icon: workspaceSourceIcon,
|
|
249
|
+
component: DataCatalogWorkspaceSource,
|
|
250
|
+
source
|
|
248
251
|
} : void 0;
|
|
249
252
|
const visualizationPanel = includeVisualizationPanel ? {
|
|
250
253
|
id: visualizationPanelId,
|
|
@@ -273,7 +276,7 @@ function createDataCatalogPlugin(options) {
|
|
|
273
276
|
return definePlugin({
|
|
274
277
|
id,
|
|
275
278
|
label,
|
|
276
|
-
|
|
279
|
+
workspaceSources: workspaceSource ? [workspaceSource] : [],
|
|
277
280
|
panels: visualizationPanel ? [visualizationPanel] : [],
|
|
278
281
|
catalogs: catalog ? [catalog] : [],
|
|
279
282
|
surfaceResolvers: resolver ? [resolver] : []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hachej/boring-data-catalog",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.60",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react": "^18.0.0 || ^19.0.0",
|
|
38
38
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
39
|
-
"@hachej/boring-workspace": "0.1.
|
|
39
|
+
"@hachej/boring-workspace": "0.1.60"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"lucide-react": "^1.8.0",
|
|
43
|
-
"@hachej/boring-data-explorer": "0.1.
|
|
43
|
+
"@hachej/boring-data-explorer": "0.1.60"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@testing-library/jest-dom": "^6.9.1",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"tsup": "^8.0.0",
|
|
56
56
|
"typescript": "^5.4.0",
|
|
57
57
|
"vitest": "^3.2.6",
|
|
58
|
-
"@hachej/boring-workspace": "0.1.
|
|
58
|
+
"@hachej/boring-workspace": "0.1.60"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"build": "tsup",
|