Rich text / foldkit-richtext-dom

On a server-rendered page

The editor's host is a custom element, <foldkit-richtext>, drawn display: block by an inline style (so a stylesheet's display needs !important to override it). Hydration leaves a custom element's contents alone, so markup the server sent there survives until the editor mounts, and the editor adopts it rather than drawing the document again. The server sends it when the placement says the render is the server's:

ts
import { SSR } from 'foldkit-ssr'

editorAt('body', { rendering: RichText.standardRendering, serverRendered: SSR.serving })

While serverRendered() is true, the host holds renderEditable of the document, with the placement's rendering and decorations: exactly what mount would build. Without the option the host is empty until the editor mounts. The browser's Model must hold the same document the server rendered, or the markup is not what mount would build and is replaced.