Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump RTE version to 2.18.0 #7711

Merged
merged 9 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Config/Project.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ KEYCHAIN_ACCESS_GROUP = $(AppIdentifierPrefix)$(BASE_BUNDLE_IDENTIFIER).keychain
BROADCAST_UPLOAD_EXTENSION_BUNDLE_IDENTIFIER = $(BASE_BUNDLE_IDENTIFIER).broadcastUploadExtension

// Build settings
IPHONEOS_DEPLOYMENT_TARGET = 14.0
IPHONEOS_DEPLOYMENT_TARGET = 15.0
SDKROOT = iphoneos
TARGETED_DEVICE_FAMILY = 1,2
SWIFT_VERSION = 5.6
Expand Down
2 changes: 1 addition & 1 deletion Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://cdn.cocoapods.org/'

# Uncomment this line to define a global platform for your project
platform :ios, '14.0'
platform :ios, '15.0'

# By default, ignore all warnings from any pod
inhibit_all_warnings!
Expand Down
8 changes: 4 additions & 4 deletions Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/Cocoanetics/DTCoreText",
"state" : {
"revision" : "9d2d4d2296e5d2d852a7d3c592b817d913a5d020",
"version" : "1.6.27"
"revision" : "b664664825da565b4c2b7a17dbe2369f68ae43d9",
"version" : "1.6.26"
}
},
{
Expand Down Expand Up @@ -50,8 +50,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/matrix-org/matrix-wysiwyg-composer-swift",
"state" : {
"revision" : "1100b217c04d096dfe072afb4484660ff794d805",
"version" : "2.2.2"
"revision" : "379ab4d0ff194eba197606c56345e5718b2e3810",
"version" : "2.15.0"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ class HTMLFormatter: NSObject {

var options: [AnyHashable: Any] = [
DTUseiOS6Attributes: true,
DTDefaultFontDescriptor: font.fontDescriptor,
alfogrillo marked this conversation as resolved.
Show resolved Hide resolved
DTDefaultLinkDecoration: false,
DTDefaultLinkColor: ThemeService.shared().theme.colors.links,
DTWillFlushBlockCallBack: sanitizeCallback
Expand Down
4 changes: 2 additions & 2 deletions Riot/Modules/Room/RoomViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,8 @@ extension RoomViewController: ComposerLinkActionBridgePresenterDelegate {
}

// MARK: - PermalinkReplacer
extension RoomViewController: PermalinkReplacer {
public func replacementForLink(_ url: String, text: String) -> NSAttributedString? {
extension RoomViewController: MentionReplacer {
public func replacementForMention(_ url: String, text: String) -> NSAttributedString? {
guard #available(iOS 15.0, *),
let url = URL(string: url),
let session = roomDataSource.mxSession,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
return (delegate as? RoomInputToolbarViewDelegate) ?? nil
}

private var permalinkReplacer: PermalinkReplacer? {
return (delegate as? PermalinkReplacer)
private var permalinkReplacer: MentionReplacer? {
return (delegate as? MentionReplacer)
}

override func awakeFromNib() {
Expand Down Expand Up @@ -238,7 +238,7 @@ class WysiwygInputToolbarView: MXKRoomInputToolbarView, NibLoadable, HtmlRoomInp
self?.handleViewModelResult(result)
}
wysiwygViewModel.plainTextMode = !RiotSettings.shared.enableWysiwygTextFormatting
wysiwygViewModel.permalinkReplacer = permalinkReplacer
wysiwygViewModel.mentionReplacer = permalinkReplacer

inputAccessoryViewForKeyboard = UIView(frame: .zero)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ extension FormatItem {

extension FormatType {
/// Convenience method to map it to the external ViewModel action
var action: WysiwygAction {
var action: ComposerAction {
switch self {
case .bold:
return .bold
Expand Down
20 changes: 16 additions & 4 deletions RiotSwiftUI/Modules/Room/Composer/View/Composer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,12 @@ struct Composer: View {
}
HStack(alignment: shouldFixRoundCorner ? .top : .center, spacing: 0) {
WysiwygComposerView(
focused: $viewModel.focused,
viewModel: wysiwygViewModel
placeholder: viewModel.viewState.placeholder ?? "",
alfogrillo marked this conversation as resolved.
Show resolved Hide resolved
viewModel: wysiwygViewModel,
itemProviderHelper: nil,
keyCommandHandler: handleKeyCommand,
pasteHandler: nil
nimau marked this conversation as resolved.
Show resolved Hide resolved
)
.tintColor(theme.colors.accent)
alfogrillo marked this conversation as resolved.
Show resolved Hide resolved
.placeholder(viewModel.viewState.placeholder, color: theme.colors.tertiaryContent)
.onAppear {
if wysiwygViewModel.isContentEmpty {
wysiwygViewModel.setup()
Expand Down Expand Up @@ -218,6 +219,17 @@ struct Composer: View {
}
}

func handleKeyCommand(_ keyCommand: WysiwygKeyCommand) -> Bool {
switch keyCommand {
case .enter:
sendMessageAction(wysiwygViewModel.content)
wysiwygViewModel.clearContent()
return true
case .shiftEnter:
return false
}
}
alfogrillo marked this conversation as resolved.
Show resolved Hide resolved

// MARK: Public

init(
Expand Down
1 change: 1 addition & 0 deletions changelog.d/7681.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Editing a message that ends with an emoji now works as expected.
4 changes: 2 additions & 2 deletions project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ packages:
branch: 0.0.1
WysiwygComposer:
url: https://github.com/matrix-org/matrix-wysiwyg-composer-swift
version: 2.2.2
version: 2.15.0
nimau marked this conversation as resolved.
Show resolved Hide resolved
DeviceKit:
url: https://github.com/devicekit/DeviceKit
majorVersion: 4.7.0
DTCoreText:
url: https://github.com/Cocoanetics/DTCoreText
version: 1.6.27
version: 1.6.26
Loading