mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-28 15:22:39 +00:00
Rich Text Composer: Enable quote & code blocks support
This commit is contained in:
parent
8b2693284b
commit
036a9f0096
11 changed files with 71 additions and 14 deletions
|
@ -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"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
23
Riot/Assets/Images.xcassets/Composer/code_block.imageset/Contents.json
vendored
Normal file
23
Riot/Assets/Images.xcassets/Composer/code_block.imageset/Contents.json
vendored
Normal file
|
@ -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
|
||||
}
|
||||
}
|
BIN
Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block.png
vendored
Normal file
BIN
Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 493 B |
BIN
Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@2x.png
vendored
Normal file
BIN
Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 649 B |
BIN
Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@3x.png
vendored
Normal file
BIN
Riot/Assets/Images.xcassets/Composer/code_block.imageset/code_block@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 953 B |
|
@ -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";
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
1
changelog.d/7271.feature
Normal file
1
changelog.d/7271.feature
Normal file
|
@ -0,0 +1 @@
|
|||
Rich Text Composer: Enable quote & code blocks support
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue