react-native-unit-components 1.8.1 → 1.10.0
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/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +9 -12
- package/android/src/main/java/com/unitreactnativecomponents/appInfo/UNAppInfoModule.kt +59 -0
- package/android/src/main/java/com/unitreactnativecomponents/extensions/ContextExtensions.kt +35 -0
- package/ios/Extensions/Bundle+Extensions.swift +23 -0
- package/ios/UNAppInfo/IOSAppInfo.swift +47 -0
- package/ios/UNAppInfo/UNAppInfoExportModule.m +5 -2
- package/ios/UnitReactNativeComponents.xcodeproj/project.pbxproj +34 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +6 -4
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +6 -4
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/index.js +21 -0
- package/lib/commonjs/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +21 -15
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/index.js +27 -0
- package/lib/commonjs/components/UNAccountComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +17 -11
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/index.js +21 -0
- package/lib/commonjs/components/UNActivityComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +4 -2
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/index.js +21 -0
- package/lib/commonjs/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js +17 -0
- package/lib/commonjs/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js +14 -0
- package/lib/commonjs/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +34 -10
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +9 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/index.js +27 -0
- package/lib/commonjs/components/UNCardComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +4 -2
- package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/commonjs/components/UNCheckDepositComponent/index.js +21 -0
- package/lib/commonjs/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +86 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +41 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/index.js +21 -0
- package/lib/commonjs/components/UNMultipleCardsComponent/index.js.map +1 -0
- package/lib/commonjs/components/index.js +19 -8
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/flows/card/UNCardFlows.js +8 -4
- package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/helpers.js +34 -0
- package/lib/commonjs/helpers/pushProvisioningService/helpers.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js +49 -3
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +33 -0
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/commonjs/helpers/pushProvisioningService/types.js +41 -0
- package/lib/commonjs/helpers/pushProvisioningService/types.js.map +1 -0
- package/lib/commonjs/helpers/store/helpers.js +29 -0
- package/lib/commonjs/helpers/store/helpers.js.map +1 -0
- package/lib/commonjs/hooks/useListenerToEvent.js +26 -0
- package/lib/commonjs/hooks/useListenerToEvent.js.map +1 -0
- package/lib/commonjs/messages/webMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js +12 -0
- package/lib/commonjs/messages/webMessages/multipleCardsMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/onLoadMessage.js +2 -1
- package/lib/commonjs/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js +30 -6
- package/lib/commonjs/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +13 -1
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/slices/ConfigurationSlice.js +36 -0
- package/lib/commonjs/slices/ConfigurationSlice.js.map +1 -0
- package/lib/commonjs/slices/SharedEventsSlice.js +28 -0
- package/lib/commonjs/slices/SharedEventsSlice.js.map +1 -0
- package/lib/commonjs/slices/pushProvisioningSlice.js +28 -0
- package/lib/commonjs/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/commonjs/store/index.js +17 -0
- package/lib/commonjs/store/index.js.map +1 -0
- package/lib/commonjs/store/store.js +20 -0
- package/lib/commonjs/store/store.js.map +1 -0
- package/lib/commonjs/types/internal/errorHelpers.js +20 -0
- package/lib/commonjs/types/internal/errorHelpers.js.map +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js +1 -0
- package/lib/commonjs/types/internal/webComponent.types.js.map +1 -1
- package/lib/commonjs/types/shared/activity.types.js +7 -0
- package/lib/commonjs/types/shared/activity.types.js.map +1 -1
- package/lib/commonjs/types/shared/error.types.js +29 -0
- package/lib/commonjs/types/shared/error.types.js.map +1 -0
- package/lib/commonjs/types/shared/index.js +33 -0
- package/lib/commonjs/types/shared/index.js.map +1 -1
- package/lib/commonjs/types/shared/multipleCards.types.js +13 -0
- package/lib/commonjs/types/shared/multipleCards.types.js.map +1 -0
- package/lib/commonjs/types/shared/onLoadResponse.types.js +4 -0
- package/lib/commonjs/types/shared/onLoadResponse.types.js.map +1 -1
- package/lib/commonjs/types/shared/versioning.types.js +14 -0
- package/lib/commonjs/types/shared/versioning.types.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js +9 -14
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js +17 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +21 -22
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js +19 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/commonjs/utils/AppInfo.js +49 -0
- package/lib/commonjs/utils/AppInfo.js.map +1 -0
- package/lib/commonjs/utils/SDKInfo.js +13 -0
- package/lib/commonjs/utils/SDKInfo.js.map +1 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js +58 -0
- package/lib/commonjs/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +30 -32
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js +19 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +4 -0
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +5 -3
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/index.js +2 -0
- package/lib/module/components/UNACHCreditComponent/index.js.map +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +5 -3
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/index.js +2 -0
- package/lib/module/components/UNACHDebitComponent/index.js.map +1 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +19 -12
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +2 -2
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNAccountComponent/index.js +2 -0
- package/lib/module/components/UNAccountComponent/index.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +16 -9
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/index.js +2 -0
- package/lib/module/components/UNActivityComponent/index.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +3 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/index.js +2 -0
- package/lib/module/components/UNBookPaymentComponent/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +29 -13
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js} +16 -11
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/components/index.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/index.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/index.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js +34 -9
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +6 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCardComponent/index.js +2 -0
- package/lib/module/components/UNCardComponent/index.js.map +1 -0
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +3 -1
- package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -1
- package/lib/module/components/UNCheckDepositComponent/index.js +2 -0
- package/lib/module/components/UNCheckDepositComponent/index.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +77 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +33 -0
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -0
- package/lib/module/components/UNMultipleCardsComponent/index.js +2 -0
- package/lib/module/components/UNMultipleCardsComponent/index.js.map +1 -0
- package/lib/module/components/index.js +9 -8
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/flows/card/UNCardFlows.js +8 -3
- package/lib/module/flows/card/UNCardFlows.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/helpers.js +24 -0
- package/lib/module/helpers/pushProvisioningService/helpers.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js +50 -4
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js +26 -0
- package/lib/module/helpers/pushProvisioningService/hooks/useLaunchInitialize.js.map +1 -0
- package/lib/module/helpers/pushProvisioningService/types.js +34 -0
- package/lib/module/helpers/pushProvisioningService/types.js.map +1 -0
- package/lib/module/helpers/store/helpers.js +20 -0
- package/lib/module/helpers/store/helpers.js.map +1 -0
- package/lib/module/hooks/useListenerToEvent.js +19 -0
- package/lib/module/hooks/useListenerToEvent.js.map +1 -0
- package/lib/module/messages/webMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/multipleCardsMessage.js +5 -0
- package/lib/module/messages/webMessages/multipleCardsMessage.js.map +1 -0
- package/lib/module/messages/webMessages/onLoadMessage.js +2 -1
- package/lib/module/messages/webMessages/onLoadMessage.js.map +1 -1
- package/lib/module/networking/requests/UNWalletPayloadRequest.js +29 -6
- package/lib/module/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +10 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/slices/ConfigurationSlice.js +25 -0
- package/lib/module/slices/ConfigurationSlice.js.map +1 -0
- package/lib/module/slices/SharedEventsSlice.js +19 -0
- package/lib/module/slices/SharedEventsSlice.js.map +1 -0
- package/lib/module/slices/pushProvisioningSlice.js +19 -0
- package/lib/module/slices/pushProvisioningSlice.js.map +1 -0
- package/lib/module/store/index.js +2 -0
- package/lib/module/store/index.js.map +1 -0
- package/lib/module/store/store.js +12 -0
- package/lib/module/store/store.js.map +1 -0
- package/lib/module/types/internal/errorHelpers.js +12 -0
- package/lib/module/types/internal/errorHelpers.js.map +1 -0
- package/lib/module/types/internal/webComponent.types.js +1 -0
- package/lib/module/types/internal/webComponent.types.js.map +1 -1
- package/lib/module/types/shared/activity.types.js +5 -1
- package/lib/module/types/shared/activity.types.js.map +1 -1
- package/lib/module/types/shared/error.types.js +22 -0
- package/lib/module/types/shared/error.types.js.map +1 -0
- package/lib/module/types/shared/index.js +3 -0
- package/lib/module/types/shared/index.js.map +1 -1
- package/lib/module/types/shared/multipleCards.types.js +6 -0
- package/lib/module/types/shared/multipleCards.types.js.map +1 -0
- package/lib/module/types/shared/onLoadResponse.types.js +1 -1
- package/lib/module/types/shared/onLoadResponse.types.js.map +1 -1
- package/lib/module/types/shared/versioning.types.js +7 -0
- package/lib/module/types/shared/versioning.types.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js +9 -12
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdk.constants.js +10 -0
- package/lib/module/unitSdkManager/UnitSdk.constants.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +20 -19
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js +12 -0
- package/lib/module/unitSdkManager/UnitSdkManager.utils.internal.js.map +1 -0
- package/lib/module/utils/AppInfo.js +39 -0
- package/lib/module/utils/AppInfo.js.map +1 -0
- package/lib/module/utils/SDKInfo.js +5 -0
- package/lib/module/utils/SDKInfo.js.map +1 -0
- package/lib/module/utils/webVersioningStrategy.utils.js +48 -0
- package/lib/module/utils/webVersioningStrategy.utils.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +33 -34
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/WebComponent.utils.js +15 -0
- package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/module/webComponent/html.js +5 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.d.ts +3 -1
- package/lib/typescript/src/components/UNACHCreditComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.d.ts +3 -1
- package/lib/typescript/src/components/UNACHDebitComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.d.ts +3 -2
- package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.utils.d.ts +2 -2
- package/lib/typescript/src/components/UNAccountComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.d.ts +5 -1
- package/lib/typescript/src/components/UNActivityComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNBookPaymentComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +2 -1
- package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.d.ts +2 -2
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/components/index.d.ts +1 -0
- package/lib/typescript/src/components/UNBottomSheetComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.d.ts +4 -1
- package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.utils.d.ts +2 -0
- package/lib/typescript/src/components/UNCardComponent/index.d.ts +1 -0
- package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNCheckDepositComponent/index.d.ts +1 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts +15 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts +3 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts +9 -0
- package/lib/typescript/src/helpers/pushProvisioningService/helpers.d.ts +4 -0
- package/lib/typescript/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.d.ts +3 -0
- package/lib/typescript/src/helpers/pushProvisioningService/types.d.ts +49 -0
- package/lib/typescript/src/helpers/store/helpers.d.ts +3 -0
- package/lib/typescript/src/hooks/useListenerToEvent.d.ts +9 -0
- package/lib/typescript/{messages → src/messages}/webMessages/index.d.ts +3 -2
- package/lib/typescript/src/messages/webMessages/multipleCardsMessage.d.ts +6 -0
- package/lib/typescript/{messages → src/messages}/webMessages/onLoadMessage.d.ts +7 -3
- package/lib/typescript/src/networking/requests/UNWalletPayloadRequest.d.ts +2 -0
- package/lib/typescript/{scripts → src/scripts}/html/bodyScript.d.ts +2 -0
- package/lib/typescript/src/slices/ConfigurationSlice.d.ts +10 -0
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts +56 -0
- package/lib/typescript/src/slices/pushProvisioningSlice.d.ts +8 -0
- package/lib/typescript/src/store/index.d.ts +1 -0
- package/lib/typescript/src/store/store.d.ts +76 -0
- package/lib/typescript/src/types/internal/errorHelpers.d.ts +4 -0
- package/lib/typescript/{types → src/types}/internal/webComponent.types.d.ts +1 -0
- package/lib/typescript/{types → src/types}/shared/activity.types.d.ts +5 -1
- package/lib/typescript/src/types/shared/error.types.d.ts +36 -0
- package/lib/typescript/{types → src/types}/shared/index.d.ts +3 -0
- package/lib/typescript/src/types/shared/multipleCards.types.d.ts +6 -0
- package/lib/typescript/src/types/shared/onLoadResponse.types.d.ts +5 -0
- package/lib/typescript/src/types/shared/versioning.types.d.ts +22 -0
- package/lib/typescript/src/unitSdkManager/UnitSdk.api.d.ts +1 -0
- package/lib/typescript/src/unitSdkManager/UnitSdk.constants.d.ts +8 -0
- package/lib/typescript/{unitSdkManager → src/unitSdkManager}/UnitSdkManager.d.ts +11 -10
- package/lib/typescript/src/unitSdkManager/UnitSdkManager.utils.internal.d.ts +3 -0
- package/lib/typescript/src/utils/AppInfo.d.ts +4 -0
- package/lib/typescript/src/utils/SDKInfo.d.ts +1 -0
- package/lib/typescript/src/utils/webVersioningStrategy.utils.d.ts +5 -0
- package/lib/typescript/{webComponent → src/webComponent}/WebComponent.utils.d.ts +3 -0
- package/package.json +8 -6
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +7 -3
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -0
- package/src/components/UNACHCreditComponent/index.ts +1 -0
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +7 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -0
- package/src/components/UNACHDebitComponent/index.ts +1 -0
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +30 -14
- package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +2 -2
- package/src/components/UNAccountComponent/index.ts +1 -0
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +37 -17
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +4 -1
- package/src/components/UNActivityComponent/index.ts +1 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +4 -1
- package/src/components/UNBookPaymentComponent/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +59 -32
- package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.tsx → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.tsx} +18 -13
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/components/index.ts +1 -0
- package/src/components/UNBottomSheetComponent/index.ts +1 -0
- package/src/components/UNCardComponent/UNCardComponent.tsx +51 -14
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +7 -0
- package/src/components/UNCardComponent/index.ts +1 -0
- package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +4 -1
- package/src/components/UNCheckDepositComponent/index.ts +1 -0
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.tsx +119 -0
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.ts +36 -0
- package/src/components/UNMultipleCardsComponent/index.ts +3 -0
- package/src/components/index.ts +9 -8
- package/src/flows/card/UNCardFlows.ts +10 -4
- package/src/helpers/pushProvisioningService/helpers.ts +31 -0
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +46 -7
- package/src/helpers/pushProvisioningService/hooks/useLaunchInitialize.ts +29 -0
- package/src/helpers/pushProvisioningService/types.ts +52 -0
- package/src/helpers/store/helpers.tsx +22 -0
- package/src/hooks/useListenerToEvent.ts +32 -0
- package/src/messages/webMessages/index.ts +3 -0
- package/src/messages/webMessages/multipleCardsMessage.ts +9 -0
- package/src/messages/webMessages/onLoadMessage.ts +14 -3
- package/src/networking/requests/UNWalletPayloadRequest.ts +30 -7
- package/src/scripts/html/bodyScript.ts +13 -1
- package/src/slices/ConfigurationSlice.ts +31 -0
- package/src/slices/SharedEventsSlice.ts +93 -0
- package/src/slices/pushProvisioningSlice.ts +24 -0
- package/src/store/index.ts +1 -0
- package/src/store/store.ts +14 -0
- package/src/types/internal/errorHelpers.ts +22 -0
- package/src/types/internal/webComponent.types.ts +1 -1
- package/src/types/shared/activity.types.ts +6 -1
- package/src/types/shared/error.types.ts +38 -0
- package/src/types/shared/index.ts +3 -0
- package/src/types/shared/multipleCards.types.ts +8 -0
- package/src/types/shared/onLoadResponse.types.ts +2 -12
- package/src/types/shared/versioning.types.ts +28 -0
- package/src/unitSdkManager/UnitSdk.api.ts +10 -10
- package/src/unitSdkManager/UnitSdk.constants.ts +11 -0
- package/src/unitSdkManager/UnitSdkManager.ts +21 -24
- package/src/unitSdkManager/UnitSdkManager.utils.internal.ts +13 -0
- package/src/utils/AppInfo.ts +40 -0
- package/src/utils/SDKInfo.ts +5 -0
- package/src/utils/webVersioningStrategy.utils.ts +52 -0
- package/src/webComponent/WebComponent.tsx +37 -34
- package/src/webComponent/WebComponent.utils.ts +17 -0
- package/src/webComponent/html.ts +16 -2
- package/android/src/main/java/com/unitreactnativecomponents/getapplicationid/UNAppInfoModule.kt +0 -35
- package/ios/UNAppInfo/UNAppInfo.swift +0 -23
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- package/lib/commonjs/components/utils/nativeModulesInfo.js +0 -20
- package/lib/commonjs/components/utils/nativeModulesInfo.js.map +0 -1
- package/lib/commonjs/helpers/EventBus.js +0 -58
- package/lib/commonjs/helpers/EventBus.js.map +0 -1
- package/lib/commonjs/hooks/listenerToBus.js +0 -34
- package/lib/commonjs/hooks/listenerToBus.js.map +0 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +0 -1
- package/lib/module/components/utils/nativeModulesInfo.js +0 -13
- package/lib/module/components/utils/nativeModulesInfo.js.map +0 -1
- package/lib/module/helpers/EventBus.js +0 -51
- package/lib/module/helpers/EventBus.js.map +0 -1
- package/lib/module/hooks/listenerToBus.js +0 -25
- package/lib/module/hooks/listenerToBus.js.map +0 -1
- package/lib/typescript/components/index.d.ts +0 -8
- package/lib/typescript/components/utils/nativeModulesInfo.d.ts +0 -1
- package/lib/typescript/helpers/EventBus.d.ts +0 -13
- package/lib/typescript/hooks/listenerToBus.d.ts +0 -7
- package/lib/typescript/networking/requests/UNWalletPayloadRequest.d.ts +0 -2
- package/lib/typescript/types/shared/onLoadResponse.types.d.ts +0 -14
- package/lib/typescript/unitSdkManager/UnitSdk.api.d.ts +0 -3
- package/src/components/utils/nativeModulesInfo.ts +0 -11
- package/src/helpers/EventBus.ts +0 -58
- package/src/hooks/listenerToBus.ts +0 -31
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/commonjs/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js} +0 -0
- /package/lib/module/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.js.map → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.js.map} +0 -0
- /package/lib/typescript/{assets → src/assets}/images/index.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.styles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +0 -0
- /package/lib/typescript/{components/UNBottomSheetComponent/components → src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem}/UNAddToWalletBottomSheetItem.styles.d.ts +0 -0
- /package/lib/typescript/{components → src/components}/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +0 -0
- /package/lib/typescript/{flows → src/flows}/UNFlows.d.ts +0 -0
- /package/lib/typescript/{flows → src/flows}/card/UNCardFlows.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/BottomSheet/BottomSheet.styles.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/hooks/useCardWallet.d.ts +0 -0
- /package/lib/typescript/{helpers → src/helpers}/pushProvisioningService/startProvisioning.d.ts +0 -0
- /package/lib/typescript/{hooks → src/hooks}/useAppStateListener.d.ts +0 -0
- /package/lib/typescript/{index.d.ts → src/index.d.ts} +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/bottomSheetMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/cardMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/index.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/nativeMessages/sdkMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/accountMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/achCreditMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/activityMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/bookPaymentMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/cardMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/checkMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/pageMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/paymentsMessage.d.ts +0 -0
- /package/lib/typescript/{messages → src/messages}/webMessages/unitMessages.d.ts +0 -0
- /package/lib/typescript/{nativeComponent → src/nativeComponent}/UnitAddToWalletButton.d.ts +0 -0
- /package/lib/typescript/{networking → src/networking}/common/UNNetworkConstants.d.ts +0 -0
- /package/lib/typescript/{scripts → src/scripts}/html/bodyHtml.d.ts +0 -0
- /package/lib/typescript/{scripts → src/scripts}/html/fontFaces.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/fonts.d.ts +0 -0
- /package/lib/typescript/{styles → src/styles}/variables.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/internal/bottomSheet.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/account.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/achCredit.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/authorization.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/bookPayment.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/card.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/checkDeposit.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/fonts.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/payments.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/transactions.types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/types.d.ts +0 -0
- /package/lib/typescript/{types → src/types}/shared/wallet.types.d.ts +0 -0
- /package/lib/typescript/{unitSdkManager → src/unitSdkManager}/unitUiManager/unitUiManager.d.ts +0 -0
- /package/lib/typescript/{webComponent → src/webComponent}/WebComponent.d.ts +0 -0
- /package/lib/typescript/{webComponent → src/webComponent}/html.d.ts +0 -0
- /package/src/components/UNBottomSheetComponent/components/{UNAddToWalletBottomSheetItem.styles.ts → UNAddToWalletBottomSheetItem/UNAddToWalletBottomSheetItem.styles.ts} +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { UNVersioningStrategyType } from '../types/shared';
|
|
2
|
+
import { UNSDKConstants } from '../unitSdkManager/UnitSdk.constants';
|
|
3
|
+
export const getWebSdkVersionString = webVersioningStrategy => {
|
|
4
|
+
switch (webVersioningStrategy.type) {
|
|
5
|
+
case UNVersioningStrategyType.exact:
|
|
6
|
+
return `${webVersioningStrategy.major}.${webVersioningStrategy.minor}.${webVersioningStrategy.patch}`;
|
|
7
|
+
case UNVersioningStrategyType.upToNextMinor:
|
|
8
|
+
return `${webVersioningStrategy.major}.${webVersioningStrategy.minor}`;
|
|
9
|
+
case UNVersioningStrategyType.upToNextMajor:
|
|
10
|
+
return `${webVersioningStrategy.major}`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export const getVersionArray = webVersioningStrategy => {
|
|
14
|
+
switch (webVersioningStrategy.type) {
|
|
15
|
+
case UNVersioningStrategyType.exact:
|
|
16
|
+
return [webVersioningStrategy.major, webVersioningStrategy.minor, webVersioningStrategy.patch];
|
|
17
|
+
case UNVersioningStrategyType.upToNextMinor:
|
|
18
|
+
return [webVersioningStrategy.major, webVersioningStrategy.minor, null];
|
|
19
|
+
case UNVersioningStrategyType.upToNextMajor:
|
|
20
|
+
return [webVersioningStrategy.major, null, null];
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export const isBehindRecommendedStrategy = currentWebVersioningStrategy => {
|
|
24
|
+
const recommendedWebVersionArray = getVersionArray(UNSDKConstants.webSDKRecommendedStrategy);
|
|
25
|
+
const currentWebVersionArray = getVersionArray(currentWebVersioningStrategy);
|
|
26
|
+
for (let i = 0; i < 3; i++) {
|
|
27
|
+
let currentVersion = currentWebVersionArray[i];
|
|
28
|
+
let recommendedVersion = recommendedWebVersionArray[i];
|
|
29
|
+
if (currentVersion === null || recommendedVersion === null) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
currentVersion = currentVersion;
|
|
33
|
+
recommendedVersion = recommendedVersion;
|
|
34
|
+
if (currentVersion !== recommendedVersion) {
|
|
35
|
+
return currentVersion < recommendedVersion;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return false;
|
|
39
|
+
};
|
|
40
|
+
export const warnClientIfNeeded = currentWebVersioningStrategy => {
|
|
41
|
+
if (currentWebVersioningStrategy.major > UNSDKConstants.webSDKRecommendedStrategy.major) {
|
|
42
|
+
console.log(`The current web sdk version is ${getWebSdkVersionString(currentWebVersioningStrategy)} which is higher than the latest supported version ${getWebSdkVersionString(UNSDKConstants.webSDKRecommendedStrategy)}. Please update the latest version of the web sdk.`);
|
|
43
|
+
}
|
|
44
|
+
if (isBehindRecommendedStrategy(currentWebVersioningStrategy)) {
|
|
45
|
+
console.log(`The current web sdk version is ${getWebSdkVersionString(currentWebVersioningStrategy)} which is older than the latest supported version ${getWebSdkVersionString(UNSDKConstants.webSDKRecommendedStrategy)}. Please consider updating to the latest version of the web sdk.`);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=webVersioningStrategy.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNVersioningStrategyType","UNSDKConstants","getWebSdkVersionString","webVersioningStrategy","type","exact","major","minor","patch","upToNextMinor","upToNextMajor","getVersionArray","isBehindRecommendedStrategy","currentWebVersioningStrategy","recommendedWebVersionArray","webSDKRecommendedStrategy","currentWebVersionArray","i","currentVersion","recommendedVersion","warnClientIfNeeded","console","log"],"sources":["webVersioningStrategy.utils.ts"],"sourcesContent":["import { UNVersioningStrategyType, UNWebVersioningStrategy } from '../types/shared';\nimport { UNSDKConstants } from '../unitSdkManager/UnitSdk.constants';\n\nexport const getWebSdkVersionString = (webVersioningStrategy: UNWebVersioningStrategy) => {\n switch (webVersioningStrategy.type) {\n case UNVersioningStrategyType.exact:\n return `${webVersioningStrategy.major}.${webVersioningStrategy.minor}.${webVersioningStrategy.patch}`;\n case UNVersioningStrategyType.upToNextMinor:\n return `${webVersioningStrategy.major}.${webVersioningStrategy.minor}`;\n case UNVersioningStrategyType.upToNextMajor:\n return `${webVersioningStrategy.major}`;\n }\n};\n\nexport const getVersionArray = (webVersioningStrategy: UNWebVersioningStrategy) => {\n switch (webVersioningStrategy.type) {\n case UNVersioningStrategyType.exact:\n return [webVersioningStrategy.major, webVersioningStrategy.minor, webVersioningStrategy.patch];\n case UNVersioningStrategyType.upToNextMinor:\n return [webVersioningStrategy.major, webVersioningStrategy.minor, null];\n case UNVersioningStrategyType.upToNextMajor:\n return [webVersioningStrategy.major, null, null];\n }\n};\n\nexport const isBehindRecommendedStrategy = (currentWebVersioningStrategy: UNWebVersioningStrategy) => {\n const recommendedWebVersionArray = getVersionArray(UNSDKConstants.webSDKRecommendedStrategy);\n const currentWebVersionArray = getVersionArray(currentWebVersioningStrategy);\n\n for (let i = 0; i < 3; i++) {\n let currentVersion = currentWebVersionArray[i];\n let recommendedVersion = recommendedWebVersionArray[i];\n if (currentVersion === null || recommendedVersion === null) {\n return false;\n }\n currentVersion = currentVersion as number;\n recommendedVersion = recommendedVersion as number;\n if (currentVersion !== recommendedVersion) {\n return currentVersion < recommendedVersion;\n }\n }\n return false;\n};\n\nexport const warnClientIfNeeded = (currentWebVersioningStrategy: UNWebVersioningStrategy) => {\n if (currentWebVersioningStrategy.major > UNSDKConstants.webSDKRecommendedStrategy.major) {\n console.log(`The current web sdk version is ${getWebSdkVersionString(currentWebVersioningStrategy)} which is higher than the latest supported version ${getWebSdkVersionString(UNSDKConstants.webSDKRecommendedStrategy)}. Please update the latest version of the web sdk.`);\n }\n if (isBehindRecommendedStrategy(currentWebVersioningStrategy)) {\n console.log(`The current web sdk version is ${getWebSdkVersionString(currentWebVersioningStrategy)} which is older than the latest supported version ${getWebSdkVersionString(UNSDKConstants.webSDKRecommendedStrategy)}. Please consider updating to the latest version of the web sdk.`);\n }\n};\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAiC,iBAAiB;AACnF,SAASC,cAAc,QAAQ,qCAAqC;AAEpE,OAAO,MAAMC,sBAAsB,GAAIC,qBAA8C,IAAK;EACxF,QAAQA,qBAAqB,CAACC,IAAI;IAChC,KAAKJ,wBAAwB,CAACK,KAAK;MACjC,OAAQ,GAAEF,qBAAqB,CAACG,KAAM,IAAGH,qBAAqB,CAACI,KAAM,IAAGJ,qBAAqB,CAACK,KAAM,EAAC;IACvG,KAAKR,wBAAwB,CAACS,aAAa;MACzC,OAAQ,GAAEN,qBAAqB,CAACG,KAAM,IAAGH,qBAAqB,CAACI,KAAM,EAAC;IACxE,KAAKP,wBAAwB,CAACU,aAAa;MACzC,OAAQ,GAAEP,qBAAqB,CAACG,KAAM,EAAC;EAAC;AAE9C,CAAC;AAED,OAAO,MAAMK,eAAe,GAAIR,qBAA8C,IAAK;EACjF,QAAQA,qBAAqB,CAACC,IAAI;IAChC,KAAKJ,wBAAwB,CAACK,KAAK;MACjC,OAAO,CAACF,qBAAqB,C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AA2B,CAACC,4BAA4B,CAAC,EAAE;IAC7DQ,OAAO,CAACC,GAAG,CAAE,kCAAiCpB,sBAAsB,CAACW,4BAA4B,CAAE,qDAAoDX,sBAAsB,CAACD,cAAc,CAACc,yBAAyB,CAAE,kEAAiE,CAAC;EAC5R;AACF,CAAC"}
|
|
@@ -1,48 +1,32 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { Platform } from 'react-native';
|
|
4
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
4
5
|
import { WebView } from 'react-native-webview';
|
|
5
|
-
import EventBus from '../helpers/EventBus';
|
|
6
6
|
import html, { HTML_PLACEHOLDER } from './html';
|
|
7
7
|
import { UnitMessage } from '../messages/webMessages/unitMessages';
|
|
8
|
-
import { useListenerToBus } from '../hooks/listenerToBus';
|
|
9
8
|
import { getHtmlBody } from '../scripts/html/bodyHtml';
|
|
10
|
-
import { fetchUnitScript
|
|
9
|
+
import { fetchUnitScript } from '../unitSdkManager/UnitSdk.api';
|
|
11
10
|
import { UnitSDK } from '../unitSdkManager/UnitSdkManager';
|
|
12
|
-
import {
|
|
13
|
-
import { handleRequestDownload } from './WebComponent.utils';
|
|
11
|
+
import { getInfoParams, handleRequestDownload } from './WebComponent.utils';
|
|
14
12
|
import { getFontFacesString } from '../scripts/html/fontFaces';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
} = NativeModules;
|
|
13
|
+
import { setEvent } from '../slices/SharedEventsSlice';
|
|
14
|
+
import * as AppInfo from '../utils/AppInfo';
|
|
18
15
|
export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(props, webRef) {
|
|
19
|
-
const
|
|
16
|
+
const dispatch = useDispatch();
|
|
17
|
+
const unitScript = useSelector(state => state.configuration.unitScript);
|
|
18
|
+
const globalTheme = useSelector(state => state.configuration.theme);
|
|
19
|
+
const globalLanguage = useSelector(state => state.configuration.language);
|
|
20
20
|
const [sourceHtml, setSourceHtml] = useState(null);
|
|
21
|
-
const [componentCurrentTheme, setComponentCurrentTheme] = useState(props.theme ?? UnitSDK.getTheme());
|
|
22
|
-
const [componentCurrentLanguage, setComponentCurrentLanguage] = useState(props.language ?? UnitSDK.getLanguage());
|
|
23
21
|
const [baseName, setBaseName] = useState();
|
|
24
|
-
const
|
|
25
|
-
setUnitScript(data.unitScript);
|
|
26
|
-
};
|
|
27
|
-
const updateInitializedParams = () => {
|
|
28
|
-
setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());
|
|
29
|
-
setComponentCurrentLanguage(props.language ?? UnitSDK.getLanguage());
|
|
30
|
-
};
|
|
31
|
-
useListenerToBus({
|
|
32
|
-
busEventKey: SDKMessage.IS_SCRIPT_FETCHED,
|
|
33
|
-
action: updateUnitScript
|
|
34
|
-
});
|
|
35
|
-
useListenerToBus({
|
|
36
|
-
busEventKey: SDKMessage.IS_SDK_INITIALIZED,
|
|
37
|
-
action: updateInitializedParams
|
|
38
|
-
});
|
|
22
|
+
const [infoParams, setInfoParams] = useState({});
|
|
39
23
|
useEffect(() => {
|
|
40
24
|
const getAppName = async () => {
|
|
41
25
|
// For iOS, we extend the app name from the HTML to display a prettier access request message.
|
|
42
26
|
// On Android, there is no request message sent from HTML.
|
|
43
27
|
try {
|
|
44
28
|
if (Platform.OS == 'ios') {
|
|
45
|
-
const name = await
|
|
29
|
+
const name = await AppInfo.getAppName();
|
|
46
30
|
setBaseName(name.replace(/ /g, '-'));
|
|
47
31
|
} else {
|
|
48
32
|
// android
|
|
@@ -52,32 +36,47 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
52
36
|
console.error(error);
|
|
53
37
|
}
|
|
54
38
|
};
|
|
39
|
+
const updateInfoParams = async () => {
|
|
40
|
+
const infoParams = await getInfoParams();
|
|
41
|
+
setInfoParams(infoParams);
|
|
42
|
+
};
|
|
55
43
|
getAppName();
|
|
44
|
+
updateInfoParams();
|
|
56
45
|
}, []);
|
|
57
46
|
useEffect(() => {
|
|
58
47
|
if (!unitScript) {
|
|
59
48
|
fetchUnitScript();
|
|
60
49
|
return;
|
|
61
50
|
}
|
|
51
|
+
const componentCurrentTheme = props.theme ?? globalTheme;
|
|
52
|
+
const componentCurrentLanguage = props.language ?? globalLanguage;
|
|
62
53
|
const themeParam = componentCurrentTheme ? ` theme="${componentCurrentTheme}"` : '';
|
|
63
54
|
const languageParam = componentCurrentLanguage ? ` language="${componentCurrentLanguage}"` : '';
|
|
64
55
|
const componentParams = (props.params || '') + themeParam + languageParam;
|
|
65
56
|
const fontFaces = getFontFacesString(UnitSDK.getFonts());
|
|
57
|
+
const windowInfoParams = `window.UnitMobileSDKConfig['info'] = ${JSON.stringify(infoParams)}`;
|
|
58
|
+
const windowParams = `${windowInfoParams}; ${props.windowParams || ''}`;
|
|
66
59
|
let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));
|
|
67
60
|
newHtml = newHtml.replace(HTML_PLACEHOLDER.FONT_FACES, fontFaces);
|
|
68
61
|
newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');
|
|
69
|
-
newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS,
|
|
62
|
+
newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, windowParams);
|
|
70
63
|
setSourceHtml(newHtml);
|
|
71
|
-
}, [props.params, unitScript, props.presentationMode,
|
|
64
|
+
}, [props.params, unitScript, props.presentationMode, props.script, props.windowParams, globalTheme, globalLanguage, infoParams]);
|
|
72
65
|
const onMessage = e => {
|
|
73
66
|
const message = JSON.parse(e.nativeEvent.data);
|
|
74
67
|
switch (message.type) {
|
|
75
68
|
case UnitMessage.UNIT_REQUEST_REFRESH:
|
|
76
|
-
message.details &&
|
|
69
|
+
message.details && dispatch(setEvent({
|
|
70
|
+
key: UnitMessage.UNIT_REQUEST_REFRESH,
|
|
71
|
+
data: message.details
|
|
72
|
+
}));
|
|
77
73
|
break;
|
|
78
74
|
case UnitMessage.UNIT_REQUEST_DOWNLOAD:
|
|
79
75
|
message.details && handleRequestDownload(message.details, () => {
|
|
80
|
-
|
|
76
|
+
dispatch(setEvent({
|
|
77
|
+
key: UnitMessage.UNIT_REQUEST_CLOSE_FLOW,
|
|
78
|
+
data: {}
|
|
79
|
+
}));
|
|
81
80
|
});
|
|
82
81
|
break;
|
|
83
82
|
default:
|
|
@@ -89,7 +88,6 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
89
88
|
if (props.handleScroll) {
|
|
90
89
|
props.handleScroll(event);
|
|
91
90
|
}
|
|
92
|
-
return null;
|
|
93
91
|
};
|
|
94
92
|
if (!baseName) {
|
|
95
93
|
return null;
|
|
@@ -116,7 +114,8 @@ export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(
|
|
|
116
114
|
baseUrl: Platform.OS === 'android' ? `https://${baseName}` : ''
|
|
117
115
|
},
|
|
118
116
|
onMessage: onMessage,
|
|
119
|
-
|
|
117
|
+
androidLayerType: "hardware",
|
|
118
|
+
webviewDebuggingEnabled: __DEV__
|
|
120
119
|
});
|
|
121
120
|
});
|
|
122
121
|
//# sourceMappingURL=WebComponent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","NativeModules","Platform","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","getFontFacesString","UNAppInfo","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","componentCurrentLanguage","setComponentCurrentLanguage","language","getLanguage","baseName","setBaseName","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","getAppName","OS","name","getBundleName","replace","error","console","themeParam","languageParam","componentParams","params","fontFaces","getFonts","newHtml","BODY","type","valueOf","presentationMode","FONT_FACES","SCRIPT_FROM_NATIVE","script","WINDOW_PARAMS","windowParams","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","ref","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","width","flex","opacity","backgroundColor","source","baseUrl","androidHardwareAccelerationDisabled"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { NativeModules, Platform } from 'react-native';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\nimport type { PresentationMode, WebComponentType } from '../types/internal/webComponent.types';\nimport { getFontFacesString } from '../scripts/html/fontFaces';\n\nconst { UNAppInfo } = NativeModules;\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n language?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n windowParams?: string;\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const [componentCurrentLanguage, setComponentCurrentLanguage] = useState<string | undefined>(props.language ?? UnitSDK.getLanguage());\n const [baseName, setBaseName] = useState<string>();\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n setComponentCurrentLanguage(props.language ?? UnitSDK.getLanguage());\n };\n\n useListenerToBus({ busEventKey: SDKMessage.IS_SCRIPT_FETCHED, action: updateUnitScript });\n useListenerToBus({ busEventKey: SDKMessage.IS_SDK_INITIALIZED, action: updateInitializedParams });\n\n useEffect(() => {\n\n const getAppName = async () => {\n // For iOS, we extend the app name from the HTML to display a prettier access request message.\n // On Android, there is no request message sent from HTML.\n try {\n if (Platform.OS == 'ios') {\n const name = await UNAppInfo.getBundleName();\n setBaseName(name.replace(/ /g, '-'));\n } else { // android\n setBaseName('unit');\n }\n } catch (error: any) {\n console.error(error);\n }\n };\n\n getAppName();\n }, []);\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const themeParam = componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '';\n const languageParam = componentCurrentLanguage ? ` language=\"${componentCurrentLanguage}\"` : '';\n\n const componentParams = (props.params || '') + themeParam + languageParam;\n\n const fontFaces = getFontFacesString(UnitSDK.getFonts());\n\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.FONT_FACES, fontFaces);\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, props.windowParams || '');\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, componentCurrentTheme, componentCurrentLanguage, props.script, props.windowParams]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW, {});\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n\n return null;\n };\n\n if (!baseName) {\n return null;\n }\n\n return (\n <WebView\n ref={webRef}\n originWhitelist={['*']}\n mediaPlaybackRequiresUserAction={false}\n allowsInlineMediaPlayback={true}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode=\"never\"\n injectedJavaScript={unitScript}\n style={{ width: '100%', flex: 1, opacity: 0.99, backgroundColor: 'transparent' }}\n source={{ html: sourceHtml, baseUrl: Platform.OS === 'android' ? `https://${baseName}` : ''}}\n onMessage={onMessage}\n androidHardwareAccelerationDisabled\n />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AACtD,SAASC,OAAO,QAA6B,sBAAsB;AACnE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,IAAIC,gBAAgB,QAAQ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KAAK,CAAC8C,SAAS,IAAI9C,KAAK,CAAC8C,SAAS,CAACE,OAAO,CAAC;IAAC;EAElD,CAAC;EAED,IAAI,CAAC5C,UAAU,EAAE,OAAO,IAAI;EAE5B,MAAMsD,SAAS,GAAIH,KAAU,IAAK;IAChC,IAAIvD,KAAK,CAAC2D,YAAY,EAAE;MACtB3D,KAAK,CAAC2D,YAAY,CAACJ,KAAK,CAAC;IAC3B;IAEA,OAAO,IAAI;EACb,CAAC;EAED,IAAI,CAACzC,QAAQ,EAAE;IACb,OAAO,IAAI;EACb;EAEA,oBACEnC,KAAA,CAAAiF,aAAA,CAAC5E,OAAO;IACN6E,GAAG,EAAE5D,MAAO;IACZ6D,eAAe,EAAE,CAAC,GAAG,CAAE;IACvBC,+BAA+B,EAAE,KAAM;IACvCC,yBAAyB,EAAE,IAAK;IAChCC,YAAY,EAAE,KAAM;IACpBC,aAAa,EAAElE,KAAK,CAACmE,YAAa;IAClCC,mBAAmB,EAAEpE,KAAK,CAACoE,mBAAoB;IAC/CC,QAAQ,EAAEX,SAAU;IACpBY,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAErE,UAAW;IAC/BsE,KAAK,EAAE;MAAEC,KAAK,EAAE,MAAM;MAAEC,IAAI,EAAE,CAAC;MAAEC,OAAO,EAAE,IAAI;MAAEC,eAAe,EAAE;IAAc,CAAE;IACjFC,MAAM,EAAE;MAAE3F,IAAI,EAAEkB,UAAU;MAAE0E,OAAO,EAAE/F,QAAQ,CAACyC,EAAE,KAAK,SAAS,GAAK,WAAUV,QAAS,EAAC,GAAG;IAAE,CAAE;IAC9FgC,SAAS,EAAEA,SAAU;IACrBiC,mCAAmC;EAAA,EACnC;AAEN,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","Platform","useDispatch","useSelector","WebView","html","HTML_PLACEHOLDER","UnitMessage","getHtmlBody","fetchUnitScript","UnitSDK","getInfoParams","handleRequestDownload","getFontFacesString","setEvent","AppInfo","WebComponent","forwardRef","props","webRef","dispatch","unitScript","state","configuration","globalTheme","theme","globalLanguage","language","sourceHtml","setSourceHtml","baseName","setBaseName","infoParams","setInfoParams","getAppName","OS","name","replace","error","console","updateInfoParams","componentCurrentTheme","componentCurrentLanguage","themeParam","languageParam","componentParams","params","fontFaces","getFonts","windowInfoParams","JSON","stringify","windowParams","newHtml","BODY","type","valueOf","presentationMode","FONT_FACES","SCRIPT_FROM_NATIVE","script","WINDOW_PARAMS","onMessage","e","message","parse","nativeEvent","data","UNIT_REQUEST_REFRESH","details","key","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","event","handleScroll","createElement","ref","originWhitelist","mediaPlaybackRequiresUserAction","allowsInlineMediaPlayback","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","width","flex","opacity","backgroundColor","source","baseUrl","androidLayerType","webviewDebuggingEnabled","__DEV__"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { Platform } from 'react-native';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { getHtmlBody } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\n\nimport { getInfoParams, handleRequestDownload } from './WebComponent.utils';\nimport type { PresentationMode, WebComponentType } from '../types/internal/webComponent.types';\nimport { getFontFacesString } from '../scripts/html/fontFaces';\nimport type { RootState } from '../store';\nimport { setEvent } from '../slices/SharedEventsSlice';\nimport * as AppInfo from '../utils/AppInfo';\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n language?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n windowParams?: string;\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const dispatch = useDispatch();\n const unitScript = useSelector((state: RootState) => state.configuration.unitScript);\n const globalTheme = useSelector((state: RootState) => state.configuration.theme);\n const globalLanguage = useSelector((state: RootState) => state.configuration.language);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [baseName, setBaseName] = useState<string>();\n const [infoParams, setInfoParams] = useState<{ [key: string]: string }>({});\n\n useEffect(() => {\n const getAppName = async () => {\n // For iOS, we extend the app name from the HTML to display a prettier access request message.\n // On Android, there is no request message sent from HTML.\n try {\n if (Platform.OS == 'ios') {\n const name = await AppInfo.getAppName();\n setBaseName(name.replace(/ /g, '-'));\n } else { // android\n setBaseName('unit');\n }\n } catch (error: any) {\n console.error(error);\n }\n };\n\n const updateInfoParams = async () => {\n const infoParams = await getInfoParams();\n setInfoParams(infoParams);\n };\n\n getAppName();\n updateInfoParams();\n }, []);\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const componentCurrentTheme = props.theme ?? globalTheme;\n const componentCurrentLanguage = props.language ?? globalLanguage;\n\n const themeParam = componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '';\n const languageParam = componentCurrentLanguage ? ` language=\"${componentCurrentLanguage}\"` : '';\n\n const componentParams = (props.params || '') + themeParam + languageParam;\n\n const fontFaces = getFontFacesString(UnitSDK.getFonts());\n\n const windowInfoParams = `window.UnitMobileSDKConfig['info'] = ${JSON.stringify(infoParams)}`;\n const windowParams = `${windowInfoParams}; ${props.windowParams || ''}`;\n\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.FONT_FACES, fontFaces);\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n newHtml = newHtml.replace(HTML_PLACEHOLDER.WINDOW_PARAMS, windowParams);\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, props.script, props.windowParams, globalTheme, globalLanguage, infoParams]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n dispatch(setEvent({\n key: UnitMessage.UNIT_REQUEST_REFRESH,\n data: message.details as RequestRefreshEvent,\n }));\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n dispatch(setEvent({ key: UnitMessage.UNIT_REQUEST_CLOSE_FLOW, data: {} }));\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n };\n\n if (!baseName) {\n return null;\n }\n\n return (\n <WebView\n ref={webRef}\n originWhitelist={['*']}\n mediaPlaybackRequiresUserAction={false}\n allowsInlineMediaPlayback={true}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode='never'\n injectedJavaScript={unitScript}\n style={{ width: '100%', flex: 1, opacity: 0.99, backgroundColor: 'transparent' }}\n source={{ html: sourceHtml, baseUrl: Platform.OS === 'android' ? `https://${baseName}` : '' }}\n onMessage={onMessage}\n androidLayerType='hardware'\n webviewDebuggingEnabled={__DEV__}\n />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,WAAW,EAAEC,WAAW,QAAQ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} from 'react-native';
|
|
3
|
+
import * as SDKInfo from '../utils/SDKInfo';
|
|
4
|
+
import * as AppInfo from '../utils/AppInfo';
|
|
3
5
|
const {
|
|
4
6
|
RNShareFile
|
|
5
7
|
} = NativeModules;
|
|
8
|
+
export const getInfoParams = async () => {
|
|
9
|
+
const appVersion = await AppInfo.getVersion();
|
|
10
|
+
const appBuildNumber = await AppInfo.getBuildNumber();
|
|
11
|
+
const appIdentifier = await AppInfo.getAppIdentifier();
|
|
12
|
+
const infoParams = {};
|
|
13
|
+
infoParams['sdkVersion'] = SDKInfo.getSDKVersion();
|
|
14
|
+
infoParams['sdkPlatform'] = 'React Native';
|
|
15
|
+
infoParams['os'] = Platform.OS == 'android' ? 'Android' : 'iOS';
|
|
16
|
+
infoParams['hostedAppVersion'] = appVersion;
|
|
17
|
+
infoParams['hostedAppBuildNumber'] = appBuildNumber;
|
|
18
|
+
infoParams['hostedAppIdentifier'] = appIdentifier;
|
|
19
|
+
return infoParams;
|
|
20
|
+
};
|
|
6
21
|
export const handleRequestDownload = async (details, onReadyToShare) => {
|
|
7
22
|
if (details.fileType === 'application/pdf') {
|
|
8
23
|
const res = await axios.get(details.url, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["axios","Share","NativeModules","Platform","RNShareFile","handleRequestDownload","details","onReadyToShare","fileType","res","get","url","headers","accessToken","responseEncoding","responseType","base64Data","request","_response","
|
|
1
|
+
{"version":3,"names":["axios","Share","NativeModules","Platform","SDKInfo","AppInfo","RNShareFile","getInfoParams","appVersion","getVersion","appBuildNumber","getBuildNumber","appIdentifier","getAppIdentifier","infoParams","getSDKVersion","OS","handleRequestDownload","details","onReadyToShare","fileType","res","get","url","headers","accessToken","responseEncoding","responseType","base64Data","request","_response","share","fileName"],"sources":["WebComponent.utils.ts"],"sourcesContent":["import axios from 'axios';\nimport { Share, NativeModules, Platform } from 'react-native';\nimport * as SDKInfo from '../utils/SDKInfo';\nimport * as AppInfo from '../utils/AppInfo';\nimport type { RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nconst { RNShareFile } = NativeModules;\n\nexport const getInfoParams = async () => {\n const appVersion = await AppInfo.getVersion();\n const appBuildNumber = await AppInfo.getBuildNumber();\n const appIdentifier = await AppInfo.getAppIdentifier();\n\n const infoParams: { [key: string]: string } = {};\n infoParams['sdkVersion'] = SDKInfo.getSDKVersion();\n infoParams['sdkPlatform'] = 'React Native';\n infoParams['os'] = Platform.OS == 'android' ? 'Android' : 'iOS';\n infoParams['hostedAppVersion'] = appVersion;\n infoParams['hostedAppBuildNumber'] = appBuildNumber;\n infoParams['hostedAppIdentifier'] = appIdentifier;\n return infoParams;\n};\n\nexport const handleRequestDownload = async (details: RequestDownloadEvent, onReadyToShare: () => void) => {\n if (details.fileType === 'application/pdf') {\n const res = await axios.get(details.url, {\n headers: {\n 'Authorization': `Bearer ${details.accessToken}`\n },\n responseEncoding: 'base64',\n responseType: 'arraybuffer'\n });\n\n const base64Data = res.request._response;\n\n onReadyToShare();\n\n if (Platform.OS === 'ios') {\n Share.share({ url: `data:application/pdf;base64,${base64Data}` });\n } else {\n RNShareFile.share(base64Data, details.fileName);\n }\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAC7D,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAC3C,OAAO,KAAKC,OAAO,MAAM,kBAAkB;AAE3C,MAAM;EAAEC;AAAY,CAAC,GAAGJ,aAAa;AAErC,OAAO,MAAMK,aAAa,GAAG,MAAAA,CAAA,KAAY;EACvC,MAAMC,UAAU,GAAG,MAAMH,OAAO,CAACI,UAAU,EAAE;EAC7C,MAAMC,cAAc,GAAG,MAAML,OAAO,CAACM,cAAc,EAAE;EACrD,MAAMC,aAAa,GAAG,MAAMP,OAAO,CAACQ,gBAAgB,EAAE;EAEtD,MAAMC,UAAqC,GAAG,CAAC,CAAC;EAChDA,UAAU,CAA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ISPATCH_REQUEST_ACCOUNT_ACTION, DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT } from '../scripts/html/bodyScript';
|
|
2
|
+
import { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT, DISPATCH_REQUEST_CARD_ACTION, DISPATCH_OPEN_ACTIONS_MENU, DISPATCH_REQUEST_ACCOUNT_ACTION, DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT, DISPATCH_REQUEST_SHOW_SENSITIVE_DATA, DISPATCH_REQUEST_HIDE_SENSITIVE_DATA } from '../scripts/html/bodyScript';
|
|
3
3
|
export const HTML_PLACEHOLDER = {
|
|
4
4
|
SCRIPT_UNIT: '<SCRIPT_UNIT>',
|
|
5
5
|
BODY: '<BODY_HTML_CODE>',
|
|
@@ -66,6 +66,10 @@ const htmlText = `
|
|
|
66
66
|
|
|
67
67
|
${DISPATCH_OPEN_ACTIONS_MENU}
|
|
68
68
|
|
|
69
|
+
${DISPATCH_REQUEST_HIDE_SENSITIVE_DATA}
|
|
70
|
+
|
|
71
|
+
${DISPATCH_REQUEST_SHOW_SENSITIVE_DATA}
|
|
72
|
+
|
|
69
73
|
${DISPATCH_REQUEST_CARD_ACTION}
|
|
70
74
|
|
|
71
75
|
${DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","DISPATCH_REQUEST_CARD_ACTION","DISPATCH_OPEN_ACTIONS_MENU","DISPATCH_REQUEST_ACCOUNT_ACTION","DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","WINDOW_PARAMS","FONT_FACES","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardActivated","cardStatusChange","unitRequestExternalSdk","unitAccountChanged","unitActivityFiltersChanged"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport {
|
|
1
|
+
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","DISPATCH_REQUEST_CARD_ACTION","DISPATCH_OPEN_ACTIONS_MENU","DISPATCH_REQUEST_ACCOUNT_ACTION","DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT","DISPATCH_REQUEST_SHOW_SENSITIVE_DATA","DISPATCH_REQUEST_HIDE_SENSITIVE_DATA","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","WINDOW_PARAMS","FONT_FACES","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardActivated","cardStatusChange","unitRequestExternalSdk","unitAccountChanged","unitActivityFiltersChanged"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport {\n DISPATCH_RENDERING_EVENT,\n LISTENERS,\n POST_MESSAGE_TO_SDK,\n POST_PAGE_HEIGHT,\n DISPATCH_REQUEST_CARD_ACTION,\n DISPATCH_OPEN_ACTIONS_MENU,\n DISPATCH_REQUEST_ACCOUNT_ACTION,\n DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT,\n DISPATCH_REQUEST_SHOW_SENSITIVE_DATA, DISPATCH_REQUEST_HIDE_SENSITIVE_DATA,\n} from '../scripts/html/bodyScript';\n\nexport const HTML_PLACEHOLDER = {\n SCRIPT_UNIT: '<SCRIPT_UNIT>',\n BODY: '<BODY_HTML_CODE>',\n SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>',\n WINDOW_PARAMS: '<WINDOW_PARAMS>',\n FONT_FACES: '<FONT_FACES>',\n};\n\nconst htmlText = `\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head lang=\"en\">\n <title>Unit Web SDK Demo</title>\n <script>\n window.UnitMobileSDK = true\n window.UnitMobileSDKConfig = {\n os: \"${Platform.OS}\",\n walletName: \"${Platform.OS === 'ios' ? 'Apple' : 'Google'}\",\n }\n ${HTML_PLACEHOLDER.WINDOW_PARAMS}\n </script>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0\">\n\n <style type=\"text/css\">\n ${HTML_PLACEHOLDER.FONT_FACES}\n\n body {\n margin: 0;\n }\n </style>\n </head>\n\n <body>\n ${HTML_PLACEHOLDER.BODY}\n\n <script>\n ${POST_MESSAGE_TO_SDK}\n\n ${POST_PAGE_HEIGHT}\n\n ${LISTENERS.isPageLoaded}\n\n ${LISTENERS.onLoad}\n\n ${LISTENERS.unitRequestDownload}\n\n ${LISTENERS.requestRendering}\n\n ${LISTENERS.requestOpenLink}\n\n ${LISTENERS.requestCloseFlow}\n\n ${LISTENERS.cardActivated}\n\n ${LISTENERS.cardStatusChange}\n\n ${LISTENERS.unitRequestExternalSdk}\n\n ${LISTENERS.unitAccountChanged}\n\n ${LISTENERS.unitActivityFiltersChanged}\n\n ${DISPATCH_RENDERING_EVENT}\n\n ${DISPATCH_OPEN_ACTIONS_MENU}\n\n ${DISPATCH_REQUEST_HIDE_SENSITIVE_DATA}\n\n ${DISPATCH_REQUEST_SHOW_SENSITIVE_DATA}\n\n ${DISPATCH_REQUEST_CARD_ACTION}\n\n ${DISPATCH_ACTIVITY_FILTER_CHANGED_EVENT}\n\n ${DISPATCH_REQUEST_ACCOUNT_ACTION}\n\n ${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}\n </script>\n </body>\n </html>\n`;\n\nexport default htmlText;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SACEC,wBAAwB,EACxBC,SAAS,EACTC,mBAAmB,EACnBC,gBAAgB,EAChBC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,sCAAsC,EACtCC,oCAAoC,EAAEC,oCAAoC,QACrE,4BAA4B;AAEnC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,CAACG,kBAAmB;AAC5C;AACA;AACA;AACA,CAAC;AAED,eAAeG,QAAQ"}
|
package/lib/typescript/{components → src/components}/UNACHCreditComponent/UNACHCreditComponent.d.ts
RENAMED
|
@@ -9,5 +9,7 @@ export interface UNACHCreditComponentProps {
|
|
|
9
9
|
withPlaid?: boolean;
|
|
10
10
|
onPaymentCreated?: (data: UNACHData) => void;
|
|
11
11
|
onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
|
|
12
|
+
sameDay?: boolean;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
+
declare const _default: (props: UNACHCreditComponentProps) => JSX.Element;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNACHCreditComponent, UNACHCreditComponentProps } from './UNACHCreditComponent';
|
package/lib/typescript/{components → src/components}/UNACHDebitComponent/UNACHDebitComponent.d.ts
RENAMED
|
@@ -8,5 +8,7 @@ export interface UNACHDebitComponentProps {
|
|
|
8
8
|
fee?: number;
|
|
9
9
|
onPaymentCreated?: (data: UNACHData) => void;
|
|
10
10
|
onLoad?: (response: UNOnLoadResponse<UNACHOnLoadData>) => void;
|
|
11
|
+
sameDay?: boolean;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
+
declare const _default: (props: UNACHDebitComponentProps) => JSX.Element;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNACHDebitComponent, UNACHDebitComponentProps } from './UNACHDebitComponent';
|
package/lib/typescript/{components → src/components}/UNAccountComponent/UNAccountComponent.d.ts
RENAMED
|
@@ -16,8 +16,9 @@ export interface UNAccountRef {
|
|
|
16
16
|
openActionsMenu: () => void;
|
|
17
17
|
openAction: (action: UNAccountMenuAction) => void;
|
|
18
18
|
}
|
|
19
|
-
export declare enum
|
|
19
|
+
export declare enum UNAccountAction {
|
|
20
20
|
List = "account-list",
|
|
21
21
|
Menu = "account-menu"
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
declare const _default: React.ForwardRefExoticComponent<UNAccountComponentProps & React.RefAttributes<UNAccountRef>>;
|
|
24
|
+
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UNAccountAction, UNAccountComponentProps } from './UNAccountComponent';
|
|
2
2
|
import { RequestRefreshEvent, RequestRenderingEvent } from '../../messages/webMessages/unitMessages';
|
|
3
3
|
import type WebView from 'react-native-webview';
|
|
4
4
|
import type { UNAccountMenuAction } from 'src/types/shared';
|
|
@@ -7,4 +7,4 @@ export declare const getAccountScript: () => string;
|
|
|
7
7
|
export declare const injectOpenActionsMenuScript: (currentWeb: WebView | null) => void;
|
|
8
8
|
export declare const injectRequestAccountActionScript: (currentWeb: WebView | null, action: UNAccountMenuAction) => void;
|
|
9
9
|
export declare const injectRefreshEventIfNeeded: (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null) => void;
|
|
10
|
-
export declare const getAccountActionType: (requestRendering: RequestRenderingEvent) =>
|
|
10
|
+
export declare const getAccountActionType: (requestRendering: RequestRenderingEvent) => UNAccountAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNAccountComponent, UNAccountComponentProps, UNAccountRef } from './UNAccountComponent';
|
package/lib/typescript/{components → src/components}/UNActivityComponent/UNActivityComponent.d.ts
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { UNOnLoadResponse } from '../../types/shared';
|
|
2
2
|
import type { UNActivityOnLoadData } from '../../types/shared/activity.types';
|
|
3
|
+
import type { UNActivityComponentPaginationType } from '../../types/shared';
|
|
3
4
|
export interface UNActivityComponentProps {
|
|
4
5
|
customerToken: string;
|
|
5
6
|
accountId?: string;
|
|
@@ -7,6 +8,9 @@ export interface UNActivityComponentProps {
|
|
|
7
8
|
theme?: string;
|
|
8
9
|
language?: string;
|
|
9
10
|
hideFilterButton?: boolean;
|
|
11
|
+
paginationType?: UNActivityComponentPaginationType;
|
|
12
|
+
transactionsPerPage?: number;
|
|
10
13
|
onLoad?: (response: UNOnLoadResponse<UNActivityOnLoadData>) => void;
|
|
11
14
|
}
|
|
12
|
-
|
|
15
|
+
declare const _default: (props: UNActivityComponentProps) => JSX.Element;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNActivityComponent, UNActivityComponentProps } from './UNActivityComponent';
|
|
@@ -11,4 +11,5 @@ export interface UNBookPaymentComponentProps {
|
|
|
11
11
|
onPaymentCreated?: (data: UNBookPaymentData) => void;
|
|
12
12
|
onLoad?: (response: UNOnLoadResponse<UNAccountData>) => void;
|
|
13
13
|
}
|
|
14
|
-
|
|
14
|
+
declare const _default: (props: UNBookPaymentComponentProps) => JSX.Element;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNBookPaymentComponent, UNBookPaymentComponentProps } from './UNBookPaymentComponent';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type RequestRenderingEvent } from '
|
|
2
|
-
import { BottomSheetRenderingType, WebComponentData } from '
|
|
1
|
+
import { type RequestRenderingEvent } from '../../../../messages/webMessages/unitMessages';
|
|
2
|
+
import { BottomSheetRenderingType, WebComponentData } from '../../../../types/internal/bottomSheet.types';
|
|
3
3
|
export interface UNAddToWalletBottomSheetItemProps {
|
|
4
4
|
renderingType: BottomSheetRenderingType;
|
|
5
5
|
renderingRequest?: RequestRenderingEvent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UNAddToWalletBottomSheetItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UNAddToWalletBottomSheetItem';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNBottomSheetComponent } from './UNBottomSheetComponent';
|
|
@@ -18,5 +18,8 @@ export interface UNCardComponentProps {
|
|
|
18
18
|
export interface CardRef {
|
|
19
19
|
openActionsMenu: () => void;
|
|
20
20
|
openAction: (action: UNCardMenuAction) => void;
|
|
21
|
+
showSensitiveData: () => void;
|
|
22
|
+
hideSensitiveData: () => void;
|
|
21
23
|
}
|
|
22
|
-
|
|
24
|
+
declare const _default: React.ForwardRefExoticComponent<UNCardComponentProps & React.RefAttributes<CardRef>>;
|
|
25
|
+
export default _default;
|
package/lib/typescript/{components → src/components}/UNCardComponent/UNCardComponent.utils.d.ts
RENAMED
|
@@ -6,4 +6,6 @@ export declare const getCardParams: (props: UNCardComponentProps) => string;
|
|
|
6
6
|
export declare const getCardScript: () => string;
|
|
7
7
|
export declare const injectOpenActionsMenuScript: (currentWeb: WebView | null) => void;
|
|
8
8
|
export declare const injectRequestCardActionScript: (currentWeb: WebView | null, action: UNCardMenuAction) => void;
|
|
9
|
+
export declare const injectRequestHideSensitiveDataScript: (currentWeb: WebView | null) => void;
|
|
10
|
+
export declare const injectRequestShowSensitiveDataScript: (currentWeb: WebView | null) => void;
|
|
9
11
|
export declare const injectRefreshEventIfNeeded: (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNCardComponent, UNCardComponentProps, CardRef } from './UNCardComponent';
|
|
@@ -10,4 +10,5 @@ export interface UNCheckDepositComponentProps {
|
|
|
10
10
|
onDepositCreated?: (checkData: UNCheckDepositData) => void;
|
|
11
11
|
onRestartRequest?: (checkData: UNCheckDepositData) => void;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
declare const _default: (props: UNCheckDepositComponentProps) => JSX.Element;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNCheckDepositComponent, UNCheckDepositComponentProps } from './UNCheckDepositComponent';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { UNCardData, UNMultipleCardsComponentPaginationType, UNMultipleCardsOnLoadData, UNOnLoadResponse } from '../../types/shared';
|
|
2
|
+
export interface UNMultipleCardsComponentProps {
|
|
3
|
+
customerToken: string;
|
|
4
|
+
paginationType?: UNMultipleCardsComponentPaginationType;
|
|
5
|
+
cardsPerPage?: number;
|
|
6
|
+
disableCardClick?: boolean;
|
|
7
|
+
theme?: string;
|
|
8
|
+
language?: string;
|
|
9
|
+
queryFilter?: string;
|
|
10
|
+
hideTitle?: boolean;
|
|
11
|
+
onLoad?: (response: UNOnLoadResponse<UNMultipleCardsOnLoadData>) => void;
|
|
12
|
+
onCardClicked?: (card: UNCardData) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: (props: UNMultipleCardsComponentProps) => JSX.Element;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as UNMultipleCardsComponent, UNMultipleCardsComponentProps, } from './UNMultipleCardsComponent';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './UNCardComponent';
|
|
2
|
+
export * from './UNMultipleCardsComponent';
|
|
3
|
+
export * from './UNBottomSheetComponent';
|
|
4
|
+
export * from './UNBookPaymentComponent';
|
|
5
|
+
export * from './UNActivityComponent';
|
|
6
|
+
export * from './UNAccountComponent';
|
|
7
|
+
export * from './UNCheckDepositComponent';
|
|
8
|
+
export * from './UNACHDebitComponent';
|
|
9
|
+
export * from './UNACHCreditComponent';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UNNativePromiseReject, UNVPError, UNVPErrorType } from './types';
|
|
2
|
+
export declare const isUNVPError: (error: any) => error is UNVPError;
|
|
3
|
+
export declare const isUNNativePromiseReject: (error: any) => error is UNNativePromiseReject;
|
|
4
|
+
export declare const promiseRejectToUNVPErrorType: (error: any) => UNVPErrorType | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
export declare enum UNVPErrorType {
|
|
2
|
+
EmptyAppId = "EmptyAppId",
|
|
3
|
+
DeviceAuthenticationFailed = "DeviceAuthenticationFailed",
|
|
4
|
+
DeviceRootDetection = "DeviceRootDetection",
|
|
5
|
+
HookDetection = "HookDetection",
|
|
6
|
+
PlayIntegrityCheckFailed = "PlayIntegrityCheckFailed",
|
|
7
|
+
EmptyEncryptedPayload = "EmptyEncryptedPayload",
|
|
8
|
+
NoWallets = "NoWallets",
|
|
9
|
+
InvalidCardId = "InvalidCardId",
|
|
10
|
+
ProvisioningNotAllowed = "ProvisioningNotAllowed",
|
|
11
|
+
CancelledByUser = "CancelledByUser",
|
|
12
|
+
GoogleWalletCreationFailed = "GoogleWalletCreationFailed",
|
|
13
|
+
UnknownErrorOccurred = "UnknownErrorOccurred",
|
|
14
|
+
WalletProvisioningInconclusive = "WalletProvisioningInconclusive",
|
|
15
|
+
WalletProvisioningError = "WalletProvisioningError",
|
|
16
|
+
NetworkFailure = "NetworkFailure",
|
|
17
|
+
SessionExpired = "SessionExpired",
|
|
18
|
+
InvalidInfo = "InvalidInfo",
|
|
19
|
+
PayloadDecryptionFailed = "PayloadDecryptionFailed",
|
|
20
|
+
ApiError = "ApiError",
|
|
21
|
+
InvalidNonce = "InvalidNonce",
|
|
22
|
+
SDKLockout = "SDKLockout",
|
|
23
|
+
NoBrowserFound = "NoBrowserFound",
|
|
24
|
+
TLCMFeatureNotSupported = "TLCMFeatureNotSupported",
|
|
25
|
+
TLCMUnsupportedWallet = "TLCMUnsupportedWallet",
|
|
26
|
+
TLCMDetailsNotFoundInPaySdk = "TLCMDetailsNotFoundInPaySdk",
|
|
27
|
+
TLCMTokenStatusExists = "TLCMTokenStatusExists",
|
|
28
|
+
TLCMInvalidOperationInput = "TLCMInvalidOperationInput",
|
|
29
|
+
TLCMInvalidRequest = "TLCMInvalidRequest",
|
|
30
|
+
TLCMUpdateStatusNotAllowed = "TLCMUpdateStatusNotAllowed",
|
|
31
|
+
TLCMTokenNotFound = "TLCMTokenNotFound"
|
|
32
|
+
}
|
|
33
|
+
export interface UNVPError {
|
|
34
|
+
code: string;
|
|
35
|
+
description: string;
|
|
36
|
+
type: UNVPErrorType;
|
|
37
|
+
correlationId: string;
|
|
38
|
+
}
|
|
39
|
+
export type UNNativePromiseReject = {
|
|
40
|
+
code: string;
|
|
41
|
+
message: string;
|
|
42
|
+
};
|
|
43
|
+
export interface UNMobileWalletPayload {
|
|
44
|
+
data: {
|
|
45
|
+
attributes: {
|
|
46
|
+
payload: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const withReduxStore: <Props>(Component: React.ComponentType<any>) => (props: Props) => JSX.Element;
|
|
3
|
+
export declare const withReduxStoreAndRefForwarding: <Props, Ref>(Component: React.ComponentType<any>) => React.ForwardRefExoticComponent<React.PropsWithoutRef<Props> & React.RefAttributes<Ref>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NativeMessageType } from '../messages/nativeMessages';
|
|
2
|
+
import type { WebViewMessageType } from '../messages/webMessages';
|
|
3
|
+
export type BusEventKey = NativeMessageType | WebViewMessageType;
|
|
4
|
+
type EventListener = {
|
|
5
|
+
busEventKey: BusEventKey;
|
|
6
|
+
action: (data: any) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const useListenerToEvent: (listener: EventListener) => void;
|
|
9
|
+
export {};
|