- 拆分 ContentDelegates/TextContentView 为独立协调器(InteractionCoordinator、LocationResolution、ExternalLinks、AttachmentTooltip) - 新增 RDEPUBAttachmentTooltipView/OverlayView 附件气泡提示 - 新增 RDEPUBDarkImageAdjuster 暗色模式图片亮度适配 - 新增 RDEPUBSelectionLoupeView 选区放大镜 - 新增 MetadataParseWorker/CancellationController 元数据解析取消机制 - 重构 PresentationRuntime/PaginationCoordinator 精简职责 - 优化 ChapterLoader/WarmupOrchestrator 异步章节加载 - CFI 模块微调与 NoteModels 更新 - 清理冗余文档,更新架构/UML/业务逻辑文档 Co-Authored-By: Claude <noreply@anthropic.com>
79 lines
1.7 KiB
Swift
79 lines
1.7 KiB
Swift
import Foundation
|
|
|
|
public enum RDEPUBNoteKind: String, Codable, Equatable {
|
|
|
|
case footnote
|
|
|
|
case endnote
|
|
|
|
case rearnote
|
|
|
|
case unknown
|
|
}
|
|
|
|
public struct RDEPUBNoteReference: Codable, Equatable {
|
|
|
|
public var sourceHref: String
|
|
|
|
public var sourceCFI: String?
|
|
|
|
public var targetHref: String
|
|
|
|
public var targetFragment: String?
|
|
|
|
public var targetCFI: String?
|
|
|
|
public var label: String?
|
|
|
|
public var kind: RDEPUBNoteKind
|
|
|
|
public init(
|
|
sourceHref: String,
|
|
sourceCFI: String? = nil,
|
|
targetHref: String,
|
|
targetFragment: String? = nil,
|
|
targetCFI: String? = nil,
|
|
label: String? = nil,
|
|
kind: RDEPUBNoteKind = .unknown
|
|
) {
|
|
self.sourceHref = sourceHref
|
|
self.sourceCFI = sourceCFI
|
|
self.targetHref = targetHref
|
|
self.targetFragment = targetFragment
|
|
self.targetCFI = targetCFI
|
|
self.label = label?.rd_nilIfEmpty
|
|
self.kind = kind
|
|
}
|
|
}
|
|
|
|
public struct RDEPUBResolvedNote: Equatable {
|
|
|
|
public var reference: RDEPUBNoteReference
|
|
|
|
public var sourceLocation: RDEPUBLocation?
|
|
|
|
public var targetLocation: RDEPUBLocation
|
|
|
|
public var title: String?
|
|
|
|
public var html: String
|
|
|
|
public var plainText: String
|
|
|
|
public init(
|
|
reference: RDEPUBNoteReference,
|
|
sourceLocation: RDEPUBLocation? = nil,
|
|
targetLocation: RDEPUBLocation,
|
|
title: String? = nil,
|
|
html: String,
|
|
plainText: String
|
|
) {
|
|
self.reference = reference
|
|
self.sourceLocation = sourceLocation
|
|
self.targetLocation = targetLocation
|
|
self.title = title?.rd_nilIfEmpty
|
|
self.html = html
|
|
self.plainText = plainText
|
|
}
|
|
}
|