feat(webshell): neues Library-Product ManaWebShell (v0.6.0)
WKWebView-Huelle fuer Hybrid-Apps (Web-Lese-Surfaces + native Submit/Widget/ShareExt). Extrahiert aus den fast-byte-identischen `WebShell/`-Ordnern in seepuls-native und zitare-native (~900 LOC, davon ~700 LOC Duplikat). Audit 2026-05-17 V2. Neu (public API): - `WebShellView` — WKWebView-Wrapper mit Progress-Bar, Pull-to- Refresh (iOS), Fehler-Snackbar, External-Link-Delegation. Universal (iOS + macOS) - `WebShellConfig` — Host-Whitelist mit Wildcard-Support (`"*.mana.how"`), User-Agent, Theme-Hints, User-Scripts - `WebTarget` — URL + monoton wachsender reloadToken - `WebNavState` — @Observable, @MainActor, reaktiver Nav-State - `WebShellCoordinator` — WKNavigationDelegate + WKUIDelegate - `WebShellScripts` — Helfer fuer `preferDarkScheme`, `syncDarkMode(localStorageKey:)`, `hideElements(selectors:tagName:)` Logging unter Subsystem `ev.mana.webshell` (App-OSLog bleibt eigen). Tests: 6 neue Tests gegen `WebShellConfig.isAllowed` (Wildcards, Negativ-Cases). 50/50 grün insgesamt (6 ManaWebShell + 44 ManaAuthUI). Doku: `mana/docs/playbooks/HYBRID_NATIVE_APP.md` (Schwester-Repo). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e284240f3c
commit
8f4d4b0c03
9 changed files with 689 additions and 0 deletions
16
Sources/ManaWebShell/WebNavState.swift
Normal file
16
Sources/ManaWebShell/WebNavState.swift
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import Foundation
|
||||
|
||||
/// Reactive Navigation-State, geteilt zwischen SwiftUI und Coordinator.
|
||||
/// Auf `MainActor` — alle Mutationen passieren via WKWebView-Callbacks
|
||||
/// (KVO + Delegate), die WebKit auf Main liefert.
|
||||
@Observable
|
||||
@MainActor
|
||||
public final class WebNavState {
|
||||
public var isLoading: Bool = false
|
||||
public var estimatedProgress: Double = 0
|
||||
public var lastError: String?
|
||||
public var currentURL: URL?
|
||||
public var canGoBack: Bool = false
|
||||
|
||||
public init() {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue