Add macOS support with dedicated NSTextView-based paragraph rendering - #92
Closed
Jun Yan (junyan72) wants to merge 1 commit into
Closed
Jun Yan (junyan72) wants to merge 1 commit into
Jun Yan (junyan72) wants to merge 1 commit into
Conversation
- Add .macOS(.v14) platform to Package.swift - Create ParagraphNSView (NSTextView subclass) with CADisplayLink fade animation, context menu, and citation/latex view providers for macOS - Create ParagraphViewMac (NSViewRepresentable wrapper) and ParagraphNSViewCache - Introduce PlatformTypes.swift with cross-platform typealiases (PlatformFont, PlatformColor, PlatformImage, PlatformEdgeInsets) - Extract LatexAttachmentData into shared model file - Rewrite InlineCitationAttachment for cross-platform rendering - Adapt Typography, TextFonts, and inline/block views with #if os guards - Update sample app with supportedDestinations: [iOS, macOS] and platform-conditional UI code (NSAlert, NSSharingServicePicker, NSPasteboard) Refs #85 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4 tasks done
4 tasks
Contributor
Author
|
Closing — all macOS support functionality from this prototype has been incorporated into main via PR #106 and related PRs. The implementation uses a different file organization (separate MDFont/MDColor/MDImage types instead of PlatformTypes, UI/Paragraph/AppKit/ instead of UI/AppKit/) but covers the same functionality. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add macOS 14+ support to SwiftStreamingMarkdown by creating a dedicated AppKit rendering layer for paragraph content (the only component that required UIKit interop), while adapting all shared source files with platform typealiases and
#if osguards.Key pieces:
PlatformFont,PlatformColor,PlatformImage,PlatformEdgeInsets) enabling shared code to compile on both platformsInterfaceStyleenum and platform-conditional image renderingsupportedDestinations: [iOS, macOS]and platform-conditional UI (NSAlert, NSSharingServicePicker, NSPasteboard)Known limitations (follow-up work):
Text()(iosMath supports macOS but wiring is deferred)Refs #85
Validation
swift build— macOS library build succeedsxcodebuild build -destination 'platform=macOS'— sample app builds for macOSxcodebuild build -destination 'platform=iOS Simulator,name=iPhone 16'— sample app builds for iOS (no regression)make lintandmake testnot yet run on this branch (draft PR)OSS readiness