ManaWebShell aus mana-swift-ui v0.6.0 ersetzt den lokalen `Sources/Features/WebShell/`-Ordner. WebShellCoordinator, WebShell- View, WebShellScripts geloescht (~430 LOC). CookieBridge bleibt lokal (App-spezifischer Cookie-SSO-Pfad fuer .mana.how), wandert nach `Sources/Core/WebShell/CookieBridge.swift`. `RootView.makeWebShellConfig()` baut Config mit Host-Whitelist `zitare.com` + `www.zitare.com` + `*.mana.how`, ZitareTheme-Hints, `syncDarkMode(localStorageKey: "zitare-mode")` und `hideElements` fuer den zitare-web-Header. ZitareTheme forwarded auf ManaTheme.paper aus mana-swift-core v1.6.0 (~90 LOC weg, paper-Werte jetzt single-source in `mana/packages/themes/src/variants/paper.css`). AppConfig.userAgent als plattform-spezifischer Helper hinzu. 20/20 Unit-Tests gruen. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
54 lines
2.5 KiB
Swift
54 lines
2.5 KiB
Swift
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",
|
|
// Explizit auf TeamID.BundleID, statt nil. Vermeidet Logout
|
|
// bei TestFlight-Cert-Drift (siehe mana-swift-core v1.5.1).
|
|
keychainAccessGroup: "QP3GLU8PH3.ev.mana.zitare"
|
|
)
|
|
|
|
/// `zitare-api.mana.how` — API-Backend (Hono+Bun).
|
|
static let apiBaseURL = URL(string: "https://zitare-api.mana.how")!
|
|
|
|
/// `zitare.com` — geplante öffentliche Domain (CC-BY-SA-Korpus,
|
|
/// statisch). Universal-Link-Domain für AASA. **Heute DNS noch
|
|
/// nicht live** (Cloudflare-Zone-Onboarding offen, siehe
|
|
/// `zitare/STATUS.md`); bis dahin nutzt der WebView `appBaseURL`
|
|
/// (`zitare.mana.how`) — der Container liefert beide Surfaces.
|
|
static let publicWebURL = URL(string: "https://zitare.com")!
|
|
|
|
/// `zitare.mana.how` — SPA-Surface, eingeloggte Pfade. Heute auch
|
|
/// der Default für Lese-Surfaces, bis `zitare.com` live ist.
|
|
static let appBaseURL = URL(string: "https://zitare.mana.how")!
|
|
|
|
/// Effektive Default-URL für den WebView. Zeigt vorerst auf
|
|
/// `appBaseURL` (`zitare.mana.how`); nach Cloudflare-Zone-Cut
|
|
/// kommt das zurück auf `publicWebURL`.
|
|
static let webBaseURL = appBaseURL
|
|
|
|
/// App-Group für Daten-Sharing zwischen App ↔ Widget ↔ ShareExt.
|
|
static let appGroup = "group.ev.mana.zitare"
|
|
|
|
/// Endpoint für den Korpus-Snapshot (Phase ζ-2). Heute noch nicht
|
|
/// als statische HTTP-Datei publiziert — Aufgabe im Web-Repo:
|
|
/// `apps/zitare/static/index-min.json` aus dem Snapshot-Job
|
|
/// zusätzlich rauskopieren. Bis dahin schlägt der Pull mit 404
|
|
/// fehl und `SnapshotSync.tryRefresh()` macht fail-soft no-op.
|
|
static let snapshotURL = webBaseURL.appendingPathComponent("index-min.json")
|
|
|
|
/// User-Agent-Suffix für WKWebView (ManaWebShell). WKWebView hängt
|
|
/// das an seinen Standard-UA an, ersetzt ihn nicht.
|
|
#if os(macOS)
|
|
static let userAgent = "ZitareNative/0.1 (macOS)"
|
|
#else
|
|
static let userAgent = "ZitareNative/0.1 (iOS)"
|
|
#endif
|
|
}
|