Callout block with editable title and message fields.
npm install @shelamkoff/rectorimport { createEditor } from '@shelamkoff/rector'
import { Warning } from '@shelamkoff/rector/plugins/warning'
const editor = createEditor({
holder: document.querySelector('#editor'),
plugins: [new Warning()],
})The registered block type is warning. The class is also exported by the complete @shelamkoff/rector/plugins preset and can be loaded through @shelamkoff/rector/plugins/async.
{ "title": "Note", "message": "Important details" }| Field | Required | Meaning and constraints |
|---|---|---|
title |
yes | String containing sanitized inline HTML; it may be empty. |
message |
yes | String containing sanitized inline HTML; it may be empty. |
At least one of title and message must be non-blank. Both fields support inline-widget marshaling.
Every built-in block plugin accepts two style ownership options: injectStyles?: boolean defaults to true; set it to false when the host bundles that plugin's CSS. css?: string adds one host-provided stylesheet URL after the plugin default, or acts as the replacement URL when default injection is disabled.
Inline formatting; editable title/message; merge; validation; export for conversion.
User actions exposed by the plugin enter the command pipeline through the supplied context.mutate() capability, so each completed action is one undo/redo step. The editor reference-counts the plugin's declared stylesheet URLs. Removing a block calls its cleanup hook; removing the editor calls destroy() for every remaining block and then releases shared plugin resources.
Do not remove the editor holder without first calling editor.destroy().
Use the matching renderer from @shelamkoff/rector/renderer/renderers/warning. The VitePress guide documents configuration, commands and history, extension contracts, document migrations, styling, security, and lifecycle in a sequential form.