From f2378ca6eaee0ef79f3af9e89cc9406069fbf22b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 14:14:21 +0200 Subject: [PATCH] Update wysiwyg to v2.37.7 (#3218) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update wysiwyg to v2.37.7 * Fix API breaks --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jorge Martín --- gradle/libs.versions.toml | 2 +- .../libraries/textcomposer/model/Suggestion.kt | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4afdd9fa56..e39b0297b6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -44,7 +44,7 @@ serialization_json = "1.6.3" showkase = "1.0.3" appyx = "1.4.0" sqldelight = "2.0.2" -wysiwyg = "2.37.5" +wysiwyg = "2.37.7" telephoto = "0.12.0" # DI diff --git a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt index 015677c99c..0e05c3606b 100644 --- a/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt +++ b/libraries/textcomposer/impl/src/main/kotlin/io/element/android/libraries/textcomposer/model/Suggestion.kt @@ -33,17 +33,19 @@ data class Suggestion( ) } -enum class SuggestionType { - Mention, - Command, - Room; +sealed interface SuggestionType { + data object Mention : SuggestionType + data object Command : SuggestionType + data object Room : SuggestionType + data class Custom(val pattern: String) : SuggestionType companion object { fun fromPatternKey(key: PatternKey): SuggestionType { return when (key) { - PatternKey.AT -> Mention - PatternKey.SLASH -> Command - PatternKey.HASH -> Room + PatternKey.At -> Mention + PatternKey.Slash -> Command + PatternKey.Hash -> Room + is PatternKey.Custom -> Custom(key.v1) } } }