reifyui 0.18.5 → 0.19.0

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 CHANGED
@@ -62,6 +62,7 @@ A production-grade surface for rendering and interacting with a live agent turn:
62
62
  | **Slides** (`reifyui/slides`) | `SlideView`, `SlideStage`, `EditorCanvas`, `Presentation`, `ElementView`, `themeVars` — render a JSON deck, edit it by direct manipulation, present it |
63
63
  | **Spreadsheet** | `SheetGrid`, `sheetToDelimited`, `sheetToAoA` — an AI-editable grid, extensible with your own column types |
64
64
  | **HarnessRouter** (`reifyui/harness`) | `configureKit`, `kitHarness`, `listSessions`, `readFile`, `writeFile`, `createResponse`, `streamTurn`, `turnsToMessages`, `fileToInputBlock` — the transport for apps served by a HarnessRouter console |
65
+ | **File tree** (`reifyui/tree`) | `FileTree`, `buildFileTree`, `treeKeyAction`, `nameProblem`, `canMove` — a folder tree of files the way an editor's Explorer shows one: names typed in place, a delete asked in the row, drag into a folder, a right-click menu, the WAI-ARIA tree keyboard |
65
66
  | **Agent chat** (`reifyui/agent-chat`) | `AgentConversation`, `AgentTurnView`, `AgentComposer`, `WorkingIndicator`, `StepRow`, `WorkGroup`, `TodoCard`, `reduceTurn`, `turnFromMessage`, `describeTool`, `motionFor` — an agent's turn the way Claude Code shows it: one live line, work folded to a past-tense line per run of calls, every call one click from its input and output |
66
67
  | **Icons / tool meta** | `Ic*` icon set, `toolMeta`, `humanize`, `summarizeSteps` |
67
68
  | **Auth (optional)** | `configureAuth`, `login`, `AuthForm`, `GoogleButton` — a thin JWT client for products with a `/v1/auth`-style backend; wired to nothing by default |
@@ -157,6 +158,7 @@ import 'reifyui/styles/panels.css'; // panel + panel grid, stat tile, res
157
158
  import 'reifyui/styles/tasks.css'; // task list
158
159
  import 'reifyui/styles/dialog.css'; // alert / confirm / prompt dialogs
159
160
  import 'reifyui/styles/agent-chat.css'; // reifyui/agent-chat: the agent conversation
161
+ import 'reifyui/styles/tree.css'; // reifyui/tree: the file tree
160
162
  ```
161
163
 
162
164
  Themes are CSS-variable files — load one, or switch at runtime by toggling which you apply. Override
@@ -231,6 +233,47 @@ into a kind, a target, lines added and removed, and the plan; a browser call rea
231
233
  the logos: pass your mark as a node and `motionFor(base)` names a motion, or none for three dots.
232
234
  All motion stops under `prefers-reduced-motion`.
233
235
 
236
+ ## File tree
237
+
238
+ `reifyui/tree` is a folder tree of files the way an editor's Explorer shows one. It draws a flat
239
+ list of paths (folders are implied by the files in them; a `dir` entry keeps an empty one) and
240
+ reports what the person did; your list changes and comes back in.
241
+
242
+ ```jsx
243
+ import { FileTree } from 'reifyui/tree';
244
+ import 'reifyui/styles/tree.css';
245
+
246
+ <FileTree
247
+ title="Snippets"
248
+ entries={[{ path: 'tasks/refund', kind: 'file' }, { path: 'drafts', kind: 'dir' }]}
249
+ selected={open} onSelect={(path, kind) => kind === 'file' && setOpen(path)}
250
+ labels={{ newFile: 'New snippet', newFileInput: 'Name of the new snippet' }}
251
+ onCreate={({ path, kind }) => api.create(path, kind)} // a returned string is shown under the name
252
+ onRename={({ from, to }) => api.rename(from, to)}
253
+ onDelete={({ path, kind }) => api.remove(path, kind)}
254
+ onMove={({ from, toDir }) => api.move(from, toDir)}
255
+ onUpload={(dir) => pickFilesInto(dir)} // your own file picker
256
+ validateName={(name) => (name.length > 64 ? 'Use 64 characters or fewer.' : '')}
257
+ menuItems={[{ id: 'include', label: 'Copy include line', when: (p, kind) => kind === 'file',
258
+ onSelect: (p) => copy(`{{template "${p}" .}}`) }]}
259
+ />
260
+ ```
261
+
262
+ The header holds the title and, beside it, New file, New folder, Upload and Collapse all (only the
263
+ ones whose handler you pass; `actions` picks fewer). New file and New folder open a name field in the
264
+ folder in use: Enter keeps it, Escape puts it away, leaving the field keeps a valid name. `''`, `.`,
265
+ `..`, a slash and a name already in that folder are refused before `validateName` is asked. F2 or the
266
+ row's pencil renames in place; Delete asks in the row ("Delete tasks and the 3 files in it?"); a row
267
+ drags into another folder or the top, never into itself. A right click, Shift+F10 or the menu key
268
+ opens the row's menu. Arrow keys, Home and End move; Right and Left open, close and step in and out.
269
+ A handler may return a message, or a Promise of one, to refuse: it shows where the person acted.
270
+
271
+ `open` + `onOpenChange` control the open folders (`defaultOpen` otherwise: every folder, or a list).
272
+ `readOnly` draws the tree with nothing to change. `busy`, `pending` (paths with a save in flight),
273
+ `rowErrors` and `error` show what the host is doing. Every word is in `labels`. The model it runs on
274
+ (`buildFileTree`, `visibleRows`, `treeKeyAction`, `nameProblem`, `canMove`) needs no React, so a
275
+ host can check a name or a move by the same rules. Colours come from `--uic-*` (or `--rui-tree-*`).
276
+
234
277
  ## Slides
235
278
 
236
279
  A deck is JSON — a fixed 1920×1080 stage, and elements with absolute frames and stable ids. That