pub struct CreateEditorArgs {
pub nodes: Vec<NodeClass>,
pub namespace: String,
pub editor_state: Option<EditorState>,
pub editable: Option<bool>,
pub on_warn: Option<WarningHandler>,
pub parent_editor: Option<Editor>,
pub theme: Object,
pub html: HtmlConfig,
pub dom: Option<EditorDomRenderConfig>,
}Expand description
CreateEditorArgs: the node classes (and LexicalNodeReplacements,
as NodeClasses) to register besides the core ones, the editor’s
namespace (when empty, its parent editor’s, or a random one,
createUID()), the initial state, whether it is editable, the theme,
the parent editor, onWarn, and (with the html feature) the HTML
import and export overrides and the render config. JS’s onError has
no counterpart: an update’s error is returned from
Editor::update.
Fields§
§nodes: Vec<NodeClass>§namespace: String§editor_state: Option<EditorState>editorState: the state the editor starts with, committed by its
first read or update.
editable: Option<bool>editable; None is JS’s undefined, editable.
on_warn: Option<WarningHandler>onWarn: what hears of recoverable conditions (an update cascade
cut short); by default the warning is returned as an error, as JS’s
default throws in development.
parent_editor: Option<Editor>parentEditor: the editor this one is nested in, which commands
dispatched in this one reach after its own listeners.
theme: Objecttheme: class names by node kind (EditorThemeClasses), as JSON:
a string or an array of strings, or (for text) an object of them
by format.
html: HtmlConfightml: export overrides by node type and extra import conversions.
dom: Option<EditorDomRenderConfig>dom: the render config; None for the default.