Packages
Stesura is a monorepo. Every public surface lives under the @stesura/* scope.
Core engine
| Package | Purpose |
|---|---|
@stesura/core | The React-free ProseMirror engine: schema, plugins, commands, helpers, stores, keymap, transaction guards. No root entry; import from a subpath: /schema, /plugins, /commands, /helpers, /utils, /constants, /types, /stores, /guards, /keymap, /sub-editor, /omml (Word equations → LaTeX), /styles (CSS), /testing. /commands/internal is not public API. |
@stesura/editor-react | The StesuraEditor component, the useLocalEditor mount hook, toolbar, menus, panels, node views, state hooks. Subpaths: /toolbar (toolbar components, lazy-loaded) and /drop (react-dnd drops). See the API reference. |
@stesura/editor-react-ui | Low-level UI primitives (color picker, editor button, toolbar primitives, emoji/symbol pickers, …). Used internally by editor-react. |
@stesura/i18n | Translation strings + SupportedLocale and TranslationKeys types. |
@stesura/icons | The editor icon system: IconProvider, the fluent / classic icon sets, createIcon. |
@stesura/fonts | The editor’s font files and fonts.css, served from your own origin by your bundler (Getting Started). Versioned on its own. Font-family resolution (findFontFamily, DOCX substitutions) is in @stesura/core/constants. |
@stesura/ui | shadcn-derived design system used by the apps in this repo (button, dropdown, popover, …). Not required to embed the editor. |
@stesura/marketing-ui | Shared marketing-site chrome (navbar, footer, theme toggle) for the apps. |
Collaboration
The collab-adapter family is the collaboration transport (Collaboration).
| Package | Purpose |
|---|---|
@stesura/collab-adapter | composeCollabPlugins, presence plugin, re-exported Pitter Patter client primitives (CollabClient, collab, …). /protocol holds what servers share with it (wire constants, presence parsers, reportCollabError) without React. |
@stesura/collab-adapter-react | Mount hooks useCollabEditor + useLocalCollabEditor, CollabProvider, RoomProvider/useRoomManifest, presence + connection hooks, comment adapters (createCollabCommentAdapter, noopCommentAdapter, LocalCommentProvider), proofread cache and dictionary factories. |
@stesura/collab-adapter-server | createCollabBackend — the server engine (Postgres + Redis): commits, presence, rooms, threads, server edits, events for mentions, thread lifecycle, commits and rooms. |
@stesura/collab-adapter-local | createLocalCollabBackend — IndexedDB-backed local backend powering useLocalCollabEditor, typed errors (DocDeletedError, StaleClientError, …). |
Feature packs
Each pair is a runtime plugin (or model package) plus its React UI extension. Mount only what you need.
| Package | Purpose |
|---|---|
@stesura/pagination | paginationPlugins(), togglePagination, layout engine, line numbering, stores, types. |
@stesura/pagination-react | paginationUiExtension, SectionNodeview, HeaderFooterPanel, and hooks (useOversizedNode, useReportNodeResize, useParagraphBreaks, …). |
@stesura/references | referencesPlugins() (cross-references + notes + note bindings), notesPlugin, schema additions, commands. |
@stesura/references-react | referenceUiExtensions, toolbar groups, FootnotePanel, EndnotePanel, referenceNodeViews. |
@stesura/bibliography | bibliographyPlugins(), citation and source commands, the citeproc formatter, bundled CSL styles, validation, BibTeX / RIS / CSL-JSON import. |
@stesura/bibliography-react | createBibliographyUiExtension, withBundledStyles, the sources panel, the citation picker, useSourceForm. |
@stesura/comments | commentsPlugins(), comment commands, thread helpers, stores. Adapter-driven — see Comments. |
@stesura/comments-react | commentsUiExtension, CommentProvider, ThreadsContainer / AnchoredThreads / FloatingThreads, FloatingComposer. |
@stesura/track-changes | trackChangesPlugin, trackChangesTransactionModifier, marks, diff engine. |
@stesura/track-changes-react | trackChangesUIExtension, TrackChangesContextMenu, toolbar group. |
@stesura/proofread | proofreadPlugin, proofread commands and helpers, IndexedDB cache (/cache-idb). |
@stesura/proofread-react | proofreadUIExtension, panel + menu UI. |
@stesura/format-lint | formatLintPlugin, collectFormatSuggestions, applyFormatSuggestions: finds and fixes formatting that belongs in styles. See Format cleanup. |
@stesura/format-lint-react | formatLintUIExtension: panel, status-bar count, Review-tab button. |
@stesura/contract-check | contractCheckPlugin, buildTermIndex: finds defined terms, their definitions and their uses. See Contract check. |
@stesura/contract-check-react | contractCheckUIExtension: defined-term hover card, visible-range reporter. |
@stesura/redaction | redactionPlugin, commands, prepareRedactedExport: redactions, redacted DOCX and PDF exports, and a leak check of the exported file. See Redaction. |
@stesura/redaction-react | createRedactionUIExtension: Redact button, review panel, export dialog. |
@stesura/docx | downloadDocx, importDocx, threadsToDocx. |
@stesura/docx-react | docxUIExtension, DocxImportButton, DocxExportButton. |
@stesura/markdown | Markdown ↔ ProseMirror blocks: parseMarkdown, serializeBlocks. Never throws; reports losses as warnings. Used by @stesura/ai (see Markdown bridge). |
@stesura/mermaid | The mermaid node, commands and lazy-loaded rendering, with markdown and DOCX support. See Diagrams. |
@stesura/mermaid-react | createMermaidUiExtension(): the node view, the source editor, the Insert group and the Diagram tab. |
@stesura/automation | Nodes and mechanics for document automation: hidden and repeating content, fields. It evaluates nothing; your code supplies the values. Subpaths: /schema, /commands, /plugins, /export. See Automation. |
@stesura/automation-react | createAutomationUIExtension, the field node view, toolbar group and hooks. |
@stesura/esign | Signature fields and their export to e-signature providers as PDF placements and anchor strings. No credentials, no HTTP. Subpaths: /schema, /commands, /export, /adapters. |
@stesura/esign-react | createEsignUIExtension, the field node view, insert snippets and toolbar group. |
@stesura/pdf-export-client | PdfExportButton, pdfUiExtension; ExportEditorShell for the export capture page lives on the /shell subpath. |
@stesura/pdf-export-server | createPdfExporter, renderDocToPdf — headless-Chromium PDF rendering (Node). |
@stesura/pdf-viewer-react | createPdfViewer — renders an embedded PDF’s own pages in the document (react-pdf). Without it every PDF file node is a card with a link. Ships a pdf-viewer-assets script for pdf.js’s worker and data files. |
@stesura/ai | autocompletePlugin, text actions, chat tool system, createHttpGenerateText. |
@stesura/ai-react | createAiUIExtension, AiTextMenuButton; the chat components (AiChatPanel, AiChatRuntimeHost) live on @stesura/ai-react/chat so their assistant-ui/AI-SDK stack stays out of initial bundles. |
@stesura/ai-server | createChatHandler, createTextActionHandler, createCompletionHandler, withRequestGuard. |
@stesura/docgen | Assembles markdown sources and a template into a document for rendering (assemble), with front matter and variable substitution. |
@stesura/docgen-cli | stesura-docgen: renders a repository’s markdown docs to PDF and Word through Stesura Docgen, from a terminal or CI (also a GitHub Action). |
Tooling
| Package | Purpose |
|---|---|
@stesura/profiler | Opt-in dev-time performance collector (installProfiler); stripped from production builds. |
@stesura/agents | stesura-agents init: points coding agents in your repo at the AGENTS.md files shipped in each @stesura/* package. |
@stesura/eslint-config, @stesura/typescript-config, @stesura/test-config | Shared lint / tsconfig / Vitest configuration presets. |
Choosing a package set
| Goal | Minimum packages |
|---|---|
| In-memory editor | @stesura/core, @stesura/editor-react |
| Offline persistence (IndexedDB) | + @stesura/collab-adapter-react, @stesura/collab-adapter-local |
| Real-time collaboration | + @stesura/collab-adapter, @stesura/collab-adapter-react, @stesura/collab-adapter-server (your backend) |
| DOCX export | + @stesura/docx, @stesura/docx-react |
| Page-aware layout | + @stesura/pagination, @stesura/pagination-react |
| Footnotes & cross-refs | + @stesura/references, @stesura/references-react |
| Citations & bibliography | + @stesura/bibliography, @stesura/bibliography-react |
| Comments | + @stesura/comments, @stesura/comments-react |
| Track changes | + @stesura/track-changes, @stesura/track-changes-react |
| Spell checking | + @stesura/proofread, @stesura/proofread-react |
| Format cleanup | + @stesura/format-lint, @stesura/format-lint-react |
| Defined terms (contract check) | + @stesura/contract-check, @stesura/contract-check-react |
| Redaction | + @stesura/redaction, @stesura/redaction-react |
| PDF export | + @stesura/pdf-export-client, @stesura/pdf-export-server |
| Embedded PDFs rendered in the document | + @stesura/pdf-viewer-react |
| AI (text actions, autocomplete, chat) | + @stesura/ai, @stesura/ai-react, @stesura/ai-server |
| Mermaid diagrams | + @stesura/mermaid, @stesura/mermaid-react |
| Document automation (conditional, repeating, field content) | + @stesura/automation, @stesura/automation-react |
| E-signature fields | + @stesura/esign, @stesura/esign-react |
Detailed references
@stesura/comments-react— the comments UI reference
Last updated on