Integrate mentions in the composer (#1799)

* Integrate mentions in the composer:

    - Add `MentionSpanProvider`.
    - Add custom colors needed for mentions.
    - Use the span provider to render mentions in the composer.
    - Allow selecting users from the mentions suggestions to insert a mention.

---------

Co-authored-by: ElementBot <benoitm+elementbot@element.io>
This commit is contained in:
Jorge Martin Espinosa 2023-11-20 18:14:02 +01:00 committed by GitHub
parent 004804a7c8
commit a8fbb882f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 465 additions and 61 deletions

View file

@ -108,6 +108,36 @@ val SemanticColors.pinDigitBg
Color(0xFF26282D)
}
val SemanticColors.currentUserMentionPillText
get() = if (isLight) {
// We want LightDesignTokens.colorGreen1100
Color(0xff005c45)
} else {
// We want DarkDesignTokens.colorGreen1100
Color(0xff1fc090)
}
val SemanticColors.currentUserMentionPillBackground
get() = if (isLight) {
// We want LightDesignTokens.colorGreenAlpha400
Color(0x3b07b661)
} else {
// We want DarkDesignTokens.colorGreenAlpha500
Color(0xff003d29)
}
val SemanticColors.mentionPillText
get() = textPrimary
val SemanticColors.mentionPillBackground
get() = if (isLight) {
// We want LightDesignTokens.colorGray400
Color(0x1f052e61)
} else {
// We want DarkDesignTokens.colorGray500
Color(0x26f4f7fa)
}
@PreviewsDayNight
@Composable
internal fun ColorAliasesPreview() = ElementPreview {