# Document editor (DocumentEditor) · Booki

> A block editor for working papers: "/" opens commands and "@" mentions the files, evidence, people and pages the app passes. Undo and Redo cover typing and block changes. An agent reads the page as blocks and proposes inserts, edits, moves and removals; each waits in the agent's colour until a person accepts or rejects it.

Source: https://booki.dev/docs/document-editor

Building blocks

# Document editor

`DocumentEditor`

A block editor for working papers: "/" opens commands and "@" mentions the files, evidence, people and pages the app passes. Undo and Redo cover typing and block changes. An agent reads the page as blocks and proposes inserts, edits, moves and removals; each waits in the agent's colour until a person accepts or rejects it.

The person sees

Loading preview…

Bridge demo

```
booki_version=$(npm view @booki-aui/react@latest version) &&
ui_sdk_version=$(npm view "@booki-aui/react@$booki_version" peerDependencies.@ui-sdk/core) &&
pnpm add --save-exact "@booki-aui/core@$booki_version" "@booki-aui/react@$booki_version" "@booki-aui/styles@$booki_version" \
  "@ui-sdk/core@$ui_sdk_version" "@ui-sdk/react@$ui_sdk_version"
```

## Try the bridge

Open this page in a browser and run the example in the console with a fresh preview. Read the current ref from the snapshot before acting.

```javascript
const { agent } = window
const entry = agent.snapshot().filter(
  (entry) => !entry.offPage && entry.component === "document-editor",
)[0]
const result = await agent.act({
  steps: [{
    ref: entry.ref,
    action: "findBlocks",
    args: ["January"],
  }],
})
console.log(result.ok) // true
```

The result lists the blocks that mention January, with their IDs and text.

Import from `@booki-aui/react`. For Booki's default styling, add `import "@booki-aui/styles"`.
