Add permalink detection and custom attributed string attributes (#536)

* Pass full attributed string to TimelineItems and let the UI level handle blockquote coalescing
* Add permalink detection and attribute embedding within the attributed string
This commit is contained in:
Stefan Ceriu
2023-02-06 16:59:32 +02:00
committed by GitHub
parent 2734a18217
commit f8e6179933
38 changed files with 287 additions and 171 deletions
@@ -18,8 +18,8 @@ import UIKit
struct EmoteRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
var attributedComponents: [AttributedStringBuilderComponent]?
let body: String
var formattedBody: AttributedString?
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -18,7 +18,7 @@ import UIKit
struct FileRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
let body: String
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -19,7 +19,7 @@ import UniformTypeIdentifiers
struct ImageRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
let body: String
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -18,8 +18,8 @@ import UIKit
struct NoticeRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
var attributedComponents: [AttributedStringBuilderComponent]?
let body: String
var formattedBody: AttributedString?
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -18,8 +18,8 @@ import UIKit
struct TextRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
var attributedComponents: [AttributedStringBuilderComponent]?
let body: String
var formattedBody: AttributedString?
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -18,7 +18,7 @@ import UIKit
struct VideoRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
let body: String
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -24,7 +24,7 @@ struct EncryptedRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable,
}
let id: String
let text: String
let body: String
let encryptionType: EncryptionType
let timestamp: String
let groupState: TimelineItemGroupState
@@ -19,7 +19,7 @@ import UIKit
struct RedactedRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
let body: String
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -18,7 +18,7 @@ import UIKit
struct StateRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
let body: String
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -18,7 +18,7 @@ import UIKit
struct StickerRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
let body: String
let timestamp: String
let groupState: TimelineItemGroupState
let isOutgoing: Bool
@@ -18,7 +18,7 @@ import UIKit
struct UnsupportedRoomTimelineItem: EventBasedTimelineItemProtocol, Identifiable, Hashable {
let id: String
let text: String
let body: String
let eventType: String
let error: String