Skip to the content
v1.0.1-beta.17

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 typeJSON typeClass
Text (paragraph)textTextNode
HeadingheadingHeadingNode
List (bulleted, numbered, checklist)listListNode
QuotequoteQuoteNode
CodecodeblockCodeBlockNode
TabletableTableNode
ImageimageImageNode
DividerdividerDividerNode

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-onEditionAddsJSON typesStylesheet
calloutsFreeAlerts (info, success, warning, danger)alertYes
blocksPremiumPage breaks, tables of contents, collapsible sectionspagebreak, toc, detailsYes
columnsPremiumSide-by-side columnscolumnsYes
rawcontentFreeHTML written into exports unchangedrawcontentNo
mediaFreeAudio and videoaudio, videoYes
linkcardsPremiumBookmark cards and embeds, which read a page's metadatabookmark, embedYes
formsFreeForms and form controlsform, label, textfield, textarea, checkbox, radiogroup, select, datalist, buttonYes
mathFreeFormulas written in LaTeX and drawn with KaTeX; see Math and diagramsmathYes
diagramsFreeDiagrams written in Mermaid and drawn with it; see Math and diagramsdiagramYes
collaborationPremiumReal-time sharing through a collaboration server—Yes
datatablePremiumRead-only tables loaded from a REST API; see Data tabledatatableYes
inspectorPremiumThe property panel for the document's and the selected blocks' settings; see The inspector—Yes
footnotesPremiumFootnotes: numbered references in the text, and their notes at the end of the document; see FootnotesfootnotesYes
templatesPremiumTemplates: reusable blocks and documents with fields, inserted from "/", the Insert menu and the Templates tool; see Templates—Yes
pdfPremiumPDF export with page size, margins, a header and footer, and page numbers, and fillable PDFs for forms; see PDF export—No
assistantPremiumAn 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
stepsFreeNumbered steps and timelines, each step holding blocks; see Steps, timelines and tabsstepsYes
tabsPremiumTabbed panels, each holding blocks; see Steps, timelines and tabstabsYes
attachmentsFreeFile attachments, shown as cards with a download button; see Files, galleries, maps and embedsattachmentYes
galleryFreeImage galleries, as a grid or a carousel, with a full-size viewer; see Files, galleries, maps and embedsgalleryYes
mapFreeMaps of a place, with a pin, from OpenStreetMap tiles; see Files, galleries, maps and embedsmapYes
chartsPremiumBar, line, area, pie and doughnut charts of a table in the document; see ChartschartYes
signaturePremiumSignature fields, signed by drawing or typing, and fillable in PDFs; see SignaturessignatureYes
datesFreeDates in text, as chips in the reader's language; see Dates and statuses in text—Yes
statusFreeStatuses in text, as colored pills from a set the application chooses; see Dates and statuses in text—Yes
outlineFreeThe document's headings as a tree, for going to them and moving whole sections; see Outline, focus mode, readability and dictation—Yes
focusFreeFocus mode, which fades all but the block being written, with typewriter scrolling; see Outline, focus mode, readability and dictation—Yes
readabilityFreeThe grade level and long sentences, in the status bar; see Outline, focus mode, readability and dictation—Yes
dictationFreeVoice typing through the browser's speech recognition; see Outline, focus mode, readability and dictation—Yes
editorjsFreeLoads documents Editor.js saved; see Moving from other editors—No
tiptapFreeLoads documents TipTap and ProseMirror saved; see Moving from other editors—No
quillFreeLoads Quill's Deltas; see Moving from other editors—No
lexicalFreeLoads Lexical's editor states; see Moving from other editors—No
suneditorFreeLoads the HTML SunEditor saved; see Moving from other editors—No
ckeditorFreeLoads the HTML CKEditor 5 and 4 saved; see Moving from other editors—No
wordPremiumWord documents (.docx): import and export; see Word, EPUB, OpenDocument, Notion and Confluence—No
epubPremiumEPUB 3 books for e-readers; see Word, EPUB, OpenDocument, Notion and Confluence—No
odtPremiumOpenDocument Text files (.odt); see Word, EPUB, OpenDocument, Notion and Confluence—No
wikiimportPremiumImports Notion and Confluence exports; see Word, EPUB, OpenDocument, Notion and Confluence—No
accessibilityPremiumAn accessibility checker for documents, with fixes; see Accessibility—Yes
versionsPremiumVersion history: saving, comparing and restoring versions, shared while collaborating; see Version history—Yes
trackchangesPremiumSuggesting mode, with changes to accept or reject; see Track changes—Yes
lockingPremiumLocked blocks and fill-in fields; see Locked blocks, fields and variables—Yes
variablesPremiumLive variables filled in from the application's data; see Locked blocks, fields and variables—Yes
gitPremiumDocuments in a GitHub repository, with versions saved to pull requests; see Documents in a git repository—Yes
tasksPremiumTask 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/.

ExampleJSON typeShows
examplenodeexampleA text block with an accent bar, toolbar and context-menu commands, a key command, and inspector items
youtubeyoutubeAn 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/.