Mention
The mention plugin in the repository is a reference implementation of an inline atom inserted by an operation hook, not an export of the package.
The repository contains a mentionPlugin in src/lib/plugins/mention/MentionPlugin.svelte (GitHub). It is not exported from edytor, and the package does not expose its file, so you cannot import it. It is demo-grade reference code: read it, then copy what you need into your own plugin.
It shows the two halves of an inline atom: a definition and an operation hook that inserts it.
- It defines one inline block,
mention, with a snippet and aplainform.plainexports the atom as@followed by the first ofdata.label,data.name,data.titleordata.id, or@mentionwhen none is set. - Its
onBeforeOperationrefuses aninsertTextof@and, in its place, inserts amentionatom (with empty data) at the caret and puts the caret right after it.
The snippet renders placeholder text (@mention) and its selected state for debugging. It does not open a picker or store who was mentioned. Inline blocks builds a usable version with a label in its data, and Operations explains the prevent(cb) pattern it uses.
For a void block with an editable caption, the other reference shape, see the image plugin, which is exported and on by default.