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

  1. Draft the summary

  2. Collect feedback

  • Book the room

  • Send the recap

Small pieces, shipped often.

const greeting = 'hello';

Questions go to team@example.com.

Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+Z undo. Tab indents list items. Press Escape, then Tab, to leave the editor.

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.

Block nodes
NodeRenders asMarkdown
paragraphpplain text
headingh1 to h4# to ####
list (bullet)ul, li- item
list (ordered)ol, li1. item
list (checklist)ul, li with a checkbox outside the text- [ ] item
quoteblockquote> text
codepre, codea fenced block
dividerhr---
mediaan image the host resolvesan image alone in a paragraph
Inline marks
MarkRenders asMarkdown
strongstrong**bold**
emem*italic*
strikes~~struck~~
codecode`code`
linka, 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 (untrusted by default).
  • Snapshot undo and redo, announced politely.
  • Paste as data: an owned HTML tokenizer and allowlist, every pasted link checked at the untrusted tier.
  • 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 yet
  • packages/editor/docs/editor-surface.md: RichTextEditor and the editing surface
  • packages/editor/docs/editor-toolbar.md: the formatting toolbar
  • packages/editor/docs/editor-link-dialog.md: link editing through the URL policy
  • packages/editor/docs/editor-controller.md: the headless controller, history and labels
  • packages/editor/docs/editor-paste.md: clipboard import as data
  • packages/core/docs/core-editor.md: the model, transforms, keymap and Markdown codec
  • docs/EDITOR_ARCHITECTURE.md: the architecture contract