Restore iOS compilation by gating AppKit-only code in
StyledTextSwiftUI, ITraceTimeline, CollaborationPanel, and
MainWindowView. Stub ITraceCFGView behind #if canImport(AppKit)
since the Metal/NSView renderer is not ported yet. Add a
UIApplicationDelegateAdaptor mirroring the macOS delegate for
luma:// URL handling and APNs. Fix the rpath for iOS's flat bundle
via SDK-conditional LD_RUNPATH_SEARCH_PATHS overrides.
Build a new phone-first shell (PhoneMainView /
PhoneSessionsListView / PhoneSessionView) that replaces
MainWindowView on iOS. Right-edge drawers for events and
collaboration with glow indicators, a session-switcher popover, and
a segmented REPL / Instruments / Insights / Captures layout. The
Sessions list and Session screen each render a custom compact
header instead of the system nav bar so they sit flush under the
DocumentGroup chrome. Notebook pushes from the Sessions root.
Extract SessionContent so the detach banner lives at the parent of
any session-bound surface instead of each detail view rendering its
own. Make HexView responsive: hide the offset column and use
smaller hex and ASCII fonts in compact width, with selection hit
testing aware of the hidden column. Move the REPL cell timestamp
to share the request line so the result row gets the full cell
width, and trim the REPL horizontal padding in compact width.
Replace Color.cyan with a light/dark adaptive Color.jsTypeLabel so
Object{N} labels stay readable on a light background, and
ellipsize the JS inspector disclosure header to one line.
52 lines
1.7 KiB
Swift
52 lines
1.7 KiB
Swift
import LumaCore
|
|
import SwiftUI
|
|
|
|
#if canImport(AppKit)
|
|
import AppKit
|
|
|
|
extension StyledText {
|
|
func nsAttributed(font: NSFont) -> NSAttributedString {
|
|
let result = NSMutableAttributedString()
|
|
for span in spans {
|
|
var attrs: [NSAttributedString.Key: Any] = [
|
|
.font: span.isBold
|
|
? NSFont.monospacedSystemFont(ofSize: font.pointSize, weight: .bold)
|
|
: font
|
|
]
|
|
if let fg = span.foreground {
|
|
attrs[.foregroundColor] = NSColor(
|
|
calibratedRed: CGFloat(fg.r) / 255,
|
|
green: CGFloat(fg.g) / 255,
|
|
blue: CGFloat(fg.b) / 255,
|
|
alpha: 1
|
|
)
|
|
} else {
|
|
attrs[.foregroundColor] = NSColor(calibratedWhite: 0.7, alpha: 1)
|
|
}
|
|
result.append(NSAttributedString(string: span.text, attributes: attrs))
|
|
}
|
|
return result
|
|
}
|
|
}
|
|
#endif
|
|
|
|
extension StyledText {
|
|
var attributed: AttributedString {
|
|
var result = AttributedString()
|
|
for span in spans {
|
|
var part = AttributedString(span.text)
|
|
if let fg = span.foreground {
|
|
part.foregroundColor = Color(red: Double(fg.r) / 255, green: Double(fg.g) / 255, blue: Double(fg.b) / 255)
|
|
}
|
|
if let bg = span.background {
|
|
part.backgroundColor = Color(red: Double(bg.r) / 255, green: Double(bg.g) / 255, blue: Double(bg.b) / 255)
|
|
}
|
|
if span.isBold {
|
|
part.font = .system(.footnote, design: .monospaced).bold()
|
|
}
|
|
result.append(part)
|
|
}
|
|
return result
|
|
}
|
|
}
|