Under construction
An at-style mentions module for quilljs.
You can get quill-mentions
through npm
$ npm install quill-modules
Or you can just take the files from the dist
folder. That works too.
quill-mentions
exposes a single global variable, QuillMentions
.
To include mentions in your Quill project, simply add the stylesheet and all the Javascripts to your page.
Pass the global QuillMentions
contsructor to Quill's registerModule function, and add mentions
to your module config when you instantiate your editor(s).
<head>
...
<link rel="stylesheet" href="/path/to/quill-mentions.css">
...
</head>
<body>
...
<script src="/path/to/quill.min.js"></script>
<script src="/path/to/quill-mentions.min.js"></script>
<script>
Quill.registerModule("mentions", QuillMentions);
var editor = new Quill('#editor-container', {
modules: {
'mentions': { /* add your configuration here */ },
}
});
</script>
</body>
The docs are not as exhaustive as they should be, but they live (nonetheless) in the docs
folder.
Not Yet Written
inject choices (as array)parse contentsuse@
to summon popover with possible choices matched to textvertically align popover to position of calling@
Customizable no-match-found messagesTODO - figre out how to configure so there's no message. Was running into issues trying this out.Keyboard events for up and down arrowsAlso for escape and enter!Insert data with mention into markup (this might require deviating from custom quill format because custom formats are too nascent 😕)Currently, thedata-mention
attribute from a matchingli
is appended to the class of a mentionspan
. This is hacky, but it avoids having to manually insert HTML...- Horizontally align the popover
Refactor with MVC- Break out defaultFactory (the main default object has toooo much 💩 on it.)
- Horizontally align the popover
- Refactor styles to not rely on dom elements
- More flexible templates, allow custom
value
accessor functions - Allow config to turn of quill custom format
- Customizable hotkeys
- Determine horizontal rendering of mentions container.
- Find alternative to current use of
transform: translateZ
on the popover list items... Write more robust regex for parsing names (separate for work)Hide view after insertAdd keyboard events for up and down arrowsDon't allow 'womp womp' message to be clickedRender ql-mentions container in a more logical position