Files
ghostgram/submodules/TelegramUI/Sources/Chat/ChatRichTextInputMorphSource.swift
ichmagmaus111andClaude Opus 5.5 0622057a4f Ghostgram: open-source release
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:57:09 +01:00

38 lines
1.3 KiB
Swift

import Foundation
import UIKit
import ChatInputTextNode
import ChatSendMessageActionUI
// Adapts any ChatRichTextInputNode backend to the send-options morph's source protocol by
// reading seam members only — so it works for the current UITextView backend and any future
// (e.g. TextKit-2) backend without change.
final class ChatRichTextInputMorphSource: ChatSendMessageContextScreenTextInputSource {
private let node: ChatRichTextInputNode
init(_ node: ChatRichTextInputNode) {
self.node = node
}
var sourceView: UIView {
// The inner editor view (== the old inputTextView). NOT asNode.view: under the
// Model-A passive wrapper the editor child is inset within the wrapper, so the
// wrapper's bounds/frame would shift the morph's start-frame geometry.
return self.node.inputView
}
var attributedText: NSAttributedString? {
return self.node.attributedText
}
var defaultTextContainerInset: UIEdgeInsets {
return self.node.textContainerInset
}
var contentOffset: CGPoint {
return self.node.inputContentOffset
}
var currentRightInset: CGFloat {
return self.node.currentRightInset
}
var quoteLineStyle: ChatInputTextView.Theme.Quote.LineStyle? {
return self.node.inputTheme?.quote.lineStyle
}
}