@nascentdigital/funnel-apps 4.4.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/react/app/domain/AppService.d.ts +19 -0
- package/dist/react/app/domain/AppService.js +19 -0
- package/dist/react/app/domain/AppServiceClient.d.ts +7 -0
- package/dist/react/app/domain/AppServiceClient.js +57 -0
- package/dist/react/app/domain/AppState.d.ts +1 -0
- package/dist/react/app/domain/AppState.js +2 -0
- package/dist/react/app/domain/index.d.ts +3 -0
- package/dist/react/app/domain/index.js +19 -0
- package/dist/react/app/server/AbstractAppService.d.ts +17 -0
- package/dist/react/app/server/AbstractAppService.js +24 -0
- package/dist/react/app/server/AppServices.d.ts +11 -0
- package/dist/react/app/server/AppServices.js +92 -0
- package/dist/react/app/server/index.d.ts +4 -0
- package/dist/react/app/server/index.js +20 -0
- package/dist/react/app/web/App.d.ts +38 -0
- package/dist/react/app/web/App.js +116 -0
- package/dist/react/app/web/AppContainer.d.ts +16 -0
- package/dist/react/app/web/AppContainer.js +109 -0
- package/dist/react/app/web/AppContext.d.ts +7 -0
- package/dist/react/app/web/AppContext.js +6 -0
- package/dist/react/app/web/AppLayout.d.ts +7 -0
- package/dist/react/app/web/AppLayout.js +34 -0
- package/dist/react/app/web/AppPage.d.ts +13 -0
- package/dist/react/app/web/AppPage.js +30 -0
- package/dist/react/app/web/AppRoot.d.ts +7 -0
- package/dist/react/app/web/AppRoot.js +43 -0
- package/dist/react/app/web/index.d.ts +5 -0
- package/dist/react/app/web/index.js +21 -0
- package/dist/react/app/web/useApp.d.ts +2 -0
- package/dist/react/app/web/useApp.js +33 -0
- package/dist/react/auth0/server/Auth0IdentityService.d.ts +25 -0
- package/dist/react/auth0/server/Auth0IdentityService.js +84 -0
- package/dist/react/auth0/server/Auth0Profile.d.ts +19 -0
- package/dist/react/auth0/server/Auth0Profile.js +108 -0
- package/dist/react/auth0/server/Auth0ProfileFactory.d.ts +15 -0
- package/dist/react/auth0/server/Auth0ProfileFactory.js +51 -0
- package/dist/react/auth0/server/Auth0ProfileManagementService.d.ts +17 -0
- package/dist/react/auth0/server/Auth0ProfileManagementService.js +127 -0
- package/dist/react/auth0/server/Auth0ProfileServices.d.ts +13 -0
- package/dist/react/auth0/server/Auth0ProfileServices.js +19 -0
- package/dist/react/auth0/server/Auth0ProfileStore.d.ts +17 -0
- package/dist/react/auth0/server/Auth0ProfileStore.js +83 -0
- package/dist/react/auth0/server/Auth0ProfileUserService.d.ts +16 -0
- package/dist/react/auth0/server/Auth0ProfileUserService.js +48 -0
- package/dist/react/auth0/server/index.d.ts +4 -0
- package/dist/react/auth0/server/index.js +20 -0
- package/dist/react/auth0/web/Auth0IdentityClient.d.ts +34 -0
- package/dist/react/auth0/web/Auth0IdentityClient.js +200 -0
- package/dist/react/auth0/web/Auth0IdentityClientProvider.d.ts +35 -0
- package/dist/react/auth0/web/Auth0IdentityClientProvider.js +67 -0
- package/dist/react/auth0/web/index.d.ts +1 -0
- package/dist/react/auth0/web/index.js +17 -0
- package/dist/react/bridge/core/BridgeConnection.d.ts +6 -0
- package/dist/react/bridge/core/BridgeConnection.js +2 -0
- package/dist/react/bridge/core/BridgeConstants.d.ts +7 -0
- package/dist/react/bridge/core/BridgeConstants.js +15 -0
- package/dist/react/bridge/core/BridgeEvent.d.ts +52 -0
- package/dist/react/bridge/core/BridgeEvent.js +28 -0
- package/dist/react/bridge/core/BridgeMethod.d.ts +12 -0
- package/dist/react/bridge/core/BridgeMethod.js +2 -0
- package/dist/react/bridge/core/BridgeMethodCall.d.ts +23 -0
- package/dist/react/bridge/core/BridgeMethodCall.js +37 -0
- package/dist/react/bridge/core/BridgeMethods.d.ts +35 -0
- package/dist/react/bridge/core/BridgeMethods.js +2 -0
- package/dist/react/bridge/core/BridgeState.d.ts +24 -0
- package/dist/react/bridge/core/BridgeState.js +2 -0
- package/dist/react/bridge/core/index.d.ts +7 -0
- package/dist/react/bridge/core/index.js +23 -0
- package/dist/react/bridge/web/Bridge.d.ts +32 -0
- package/dist/react/bridge/web/Bridge.js +183 -0
- package/dist/react/bridge/web/BridgeContext.d.ts +8 -0
- package/dist/react/bridge/web/BridgeContext.js +6 -0
- package/dist/react/bridge/web/BridgeGlobals.d.ts +12 -0
- package/dist/react/bridge/web/BridgeGlobals.js +2 -0
- package/dist/react/bridge/web/BridgeProvider.d.ts +7 -0
- package/dist/react/bridge/web/BridgeProvider.js +36 -0
- package/dist/react/bridge/web/index.d.ts +6 -0
- package/dist/react/bridge/web/index.js +22 -0
- package/dist/react/bridge/web/useBridge.d.ts +3 -0
- package/dist/react/bridge/web/useBridge.js +39 -0
- package/dist/react/bridge/web/useBridgeState.d.ts +2 -0
- package/dist/react/bridge/web/useBridgeState.js +43 -0
- package/dist/react/bridge/web/useSafeArea.d.ts +1 -0
- package/dist/react/bridge/web/useSafeArea.js +11 -0
- package/dist/react/content/core/AppContentClient.d.ts +14 -0
- package/dist/react/content/core/AppContentClient.js +51 -0
- package/dist/react/content/core/ContentClientContext.d.ts +7 -0
- package/dist/react/content/core/ContentClientContext.js +6 -0
- package/dist/react/content/core/index.d.ts +1 -0
- package/dist/react/content/core/index.js +17 -0
- package/dist/react/content/domain/ContentAppRequest.d.ts +20 -0
- package/dist/react/content/domain/ContentAppRequest.js +11 -0
- package/dist/react/content/domain/index.d.ts +1 -0
- package/dist/react/content/domain/index.js +17 -0
- package/dist/react/content/server/ContentAppService.d.ts +11 -0
- package/dist/react/content/server/ContentAppService.js +34 -0
- package/dist/react/content/server/index.d.ts +1 -0
- package/dist/react/content/server/index.js +17 -0
- package/dist/react/content/web/ContentProvider.d.ts +5 -0
- package/dist/react/content/web/ContentProvider.js +17 -0
- package/dist/react/content/web/index.d.ts +6 -0
- package/dist/react/content/web/index.js +22 -0
- package/dist/react/content/web/useCollection.d.ts +10 -0
- package/dist/react/content/web/useCollection.js +22 -0
- package/dist/react/content/web/useCollections.d.ts +10 -0
- package/dist/react/content/web/useCollections.js +32 -0
- package/dist/react/content/web/useContentClient.d.ts +1 -0
- package/dist/react/content/web/useContentClient.js +9 -0
- package/dist/react/cookies/web/CookieService.d.ts +25 -0
- package/dist/react/cookies/web/CookieService.js +45 -0
- package/dist/react/cookies/web/CookieServiceContext.d.ts +7 -0
- package/dist/react/cookies/web/CookieServiceContext.js +6 -0
- package/dist/react/cookies/web/CookieServiceProvider.d.ts +6 -0
- package/dist/react/cookies/web/CookieServiceProvider.js +16 -0
- package/dist/react/cookies/web/index.d.ts +3 -0
- package/dist/react/cookies/web/index.js +19 -0
- package/dist/react/cookies/web/useCookieService.d.ts +2 -0
- package/dist/react/cookies/web/useCookieService.js +29 -0
- package/dist/react/identity/core/AbstractIdentityClient.d.ts +22 -0
- package/dist/react/identity/core/AbstractIdentityClient.js +31 -0
- package/dist/react/identity/core/IdentityClient.d.ts +22 -0
- package/dist/react/identity/core/IdentityClient.js +13 -0
- package/dist/react/identity/core/IdentityClientContext.d.ts +7 -0
- package/dist/react/identity/core/IdentityClientContext.js +6 -0
- package/dist/react/identity/core/index.d.ts +6 -0
- package/dist/react/identity/core/index.js +22 -0
- package/dist/react/identity/core/useIdentity.d.ts +10 -0
- package/dist/react/identity/core/useIdentity.js +39 -0
- package/dist/react/identity/core/useIdentityClient.d.ts +2 -0
- package/dist/react/identity/core/useIdentityClient.js +17 -0
- package/dist/react/identity/domain/AnonymousIdentity.d.ts +15 -0
- package/dist/react/identity/domain/AnonymousIdentity.js +27 -0
- package/dist/react/identity/domain/AuthenticatedIdentity.d.ts +25 -0
- package/dist/react/identity/domain/AuthenticatedIdentity.js +32 -0
- package/dist/react/identity/domain/Identity.d.ts +6 -0
- package/dist/react/identity/domain/Identity.js +2 -0
- package/dist/react/identity/domain/IdentityAppRequest.d.ts +8 -0
- package/dist/react/identity/domain/IdentityAppRequest.js +10 -0
- package/dist/react/identity/domain/index.d.ts +4 -0
- package/dist/react/identity/domain/index.js +20 -0
- package/dist/react/identity/server/IdentityAppService.d.ts +9 -0
- package/dist/react/identity/server/IdentityAppService.js +32 -0
- package/dist/react/identity/server/IdentityService.d.ts +17 -0
- package/dist/react/identity/server/IdentityService.js +25 -0
- package/dist/react/identity/server/index.d.ts +4 -0
- package/dist/react/identity/server/index.js +20 -0
- package/dist/react/identity/web/WebIdentityClientProvider.d.ts +8 -0
- package/dist/react/identity/web/WebIdentityClientProvider.js +27 -0
- package/dist/react/identity/web/WebIdentityProvider.d.ts +5 -0
- package/dist/react/identity/web/WebIdentityProvider.js +21 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClient.d.ts +14 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClient.js +47 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClientProvider.d.ts +2 -0
- package/dist/react/identity/web/bridge/AppBridgeIdentityClientProvider.js +28 -0
- package/dist/react/identity/web/bridge/index.d.ts +1 -0
- package/dist/react/identity/web/bridge/index.js +17 -0
- package/dist/react/identity/web/index.d.ts +3 -0
- package/dist/react/identity/web/index.js +19 -0
- package/dist/react/nav/core/SpecSourceContext.d.ts +7 -0
- package/dist/react/nav/core/SpecSourceContext.js +6 -0
- package/dist/react/nav/core/index.d.ts +2 -0
- package/dist/react/nav/core/index.js +18 -0
- package/dist/react/nav/core/useSpec.d.ts +3 -0
- package/dist/react/nav/core/useSpec.js +30 -0
- package/dist/react/nav/domain/Icon.d.ts +2 -0
- package/dist/react/nav/domain/Icon.js +2 -0
- package/dist/react/nav/domain/Modal.d.ts +25 -0
- package/dist/react/nav/domain/Modal.js +28 -0
- package/dist/react/nav/domain/Navigation.d.ts +13 -0
- package/dist/react/nav/domain/Navigation.js +2 -0
- package/dist/react/nav/domain/NavigationCommand.d.ts +14 -0
- package/dist/react/nav/domain/NavigationCommand.js +2 -0
- package/dist/react/nav/domain/Route.d.ts +12 -0
- package/dist/react/nav/domain/Route.js +2 -0
- package/dist/react/nav/domain/Routes.d.ts +6 -0
- package/dist/react/nav/domain/Routes.js +74 -0
- package/dist/react/nav/domain/Screen.d.ts +24 -0
- package/dist/react/nav/domain/Screen.js +28 -0
- package/dist/react/nav/domain/Skeleton.d.ts +26 -0
- package/dist/react/nav/domain/Skeleton.js +2 -0
- package/dist/react/nav/domain/Spec.d.ts +33 -0
- package/dist/react/nav/domain/Spec.js +124 -0
- package/dist/react/nav/domain/SpecSource.d.ts +21 -0
- package/dist/react/nav/domain/SpecSource.js +28 -0
- package/dist/react/nav/domain/Stack.d.ts +35 -0
- package/dist/react/nav/domain/Stack.js +44 -0
- package/dist/react/nav/domain/Tabs.d.ts +37 -0
- package/dist/react/nav/domain/Tabs.js +45 -0
- package/dist/react/nav/domain/icons/ImageIcon.d.ts +2 -0
- package/dist/react/nav/domain/icons/ImageIcon.js +7 -0
- package/dist/react/nav/domain/icons/LucideIcon.d.ts +2 -0
- package/dist/react/nav/domain/icons/LucideIcon.js +7 -0
- package/dist/react/nav/domain/icons/index.d.ts +2 -0
- package/dist/react/nav/domain/icons/index.js +18 -0
- package/dist/react/nav/domain/index.d.ts +14 -0
- package/dist/react/nav/domain/index.js +30 -0
- package/dist/react/nav/domain/sources/AbstractSpecSource.d.ts +23 -0
- package/dist/react/nav/domain/sources/AbstractSpecSource.js +64 -0
- package/dist/react/nav/domain/sources/StaticSpecSource.d.ts +9 -0
- package/dist/react/nav/domain/sources/StaticSpecSource.js +16 -0
- package/dist/react/nav/domain/sources/index.d.ts +2 -0
- package/dist/react/nav/domain/sources/index.js +18 -0
- package/dist/react/nav/server/SpecService.d.ts +9 -0
- package/dist/react/nav/server/SpecService.js +31 -0
- package/dist/react/nav/server/exports.d.ts +1 -0
- package/dist/react/nav/server/exports.js +17 -0
- package/dist/react/nav/server/index.d.ts +2 -0
- package/dist/react/nav/server/index.js +38 -0
- package/dist/react/nav/web/WebSpecProvider.d.ts +2 -0
- package/dist/react/nav/web/WebSpecProvider.js +41 -0
- package/dist/react/nav/web/index.d.ts +3 -0
- package/dist/react/nav/web/index.js +19 -0
- package/dist/react/nav/web/navigator/NativeNavigator.d.ts +13 -0
- package/dist/react/nav/web/navigator/NativeNavigator.js +47 -0
- package/dist/react/nav/web/navigator/Navigator.d.ts +7 -0
- package/dist/react/nav/web/navigator/Navigator.js +2 -0
- package/dist/react/nav/web/navigator/NavigatorContext.d.ts +7 -0
- package/dist/react/nav/web/navigator/NavigatorContext.js +6 -0
- package/dist/react/nav/web/navigator/WebNavigator.d.ts +13 -0
- package/dist/react/nav/web/navigator/WebNavigator.js +38 -0
- package/dist/react/nav/web/navigator/index.d.ts +5 -0
- package/dist/react/nav/web/navigator/index.js +21 -0
- package/dist/react/nav/web/navigator/useNavigator.d.ts +1 -0
- package/dist/react/nav/web/navigator/useNavigator.js +17 -0
- package/dist/react/nav.d.ts +1 -0
- package/dist/react/nav.js +37 -0
- package/dist/react/profile/core/AbstractProfileClient.d.ts +18 -0
- package/dist/react/profile/core/AbstractProfileClient.js +31 -0
- package/dist/react/profile/core/ProfileClient.d.ts +21 -0
- package/dist/react/profile/core/ProfileClient.js +2 -0
- package/dist/react/profile/core/ProfileClientContext.d.ts +7 -0
- package/dist/react/profile/core/ProfileClientContext.js +6 -0
- package/dist/react/profile/core/index.d.ts +6 -0
- package/dist/react/profile/core/index.js +22 -0
- package/dist/react/profile/core/useProfile.d.ts +9 -0
- package/dist/react/profile/core/useProfile.js +47 -0
- package/dist/react/profile/core/useProfileClient.d.ts +2 -0
- package/dist/react/profile/core/useProfileClient.js +17 -0
- package/dist/react/profile/core/useProfileStore.d.ts +2 -0
- package/dist/react/profile/core/useProfileStore.js +28 -0
- package/dist/react/profile/domain/Profile.d.ts +80 -0
- package/dist/react/profile/domain/Profile.js +209 -0
- package/dist/react/profile/domain/ProfileAppRequest.d.ts +15 -0
- package/dist/react/profile/domain/ProfileAppRequest.js +12 -0
- package/dist/react/profile/domain/ProfileStore.d.ts +65 -0
- package/dist/react/profile/domain/ProfileStore.js +180 -0
- package/dist/react/profile/domain/index.d.ts +3 -0
- package/dist/react/profile/domain/index.js +19 -0
- package/dist/react/profile/server/ProfileAppService.d.ts +11 -0
- package/dist/react/profile/server/ProfileAppService.js +49 -0
- package/dist/react/profile/server/ProfileManagementService.d.ts +28 -0
- package/dist/react/profile/server/ProfileManagementService.js +3 -0
- package/dist/react/profile/server/ProfileServices.d.ts +22 -0
- package/dist/react/profile/server/ProfileServices.js +24 -0
- package/dist/react/profile/server/ProfileUserService.d.ts +5 -0
- package/dist/react/profile/server/ProfileUserService.js +2 -0
- package/dist/react/profile/server/index.d.ts +5 -0
- package/dist/react/profile/server/index.js +21 -0
- package/dist/react/profile/web/WebProfile.d.ts +11 -0
- package/dist/react/profile/web/WebProfile.js +37 -0
- package/dist/react/profile/web/WebProfileClient.d.ts +9 -0
- package/dist/react/profile/web/WebProfileClient.js +76 -0
- package/dist/react/profile/web/WebProfileProvider.d.ts +5 -0
- package/dist/react/profile/web/WebProfileProvider.js +62 -0
- package/dist/react/profile/web/WebProfileStore.d.ts +8 -0
- package/dist/react/profile/web/WebProfileStore.js +32 -0
- package/dist/react/profile/web/index.d.ts +3 -0
- package/dist/react/profile/web/index.js +19 -0
- package/dist/react/push/domain/PushAppRequest.d.ts +13 -0
- package/dist/react/push/domain/PushAppRequest.js +12 -0
- package/dist/react/push/domain/PushStore.d.ts +7 -0
- package/dist/react/push/domain/PushStore.js +9 -0
- package/dist/react/push/domain/index.d.ts +2 -0
- package/dist/react/push/domain/index.js +18 -0
- package/dist/react/push/server/PushService.d.ts +22 -0
- package/dist/react/push/server/PushService.js +57 -0
- package/dist/react/push/server/index.d.ts +3 -0
- package/dist/react/push/server/index.js +19 -0
- package/dist/react/push/server/keygen.d.ts +1 -0
- package/dist/react/push/server/keygen.js +8 -0
- package/dist/react/push/web/PushClient.d.ts +35 -0
- package/dist/react/push/web/PushClient.js +204 -0
- package/dist/react/push/web/PushContext.d.ts +7 -0
- package/dist/react/push/web/PushContext.js +6 -0
- package/dist/react/push/web/PushProvider.d.ts +6 -0
- package/dist/react/push/web/PushProvider.js +42 -0
- package/dist/react/push/web/index.d.ts +4 -0
- package/dist/react/push/web/index.js +20 -0
- package/dist/react/push/web/usePushClient.d.ts +3 -0
- package/dist/react/push/web/usePushClient.js +40 -0
- package/dist/react/server.d.ts +7 -0
- package/dist/react/server.js +23 -0
- package/dist/react/ui/web/HideSplash.d.ts +1 -0
- package/dist/react/ui/web/HideSplash.js +28 -0
- package/dist/react/ui/web/Link.d.ts +6 -0
- package/dist/react/ui/web/Link.js +12 -0
- package/dist/react/ui/web/SafeArea.d.ts +9 -0
- package/dist/react/ui/web/SafeArea.js +26 -0
- package/dist/react/ui/web/index.d.ts +3 -0
- package/dist/react/ui/web/index.js +19 -0
- package/dist/react/web.d.ts +10 -0
- package/dist/react/web.js +26 -0
- package/dist/reactnative/app/domain/AppService.d.ts +19 -0
- package/dist/reactnative/app/domain/AppService.js +19 -0
- package/dist/reactnative/app/domain/AppServiceClient.d.ts +7 -0
- package/dist/reactnative/app/domain/AppServiceClient.js +57 -0
- package/dist/reactnative/app/domain/AppState.d.ts +1 -0
- package/dist/reactnative/app/domain/AppState.js +2 -0
- package/dist/reactnative/app/domain/index.d.ts +3 -0
- package/dist/reactnative/app/domain/index.js +19 -0
- package/dist/reactnative/app/rn/AppContainer.d.ts +10 -0
- package/dist/reactnative/app/rn/AppContainer.js +77 -0
- package/dist/reactnative/app/rn/AppRoot.d.ts +5 -0
- package/dist/reactnative/app/rn/AppRoot.js +22 -0
- package/dist/reactnative/app/rn/AppServiceClient.d.ts +4 -0
- package/dist/reactnative/app/rn/AppServiceClient.js +44 -0
- package/dist/reactnative/app/rn/index.d.ts +5 -0
- package/dist/reactnative/app/rn/index.js +22 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClient.d.ts +33 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClient.js +234 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClientProvider.d.ts +27 -0
- package/dist/reactnative/auth0/rn/Auth0IdentityClientProvider.js +60 -0
- package/dist/reactnative/auth0/rn/index.d.ts +2 -0
- package/dist/reactnative/auth0/rn/index.js +18 -0
- package/dist/reactnative/bridge/core/BridgeConnection.d.ts +6 -0
- package/dist/reactnative/bridge/core/BridgeConnection.js +2 -0
- package/dist/reactnative/bridge/core/BridgeConstants.d.ts +7 -0
- package/dist/reactnative/bridge/core/BridgeConstants.js +15 -0
- package/dist/reactnative/bridge/core/BridgeEvent.d.ts +52 -0
- package/dist/reactnative/bridge/core/BridgeEvent.js +28 -0
- package/dist/reactnative/bridge/core/BridgeMethod.d.ts +12 -0
- package/dist/reactnative/bridge/core/BridgeMethod.js +2 -0
- package/dist/reactnative/bridge/core/BridgeMethodCall.d.ts +23 -0
- package/dist/reactnative/bridge/core/BridgeMethodCall.js +37 -0
- package/dist/reactnative/bridge/core/BridgeMethods.d.ts +35 -0
- package/dist/reactnative/bridge/core/BridgeMethods.js +2 -0
- package/dist/reactnative/bridge/core/BridgeState.d.ts +24 -0
- package/dist/reactnative/bridge/core/BridgeState.js +2 -0
- package/dist/reactnative/bridge/core/index.d.ts +7 -0
- package/dist/reactnative/bridge/core/index.js +23 -0
- package/dist/reactnative/bridge/rn/BridgeProxy.d.ts +35 -0
- package/dist/reactnative/bridge/rn/BridgeProxy.js +331 -0
- package/dist/reactnative/bridge/rn/BridgeProxyContext.d.ts +8 -0
- package/dist/reactnative/bridge/rn/BridgeProxyContext.js +6 -0
- package/dist/reactnative/bridge/rn/BridgeProxyProvider.d.ts +8 -0
- package/dist/reactnative/bridge/rn/BridgeProxyProvider.js +39 -0
- package/dist/reactnative/bridge/rn/BridgeWebview.d.ts +7 -0
- package/dist/reactnative/bridge/rn/BridgeWebview.js +51 -0
- package/dist/reactnative/bridge/rn/index.d.ts +7 -0
- package/dist/reactnative/bridge/rn/index.js +23 -0
- package/dist/reactnative/bridge/rn/useBridgeProxy.d.ts +3 -0
- package/dist/reactnative/bridge/rn/useBridgeProxy.js +38 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyCalls.d.ts +3 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyCalls.js +32 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyState.d.ts +2 -0
- package/dist/reactnative/bridge/rn/useBridgeProxyState.js +46 -0
- package/dist/reactnative/identity/core/AbstractIdentityClient.d.ts +22 -0
- package/dist/reactnative/identity/core/AbstractIdentityClient.js +31 -0
- package/dist/reactnative/identity/core/IdentityClient.d.ts +22 -0
- package/dist/reactnative/identity/core/IdentityClient.js +13 -0
- package/dist/reactnative/identity/core/IdentityClientContext.d.ts +7 -0
- package/dist/reactnative/identity/core/IdentityClientContext.js +6 -0
- package/dist/reactnative/identity/core/index.d.ts +6 -0
- package/dist/reactnative/identity/core/index.js +22 -0
- package/dist/reactnative/identity/core/useIdentity.d.ts +10 -0
- package/dist/reactnative/identity/core/useIdentity.js +39 -0
- package/dist/reactnative/identity/core/useIdentityClient.d.ts +2 -0
- package/dist/reactnative/identity/core/useIdentityClient.js +17 -0
- package/dist/reactnative/identity/domain/AnonymousIdentity.d.ts +15 -0
- package/dist/reactnative/identity/domain/AnonymousIdentity.js +27 -0
- package/dist/reactnative/identity/domain/AuthenticatedIdentity.d.ts +25 -0
- package/dist/reactnative/identity/domain/AuthenticatedIdentity.js +32 -0
- package/dist/reactnative/identity/domain/Identity.d.ts +6 -0
- package/dist/reactnative/identity/domain/Identity.js +2 -0
- package/dist/reactnative/identity/domain/IdentityAppRequest.d.ts +8 -0
- package/dist/reactnative/identity/domain/IdentityAppRequest.js +10 -0
- package/dist/reactnative/identity/domain/index.d.ts +4 -0
- package/dist/reactnative/identity/domain/index.js +20 -0
- package/dist/reactnative/identity/rn/RNIdentityClientProvider.d.ts +8 -0
- package/dist/reactnative/identity/rn/RNIdentityClientProvider.js +22 -0
- package/dist/reactnative/identity/rn/RNIdentityProvider.d.ts +5 -0
- package/dist/reactnative/identity/rn/RNIdentityProvider.js +14 -0
- package/dist/reactnative/identity/rn/index.d.ts +3 -0
- package/dist/reactnative/identity/rn/index.js +19 -0
- package/dist/reactnative/nav/core/SpecSourceContext.d.ts +7 -0
- package/dist/reactnative/nav/core/SpecSourceContext.js +6 -0
- package/dist/reactnative/nav/core/index.d.ts +2 -0
- package/dist/reactnative/nav/core/index.js +18 -0
- package/dist/reactnative/nav/core/useSpec.d.ts +3 -0
- package/dist/reactnative/nav/core/useSpec.js +30 -0
- package/dist/reactnative/nav/domain/Icon.d.ts +2 -0
- package/dist/reactnative/nav/domain/Icon.js +2 -0
- package/dist/reactnative/nav/domain/Modal.d.ts +25 -0
- package/dist/reactnative/nav/domain/Modal.js +28 -0
- package/dist/reactnative/nav/domain/Navigation.d.ts +13 -0
- package/dist/reactnative/nav/domain/Navigation.js +2 -0
- package/dist/reactnative/nav/domain/NavigationCommand.d.ts +14 -0
- package/dist/reactnative/nav/domain/NavigationCommand.js +2 -0
- package/dist/reactnative/nav/domain/Route.d.ts +12 -0
- package/dist/reactnative/nav/domain/Route.js +2 -0
- package/dist/reactnative/nav/domain/Routes.d.ts +6 -0
- package/dist/reactnative/nav/domain/Routes.js +74 -0
- package/dist/reactnative/nav/domain/Screen.d.ts +24 -0
- package/dist/reactnative/nav/domain/Screen.js +28 -0
- package/dist/reactnative/nav/domain/Skeleton.d.ts +26 -0
- package/dist/reactnative/nav/domain/Skeleton.js +2 -0
- package/dist/reactnative/nav/domain/Spec.d.ts +33 -0
- package/dist/reactnative/nav/domain/Spec.js +124 -0
- package/dist/reactnative/nav/domain/SpecSource.d.ts +21 -0
- package/dist/reactnative/nav/domain/SpecSource.js +28 -0
- package/dist/reactnative/nav/domain/Stack.d.ts +35 -0
- package/dist/reactnative/nav/domain/Stack.js +44 -0
- package/dist/reactnative/nav/domain/Tabs.d.ts +37 -0
- package/dist/reactnative/nav/domain/Tabs.js +45 -0
- package/dist/reactnative/nav/domain/icons/ImageIcon.d.ts +2 -0
- package/dist/reactnative/nav/domain/icons/ImageIcon.js +7 -0
- package/dist/reactnative/nav/domain/icons/LucideIcon.d.ts +2 -0
- package/dist/reactnative/nav/domain/icons/LucideIcon.js +7 -0
- package/dist/reactnative/nav/domain/icons/index.d.ts +2 -0
- package/dist/reactnative/nav/domain/icons/index.js +18 -0
- package/dist/reactnative/nav/domain/index.d.ts +14 -0
- package/dist/reactnative/nav/domain/index.js +30 -0
- package/dist/reactnative/nav/domain/sources/AbstractSpecSource.d.ts +23 -0
- package/dist/reactnative/nav/domain/sources/AbstractSpecSource.js +64 -0
- package/dist/reactnative/nav/domain/sources/StaticSpecSource.d.ts +9 -0
- package/dist/reactnative/nav/domain/sources/StaticSpecSource.js +16 -0
- package/dist/reactnative/nav/domain/sources/index.d.ts +2 -0
- package/dist/reactnative/nav/domain/sources/index.js +18 -0
- package/dist/reactnative/nav/rn/NavigationEngine.d.ts +1 -0
- package/dist/reactnative/nav/rn/NavigationEngine.js +155 -0
- package/dist/reactnative/nav/rn/NavigationScreen.d.ts +9 -0
- package/dist/reactnative/nav/rn/NavigationScreen.js +215 -0
- package/dist/reactnative/nav/rn/RNSpecProvider.d.ts +2 -0
- package/dist/reactnative/nav/rn/RNSpecProvider.js +30 -0
- package/dist/reactnative/nav/rn/RNSpecSource.d.ts +5 -0
- package/dist/reactnative/nav/rn/RNSpecSource.js +30 -0
- package/dist/reactnative/nav/rn/index.d.ts +4 -0
- package/dist/reactnative/nav/rn/index.js +20 -0
- package/dist/reactnative/profile/domain/Profile.d.ts +80 -0
- package/dist/reactnative/profile/domain/Profile.js +209 -0
- package/dist/reactnative/profile/domain/ProfileAppRequest.d.ts +15 -0
- package/dist/reactnative/profile/domain/ProfileAppRequest.js +12 -0
- package/dist/reactnative/profile/domain/ProfileStore.d.ts +65 -0
- package/dist/reactnative/profile/domain/ProfileStore.js +180 -0
- package/dist/reactnative/profile/domain/index.d.ts +3 -0
- package/dist/reactnative/profile/domain/index.js +19 -0
- package/dist/reactnative/push/domain/PushAppRequest.d.ts +13 -0
- package/dist/reactnative/push/domain/PushAppRequest.js +12 -0
- package/dist/reactnative/push/domain/PushStore.d.ts +7 -0
- package/dist/reactnative/push/domain/PushStore.js +9 -0
- package/dist/reactnative/push/domain/index.d.ts +2 -0
- package/dist/reactnative/push/domain/index.js +18 -0
- package/dist/reactnative/push/rn/PushClient.d.ts +32 -0
- package/dist/reactnative/push/rn/PushClient.js +247 -0
- package/dist/reactnative/push/rn/PushContext.d.ts +7 -0
- package/dist/reactnative/push/rn/PushContext.js +6 -0
- package/dist/reactnative/push/rn/PushProvider.d.ts +2 -0
- package/dist/reactnative/push/rn/PushProvider.js +45 -0
- package/dist/reactnative/push/rn/index.d.ts +3 -0
- package/dist/reactnative/push/rn/index.js +19 -0
- package/dist/reactnative/push/rn/usePushClient.d.ts +3 -0
- package/dist/reactnative/push/rn/usePushClient.js +40 -0
- package/dist/reactnative/rn.d.ts +7 -0
- package/dist/reactnative/rn.js +23 -0
- package/dist/reactnative/ui/rn/Tailwind.d.ts +175 -0
- package/dist/reactnative/ui/rn/Tailwind.js +211 -0
- package/dist/reactnative/ui/rn/atomic/Button.d.ts +97 -0
- package/dist/reactnative/ui/rn/atomic/Button.js +75 -0
- package/dist/reactnative/ui/rn/atomic/TextField.d.ts +112 -0
- package/dist/reactnative/ui/rn/atomic/TextField.js +135 -0
- package/dist/reactnative/ui/rn/atomic/index.d.ts +2 -0
- package/dist/reactnative/ui/rn/atomic/index.js +18 -0
- package/dist/reactnative/ui/rn/index.d.ts +1 -0
- package/dist/reactnative/ui/rn/index.js +17 -0
- package/dist/styles/rn/_index.css +2 -0
- package/dist/styles/rn/atomic/Button.css +54 -0
- package/dist/styles/rn/atomic/TextField.css +77 -0
- package/dist/styles/rn/atomic/_index.css +2 -0
- package/dist/styles/rn/base/_index.css +1 -0
- package/dist/styles/rn/base/tailwind.css +3 -0
- package/dist/styles/rn.css +1 -0
- package/dist/styles/web/_index.css +1 -0
- package/dist/styles/web/layout/SafeArea.css +17 -0
- package/dist/styles/web/layout/_index.css +1 -0
- package/dist/styles/web.css +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Transform } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { JsonValue } from 'type-fest';
|
|
3
|
+
export type BridgeMethod<TMethodName extends string = string> = {
|
|
4
|
+
name: TMethodName;
|
|
5
|
+
args: BridgeMethod.Args;
|
|
6
|
+
result: BridgeMethod.Result;
|
|
7
|
+
};
|
|
8
|
+
export declare namespace BridgeMethod {
|
|
9
|
+
type Args = Record<string, JsonValue>;
|
|
10
|
+
type Result = JsonValue;
|
|
11
|
+
type Signature<TMethod extends BridgeMethod = BridgeMethod> = Transform.Async<TMethod['args'], TMethod['result']>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Callback, IsometricError } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { BridgeEvent } from './BridgeEvent';
|
|
3
|
+
import { BridgeMethod } from './BridgeMethod';
|
|
4
|
+
export declare class BridgeMethodCall<TMethod extends BridgeMethod = BridgeMethod> {
|
|
5
|
+
readonly call: BridgeEvent.Call.Invoke<TMethod>;
|
|
6
|
+
private readonly _onResolve;
|
|
7
|
+
private readonly _onReject;
|
|
8
|
+
private _status;
|
|
9
|
+
constructor(args: BridgeMethodCall.ConstructorArgs<TMethod>);
|
|
10
|
+
get id(): string;
|
|
11
|
+
get method(): TMethod["name"];
|
|
12
|
+
get status(): BridgeMethodCall.Status;
|
|
13
|
+
resolve(result: TMethod['result']): Promise<void>;
|
|
14
|
+
reject(error: IsometricError): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace BridgeMethodCall {
|
|
17
|
+
type Status = 'pending' | 'resolved' | 'rejected';
|
|
18
|
+
type ConstructorArgs<TMethod extends BridgeMethod = BridgeMethod> = {
|
|
19
|
+
call: BridgeEvent.Call.Invoke<TMethod>;
|
|
20
|
+
onResolve: Callback.Async<TMethod['result']>;
|
|
21
|
+
onReject: Callback.Async<IsometricError>;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BridgeMethodCall = void 0;
|
|
4
|
+
// class
|
|
5
|
+
class BridgeMethodCall {
|
|
6
|
+
constructor(args) {
|
|
7
|
+
// initialize instance variables
|
|
8
|
+
this.call = args.call;
|
|
9
|
+
this._onResolve = args.onResolve;
|
|
10
|
+
this._onReject = args.onReject;
|
|
11
|
+
this._status = 'pending';
|
|
12
|
+
}
|
|
13
|
+
get id() {
|
|
14
|
+
return this.call.id;
|
|
15
|
+
}
|
|
16
|
+
get method() {
|
|
17
|
+
return this.call.method;
|
|
18
|
+
}
|
|
19
|
+
get status() {
|
|
20
|
+
return this._status;
|
|
21
|
+
}
|
|
22
|
+
async resolve(result) {
|
|
23
|
+
console.debug('[BridgeMethodCall] resolving call with:', result);
|
|
24
|
+
// mark as resolved
|
|
25
|
+
this._status = 'resolved';
|
|
26
|
+
// resolve
|
|
27
|
+
await this._onResolve(result);
|
|
28
|
+
}
|
|
29
|
+
async reject(error) {
|
|
30
|
+
console.debug('[BridgeMethodCall] rejecting call with:', error);
|
|
31
|
+
// mark as resolved
|
|
32
|
+
this._status = 'rejected';
|
|
33
|
+
// resolve
|
|
34
|
+
await this._onReject(error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.BridgeMethodCall = BridgeMethodCall;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { StringKeyOf } from 'type-fest';
|
|
2
|
+
import type { NavigationCommand } from '../../nav/domain';
|
|
3
|
+
import { BridgeConnection } from './BridgeConnection';
|
|
4
|
+
import { BridgeMethod } from './BridgeMethod';
|
|
5
|
+
export type BridgeMethods<TMethod extends BridgeMethod = BridgeMethod> = {
|
|
6
|
+
[TMethodName in TMethod['name']]: BridgeMethod<TMethodName>;
|
|
7
|
+
};
|
|
8
|
+
export declare namespace BridgeMethods {
|
|
9
|
+
type Signatures<TMethods extends BridgeMethods = BridgeMethods> = {
|
|
10
|
+
[TMethodName in StringKeyOf<TMethods>]: BridgeMethod.Signature<TMethods[TMethodName]>;
|
|
11
|
+
};
|
|
12
|
+
type ForName<TMethods extends BridgeMethods = BridgeMethods, TMethodName extends StringKeyOf<TMethods> = StringKeyOf<TMethods>> = ({
|
|
13
|
+
[TKey in TMethodName]: TMethods[TKey];
|
|
14
|
+
})[TMethodName];
|
|
15
|
+
type Handler<TMethods extends BridgeMethods = BridgeMethods, TMethodName extends StringKeyOf<TMethods> = StringKeyOf<TMethods>> = (method: TMethodName, args: Args<TMethods, TMethodName>) => Promise<Result<TMethods, TMethodName>>;
|
|
16
|
+
type Args<TMethods extends BridgeMethods, TMethodName extends StringKeyOf<TMethods>> = TMethods[TMethodName]['args'];
|
|
17
|
+
type Result<TMethods extends BridgeMethods, TMethodName extends StringKeyOf<TMethods>> = TMethods[TMethodName]['result'];
|
|
18
|
+
type Native<TMethods extends BridgeMethods = BridgeMethods> = TMethods & {
|
|
19
|
+
'app.connect': {
|
|
20
|
+
name: 'app.connect';
|
|
21
|
+
args: BridgeConnection.ConnectArgs;
|
|
22
|
+
result: true;
|
|
23
|
+
};
|
|
24
|
+
'app.hideSplash': {
|
|
25
|
+
name: 'app.hideSplash';
|
|
26
|
+
args: {};
|
|
27
|
+
result: true;
|
|
28
|
+
};
|
|
29
|
+
'app.navigate': {
|
|
30
|
+
name: 'app.navigate';
|
|
31
|
+
args: NavigationCommand;
|
|
32
|
+
result: true;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Insets } from '@nascentdigital/funnel-core';
|
|
2
|
+
import { Jsonify, JsonValue, StringKeyOf } from 'type-fest';
|
|
3
|
+
import type { Identity } from '../../identity/domain';
|
|
4
|
+
import type { Profile } from '../../profile/domain';
|
|
5
|
+
export type BridgeState<TState extends BridgeState.Custom = BridgeState.Custom> = BridgeState.Core & TState;
|
|
6
|
+
export declare namespace BridgeState {
|
|
7
|
+
type Core = {
|
|
8
|
+
identityData: Identity.Data | null;
|
|
9
|
+
profileData: Jsonify<Profile.Data> | null;
|
|
10
|
+
safeArea: Readonly<Insets>;
|
|
11
|
+
};
|
|
12
|
+
type Custom = Omit<Record<string, JsonValue>, keyof Core>;
|
|
13
|
+
type Key<TState extends Custom = Custom> = StringKeyOf<Core> | StringKeyOf<TState>;
|
|
14
|
+
type Value<TState extends Custom, TKey extends Key<TState>> = TKey extends StringKeyOf<Core> ? Core[TKey] : TState[TKey];
|
|
15
|
+
type ValueBroken<TState extends Custom, TKey extends Key<TState>> = ({
|
|
16
|
+
[K in keyof TState]: TState[K];
|
|
17
|
+
} & {
|
|
18
|
+
[K in keyof Core]: Core[K];
|
|
19
|
+
})[TKey];
|
|
20
|
+
type Change<TState extends Custom, TKey extends Key<TState> = Key<TState>> = {
|
|
21
|
+
key: TKey;
|
|
22
|
+
value: Value<TState, TKey>;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./BridgeConnection"), exports);
|
|
18
|
+
__exportStar(require("./BridgeConstants"), exports);
|
|
19
|
+
__exportStar(require("./BridgeEvent"), exports);
|
|
20
|
+
__exportStar(require("./BridgeMethod"), exports);
|
|
21
|
+
__exportStar(require("./BridgeMethodCall"), exports);
|
|
22
|
+
__exportStar(require("./BridgeMethods"), exports);
|
|
23
|
+
__exportStar(require("./BridgeState"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import './BridgeGlobals';
|
|
2
|
+
import { JsonValue, StringKeyOf } from 'type-fest';
|
|
3
|
+
import { BridgeConnection, BridgeMethods, BridgeState } from '../core';
|
|
4
|
+
export declare class Bridge<TState extends BridgeState.Custom = BridgeState.Custom, TNativeMethods extends BridgeMethods.Native = BridgeMethods.Native> {
|
|
5
|
+
private readonly _webViewId?;
|
|
6
|
+
private readonly _connection$;
|
|
7
|
+
private readonly _stateChange$;
|
|
8
|
+
private _state;
|
|
9
|
+
private readonly _deferredCalls;
|
|
10
|
+
private readonly _onNativeMethod;
|
|
11
|
+
constructor(args: Bridge.ConstructorArgs<TState, TNativeMethods>);
|
|
12
|
+
get isNative(): boolean;
|
|
13
|
+
get stateChange$(): import("rxjs").Observable<BridgeState.Change<TState, BridgeState.Key<TState>>>;
|
|
14
|
+
get connection$(): import("rxjs").Observable<BridgeConnection>;
|
|
15
|
+
get connection(): BridgeConnection;
|
|
16
|
+
private set connection(value);
|
|
17
|
+
get connected(): boolean;
|
|
18
|
+
get state(): BridgeState<TState>;
|
|
19
|
+
connect(): void;
|
|
20
|
+
disconnect(): void;
|
|
21
|
+
setState<TKey extends BridgeState.Key<TState>>(key: TKey, value: BridgeState.Value<TState, TKey>): boolean;
|
|
22
|
+
updateState<TKey extends BridgeState.Key<TState>>(key: TKey, value: BridgeState.Value<TState, TKey>): boolean;
|
|
23
|
+
call<TMethodName extends StringKeyOf<TNativeMethods>>(method: TMethodName, args?: BridgeMethods.Args<TNativeMethods, TMethodName>): Promise<BridgeMethods.Result<TNativeMethods, TMethodName>>;
|
|
24
|
+
onEvent(event: JsonValue): void;
|
|
25
|
+
private raiseEvent;
|
|
26
|
+
}
|
|
27
|
+
export declare namespace Bridge {
|
|
28
|
+
type ConstructorArgs<TState extends BridgeState.Custom = BridgeState.Custom, TNativeMethods extends BridgeMethods.Native = BridgeMethods.Native> = {
|
|
29
|
+
initialState: TState;
|
|
30
|
+
onNativeMethod: BridgeMethods.Handler<TNativeMethods>;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Bridge = void 0;
|
|
4
|
+
require("./BridgeGlobals");
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
const rxjs_1 = require("rxjs");
|
|
7
|
+
const core_1 = require("../core");
|
|
8
|
+
// class
|
|
9
|
+
class Bridge {
|
|
10
|
+
constructor(args) {
|
|
11
|
+
// initialize instances
|
|
12
|
+
this._webViewId = window[core_1.BridgeConstants.Window.bridgeId];
|
|
13
|
+
this._connection$ = new rxjs_1.BehaviorSubject('uninitialized');
|
|
14
|
+
this._stateChange$ = new rxjs_1.Subject();
|
|
15
|
+
this._state = Object.assign({ identityData: null, profileData: null, safeArea: funnel_core_1.Insets.none }, args.initialState);
|
|
16
|
+
this._deferredCalls = new Map();
|
|
17
|
+
this._onNativeMethod = args.onNativeMethod;
|
|
18
|
+
}
|
|
19
|
+
get isNative() {
|
|
20
|
+
return !!this._webViewId;
|
|
21
|
+
}
|
|
22
|
+
get stateChange$() {
|
|
23
|
+
return this._stateChange$.asObservable();
|
|
24
|
+
}
|
|
25
|
+
get connection$() {
|
|
26
|
+
return this._connection$.asObservable();
|
|
27
|
+
}
|
|
28
|
+
get connection() {
|
|
29
|
+
return this._connection$.getValue();
|
|
30
|
+
}
|
|
31
|
+
set connection(connection) {
|
|
32
|
+
this._connection$.next(connection);
|
|
33
|
+
}
|
|
34
|
+
get connected() {
|
|
35
|
+
return this.connection === 'ready';
|
|
36
|
+
}
|
|
37
|
+
get state() {
|
|
38
|
+
return this._state;
|
|
39
|
+
}
|
|
40
|
+
connect() {
|
|
41
|
+
console.debug('[Bridge] connecting bridge');
|
|
42
|
+
// throw if there's no webview
|
|
43
|
+
const { _webViewId } = this;
|
|
44
|
+
if (!_webViewId) {
|
|
45
|
+
throw new funnel_core_1.InvalidOperationError('Cannot connect() outside of RN application');
|
|
46
|
+
}
|
|
47
|
+
// update connection state
|
|
48
|
+
this.connection = 'initializing';
|
|
49
|
+
// bind bridge
|
|
50
|
+
window[core_1.BridgeConstants.Window.bridge] = this;
|
|
51
|
+
// sync state if it exists
|
|
52
|
+
const initialState = window[core_1.BridgeConstants.Window.initialState];
|
|
53
|
+
if (initialState) {
|
|
54
|
+
// TODO: update each different value
|
|
55
|
+
Object.entries(initialState).forEach(([key, value]) => {
|
|
56
|
+
this.updateState(key, value);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
console.debug('[Bridge] registering with remote proxy');
|
|
60
|
+
// send connect message to proxy
|
|
61
|
+
this.call('app.connect', { webViewId: _webViewId })
|
|
62
|
+
.then(() => {
|
|
63
|
+
console.debug('[Bridge] connecting bridge');
|
|
64
|
+
this.connection = 'ready';
|
|
65
|
+
})
|
|
66
|
+
.catch(e => {
|
|
67
|
+
console.error('[Bridge] bridge connection failed', e);
|
|
68
|
+
this.connection = 'error';
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
disconnect() {
|
|
72
|
+
console.log('[Bridge] disconnecting bridge');
|
|
73
|
+
// remove webview
|
|
74
|
+
// TODO: clear out any additional connections
|
|
75
|
+
// mark disconnected
|
|
76
|
+
this.connection = 'uninitialized';
|
|
77
|
+
}
|
|
78
|
+
setState(key, value) {
|
|
79
|
+
// skip if there's no local change
|
|
80
|
+
if (!this.updateState(key, value)) {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
// update remote state (native and other browsers)
|
|
84
|
+
this.raiseEvent({
|
|
85
|
+
__type: 'state.set',
|
|
86
|
+
key,
|
|
87
|
+
value
|
|
88
|
+
});
|
|
89
|
+
// indicate change
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
updateState(key, value) {
|
|
93
|
+
// skip if unchanged
|
|
94
|
+
const { _state, _stateChange$ } = this;
|
|
95
|
+
if (funnel_core_1.Value.equals(_state[key], value)) {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
// update local state
|
|
99
|
+
this._state = Object.assign(Object.assign({}, _state), { [key]: value });
|
|
100
|
+
_stateChange$.next({ key, value });
|
|
101
|
+
// indicate change
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
async call(method, args = {}) {
|
|
105
|
+
// throw if not native
|
|
106
|
+
const { _webViewId, _deferredCalls } = this;
|
|
107
|
+
if (!_webViewId) {
|
|
108
|
+
console.error('[Bridge] cannot find valid webview id');
|
|
109
|
+
throw new funnel_core_1.InvalidOperationError('Cannot call native methods on unbound proxy');
|
|
110
|
+
}
|
|
111
|
+
// wait until connected
|
|
112
|
+
// await firstValueFrom(this.connected$.pipe(filter(value => value)))
|
|
113
|
+
// create new deferral
|
|
114
|
+
const id = funnel_core_1.Value.uuid();
|
|
115
|
+
const deferral = new funnel_core_1.Deferral();
|
|
116
|
+
_deferredCalls.set(id, deferral);
|
|
117
|
+
// try to make the call
|
|
118
|
+
try {
|
|
119
|
+
console.debug(`[Bridge] invoking "${method}" with args`, args);
|
|
120
|
+
// send method call via event
|
|
121
|
+
this.raiseEvent({
|
|
122
|
+
__type: 'call.invocation',
|
|
123
|
+
webViewId: _webViewId,
|
|
124
|
+
id,
|
|
125
|
+
method,
|
|
126
|
+
args
|
|
127
|
+
});
|
|
128
|
+
// wait on the deferral (throw if it's an error)
|
|
129
|
+
const resultOrError = await deferral.promise;
|
|
130
|
+
if (resultOrError.__type === 'call.error') {
|
|
131
|
+
console.debug(`[Bridge] throwing completion for "${method}"`, resultOrError.error);
|
|
132
|
+
throw funnel_core_1.IsometricErrorUtils.deserializeError(resultOrError.error);
|
|
133
|
+
}
|
|
134
|
+
// or return result
|
|
135
|
+
else {
|
|
136
|
+
console.debug(`[Bridge] returning completion for "${method}"`, resultOrError.result);
|
|
137
|
+
return resultOrError.result;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// forward any thrown error
|
|
141
|
+
catch (e) {
|
|
142
|
+
console.error('[Bridge/call] call failed', e);
|
|
143
|
+
throw funnel_core_1.IsometricErrorUtils.coerceError(e);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
onEvent(event) {
|
|
147
|
+
// parse event (or skip if invalid)
|
|
148
|
+
if (!core_1.BridgeEvent.filter(event)) {
|
|
149
|
+
console.error('[Bridge] invalid bridge event', event);
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
console.log('[Bridge] handling onEvent:', event);
|
|
153
|
+
// process event
|
|
154
|
+
switch (event.__type) {
|
|
155
|
+
// capture state changes
|
|
156
|
+
case 'state.set':
|
|
157
|
+
this.setState(event.key, event.value);
|
|
158
|
+
break;
|
|
159
|
+
// call: resolve/throw
|
|
160
|
+
case 'call.result':
|
|
161
|
+
case 'call.error': {
|
|
162
|
+
// handle if originating from this bridge
|
|
163
|
+
const deferral = this._deferredCalls.get(event.id);
|
|
164
|
+
if (deferral) {
|
|
165
|
+
// clear deferral
|
|
166
|
+
this._deferredCalls.delete(event.id);
|
|
167
|
+
// resolve call
|
|
168
|
+
deferral.resolve(event);
|
|
169
|
+
}
|
|
170
|
+
// stop processing
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
raiseEvent(event) {
|
|
176
|
+
var _a;
|
|
177
|
+
if ((_a = window.ReactNativeWebView) === null || _a === void 0 ? void 0 : _a.postMessage) {
|
|
178
|
+
console.debug('[Bridge] raising event', event);
|
|
179
|
+
window.ReactNativeWebView.postMessage(JSON.stringify(event));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
exports.Bridge = Bridge;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BridgeState } from '../core';
|
|
2
|
+
import { Bridge } from './Bridge';
|
|
3
|
+
export declare const BridgeContext: import("react").Context<BridgeContext.Data<any>>;
|
|
4
|
+
export declare namespace BridgeContext {
|
|
5
|
+
type Data<TState extends BridgeState.Custom = BridgeState.Custom> = {
|
|
6
|
+
bridge?: Bridge<TState>;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BridgeConstants, BridgeState } from '../core';
|
|
2
|
+
import type { Bridge } from './Bridge';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
[BridgeConstants.Window.initialState]?: BridgeState;
|
|
6
|
+
[BridgeConstants.Window.bridgeId]?: string;
|
|
7
|
+
[BridgeConstants.Window.bridge]?: Bridge<any, any>;
|
|
8
|
+
ReactNativeWebView: {
|
|
9
|
+
postMessage?: (data: string) => void;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { BridgeState } from '../core';
|
|
3
|
+
import { Bridge } from './Bridge';
|
|
4
|
+
export declare function BridgeProvider<TState extends BridgeState.Custom = BridgeState.Custom>({ children, ...bridgePropsRaw }: BridgeProvider.Props<TState>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare namespace BridgeProvider {
|
|
6
|
+
type Props<TState extends BridgeState.Custom = BridgeState.Custom> = PropsWithChildren & Bridge.ConstructorArgs<TState>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.BridgeProvider = BridgeProvider;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const hooks_1 = require("@nascentdigital/funnel-ui/hooks");
|
|
17
|
+
const react_1 = require("react");
|
|
18
|
+
const Bridge_1 = require("./Bridge");
|
|
19
|
+
const BridgeContext_1 = require("./BridgeContext");
|
|
20
|
+
// component
|
|
21
|
+
function BridgeProvider(_a) {
|
|
22
|
+
var { children } = _a, bridgePropsRaw = __rest(_a, ["children"]);
|
|
23
|
+
// bind context
|
|
24
|
+
const bridgeProps = (0, hooks_1.useLatestValue)(bridgePropsRaw);
|
|
25
|
+
const bridge = (0, react_1.useMemo)(() => new Bridge_1.Bridge(bridgeProps), [bridgeProps]);
|
|
26
|
+
const context = (0, react_1.useMemo)(() => ({ bridge }), [bridge]);
|
|
27
|
+
// bind bridge
|
|
28
|
+
(0, react_1.useEffect)(() => {
|
|
29
|
+
// connect bridge
|
|
30
|
+
bridge.connect();
|
|
31
|
+
// disconnect on unmount
|
|
32
|
+
return () => bridge.disconnect();
|
|
33
|
+
}, [bridge]);
|
|
34
|
+
// render
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(BridgeContext_1.BridgeContext.Provider, { value: context, children: children }));
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("../core"), exports);
|
|
18
|
+
__exportStar(require("./Bridge"), exports);
|
|
19
|
+
__exportStar(require("./BridgeProvider"), exports);
|
|
20
|
+
__exportStar(require("./useBridge"), exports);
|
|
21
|
+
__exportStar(require("./useBridgeState"), exports);
|
|
22
|
+
__exportStar(require("./useSafeArea"), exports);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.usePossibleBridge = usePossibleBridge;
|
|
4
|
+
exports.useBridge = useBridge;
|
|
5
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
6
|
+
const hooks_1 = require("@nascentdigital/funnel-ui/hooks");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const BridgeContext_1 = require("./BridgeContext");
|
|
9
|
+
// hook
|
|
10
|
+
function usePossibleBridge() {
|
|
11
|
+
// bind context
|
|
12
|
+
const { bridge } = (0, react_1.useContext)(BridgeContext_1.BridgeContext);
|
|
13
|
+
const touch = (0, hooks_1.useTouch)();
|
|
14
|
+
// sync changes
|
|
15
|
+
(0, react_1.useEffect)(() => {
|
|
16
|
+
// skip if there's no bridge
|
|
17
|
+
if (!bridge) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// refresh when state changes
|
|
21
|
+
const subscriptions = [
|
|
22
|
+
bridge.stateChange$.subscribe(touch),
|
|
23
|
+
bridge.connection$.subscribe(touch)
|
|
24
|
+
];
|
|
25
|
+
// unsubscribe on unmount
|
|
26
|
+
return () => subscriptions.forEach(subscription => subscription.unsubscribe());
|
|
27
|
+
}, [bridge, touch]);
|
|
28
|
+
// return bridge (might be undefined)
|
|
29
|
+
return bridge;
|
|
30
|
+
}
|
|
31
|
+
function useBridge() {
|
|
32
|
+
// resolve bridge (or throw)
|
|
33
|
+
const bridge = usePossibleBridge();
|
|
34
|
+
if (!bridge) {
|
|
35
|
+
throw new funnel_core_1.InvalidOperationError('Cannot access bridge outside of BridgeProvider');
|
|
36
|
+
}
|
|
37
|
+
// forward result
|
|
38
|
+
return bridge;
|
|
39
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useBridgeState = useBridgeState;
|
|
4
|
+
const funnel_core_1 = require("@nascentdigital/funnel-core");
|
|
5
|
+
const hooks_1 = require("@nascentdigital/funnel-ui/hooks");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const BridgeContext_1 = require("./BridgeContext");
|
|
8
|
+
// hook
|
|
9
|
+
function useBridgeState(...keysRaw) {
|
|
10
|
+
// bind context
|
|
11
|
+
const keys = (0, hooks_1.useLatestValue)(keysRaw);
|
|
12
|
+
const { bridge } = (0, react_1.useContext)(BridgeContext_1.BridgeContext);
|
|
13
|
+
const [state, setState] = (0, react_1.useState)(() => {
|
|
14
|
+
var _a;
|
|
15
|
+
return Object.entries((_a = bridge === null || bridge === void 0 ? void 0 : bridge.state) !== null && _a !== void 0 ? _a : {})
|
|
16
|
+
.reduce((state, [keyRaw, value]) => {
|
|
17
|
+
// bind value (if mapped)
|
|
18
|
+
const key = keyRaw;
|
|
19
|
+
if (keys.includes(key)) {
|
|
20
|
+
state[key] = value;
|
|
21
|
+
}
|
|
22
|
+
// keep reducing
|
|
23
|
+
return state;
|
|
24
|
+
}, {});
|
|
25
|
+
});
|
|
26
|
+
// monitor keys
|
|
27
|
+
(0, react_1.useEffect)(() => {
|
|
28
|
+
// skip if there's no bridge
|
|
29
|
+
if (!bridge) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// update if value of key changes
|
|
33
|
+
const subscription = bridge.stateChange$.subscribe(change => setState(state => (Object.assign(Object.assign({}, state), { [change.key]: change.value }))));
|
|
34
|
+
// unsubscribe on unmount
|
|
35
|
+
return () => subscription.unsubscribe();
|
|
36
|
+
}, [bridge, keys]);
|
|
37
|
+
// throw if bridge isn't set
|
|
38
|
+
if (!bridge) {
|
|
39
|
+
throw new funnel_core_1.InvalidOperationError('Cannot access bridge outside of BridgeProvider');
|
|
40
|
+
}
|
|
41
|
+
// return state
|
|
42
|
+
return state;
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useSafeArea(): Readonly<import("@nascentdigital/funnel-core").Insets>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useSafeArea = useSafeArea;
|
|
4
|
+
const useBridgeState_1 = require("./useBridgeState");
|
|
5
|
+
// hook
|
|
6
|
+
function useSafeArea() {
|
|
7
|
+
// bind hooks
|
|
8
|
+
const { safeArea } = (0, useBridgeState_1.useBridgeState)('safeArea');
|
|
9
|
+
// return safe area
|
|
10
|
+
return safeArea;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Pagination } from '@nascentdigital/funnel-cms';
|
|
2
|
+
import { Schema } from '@nascentdigital/funnel-core';
|
|
3
|
+
import type { ContentAppRequest } from '../domain';
|
|
4
|
+
export declare class AppContentClient {
|
|
5
|
+
private readonly _apiToken?;
|
|
6
|
+
constructor(args: AppContentClient.ConstructorArgs);
|
|
7
|
+
getCollection<T extends Schema.Collection = Schema.Collection>(args: ContentAppRequest.GetCollection.Args): Promise<Schema.Collection.LinkedData.FromRef<T> | undefined>;
|
|
8
|
+
findCollection<T extends Schema.Collection = Schema.Collection>(args: ContentAppRequest.FindCollection.Args): Promise<Pagination.Paginated<Schema.Collection.LinkedData.FromRef<T>>>;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace AppContentClient {
|
|
11
|
+
type ConstructorArgs = {
|
|
12
|
+
apiToken?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|