diff --git a/Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3d0b1278d..1cc4e6de4 100644 --- a/Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Riot.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -23,8 +23,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/matrix-org/matrix-wysiwyg-composer-swift", "state" : { - "revision" : "2f101426d9df13b830e87a5e6f0ac672e8118ca0", - "version" : "0.15.0" + "revision" : "e63034b57eeec1164e6cfcccf817f3b764b56a83", + "version" : "0.17.0" } }, { diff --git a/Riot/Assets/Images.xcassets/Composer/code_block.imageset/Contents.json b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/Contents.json new file mode 100644 index 000000000..bcb234ccc --- /dev/null +++ b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "code_block.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "code_block@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "code_block@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block.png b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block.png new file mode 100644 index 000000000..a70342a59 Binary files /dev/null and b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block.png differ diff --git a/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@2x.png b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@2x.png new file mode 100644 index 000000000..8b69b41cb Binary files /dev/null and b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@2x.png differ diff --git a/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@3x.png b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@3x.png new file mode 100644 index 000000000..21bd83678 Binary files /dev/null and b/Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@3x.png differ diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index cd852aeda..362b38f65 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -2561,6 +2561,10 @@ To enable access, tap Settings> Location and select Always"; "wysiwyg_composer_format_action_inline_code" = "Apply inline code format"; "wysiwyg_composer_format_action_unordered_list" = "Toggle bulleted list"; "wysiwyg_composer_format_action_ordered_list" = "Toggle numbered list"; +"wysiwyg_composer_format_action_code_block" = "Toggle code block"; +"wysiwyg_composer_format_action_quote" = "Toggle quote"; + + // Links "wysiwyg_composer_link_action_text" = "Text"; diff --git a/Riot/Generated/Images.swift b/Riot/Generated/Images.swift index ed763a171..5f3ef86c5 100644 --- a/Riot/Generated/Images.swift +++ b/Riot/Generated/Images.swift @@ -110,6 +110,7 @@ internal class Asset: NSObject { internal static let strikethrough = ImageAsset(name: "Strikethrough") internal static let underlined = ImageAsset(name: "Underlined") internal static let bulletList = ImageAsset(name: "bullet_list") + internal static let codeBlock = ImageAsset(name: "code_block") internal static let indentDecrease = ImageAsset(name: "indent_decrease") internal static let maximiseComposer = ImageAsset(name: "maximise_composer") internal static let minimiseComposer = ImageAsset(name: "minimise_composer") diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 111f81061..920857f28 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -9347,6 +9347,10 @@ public class VectorL10n: NSObject { public static var wysiwygComposerFormatActionBold: String { return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_bold") } + /// Toggle code block + public static var wysiwygComposerFormatActionCodeBlock: String { + return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_code_block") + } /// Apply inline code format public static var wysiwygComposerFormatActionInlineCode: String { return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_inline_code") @@ -9363,6 +9367,10 @@ public class VectorL10n: NSObject { public static var wysiwygComposerFormatActionOrderedList: String { return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_ordered_list") } + /// Toggle quote + public static var wysiwygComposerFormatActionQuote: String { + return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_quote") + } /// Apply underline format public static var wysiwygComposerFormatActionStrikethrough: String { return VectorL10n.tr("Vector", "wysiwyg_composer_format_action_strikethrough") diff --git a/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift b/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift index d63c096cd..5525e9940 100644 --- a/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift +++ b/RiotSwiftUI/Modules/Room/Composer/Model/ComposerModels.swift @@ -34,9 +34,11 @@ enum FormatType { case italic case underline case strikethrough - case inlineCode case unorderedList case orderedList + case inlineCode + case codeBlock + case quote case link } @@ -60,12 +62,16 @@ extension FormatItem { return Asset.Images.underlined.name case .strikethrough: return Asset.Images.strikethrough.name - case .inlineCode: - return Asset.Images.code.name case .unorderedList: return Asset.Images.bulletList.name case .orderedList: return Asset.Images.numberedList.name + case .inlineCode: + return Asset.Images.code.name + case .codeBlock: + return Asset.Images.codeBlock.name + case .quote: + return Asset.Images.quote.name case .link: return Asset.Images.link.name } @@ -81,12 +87,16 @@ extension FormatItem { return "underlineButton" case .strikethrough: return "strikethroughButton" - case .inlineCode: - return "inlineCodeButton" case .unorderedList: return "unorderedListButton" case .orderedList: return "orderedListButton" + case .inlineCode: + return "inlineCodeButton" + case .codeBlock: + return "codeBlockButton" + case .quote: + return "quoteButton" case .link: return "linkButton" } @@ -102,12 +112,16 @@ extension FormatItem { return VectorL10n.wysiwygComposerFormatActionUnderline case .strikethrough: return VectorL10n.wysiwygComposerFormatActionStrikethrough - case .inlineCode: - return VectorL10n.wysiwygComposerFormatActionInlineCode case .unorderedList: return VectorL10n.wysiwygComposerFormatActionUnorderedList case .orderedList: return VectorL10n.wysiwygComposerFormatActionOrderedList + case .inlineCode: + return VectorL10n.wysiwygComposerFormatActionInlineCode + case .codeBlock: + return VectorL10n.wysiwygComposerFormatActionCodeBlock + case .quote: + return VectorL10n.wysiwygComposerFormatActionQuote case .link: return VectorL10n.wysiwygComposerFormatActionLink } @@ -126,12 +140,16 @@ extension FormatType { return .underline case .strikethrough: return .strikeThrough - case .inlineCode: - return .inlineCode case .unorderedList: return .unorderedList case .orderedList: return .orderedList + case .inlineCode: + return .inlineCode + case .codeBlock: + return .codeBlock + case .quote: + return .quote case .link: return .link } @@ -155,6 +173,10 @@ extension FormatType { return .orderedList case .inlineCode: return .inlineCode + case .codeBlock: + return .codeBlock + case .quote: + return .quote case .link: return .link } @@ -189,5 +211,3 @@ final class LinkActionWrapper: NSObject { super.init() } } - - diff --git a/changelog.d/7271.feature b/changelog.d/7271.feature new file mode 100644 index 000000000..f2ae089f9 --- /dev/null +++ b/changelog.d/7271.feature @@ -0,0 +1 @@ +Rich Text Composer: Enable quote & code blocks support diff --git a/project.yml b/project.yml index 7d0096d51..c2de639ef 100644 --- a/project.yml +++ b/project.yml @@ -53,7 +53,7 @@ packages: branch: main WysiwygComposer: url: https://github.com/matrix-org/matrix-wysiwyg-composer-swift - version: 0.15.0 + version: 0.17.0 DeviceKit: url: https://github.com/devicekit/DeviceKit majorVersion: 4.7.0