* Fix message completion trigger to work anywhere in the message * Add tests for display suggestion in difference message positions * Fix suggestion trigger could support multiple mention symbol * Remove optional parameter type and tweak argument name to hide * Optimize the suggestions trigger using regex * Fix the cursor at wrong position after selected suggestion * Modify the rawSuggestionText pass data in right way * Modify mention symbol to use regex type * Update ElementX/Sources/Screens/RoomScreen/ComposerToolbar/CompletionSuggestionService.swift Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com> * Update generated mock --------- Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
35 lines
840 B
Swift
35 lines
840 B
Swift
//
|
|
// Copyright 2022-2024 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
enum MediaUploadPreviewScreenViewModelAction {
|
|
case dismiss
|
|
}
|
|
|
|
struct MediaUploadPreviewScreenViewState: BindableState {
|
|
let url: URL
|
|
let title: String?
|
|
let shouldShowCaptionWarning: Bool
|
|
var shouldDisableInteraction = false
|
|
|
|
var bindings = MediaUploadPreviewScreenBindings()
|
|
}
|
|
|
|
struct MediaUploadPreviewScreenBindings: BindableState {
|
|
var caption = NSAttributedString()
|
|
var presendCallback: (() -> Void)?
|
|
var selectedRange = NSRange(location: 0, length: 0)
|
|
|
|
var isPresentingMediaCaptionWarning = false
|
|
}
|
|
|
|
enum MediaUploadPreviewScreenViewAction {
|
|
case send
|
|
case cancel
|
|
}
|