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: . (root), /types, /providers, /toolbar, /hooks, /drop (react-dnd drops), /sub-editor. 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 | Bundled editor fonts, loadEditorFonts (+ the SSR head-link fast path: EDITOR_FONTS_LINK_ID, editorFontsStylesheetHref — see Getting Started), font-family resolution (findFontFamily, DOCX substitutions). |
@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, …). |
@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.onThreadMentionsCreated. |
@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/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/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/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. |
Tooling
| Package | Purpose |
|---|---|
@stesura/profiler | Opt-in dev-time performance collector (installProfiler); stripped from production builds. |
@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 |
| Comments | + @stesura/comments, @stesura/comments-react |
| Track changes | + @stesura/track-changes, @stesura/track-changes-react |
| Spell checking | + @stesura/proofread, @stesura/proofread-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 |
Detailed references
@stesura/comments-react— the comments UI reference
Last updated on