Files
self/packages/webview-app/index.html
Evi Nova 64a4f04c6a Feat/webview+bridge (#1763)
* 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
2026-02-16 21:41:02 +10:00

13 lines
328 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Self</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>