@soeditor/engine
v1.6.0
Published
Controlled browser visual-editing engine for SoEditor.
Maintainers
Readme
@soeditor/engine
This package provides SoEditor's controlled browser visual-editing engine.
import { Editor } from '@soeditor/core';
import {
createVisualEditingEngine,
HistoryPlugin,
StructuredEditingPlugin,
} from '@soeditor/engine';
const editor = await Editor.create({
data: '<p>Hello</p>',
plugins: [HistoryPlugin, StructuredEditingPlugin],
});
const visual = createVisualEditingEngine({
editor,
element: document.querySelector('#editor')!,
});The engine edits a bounded paragraph/list/mark/link subset. Unsupported HTML is retained as inert opaque content rather than injected into the editing DOM. The live DOM is a projection; user changes become Core transactions.
Add HistoryPlugin to enable transaction-backed editor.undo and
editor.redo. The Phase 4 surface also owns copy, cut, paste, and standard
undo/redo keyboard shortcuts.
StructuredEditingPlugin provides a per-editor registry for custom structured
block conversion. Phase 23 custom blocks are atomic or readonly and remain
inert; interactive node views are an optional, separate runtime contribution. Visual
transactions expose validated EditingOperation metadata through
readEditingOperations() for position-aware plugins.
VisualDecorationsPlugin accepts bounded, non-canonical editing-model ranges
from annotation features. The projection validates and renders them without
placing their data in HTML source or exposing DOM mapping internals.
