Editor Package
@prox-os/editor is the shared editing surface package for Prox OS apps. It
@prox-os/editor is the shared editing surface package for Prox OS apps. It
defines an editor value contract, document model, provider boundary, toolbar
action shape, React primitives, Tiptap rich text adapter, CodeMirror
markdown/code/prompt adapter, and Storybook examples.
It is not a Notion clone, Google Docs clone, collaborative document backend, or single-editor lock-in. Apps own domain content, persistence, permissions, and AI side effects.
Package Scope
The package provides:
- editor value, document, mode, format, provider, selection, and status types;
- helper functions for editor values, documents, serialization, counts, and empty checks;
- editor action helpers aligned with
@prox-os/actions; - Tiptap-backed
OsRichTextEditor; - CodeMirror-backed
OsMarkdownEditor,OsCodeEditor, andOsPromptEditor; - lightweight
OsCommentEditor; - shell, toolbar, status, preview, read-only, and empty-state primitives;
- demo documents for dream notes, founder memos, app descriptions, prompts, comment drafts, and code snippets.
Core Types
OsEditorValueOsEditorDocumentOsEditorFormatOsEditorModeOsEditorProviderOsEditorSelectionSummaryOsEditorToolbarItemOsEditorStatusOsEditorChangeHandler
Core Components
OsEditorShellOsRichTextEditorOsMarkdownEditorOsCodeEditorOsPromptEditorOsCommentEditorOsEditorToolbarOsEditorStatusBarOsEditorPreviewOsEditorEmptyStateOsEditorReadOnlyOsEditorFormatBadgeOsEditorWordCount
Phase 1 Adapters
Tiptap is the Phase 1 rich text adapter because it gives Prox OS a pragmatic React editing surface with StarterKit, links, placeholders, and character count without building a custom rich text engine.
CodeMirror is the Phase 1 structured text adapter because markdown, code, prompt text, JSON snippets, and developer-facing configuration are better served by a focused text editor than by a document editor.
The public API is still OsEditor*. Apps should not couple themselves to
Tiptap or CodeMirror internals unless they are writing an adapter.
Future Adapter Candidates
| Candidate | Future role | Phase 1 stance |
|---|---|---|
| Lexical | High-performance lower-level rich text adapter. | Documented only. |
| Plate | Block/rich text UI composition candidate. | Documented only. |
| Monaco | Heavy developer IDE/code workspace adapter. | Not installed in Phase 1. |
| Yjs | Collaboration/CRDT foundation. | Future @prox-os/collaboration, not editor Phase 1. |
Storybook
Open UI Workshop and browse:
Editor / OsEditorShellEditor / OsRichTextEditorEditor / OsMarkdownEditorEditor / OsCodeEditorEditor / OsPromptEditorEditor / OsCommentEditorEditor / OsEditorPreviewEditor / Integration
These stories cover rich text, markdown preview placeholders, JSON and JavaScript snippets, prompt variables, comment drafts, read-only preview, status states, action toolbar, forms integration, and AI rewrite placeholders.
Package Relationships
| Package | Relationship |
|---|---|
@prox-os/actions | Editor toolbar items use action intent for save draft, copy markdown, ask AI, improve writing, and insert media. |
@prox-os/forms | Editor primitives can become custom form fields for descriptions, prompt config, notes, and metadata. |
@prox-os/media | Future insert media, pasted image handling, media cards, and alt text editing should use media resources. |
@prox-os/command | Future slash commands, selection-aware commands, and command palette editor actions can consume editor context. |
| Future AI UI | Prompt editing, rewrite, summarize, improve writing, and AI-generated content review should reuse editor values. |
| Future collaboration | Presence, cursors, comments, suggestions, version history, and CRDT state belong to a later collaboration layer. |
| Future backend packages | api-contract, storage, search-service, audit, and agents-runtime can provide persistence, attachments, indexing, audit, and AI tool execution later. |
Current Boundaries
- Primitive package only.
- No Notion-style block editor.
- No Google Docs-style collaboration.
- No Monaco runtime dependency.
- No paste upload, file upload, or media persistence.
- No real AI rewrite calls.
- No backend save/load API.
- No OS Shell private imports.
See docs/platform/architecture/capabilities/editor-system.md for the architecture roadmap.