Feature Description
- currently the Mention span just use Regex based parsing system
- this just paint background color and does not validates if user exists or not
- implement a metadata based span which checks for user existence and only apply styling if user exists
Motivation and Use Case
WhatsApp and slack based mentions
Implementation Ideas
- use a js side
command to pass metadata to native side
- this contains
userId, userName, label for user or firstName and possibly avatars (future implementation)
- we pass the selection
start, end with this metadata
- apply this span replacing the selection with Mention span
- in the
onTextChanged() event we replaces the text with username back while deleting
example command syntax
completeMention({
start: number,
end: number,
label: string, // name of user
attributes: {
userId: string,
username: string
}
})
for restoring username back
val username = span.getAttributes()["username"] ?: return
runAsATransaction {
editable.replace(
editable.getSpanStart(span),
editable.getSpanEnd(span),
"@$username"
)
}
Additional Context
may change implementation later
Feature Description
Motivation and Use Case
WhatsApp and slack based mentions
Implementation Ideas
commandto pass metadata to native sideuserId,userName,labelfor user orfirstNameand possibly avatars (future implementation)start,endwith this metadataonTextChanged()event we replaces the text with username back while deletingexample command syntax
for restoring username back
Additional Context
may change implementation later