@tangle-network/sandbox-ui 0.112.0 → 0.113.1
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 +46 -0
- package/dist/{chunk-D5VXCWUG.js → chunk-2Q3KDQX7.js} +370 -156
- package/dist/{chunk-ISTJTUHJ.js → chunk-VEK3EZIW.js} +27 -6
- package/dist/globals.css +38 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/dist/styles.css +38 -0
- package/dist/workbench.d.ts +12 -3
- package/dist/workbench.js +1 -1
- package/dist/workspace.d.ts +114 -5
- package/dist/workspace.js +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -168,6 +168,52 @@ const partMap: Record<string, SessionPart[]> = {};
|
|
|
168
168
|
|
|
169
169
|
`FileTreeVisibilityOptions` is a UI-layer policy only. Sensitive paths still need to be hidden and denied by the app/backend layer.
|
|
170
170
|
|
|
171
|
+
### The three-pane shell
|
|
172
|
+
|
|
173
|
+
For a chats rail · transcript + composer · artifacts layout, hand `SandboxWorkbench` a `SessionSidebar` as its `rail`, your composer as `composer`, and `centerHeader={null}` for the quiet center. `WorkspaceLayout` owns the pane sizes and, when you pass `layout.leftOpen` / `layout.onLeftOpenChange`, the open state too.
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
const [chatsOpen, setChatsOpen] = useState(true);
|
|
177
|
+
|
|
178
|
+
<SandboxWorkbench
|
|
179
|
+
centerHeader={null}
|
|
180
|
+
rail={
|
|
181
|
+
<SessionSidebar
|
|
182
|
+
variant="quiet"
|
|
183
|
+
groupBy="status"
|
|
184
|
+
showUpdatedAt
|
|
185
|
+
fill
|
|
186
|
+
className="border-r-0"
|
|
187
|
+
title="Chats"
|
|
188
|
+
createLabel="New chat"
|
|
189
|
+
items={threads}
|
|
190
|
+
currentItemId={threadId}
|
|
191
|
+
onSelectItem={(item) => navigate(item.href)}
|
|
192
|
+
onCreate={createThread}
|
|
193
|
+
onCollapse={() => setChatsOpen(false)}
|
|
194
|
+
/>
|
|
195
|
+
}
|
|
196
|
+
session={{ messages, partMap, isStreaming }}
|
|
197
|
+
composer={<ChatComposer onSend={runTurn} />}
|
|
198
|
+
artifacts={[
|
|
199
|
+
{ id: "changes", kind: "custom", title: "Changes", icon: GitCompare, pinned: true, content: <ChangesPanel /> },
|
|
200
|
+
...openFiles,
|
|
201
|
+
]}
|
|
202
|
+
layout={{
|
|
203
|
+
leftOpen: chatsOpen,
|
|
204
|
+
onLeftOpenChange: setChatsOpen,
|
|
205
|
+
keyboardShortcuts: true,
|
|
206
|
+
leftCollapsedControl: (
|
|
207
|
+
<button type="button" aria-label="Show chats" onClick={() => setChatsOpen(true)}>
|
|
208
|
+
<PanelLeftOpen className="h-4 w-4" />
|
|
209
|
+
</button>
|
|
210
|
+
),
|
|
211
|
+
}}
|
|
212
|
+
/>;
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Each `SessionSidebarItem` can carry an `icon` (rendered in a 16×20 slot, with the status dot as a corner badge) and a `meta` line; `formatRelativeAge` from `/workspace` formats the age for that line.
|
|
216
|
+
|
|
171
217
|
## Theming And Retheming
|
|
172
218
|
|
|
173
219
|
There is a built-in Tangle default theme, but consumers can restyle the library in three layers:
|