mirror of
https://github.com/selfxyz/self.git
synced 2026-04-27 03:01:15 -04:00
* feat: add @selfxyz/webview-bridge protocol library
Pure TypeScript bridge for WebView-to-native communication via postMessage JSON.
- WebViewBridge class: request/response lifecycle, event subscriptions, timeouts
- 9 adapter factories: NFC scanner (120s timeout, abort support), crypto
(WebCrypto hash + bridge sign), auth, documents, storage, analytics,
haptic, navigation (React Router mapping), lifecycle
- MockNativeBridge test utility for testing without native
- Schema validation with typed errors
- 44 tests passing (bridge, schema, adapters)
- Build: tsup → ESM + CJS + DTS
* chore: gitignore Android SDK and platform directories
Add app/build-tools, licenses, ndk, platform-tools, platforms and mobile-sdk-alpha equivalents to .gitignore.
* feat: add @selfxyz/webview-app shell with routing, providers, and stubs
Scaffolds the private @selfxyz/webview-app Vite package that runs inside
the KMP SDK's native WebView.
- Vite config with @vitejs/plugin-react + @tamagui/vite-plugin,
react-native → react-native-web alias, lottie-react-native → lottie-react
- Tamagui config copied from app/ with custom fonts (advercase, dinot, plexMono)
- 4 OTF font files copied to public/fonts/ with @font-face CSS
- BridgeProvider: singleton WebViewBridge context (debug in dev mode)
- SelfClientProvider: wires all 9 bridge adapters (nfc, crypto, auth,
documents, storage, analytics, haptic, navigation, lifecycle) and
fires lifecycle.ready() on mount
- BrowserRouter with 11 routes + catch-all redirect
- 10 stub screen components (to be implemented in follow-up commits)
- CSS reset tuned for WebView (no scroll, no tap highlight, no user-select)
Verified: tsc --noEmit passes, vite build produces dist/index.html + 520KB bundle.
* feat(webview-app): implement all 10 WebView screens
Replace stub screens with full implementations wired to bridge adapters.
Onboarding flow (5 screens):
- CountryPickerScreen: searchable country list from local JSON data
- IDSelectionScreen: passport/ID card/other document type selection
- DocumentCameraScreen: MRZ scanning via bridge camera adapter
- DocumentNFCScreen: NFC chip reading with progress, 120s timeout, abort
- ConfirmIdentificationScreen: ownership confirmation via lifecycle.setResult
App screens (5 screens):
- HomeScreen: document catalog with empty/loaded states
- ProvingScreen: disclosure item review + proof generation
- VerificationResultScreen: success/failure result display
- SettingsScreen: account menu items + dismiss SDK
- ComingSoonScreen: placeholder for unimplemented features
* chore: yarn prettier