Editor
@texuli/editor edits rich text over a closed document model: every node and mark renders through owned components, links pass the URL policy, and Markdown goes in and out. The package is private and in development; it is not published to npm.
Try the editor
A live RichTextEditor. The document loads from Markdown at theuntrusted tier, and the Markdown it saves as updates below it. It follows this site's light or dark mode; the editor has no motion to reduce.
- Ctrl or Cmd + B, I: bold, italic
- Ctrl or Cmd + K: edit a link; an unsafe address such as
javascript:is refused with a visible error - Ctrl or Cmd + Z, and with Shift: undo, redo
- Tab: indent a list item; Escape, then Tab: leave the editor
Launch notes
Launch notes
The pilot starts on Monday. Keep Friday free and run pnpm build first. Read the plan.
-
Invite the review group
-
Share the agenda
-
Draft the summary
-
Collect feedback
-
Book the room
-
Send the recap
Small pieces, shipped often.
const greeting = 'hello';Questions go to team@example.com.
Saved as Markdown
## Launch notes The **pilot** starts on *Monday*. Keep ~~Friday~~ free and run `pnpm build` first. Read the [plan](https://example.com/plan). - Invite the review group - Share the agenda 1. Draft the summary 2. Collect feedback - [x] Book the room - [ ] Send the recap > Small pieces, shipped often. ```ts const greeting = 'hello'; ``` --- Questions go to team@example.com.
Nodes and marks
The vocabulary is closed: anything else in pasted HTML or loaded Markdown degrades to text with a diagnostic. Nothing renders through an HTML sink.
| Node | Renders as | Markdown |
|---|---|---|
paragraph | p | plain text |
heading | h1 to h4 | # to #### |
list (bullet) | ul, li | - item |
list (ordered) | ol, li | 1. item |
list (checklist) | ul, li with a checkbox outside the text | - [ ] item |
quote | blockquote | > text |
code | pre, code | a fenced block |
divider | hr | --- |
media | an image the host resolves | an image alone in a paragraph |
| Mark | Renders as | Markdown |
|---|---|---|
strong | strong | **bold** |
em | em | *italic* |
strike | s | ~~struck~~ |
code | code | `code` |
link | a, checked by the URL policy | [text](https://example.com) |
In the builder
The blueprint builder edits the Markdown fields of text blocks (text, quote and callout body) with this editor. The field still stores Markdown: the editor reads it, reports what it could not keep, and writes the Markdown back on each edit. Text edits join one labeled undo step in the builder history, and Ctrl or Cmd +Z inside the editor undoes text first.
Examples
What ships
- One labelled multiline textbox; every edit becomes a model transform, and input methods are diffed into one step.
- A roving formatting toolbar with pressed states and shortcuts.
- A link dialog that checks addresses with
safeHref(untrustedby default). - Snapshot undo and redo, announced politely.
- Paste as data: an owned HTML tokenizer and allowlist, every pasted link checked at the
untrustedtier. - Markdown in and out, the same subset text blocks and the catalog's rich text parse.
Planned
- Copy in the editor's own JSON format, and drop.
- A block-type menu, drag handles and a “Paste as Markdown” command.
- A browser behavior scenario, an axe sweep and measured long-document limits for the editor package.
- The editor on list items in the builder (each item is a plain text field today).
Package docs
The site does not render the package docs yet. Read them in the repository:
packages/editor/README.md: what works today and what is not done yetpackages/editor/docs/editor-surface.md: RichTextEditor and the editing surfacepackages/editor/docs/editor-toolbar.md: the formatting toolbarpackages/editor/docs/editor-link-dialog.md: link editing through the URL policypackages/editor/docs/editor-controller.md: the headless controller, history and labelspackages/editor/docs/editor-paste.md: clipboard import as datapackages/core/docs/core-editor.md: the model, transforms, keymap and Markdown codecdocs/EDITOR_ARCHITECTURE.md: the architecture contract