@factory/editor
Block editor kernel for AI Software Factory
(PRODUCT-SPEC.md §4–§8, docs/architecture/frontend-architecture.md §3).
Two layers:
- Inline rich-text — the extension set (
mention,equation,highlight) consumed byapps/web's per-block Tiptap editors viafactoryEditorExtensions()(./factory). - Block-canvas kernel — lossless block tree ↔ document codec, the Tiptap block-node registry, slash command registry + fuzzy search, context menus, 800 ms debounced autosave with version-conflict rebase, undo/redo history, and clipboard (internal JSON + markdown).
Fractional positions are re-exported from @factory/shared/positions
(./positions) — block ordering uses LexoRank-style fractional positions,
never array indexes (architectural invariant).
Subpath exports
| Export | Contents |
|---|---|
. |
Public surface (re-exports of the modules below) |
./codec |
Block tree ↔ document codec (tiptap-free) |
./factory |
factoryEditorExtensions() — the per-block Tiptap extension set |
./slash |
Slash command registry + fuzzy search (tiptap-free) |
./context-menu |
Block context-menu model (tiptap-free) |
./autosave |
800 ms debounce + version-conflict rebase (tiptap-free) |
./history |
Undo/redo history (tiptap-free) |
./clipboard |
Internal JSON + markdown clipboard codec (tiptap-free) |
./positions |
Fractional positions, re-exported from @factory/shared |
The pure-logic modules are tiptap-free; only the nodes/ / marks/ layer
imports @tiptap/core (the same ^2.4.0 line apps/web uses, so pnpm
dedupes to one copy).
Dependencies
@factory/shared, @tiptap/core.
Tests
pnpm --dir packages/editor test # vitest
pnpm --dir packages/editor typecheck