A headless-first rich-text editor engine for Scala.js. One immutable document drives server-rendered HTML and a hydrated editor in the browser; there is no contenteditable command layer underneath.
DOCUMENT ENGINE
DOCUMENT / TRANSACTION / VIEW
1.0.3Current release
Scala.jsRuns on
Scala 3.3Language version
MITLicense
Installation
Modules are published one by one. A minimal rich-text editor needs the kernel, the rich-text profile, the HTML contract and the view.
# Writing with Ember
Ember keeps one **immutable document**. Every keystroke becomes a *transaction*, and every view is derived from it.
- Select a word and press **Ctrl+B**
- Turn this line into a heading with the toolbar
- Undo it again with **Ctrl+Z**
> Markdown, JSON and HTML below are read from the same document, live.
```scala
session.dispatch(RichText.ToggleMark, StandardMarks.Strong)
```
The smallest program
Resolve the extensions, build an empty document, open a session, mount the view and dispatch a command.