Packages and add-ons
Scriviamo is split into a base package and add-ons. The base package is a complete editor on its own. Each add-on is a separate module that adds node types or features to it.
The base package
dist/scriviamo.js and dist/scriviamo.css, imported as
scriviamo.
It contains the editor, import and export, localization, the settings node types show in the inspector, and these node types:
| Node type | JSON type | Class |
|---|---|---|
| Text (paragraph) | text | TextNode |
| Heading | heading | HeadingNode |
| List (bulleted, numbered, checklist) | list | ListNode |
| Quote | quote | QuoteNode |
| Code | codeblock | CodeBlockNode |
| Table | table | TableNode |
| Image | image | ImageNode |
| Divider | divider | DividerNode |
It also keeps content it can't read. A node whose type isn't registered loads as an
UnknownNode, which shows a placeholder and saves the node's JSON back unchanged, so a
document made with more add-ons survives being opened without them.
Add-ons
Each add-on is dist/addons/scriviamo.<name>.js, plus a .css file when it
has one.
| Add-on | Edition | Adds | JSON types | Stylesheet |
|---|---|---|---|---|
callouts | Free | Alerts (info, success, warning, danger) | alert | Yes |
blocks | Premium | Page breaks, tables of contents, collapsible sections | pagebreak, toc, details | Yes |
columns | Premium | Side-by-side columns | columns | Yes |
rawcontent | Free | HTML written into exports unchanged | rawcontent | No |
media | Free | Audio and video | audio, video | Yes |
linkcards | Premium | Bookmark cards and embeds, which read a page's metadata | bookmark, embed | Yes |
forms | Free | Forms and form controls | form, label, textfield, textarea, checkbox, radiogroup, select, datalist, button | Yes |
math | Free | Formulas written in LaTeX and drawn with KaTeX; see Math and diagrams | math | Yes |
diagrams | Free | Diagrams written in Mermaid and drawn with it; see Math and diagrams | diagram | Yes |
collaboration | Premium | Real-time sharing through a collaboration server | — | Yes |
datatable | Premium | Read-only tables loaded from a REST API; see Data table | datatable | Yes |
inspector | Premium | The property panel for the document's and the selected blocks' settings; see The inspector | — | Yes |
footnotes | Premium | Footnotes: numbered references in the text, and their notes at the end of the document; see Footnotes | footnotes | Yes |
templates | Premium | Templates: reusable blocks and documents with fields, inserted from "/", the Insert menu and the Templates tool; see Templates | — | Yes |
pdf | Premium | PDF export with page size, margins, a header and footer, and page numbers, and fillable PDFs for forms; see PDF export | — | No |
assistant | Premium | An AI writing assistant that rewrites, fixes, translates or continues text through OpenAI-compatible services, Claude, local models or your own endpoint; see AI assistant | — | Yes |
steps | Free | Numbered steps and timelines, each step holding blocks; see Steps, timelines and tabs | steps | Yes |
tabs | Premium | Tabbed panels, each holding blocks; see Steps, timelines and tabs | tabs | Yes |
attachments | Free | File attachments, shown as cards with a download button; see Files, galleries, maps and embeds | attachment | Yes |
gallery | Free | Image galleries, as a grid or a carousel, with a full-size viewer; see Files, galleries, maps and embeds | gallery | Yes |
map | Free | Maps of a place, with a pin, from OpenStreetMap tiles; see Files, galleries, maps and embeds | map | Yes |
charts | Premium | Bar, line, area, pie and doughnut charts of a table in the document; see Charts | chart | Yes |
signature | Premium | Signature fields, signed by drawing or typing, and fillable in PDFs; see Signatures | signature | Yes |
dates | Free | Dates in text, as chips in the reader's language; see Dates and statuses in text | — | Yes |
status | Free | Statuses in text, as colored pills from a set the application chooses; see Dates and statuses in text | — | Yes |
outline | Free | The document's headings as a tree, for going to them and moving whole sections; see Outline, focus mode, readability and dictation | — | Yes |
focus | Free | Focus mode, which fades all but the block being written, with typewriter scrolling; see Outline, focus mode, readability and dictation | — | Yes |
readability | Free | The grade level and long sentences, in the status bar; see Outline, focus mode, readability and dictation | — | Yes |
dictation | Free | Voice typing through the browser's speech recognition; see Outline, focus mode, readability and dictation | — | Yes |
editorjs | Free | Loads documents Editor.js saved; see Moving from other editors | — | No |
tiptap | Free | Loads documents TipTap and ProseMirror saved; see Moving from other editors | — | No |
quill | Free | Loads Quill's Deltas; see Moving from other editors | — | No |
lexical | Free | Loads Lexical's editor states; see Moving from other editors | — | No |
suneditor | Free | Loads the HTML SunEditor saved; see Moving from other editors | — | No |
ckeditor | Free | Loads the HTML CKEditor 5 and 4 saved; see Moving from other editors | — | No |
word | Premium | Word documents (.docx): import and export; see Word, EPUB, OpenDocument, Notion and Confluence | — | No |
epub | Premium | EPUB 3 books for e-readers; see Word, EPUB, OpenDocument, Notion and Confluence | — | No |
odt | Premium | OpenDocument Text files (.odt); see Word, EPUB, OpenDocument, Notion and Confluence | — | No |
wikiimport | Premium | Imports Notion and Confluence exports; see Word, EPUB, OpenDocument, Notion and Confluence | — | No |
accessibility | Premium | An accessibility checker for documents, with fixes; see Accessibility | — | Yes |
versions | Premium | Version history: saving, comparing and restoring versions, shared while collaborating; see Version history | — | Yes |
trackchanges | Premium | Suggesting mode, with changes to accept or reject; see Track changes | — | Yes |
locking | Premium | Locked blocks and fill-in fields; see Locked blocks, fields and variables | — | Yes |
variables | Premium | Live variables filled in from the application's data; see Locked blocks, fields and variables | — | Yes |
git | Premium | Documents in a GitHub repository, with versions saved to pull requests; see Documents in a git repository | — | Yes |
tasks | Premium | Task lists, and a review of every task, the current user's, and those mentioning them; see Task lists | — | Yes |
The base package and free add-ons are MIT licensed. Premium add-ons need a license under the Scriviamo Commercial License.
Load an add-on by importing it after the base package and before creating editors:
import {Editor} from "scriviamo"
import "./dist/addons/scriviamo.media.js"
import {AlertNode, AlertTypes} from "./dist/addons/scriviamo.callouts.js"
An add-on registers its node types with Editor.registerNodeType when it is imported. Each
type has an order number, which places it in the insertion menu and the block type menu: the
built-in types use multiples of 10 below 300, mixed so related types sit together. Importing
add-ons in a different order doesn't change the menus.
Add-ons also bring their own interface text, which a locale pack can translate like the base package's. See Localization.
Examples
src/examples/ holds node types that show how an application adds its own. They aren't part
of the base package or the add-ons, and build to dist/examples/.
| Example | JSON type | Shows |
|---|---|---|
examplenode | example | A text block with an accent bar, toolbar and context-menu commands, a key command, and inspector items |
youtube | youtube | An embedded YouTube video, with HTML import that takes priority over embeds |
The demo page loads both. See Writing node types.
Source layout
src/
index.ts the base package's entry module
internal.ts loads the base modules in order; base modules import from it
*.ts, nodes/*.ts the base package
addons/<name>/ one entry module per add-on, its stylesheet, and anything it ships
examples/<name>/ one entry module per example
build.mjs the build
test/
suites/base/ tests for the base package
suites/<add-on>/ tests for one add-on
suites/integration/ tests that need several add-ons
An add-on folder holds exactly one TypeScript module.
The collaboration add-on also holds its development server, in addons/collaboration/server/.