Every extension
core
The primitives every editor needs, exposed as commands.
Always loaded by createEditor — an editor that cannot move its own selection is not useful, and making callers remember to add it would be a papercut.
Adding it
import { createEditor, document, paragraph, text, core } from '@matrajs/core'
const editor = createEditor({
extensions: [document, paragraph, text, core],
element: document.querySelector('#editor'),
})
There is no separate package · core is already in @matrajs/core, and an extension you do not import is not in your bundle. document, paragraph and text are the floor every document needs.
Commands
-
editor.commands.select() -
editor.commands.insert() -
editor.commands.replace() -
editor.commands.remove() -
editor.commands.moveBlock() -
editor.commands.focus()