From 360d710d4fc8704734a75e400d147415428a46b0 Mon Sep 17 00:00:00 2001 From: Nicolas Mauri Date: Tue, 14 Nov 2023 10:27:00 +0100 Subject: [PATCH] Update deployment target to 15.0, WysiwygComposer to 2.15.0, downgrade DTCoreText to 1.6.26 --- Config/Project.xcconfig | 2 +- Podfile | 2 +- .../MatrixKit/Utils/EventFormatter/HTMLFormatter.swift | 1 - Riot/Modules/Room/RoomViewController.swift | 4 ++-- .../WYSIWYGInputToolbar/WysiwygInputToolbarView.swift | 6 +++--- .../Modules/Room/Composer/Model/ComposerModels.swift | 2 +- RiotSwiftUI/Modules/Room/Composer/View/Composer.swift | 9 +++++---- project.yml | 4 ++-- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Config/Project.xcconfig b/Config/Project.xcconfig index bbca50a1b..2413f765f 100644 --- a/Config/Project.xcconfig +++ b/Config/Project.xcconfig @@ -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 diff --git a/Podfile b/Podfile index d408e4f72..bd57ace72 100644 --- a/Podfile +++ b/Podfile @@ -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! diff --git a/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift b/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift index 819eb632f..d109c42df 100644 --- a/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift +++ b/Riot/Modules/MatrixKit/Utils/EventFormatter/HTMLFormatter.swift @@ -47,7 +47,6 @@ class HTMLFormatter: NSObject { var options: [AnyHashable: Any] = [ DTUseiOS6Attributes: true, - DTDefaultFontDescriptor: font.fontDescriptor, DTDefaultLinkDecoration: false, DTDefaultLinkColor: ThemeService.shared().theme.colors.links, DTWillFlushBlockCallBack: sanitizeCallback diff --git a/Riot/Modules/Room/RoomViewController.swift b/Riot/Modules/Room/RoomViewController.swift index 727ca8f80..e9260105e 100644 --- a/Riot/Modules/Room/RoomViewController.swift +++ b/Riot/Modules/Room/RoomViewController.swift @@ -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, diff --git a/Riot/Modules/Room/Views/WYSIWYGInputToolbar/WysiwygInputToolbarView.swift b/Riot/Modules/Room/Views/WYSIWYGInputToolbar/WysiwygInputToolbarView.swift index 60b6edf94..5484ea1ce 100644 --- a/Riot/Modules/Room/Views/WYSIWYGInputToolbar/WysiwygInputToolbarView.swift +++ b/Riot/Modules/Room/Views/WYSIWYGInputToolbar/WysiwygInputToolbarView.swift @@ -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() { @@ -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) diff --git a/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift b/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift index 33d73ef4a..f0b3a3780 100644 --- a/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift +++ b/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift @@ -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 diff --git a/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift b/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift index a74b0bb4d..ca86478f9 100644 --- a/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift +++ b/RiotSwiftUI/Modules/Room/Composer/View/Composer.swift @@ -140,11 +140,12 @@ struct Composer: View { } HStack(alignment: shouldFixRoundCorner ? .top : .center, spacing: 0) { WysiwygComposerView( - focused: $viewModel.focused, - viewModel: wysiwygViewModel + placeholder: viewModel.viewState.placeholder ?? "", + viewModel: wysiwygViewModel, + itemProviderHelper: nil, + keyCommandHandler: nil, + pasteHandler: nil ) - .tintColor(theme.colors.accent) - .placeholder(viewModel.viewState.placeholder, color: theme.colors.tertiaryContent) .onAppear { if wysiwygViewModel.isContentEmpty { wysiwygViewModel.setup() diff --git a/project.yml b/project.yml index 430b39cbc..26cabc792 100644 --- a/project.yml +++ b/project.yml @@ -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 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