Files
Morgan Pretty 7dfa2a77ae Merge remote-tracking branch 'upstream/dev' into feature/libsession-message-wrapping
# Conflicts:
#	Session.xcodeproj/project.pbxproj
#	Session/Conversations/ConversationVC+Interaction.swift
#	Session/Conversations/ConversationVC.swift
#	Session/Conversations/Settings/ThreadSettingsViewModel.swift
#	Session/Home/App Review/AppReviewPromptModel.swift
#	Session/Home/HomeViewModel.swift
#	Session/Media Viewing & Editing/MessageInfoScreen.swift
#	Session/Meta/AppDelegate.swift
#	Session/Settings/DeveloperSettings/DeveloperSettingsProViewModel.swift
#	Session/Settings/SettingsViewModel.swift
#	Session/Shared/BaseVC.swift
#	Session/Utilities/UIContextualAction+Utilities.swift
#	SessionMessagingKit/Database/Models/SessionThread.swift
#	SessionMessagingKit/SessionPro/SessionProPaymentScreenContent.swift
#	SessionMessagingKit/SessionPro/SessionProSettingsViewModel.swift
#	SessionMessagingKit/SessionPro/SessionProState.swift
#	SessionMessagingKit/Shared Models/SessionThreadViewModel.swift
#	SessionNotificationServiceExtension/NotificationServiceExtension.swift
#	SessionUIKit/Components/Input View/InputView.swift
#	SessionUIKit/Components/SwiftUI/ProCTAModal.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+CancelPlan.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+Models.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+Purchase.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+Renew.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+RequestRefund.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen+UpdatePlan.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPaymentScreen.swift
#	SessionUIKit/Screens/Settings/SessionProSettings/SessionProPlanUpdatedScreen.swift
#	SessionUIKit/Style Guide/Constants+Apple.swift
#	SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentApprovalViewController.swift
#	SignalUtilitiesKit/Media Viewing & Editing/Attachment Approval/AttachmentTextToolbar.swift
2025-12-17 09:36:05 +11:00

102 lines
3.0 KiB
Swift

// Copyright © 2025 Rangeproof Pty Ltd. All rights reserved.
import Foundation
import UIKit
import SwiftUI
import Combine
public enum SessionListScreenContent {}
// MARK: - ViewModelType
public extension SessionListScreenContent {
protocol ViewModelType: ObservableObject, SectionedListItemData {
var title: String { get }
var state: ListItemDataState<Section, ListItem> { get }
}
struct TooltipInfo: Hashable, Equatable {
let id: String
let content: ThemedAttributedString
let tintColor: ThemeValue
let position: ViewPosition
public init(
id: String,
content: ThemedAttributedString,
tintColor: ThemeValue,
position: ViewPosition
) {
self.id = id
self.content = content
self.tintColor = tintColor
self.position = position
}
}
struct TextInfo: Hashable, Equatable {
public enum Accessory: Hashable, Equatable {
case proBadgeLeading(
size: SessionProBadge.Size,
themeBackgroundColor: ThemeValue
)
case proBadgeTrailing(
size: SessionProBadge.Size,
themeBackgroundColor: ThemeValue
)
case none
}
let text: String?
let font: Font?
let attributedString: ThemedAttributedString?
let alignment: TextAlignment
let color: ThemeValue
let accessory: Accessory
let accessibility: Accessibility?
public init(
_ text: String? = nil,
font: Font? = nil,
attributedString: ThemedAttributedString? = nil,
alignment: TextAlignment = .leading,
color: ThemeValue = .textPrimary,
accessory: Accessory = .none,
accessibility: Accessibility? = nil
) {
self.text = text
self.font = font
self.attributedString = attributedString
self.alignment = alignment
self.color = color
self.accessory = accessory
self.accessibility = accessibility
}
// MARK: - Conformance
public func hash(into hasher: inout Hasher) {
text.hash(into: &hasher)
font.hash(into: &hasher)
attributedString.hash(into: &hasher)
alignment.hash(into: &hasher)
color.hash(into: &hasher)
accessory.hash(into: &hasher)
accessibility.hash(into: &hasher)
}
public static func == (lhs: TextInfo, rhs: TextInfo) -> Bool {
return (
lhs.text == rhs.text &&
lhs.font == rhs.font &&
lhs.attributedString == rhs.attributedString &&
lhs.alignment == rhs.alignment &&
lhs.color == rhs.color &&
lhs.accessory == rhs.accessory &&
lhs.accessibility == rhs.accessibility
)
}
}
}