@email-builder/engine
v0.3.0
Published
Headless editor controller, drag engine and inline-edit controller. Framework-agnostic DOM.
Maintainers
Readme
@email-builder/engine
The headless editor behind Email Builder: selection, undo/redo, autosave, and the drag-and-drop engine. It has no UI of its own.
Most apps don't install this directly. @email-builder/react
and @email-builder/vue depend on it. Use it
when you're building your own editor UI on top of the same model.
Install
npm i @email-builder/engine @email-builder/coreUse
import { setup } from "@email-builder/core";
import { createEditor } from "@email-builder/engine";
const { blocks, merge } = setup();
const editor = createEditor({ document: savedDocument, blocks, merge });
const row = editor.addRow([1]);
editor.addBlock("text", row.columns[0].id);
editor.undo();
const { html } = editor.compile();See the full documentation.
License
MIT
