@hachej/boring-ui-plugin-cli 0.1.59 → 0.1.61
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/package.json
CHANGED
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
// Copy this shape — replace <kebab-name> and <Label>.
|
|
3
3
|
//
|
|
4
4
|
// Structure rule:
|
|
5
|
-
// -
|
|
6
|
-
// -
|
|
7
|
-
// - If
|
|
8
|
-
// Register a small LeftPane and a separate MainPane.
|
|
5
|
+
// - Use placement: "workspace-page" for full plugin pages/dashboards.
|
|
6
|
+
// - Use placement: "shared-dockview" for artifacts/details/results.
|
|
7
|
+
// - If your plugin needs side navigation, render it inside your page as normal React.
|
|
9
8
|
|
|
10
9
|
import React from "react"
|
|
11
|
-
import { definePlugin
|
|
10
|
+
import { definePlugin } from "@hachej/boring-workspace/plugin"
|
|
12
11
|
import {
|
|
13
12
|
Badge,
|
|
14
13
|
Button,
|
|
@@ -22,8 +21,7 @@ import {
|
|
|
22
21
|
ToolbarGroup,
|
|
23
22
|
} from "@hachej/boring-ui-kit"
|
|
24
23
|
|
|
25
|
-
const MAIN_PANEL_ID = "<kebab-name>.
|
|
26
|
-
const LEFT_PANEL_ID = "<kebab-name>.left"
|
|
24
|
+
const MAIN_PANEL_ID = "<kebab-name>.page"
|
|
27
25
|
|
|
28
26
|
function MainPane() {
|
|
29
27
|
return (
|
|
@@ -44,7 +42,7 @@ function MainPane() {
|
|
|
44
42
|
<CardHeader>
|
|
45
43
|
<CardTitle><Label></CardTitle>
|
|
46
44
|
<CardDescription>
|
|
47
|
-
This is the full
|
|
45
|
+
This is the full workspace page. Put detailed views, tables, charts,
|
|
48
46
|
editors, previews, and multi-step workflows here.
|
|
49
47
|
</CardDescription>
|
|
50
48
|
</CardHeader>
|
|
@@ -81,69 +79,21 @@ function MainPane() {
|
|
|
81
79
|
)
|
|
82
80
|
}
|
|
83
81
|
|
|
84
|
-
function LeftPane({ containerApi }: PaneProps) {
|
|
85
|
-
const openMainPane = () => {
|
|
86
|
-
containerApi.addPanel({
|
|
87
|
-
id: `${MAIN_PANEL_ID}.from-left`,
|
|
88
|
-
component: MAIN_PANEL_ID,
|
|
89
|
-
title: "<Label>",
|
|
90
|
-
params: { source: "left-tab" },
|
|
91
|
-
})
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return (
|
|
95
|
-
<div className="flex h-full min-h-0 min-w-0 flex-col bg-background text-foreground">
|
|
96
|
-
<div className="border-b border-border/60 px-3 py-2">
|
|
97
|
-
<div className="text-sm font-medium"><Label></div>
|
|
98
|
-
<div className="text-xs text-muted-foreground">Compact sidebar navigator</div>
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
<div className="min-h-0 min-w-0 flex-1 overflow-auto p-3">
|
|
102
|
-
<div className="space-y-3">
|
|
103
|
-
<Card className="min-w-0">
|
|
104
|
-
<CardHeader className="space-y-1 p-3">
|
|
105
|
-
<CardTitle className="text-sm">Overview</CardTitle>
|
|
106
|
-
<CardDescription className="text-xs">
|
|
107
|
-
Keep left tabs small: summary, filters, navigation, and actions.
|
|
108
|
-
</CardDescription>
|
|
109
|
-
</CardHeader>
|
|
110
|
-
<CardContent className="p-3 pt-0">
|
|
111
|
-
<Button size="sm" className="w-full" onClick={openMainPane}>
|
|
112
|
-
Open main pane
|
|
113
|
-
</Button>
|
|
114
|
-
</CardContent>
|
|
115
|
-
</Card>
|
|
116
|
-
|
|
117
|
-
<div className="space-y-1 text-xs text-muted-foreground">
|
|
118
|
-
<div className="rounded-md border border-border bg-card px-2 py-1.5">Recent item</div>
|
|
119
|
-
<div className="rounded-md border border-border bg-card px-2 py-1.5">Saved filter</div>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
)
|
|
125
|
-
}
|
|
126
82
|
|
|
127
83
|
export default definePlugin({
|
|
128
84
|
id: "<kebab-name>", // contribution namespace; matching package name is recommended
|
|
129
85
|
label: "<Label>",
|
|
130
86
|
panels: [
|
|
131
|
-
{ id: MAIN_PANEL_ID, label: "<Label>", component: MainPane },
|
|
132
|
-
// Optional left-tab component. Register separately from the main panel so
|
|
133
|
-
// the sidebar does not duplicate a full workbench view.
|
|
134
|
-
{ id: LEFT_PANEL_ID, label: "<Label>", component: LeftPane },
|
|
87
|
+
{ id: MAIN_PANEL_ID, label: "<Label>", placement: "workspace-page", component: MainPane },
|
|
135
88
|
],
|
|
136
89
|
commands: [
|
|
137
90
|
{ id: "<kebab-name>.open", title: "Open <Label>", panelId: MAIN_PANEL_ID },
|
|
138
91
|
],
|
|
139
|
-
//
|
|
140
|
-
//
|
|
141
|
-
// open the full center panel via containerApi.addPanel(...).
|
|
92
|
+
// If this plugin needs navigation/facets/lists, render them inside MainPane
|
|
93
|
+
// as regular React/shadcn layout. Do not register shell left tabs.
|
|
142
94
|
//
|
|
143
|
-
//
|
|
144
|
-
//
|
|
145
|
-
// { id: "<kebab-name>.tab", title: "<Label>", panelId: LEFT_PANEL_ID },
|
|
146
|
-
// ],
|
|
95
|
+
// For generated artifacts/details, add a separate panel with
|
|
96
|
+
// placement: "shared-dockview" and open it with containerApi.addPanel(...).
|
|
147
97
|
//
|
|
148
98
|
// File visualizer example: import WORKSPACE_OPEN_PATH_SURFACE_KIND from
|
|
149
99
|
// "@hachej/boring-workspace/plugin", import useApiBaseUrl/useWorkspaceRequestId
|
|
@@ -159,16 +109,15 @@ export default definePlugin({
|
|
|
159
109
|
// setup: (api) => { if (env.beta) api.registerPanel(betaPanel) },
|
|
160
110
|
})
|
|
161
111
|
|
|
162
|
-
// Responsive pane rule:
|
|
112
|
+
// Responsive pane rule: plugin pages and panels live inside resizable dock regions.
|
|
163
113
|
// Avoid fixed large widths; prefer w-full/min-w-0 layouts and responsive chart
|
|
164
114
|
// wrappers such as Recharts ResponsiveContainer.
|
|
165
115
|
//
|
|
166
116
|
// All available `definePlugin` config fields:
|
|
167
117
|
// id (required, string)
|
|
168
118
|
// label (optional, string)
|
|
169
|
-
// panels [{ id, label, component }]
|
|
119
|
+
// panels [{ id, label, placement, component }]
|
|
170
120
|
// commands [{ id, title, panelId }]
|
|
171
|
-
// leftTabs [{ id, title, panelId }]
|
|
172
121
|
// surfaceResolvers [{ id, kind, resolve(request) }]
|
|
173
122
|
// providers (rare — context wrappers)
|
|
174
123
|
// bindings (rare — same as provider)
|
|
@@ -13,7 +13,6 @@ describe("samplePlugin (BoringFrontFactory)", () => {
|
|
|
13
13
|
registerCatalog: vi.fn(),
|
|
14
14
|
registerPanel,
|
|
15
15
|
registerPanelCommand,
|
|
16
|
-
registerLeftTab: vi.fn(),
|
|
17
16
|
registerSurfaceResolver,
|
|
18
17
|
}
|
|
19
18
|
|
|
@@ -23,7 +22,7 @@ describe("samplePlugin (BoringFrontFactory)", () => {
|
|
|
23
22
|
expect.objectContaining({
|
|
24
23
|
id: SAMPLE_PANEL_ID,
|
|
25
24
|
label: "Sample",
|
|
26
|
-
placement: "
|
|
25
|
+
placement: "workspace-page",
|
|
27
26
|
component: SamplePanel,
|
|
28
27
|
}),
|
|
29
28
|
)
|