ζ-0 Setup: Repo-Skelett, iOS-Build grün, Healthz live
- project.yml mit Bundle ev.mana.zitare + Widget + ShareExt-Targets - ManaSwiftCore (ManaCore + ManaTokens) + ManaSwiftUI (ManaAuthUI) als Package-Dependencies via path: - Pure SwiftUI für Native-Surfaces, WKWebView nur für Lese-Tabs (Hybrid-Sonderfall vs cards/memoro/manaspur, dokumentiert im Playbook ZITARE_NATIVE_GREENFIELD.md) - Theme: paper-Variant aus @mana/themes - ZitareAPI.healthCheck via direct URLSession (öffentlicher Endpoint, kein AuthenticatedTransport-Gate) - 6/6 AppConfigTests + 1/1 UI-Smoke grün auf iPhone 16e Simulator - Live: zitare-api.mana.how/healthz → HTTP/2 200 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
0bd59ed148
25 changed files with 1468 additions and 0 deletions
105
Sources/App/RootView.swift
Normal file
105
Sources/App/RootView.swift
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
import ManaCore
|
||||
import SwiftUI
|
||||
|
||||
/// Top-Level-View: TabView mit drei Tabs.
|
||||
///
|
||||
/// **Phase ζ-0 — Setup.** Tabs zeigen aktuell nur Placeholder-Views.
|
||||
/// Ab Phase ζ-1 wird der Lesen-Tab durch `WebShellView` ersetzt,
|
||||
/// der `zitare.com` im `WKWebView` rendert.
|
||||
struct RootView: View {
|
||||
@Environment(AuthClient.self) private var auth
|
||||
@State private var selectedTab: AppTab = .read
|
||||
@State private var healthStatus: HealthStatus = .unknown
|
||||
|
||||
var body: some View {
|
||||
TabView(selection: $selectedTab) {
|
||||
placeholderView(
|
||||
title: "Lesen",
|
||||
subtitle: "ζ-1: WebShellView gegen zitare.com",
|
||||
systemImage: "book"
|
||||
)
|
||||
.tabItem { Label("Lesen", systemImage: "book") }
|
||||
.tag(AppTab.read)
|
||||
|
||||
placeholderView(
|
||||
title: "Erkunden",
|
||||
subtitle: "ζ-1: WebShell auf zitare.com/explore",
|
||||
systemImage: "sparkle.magnifyingglass"
|
||||
)
|
||||
.tabItem { Label("Erkunden", systemImage: "sparkle.magnifyingglass") }
|
||||
.tag(AppTab.explore)
|
||||
|
||||
AccountView(healthStatus: healthStatus)
|
||||
.tabItem { Label("Konto", systemImage: "person.circle") }
|
||||
.tag(AppTab.account)
|
||||
}
|
||||
.task {
|
||||
await probeHealth()
|
||||
}
|
||||
.onOpenURL { url in
|
||||
handle(url: url)
|
||||
}
|
||||
.onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { activity in
|
||||
if let url = activity.webpageURL { handle(url: url) }
|
||||
}
|
||||
}
|
||||
|
||||
/// Phase ζ-0 Probe: ein Aufruf gegen `/healthz` bei App-Start.
|
||||
/// Ab Phase ζ-1 wandert das in einen Service, der den Status global
|
||||
/// trackt und im AccountView anzeigt.
|
||||
private func probeHealth() async {
|
||||
let api = ZitareAPI(auth: auth)
|
||||
do {
|
||||
let ok = try await api.healthCheck()
|
||||
healthStatus = ok ? .ok : .down
|
||||
Log.api.info("Healthz: \(ok ? "OK" : "DOWN")")
|
||||
} catch {
|
||||
healthStatus = .down
|
||||
Log.api.warning(
|
||||
"Healthz fehlgeschlagen: \(String(describing: error), privacy: .public)"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/// Deep-Link-Routing. Phase ζ-0: nur loggen. Phase ζ-1: in den
|
||||
/// passenden Tab + Pfad routen.
|
||||
private func handle(url: URL) {
|
||||
Log.app.info("Deep-Link empfangen: \(url.absoluteString, privacy: .public)")
|
||||
// ζ-1 TODO: parse zitare.com/q/<slug>, /a/<slug>, /c/<slug>
|
||||
// und in WebShellView mit entsprechender URL laden.
|
||||
}
|
||||
|
||||
private func placeholderView(
|
||||
title: String,
|
||||
subtitle: String,
|
||||
systemImage: String
|
||||
) -> some View {
|
||||
VStack(spacing: 16) {
|
||||
Image(systemName: systemImage)
|
||||
.font(.system(size: 48))
|
||||
.foregroundStyle(ZitareTheme.primary)
|
||||
Text(title)
|
||||
.font(.title2)
|
||||
.fontWeight(.semibold)
|
||||
Text(subtitle)
|
||||
.font(.callout)
|
||||
.foregroundStyle(ZitareTheme.mutedForeground)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal, 32)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(ZitareTheme.background)
|
||||
}
|
||||
}
|
||||
|
||||
enum AppTab: Hashable {
|
||||
case read
|
||||
case explore
|
||||
case account
|
||||
}
|
||||
|
||||
enum HealthStatus {
|
||||
case unknown
|
||||
case ok
|
||||
case down
|
||||
}
|
||||
24
Sources/App/ZitareNativeApp.swift
Normal file
24
Sources/App/ZitareNativeApp.swift
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import ManaCore
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct ZitareNativeApp: App {
|
||||
@State private var auth: AuthClient
|
||||
|
||||
init() {
|
||||
let auth = AuthClient(config: AppConfig.manaAppConfig)
|
||||
auth.bootstrap()
|
||||
_auth = State(initialValue: auth)
|
||||
Log.app.info(
|
||||
"Zitare starting — auth status: \(String(describing: auth.status), privacy: .public)"
|
||||
)
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
RootView()
|
||||
.environment(auth)
|
||||
.tint(ZitareTheme.primary)
|
||||
}
|
||||
}
|
||||
}
|
||||
39
Sources/Core/API/ZitareAPI.swift
Normal file
39
Sources/Core/API/ZitareAPI.swift
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import Foundation
|
||||
import ManaCore
|
||||
|
||||
/// Zitare-spezifischer API-Client. Wrapper um `AuthenticatedTransport`
|
||||
/// aus ManaCore, der die zitare-api-Endpoints kennt.
|
||||
///
|
||||
/// Phase ζ-0: nur Health-Probe. Endpoints für Submit, Share-Receive,
|
||||
/// Quote-Lookup folgen in ζ-3 / ζ-4.
|
||||
actor ZitareAPI {
|
||||
let transport: AuthenticatedTransport
|
||||
let decoder: JSONDecoder
|
||||
|
||||
init(auth: AuthClient) {
|
||||
transport = AuthenticatedTransport(baseURL: AppConfig.apiBaseURL, auth: auth)
|
||||
decoder = JSONDecoder()
|
||||
// ζ-3 TODO: bei echten DTOs `.iso8601withFractional`-Extension
|
||||
// aus cards-native portieren (Server liefert ISO8601 mit
|
||||
// Fractional-Seconds, Standard `.iso8601` schluckt das nicht).
|
||||
}
|
||||
|
||||
/// `GET /healthz` — verifiziert dass zitare-api erreichbar ist.
|
||||
/// Öffentlicher Endpoint, läuft direkt via `URLSession` (nicht
|
||||
/// `AuthenticatedTransport`), damit auch nicht-eingeloggte Apps
|
||||
/// die API-Erreichbarkeit prüfen können.
|
||||
func healthCheck() async throws -> Bool {
|
||||
let url = AppConfig.apiBaseURL.appendingPathComponent("healthz")
|
||||
let (_, response) = try await URLSession.shared.data(from: url)
|
||||
guard let http = response as? HTTPURLResponse else { return false }
|
||||
return http.statusCode == 200
|
||||
}
|
||||
|
||||
// MARK: - Phase ζ-3: Submit
|
||||
|
||||
// func submitQuote(_ draft: QuoteDraft) async throws -> SubmittedQuote { ... }
|
||||
|
||||
// MARK: - Phase ζ-4: Share-Receive
|
||||
|
||||
// func receiveShare(_ envelope: ShareEnvelope) async throws -> ShareReceipt { ... }
|
||||
}
|
||||
30
Sources/Core/Auth/AppConfig.swift
Normal file
30
Sources/Core/Auth/AppConfig.swift
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import Foundation
|
||||
import ManaCore
|
||||
|
||||
/// App-spezifische Konfiguration für Zitare. Implementiert
|
||||
/// `ManaAppConfig` aus ManaCore und ergänzt die Zitare-eigene
|
||||
/// `apiBaseURL` (zitare-api, getrennt von mana-auth) sowie
|
||||
/// `webBaseURL` (zitare.com, für WKWebView und Universal-Links)
|
||||
/// und `appBaseURL` (zitare.mana.how, für eingeloggte Pfade).
|
||||
enum AppConfig {
|
||||
static let manaAppConfig: ManaAppConfig = DefaultManaAppConfig(
|
||||
authBaseURL: URL(string: "https://auth.mana.how")!,
|
||||
keychainService: "ev.mana.zitare",
|
||||
keychainAccessGroup: nil
|
||||
)
|
||||
|
||||
/// `zitare-api.mana.how` — API-Backend (Hono+Bun).
|
||||
static let apiBaseURL = URL(string: "https://zitare-api.mana.how")!
|
||||
|
||||
/// `zitare.com` — öffentliches statisches Frontend. Universal-Link-
|
||||
/// Domain. WKWebView-Default für Lesen-Surfaces.
|
||||
static let webBaseURL = URL(string: "https://zitare.com")!
|
||||
|
||||
/// `zitare.mana.how` — SPA-Surface für eingeloggte Pfade (Submit,
|
||||
/// Edit, Moderation). Bekommt den `mana.access`-Cookie injiziert
|
||||
/// für Cookie-SSO.
|
||||
static let appBaseURL = URL(string: "https://zitare.mana.how")!
|
||||
|
||||
/// App-Group für Daten-Sharing zwischen App ↔ Widget ↔ ShareExt.
|
||||
static let appGroup = "group.ev.mana.zitare"
|
||||
}
|
||||
16
Sources/Core/Telemetry/Log.swift
Normal file
16
Sources/Core/Telemetry/Log.swift
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import Foundation
|
||||
import OSLog
|
||||
|
||||
/// App-eigene OSLog-Logger unter Subsystem `ev.mana.zitare`.
|
||||
/// ManaCore loggt unter `ev.mana.core` parallel — siehe
|
||||
/// `mana-swift-core/Sources/ManaCore/Telemetry/CoreLog.swift`.
|
||||
enum Log {
|
||||
static let app = Logger(subsystem: "ev.mana.zitare", category: "app")
|
||||
static let auth = Logger(subsystem: "ev.mana.zitare", category: "auth")
|
||||
static let api = Logger(subsystem: "ev.mana.zitare", category: "api")
|
||||
static let web = Logger(subsystem: "ev.mana.zitare", category: "web")
|
||||
static let snapshot = Logger(subsystem: "ev.mana.zitare", category: "snapshot")
|
||||
static let widget = Logger(subsystem: "ev.mana.zitare", category: "widget")
|
||||
static let spotlight = Logger(subsystem: "ev.mana.zitare", category: "spotlight")
|
||||
static let share = Logger(subsystem: "ev.mana.zitare", category: "share")
|
||||
}
|
||||
105
Sources/Core/Theme/ZitareTheme.swift
Normal file
105
Sources/Core/Theme/ZitareTheme.swift
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
import SwiftUI
|
||||
|
||||
#if canImport(UIKit)
|
||||
import UIKit
|
||||
|
||||
private typealias PlatformColorType = UIColor
|
||||
#elseif canImport(AppKit)
|
||||
import AppKit
|
||||
|
||||
private typealias PlatformColorType = NSColor
|
||||
#endif
|
||||
|
||||
/// Paper-Variant aus `mana/packages/themes/src/variants/paper.css`.
|
||||
/// Lokal in zitare-native nachgebaut, weil ManaTokens noch keine
|
||||
/// Variants kennt.
|
||||
///
|
||||
/// Sepia, warm, lese-fokussiert — skeumorph an Druckpapier angelehnt,
|
||||
/// passt zum (read)-Surface der Web-App.
|
||||
enum ZitareTheme {
|
||||
/// Page-Hintergrund (warmes Off-White / dunkles Sepia)
|
||||
static let background = dynamic(light: HSL(38, 28, 95), dark: HSL(24, 14, 9))
|
||||
|
||||
/// Standard-Text
|
||||
static let foreground = dynamic(light: HSL(20, 14, 16), dark: HSL(38, 24, 88))
|
||||
|
||||
/// Card, Panel, Modal
|
||||
static let surface = dynamic(light: HSL(0, 0, 100), dark: HSL(24, 12, 13))
|
||||
|
||||
/// Hover-State auf Surface
|
||||
static let surfaceHover = dynamic(light: HSL(38, 24, 92), dark: HSL(24, 14, 17))
|
||||
|
||||
/// Disabled-Felder, Skeleton
|
||||
static let muted = dynamic(light: HSL(38, 20, 90), dark: HSL(24, 12, 18))
|
||||
|
||||
/// Sekundär-Text, Placeholder
|
||||
static let mutedForeground = dynamic(light: HSL(20, 14, 50), dark: HSL(38, 12, 60))
|
||||
|
||||
/// Rahmen, Trennlinien
|
||||
static let border = dynamic(light: HSL(38, 18, 80), dark: HSL(24, 10, 25))
|
||||
|
||||
/// Zitare-Primary — warmes Terra/Sienna im Light, weicheres Sienna im Dark
|
||||
static let primary = dynamic(light: HSL(18, 50, 38), dark: HSL(24, 60, 65))
|
||||
|
||||
/// Text auf Primary
|
||||
static let primaryForeground = dynamic(light: HSL(0, 0, 100), dark: HSL(24, 14, 9))
|
||||
|
||||
static let error = dynamic(light: HSL(0, 65, 45), dark: HSL(0, 60, 55))
|
||||
static let success = dynamic(light: HSL(135, 35, 35), dark: HSL(135, 35, 55))
|
||||
static let warning = dynamic(light: HSL(38, 80, 40), dark: HSL(38, 70, 55))
|
||||
|
||||
// MARK: - HSL Helper
|
||||
|
||||
struct HSL {
|
||||
let hue: Double
|
||||
let saturation: Double
|
||||
let lightness: Double
|
||||
|
||||
init(_ hue: Double, _ saturation: Double, _ lightness: Double) {
|
||||
self.hue = hue
|
||||
self.saturation = saturation
|
||||
self.lightness = lightness
|
||||
}
|
||||
|
||||
var color: Color {
|
||||
Color(
|
||||
hue: hue / 360.0,
|
||||
saturation: saturation / 100.0,
|
||||
brightness: brightnessFromLightness(),
|
||||
opacity: 1.0
|
||||
)
|
||||
}
|
||||
|
||||
/// HSL → HSB Konversion (SwiftUI Color nutzt HSB).
|
||||
private func brightnessFromLightness() -> Double {
|
||||
let l = lightness / 100.0
|
||||
let s = saturation / 100.0
|
||||
return l + s * min(l, 1 - l)
|
||||
}
|
||||
}
|
||||
|
||||
private static func dynamic(light: HSL, dark: HSL) -> Color {
|
||||
#if canImport(UIKit)
|
||||
return Color(
|
||||
PlatformColorType { trait in
|
||||
trait.userInterfaceStyle == .dark
|
||||
? PlatformColorType(dark.color)
|
||||
: PlatformColorType(light.color)
|
||||
}
|
||||
)
|
||||
#elseif canImport(AppKit)
|
||||
return Color(
|
||||
PlatformColorType(name: nil) { appearance in
|
||||
let isDark = appearance.bestMatch(
|
||||
from: [.darkAqua, .aqua]
|
||||
) == .darkAqua
|
||||
return isDark
|
||||
? PlatformColorType(dark.color)
|
||||
: PlatformColorType(light.color)
|
||||
}
|
||||
)
|
||||
#else
|
||||
return light.color
|
||||
#endif
|
||||
}
|
||||
}
|
||||
106
Sources/Features/Account/AccountView.swift
Normal file
106
Sources/Features/Account/AccountView.swift
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
import ManaCore
|
||||
import SwiftUI
|
||||
|
||||
/// Phase ζ-0 minimal: zeigt Auth-Status und Healthz-Probe-Ergebnis.
|
||||
/// Phase ζ-3 erweitert um ManaAuthUI-Login-Sheet und Submission-
|
||||
/// History-Link (via WebShell auf `zitare.mana.how/me`).
|
||||
struct AccountView: View {
|
||||
@Environment(AuthClient.self) private var auth
|
||||
let healthStatus: HealthStatus
|
||||
|
||||
var body: some View {
|
||||
ScrollView {
|
||||
VStack(spacing: 24) {
|
||||
header
|
||||
|
||||
statusCard
|
||||
|
||||
Spacer(minLength: 32)
|
||||
|
||||
aboutCard
|
||||
}
|
||||
.padding()
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(ZitareTheme.background)
|
||||
}
|
||||
|
||||
private var header: some View {
|
||||
VStack(spacing: 8) {
|
||||
Image(systemName: "quote.opening")
|
||||
.font(.system(size: 48))
|
||||
.foregroundStyle(ZitareTheme.primary)
|
||||
Text("Zitare")
|
||||
.font(.largeTitle)
|
||||
.fontWeight(.semibold)
|
||||
Text("Öffentlicher Zitat-Korpus von mana e.V.")
|
||||
.font(.callout)
|
||||
.foregroundStyle(ZitareTheme.mutedForeground)
|
||||
.multilineTextAlignment(.center)
|
||||
}
|
||||
.padding(.top, 32)
|
||||
}
|
||||
|
||||
private var statusCard: some View {
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
row("Auth", value: authStatusLabel)
|
||||
Divider()
|
||||
row("API", value: healthLabel)
|
||||
}
|
||||
.padding()
|
||||
.background(ZitareTheme.surface)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12))
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: 12)
|
||||
.stroke(ZitareTheme.border, lineWidth: 1)
|
||||
)
|
||||
}
|
||||
|
||||
private var aboutCard: some View {
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text("Phase ζ-0 — Setup")
|
||||
.font(.caption)
|
||||
.foregroundStyle(ZitareTheme.mutedForeground)
|
||||
Text(
|
||||
"Diese App ist noch im Aufbau. Web-App live auf "
|
||||
+ "zitare.com und zitare.mana.how. "
|
||||
+ "Plan in mana/docs/playbooks/ZITARE_NATIVE_GREENFIELD.md."
|
||||
)
|
||||
.font(.footnote)
|
||||
.foregroundStyle(ZitareTheme.foreground)
|
||||
}
|
||||
.padding()
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
|
||||
private func row(_ label: String, value: String) -> some View {
|
||||
HStack {
|
||||
Text(label)
|
||||
.foregroundStyle(ZitareTheme.mutedForeground)
|
||||
Spacer()
|
||||
Text(value)
|
||||
.foregroundStyle(ZitareTheme.foreground)
|
||||
.fontWeight(.medium)
|
||||
}
|
||||
}
|
||||
|
||||
private var authStatusLabel: String {
|
||||
switch auth.status {
|
||||
case .unknown: "—"
|
||||
case .signedOut: "Nicht eingeloggt"
|
||||
case .guest: "Gast"
|
||||
case .signingIn: "Login läuft …"
|
||||
case .twoFactorRequired: "2FA erforderlich"
|
||||
case let .signedIn(email): email
|
||||
case .error: "Fehler"
|
||||
}
|
||||
}
|
||||
|
||||
private var healthLabel: String {
|
||||
switch healthStatus {
|
||||
case .unknown: "—"
|
||||
case .ok: "OK"
|
||||
case .down: "nicht erreichbar"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Sources/Features/Settings/SettingsView.swift
Normal file
19
Sources/Features/Settings/SettingsView.swift
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import SwiftUI
|
||||
|
||||
/// Phase ζ-5 Placeholder.
|
||||
///
|
||||
/// Aufgabenliste in ζ-5:
|
||||
///
|
||||
/// - Theme-Toggle (System / Light / Dark) — propagiert per
|
||||
/// `localStorage['zitare-mode']` an den WebView.
|
||||
/// - Reader-Schriftgröße (S/M/L/XL) — per JS-Bridge an die Web-CSS-
|
||||
/// Variable `--zit-reader-size`.
|
||||
/// - DSGVO-Daten-Export (öffnet `zitare.mana.how/me` Export-Page im
|
||||
/// WebView).
|
||||
/// - About / Impressum / Lizenz (CC-BY-SA-4.0).
|
||||
struct SettingsView: View {
|
||||
var body: some View {
|
||||
Text("Einstellungen — ζ-5 TODO")
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
}
|
||||
32
Sources/Features/Submit/SubmitQuoteView.swift
Normal file
32
Sources/Features/Submit/SubmitQuoteView.swift
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import SwiftUI
|
||||
|
||||
/// Phase ζ-3 Placeholder — native Submit-View für Quote-Drafts.
|
||||
///
|
||||
/// Aufgabenliste in ζ-3:
|
||||
///
|
||||
/// - SwiftUI-Form mit Feldern: text (TextEditor), attribution (Author-
|
||||
/// Name mit Auto-Complete aus lokalem Snapshot), language (Picker),
|
||||
/// optional source (Werk, Jahr, URL), optional theme-Chips.
|
||||
/// - `ManaAuthGate`-Wrap: nicht-eingeloggter Tap auf „Einreichen"
|
||||
/// öffnet `ManaAuthUI`-Login-Sheet.
|
||||
/// - `POST /api/v1/quotes` mit `status: 'draft'` (Endpoint existiert
|
||||
/// schon, Phase 2.A im Web-Repo).
|
||||
/// - Offline-Queue: bei Network-Failure Draft in SwiftData
|
||||
/// `PendingSubmission` persistieren, beim Reconnect retry.
|
||||
/// - Erfolg: Toast + Link „Im Web ansehen" (öffnet WebView auf
|
||||
/// `zitare.mana.how/me` bzw. `/admin/queue` wenn Moderator).
|
||||
struct SubmitQuoteView: View {
|
||||
var body: some View {
|
||||
VStack(spacing: 12) {
|
||||
Image(systemName: "square.and.pencil")
|
||||
.font(.system(size: 36))
|
||||
.foregroundStyle(ZitareTheme.primary)
|
||||
Text("Quote vorschlagen")
|
||||
.font(.headline)
|
||||
Text("ζ-3 — TODO: SwiftUI-Form + ManaAuthGate")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
38
Sources/Features/WebShell/WebShellView.swift
Normal file
38
Sources/Features/WebShell/WebShellView.swift
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
import SwiftUI
|
||||
|
||||
/// Phase ζ-1 Placeholder.
|
||||
///
|
||||
/// Wird in ζ-1 zu einer echten `UIViewRepresentable`/
|
||||
/// `NSViewRepresentable` um `WKWebView`. Aufgabenliste in ζ-1:
|
||||
///
|
||||
/// - WebView-Konfiguration: `WKWebViewConfiguration` mit non-persistent
|
||||
/// DataStore in Debug-Builds; Persistent in Release.
|
||||
/// - Cookie-Bridge: nach ManaCore-Login JWT als `mana.access`-Cookie
|
||||
/// für `.mana.how` ins `WKHTTPCookieStore` schreiben.
|
||||
/// - Pull-to-Refresh via `UIRefreshControl` (iOS) /
|
||||
/// `NSScrollView` (macOS).
|
||||
/// - `WKNavigationDelegate` für Deep-Link-Catching: wenn der WebView
|
||||
/// eine Navigation auf `zitare://` oder eine andere mana-Domain
|
||||
/// versucht, abfangen und natively routen.
|
||||
/// - `WKUIDelegate` für `target=_blank`-Links (Safari öffnen, nicht
|
||||
/// im WebView).
|
||||
/// - Native-Toolbar overlay (ζ-5).
|
||||
///
|
||||
/// Heute nur die Signatur, damit `RootView` schon den finalen
|
||||
/// Import-Pfad nutzt.
|
||||
struct WebShellView: View {
|
||||
let initialURL: URL
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 12) {
|
||||
Text("WebShellView")
|
||||
.font(.headline)
|
||||
Text("ζ-1 — TODO: WKWebView auf \(initialURL.absoluteString)")
|
||||
.font(.caption)
|
||||
.foregroundStyle(.secondary)
|
||||
.multilineTextAlignment(.center)
|
||||
.padding(.horizontal)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"colors" : [
|
||||
{
|
||||
"color" : {
|
||||
"color-space" : "srgb",
|
||||
"components" : {
|
||||
"alpha" : "1.000",
|
||||
"blue" : "0.286",
|
||||
"green" : "0.337",
|
||||
"red" : "0.580"
|
||||
}
|
||||
},
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"platform" : "ios",
|
||||
"size" : "1024x1024"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
6
Sources/Resources/Assets.xcassets/Contents.json
Normal file
6
Sources/Resources/Assets.xcassets/Contents.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"info" : {
|
||||
"author" : "xcode",
|
||||
"version" : 1
|
||||
}
|
||||
}
|
||||
48
Sources/Resources/Localizable.xcstrings
Normal file
48
Sources/Resources/Localizable.xcstrings
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"sourceLanguage" : "de",
|
||||
"strings" : {
|
||||
"Zitare" : {
|
||||
"comment" : "App name",
|
||||
"extractionState" : "manual",
|
||||
"localizations" : {
|
||||
"de" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Zitare"
|
||||
}
|
||||
},
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "Zitare"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"Lesen" : {
|
||||
"localizations" : {
|
||||
"de" : { "stringUnit" : { "state" : "translated", "value" : "Lesen" } },
|
||||
"en" : { "stringUnit" : { "state" : "translated", "value" : "Read" } }
|
||||
}
|
||||
},
|
||||
"Erkunden" : {
|
||||
"localizations" : {
|
||||
"de" : { "stringUnit" : { "state" : "translated", "value" : "Erkunden" } },
|
||||
"en" : { "stringUnit" : { "state" : "translated", "value" : "Explore" } }
|
||||
}
|
||||
},
|
||||
"Konto" : {
|
||||
"localizations" : {
|
||||
"de" : { "stringUnit" : { "state" : "translated", "value" : "Konto" } },
|
||||
"en" : { "stringUnit" : { "state" : "translated", "value" : "Account" } }
|
||||
}
|
||||
},
|
||||
"Öffentlicher Zitat-Korpus von mana e.V." : {
|
||||
"localizations" : {
|
||||
"de" : { "stringUnit" : { "state" : "translated", "value" : "Öffentlicher Zitat-Korpus von mana e.V." } },
|
||||
"en" : { "stringUnit" : { "state" : "translated", "value" : "Public quote corpus by mana e.V." } }
|
||||
}
|
||||
}
|
||||
},
|
||||
"version" : "1.0"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue