@folijs/view
v0.2.0
Published
Framework-agnostic DOM view for the Foli document engine: rendering, input, selection, layout.
Readme
@folijs/view
The editable view of Foli, without a framework: renders
a @folijs/core editor into an element as real pages and turns keyboard, IME, clipboard and
mouse input into editor commands. For React, use @folijs/react.
Early release: the API may change in any 0.x minor version (changes in
CHANGELOG.md).
npm install @folijs/view @folijs/coreimport { createDocument, createEditor } from "@folijs/core";
import { EditorView } from "@folijs/view";
const editor = createEditor({ document: createDocument() });
const host = document.getElementById("editor")!;
host.classList.add("foli-content"); // the default theme's selection color
host.setAttribute("aria-label", "Document");
const view = new EditorView(host, editor, { placeholder: "Start writing…" });
// later: view.destroy();The view sets page size and margins from the document settings; the page look (background,
shadow, gap, fonts) comes from your CSS or a copy of
@folijs/react's styles.css.
MIT
