react-native-unit-components 2.1.0 → 3.0.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/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +44 -9
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +8 -3
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +44 -9
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +7 -2
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +5 -10
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +7 -12
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +32 -10
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +9 -6
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +20 -6
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +18 -7
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +48 -49
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +6 -10
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCheckPaymentComponent/UNCheckPaymentComponent.js +96 -0
- package/lib/commonjs/components/UNCheckPaymentComponent/UNCheckPaymentComponent.js.map +1 -0
- package/lib/commonjs/components/UNCheckPaymentComponent/UNCheckPaymentComponent.utils.js +36 -0
- package/lib/commonjs/components/UNCheckPaymentComponent/UNCheckPaymentComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNCheckPaymentComponent/index.js +21 -0
- package/lib/commonjs/components/UNCheckPaymentComponent/index.js.map +1 -0
- package/lib/commonjs/components/UNCreateCardComponent/UNCreateCardComponent.js +6 -7
- package/lib/commonjs/components/UNCreateCardComponent/UNCreateCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +6 -11
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -1
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +2 -1
- package/lib/commonjs/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js +10 -18
- package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -1
- package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js +2 -0
- package/lib/commonjs/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +5 -10
- package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -1
- package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js +0 -2
- package/lib/commonjs/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/flows/card/UNCardFlows.js +2 -6
- package/lib/commonjs/flows/card/UNCardFlows.js.map +1 -1
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js +13 -3
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView.js +4 -2
- package/lib/commonjs/helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView.js.map +1 -1
- package/lib/commonjs/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/commonjs/hooks/useEventListener.js +31 -0
- package/lib/commonjs/hooks/useEventListener.js.map +1 -0
- package/lib/commonjs/hooks/useSafeAreaDimensions.js +53 -0
- package/lib/commonjs/hooks/useSafeAreaDimensions.js.map +1 -0
- package/lib/commonjs/messages/webMessages/checkPaymentMessage.js +6 -0
- package/lib/commonjs/messages/webMessages/checkPaymentMessage.js.map +1 -0
- package/lib/commonjs/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js +2 -7
- package/lib/commonjs/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +7 -1
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/store/store.js +0 -2
- package/lib/commonjs/store/store.js.map +1 -1
- package/lib/commonjs/types/internal/bottomSheet.types.js +1 -0
- package/lib/commonjs/types/internal/bottomSheet.types.js.map +1 -1
- 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/payment/checkPayment.types.js +6 -0
- package/lib/commonjs/types/shared/payment/checkPayment.types.js.map +1 -0
- package/lib/commonjs/types/shared/payment/index.js +11 -0
- package/lib/commonjs/types/shared/payment/index.js.map +1 -1
- package/lib/commonjs/types/shared/payment/payments.types.js +1 -0
- package/lib/commonjs/types/shared/payment/payments.types.js.map +1 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdk.constants.js +2 -2
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/commonjs/utils/eventBus/EventBus.js +107 -0
- package/lib/commonjs/utils/eventBus/EventBus.js.map +1 -0
- package/lib/commonjs/utils/eventBus/EventBus.types.js +6 -0
- package/lib/commonjs/utils/eventBus/EventBus.types.js.map +1 -0
- package/lib/commonjs/utils/eventBus/index.js +13 -0
- package/lib/commonjs/utils/eventBus/index.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +22 -17
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +46 -11
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +7 -3
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +46 -11
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +6 -2
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +5 -10
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +7 -12
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +32 -10
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +8 -5
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +20 -6
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js +19 -8
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +48 -49
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js +7 -11
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCheckPaymentComponent/UNCheckPaymentComponent.js +88 -0
- package/lib/module/components/UNCheckPaymentComponent/UNCheckPaymentComponent.js.map +1 -0
- package/lib/module/components/UNCheckPaymentComponent/UNCheckPaymentComponent.utils.js +28 -0
- package/lib/module/components/UNCheckPaymentComponent/UNCheckPaymentComponent.utils.js.map +1 -0
- package/lib/module/components/UNCheckPaymentComponent/index.js +2 -0
- package/lib/module/components/UNCheckPaymentComponent/index.js.map +1 -0
- package/lib/module/components/UNCreateCardComponent/UNCreateCardComponent.js +6 -7
- package/lib/module/components/UNCreateCardComponent/UNCreateCardComponent.js.map +1 -1
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js +6 -11
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.js.map +1 -1
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js +2 -1
- package/lib/module/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.js.map +1 -1
- package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js +11 -19
- package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.js.map +1 -1
- package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js +3 -1
- package/lib/module/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.js.map +1 -1
- package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +5 -10
- package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -1
- package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.js.map +1 -1
- package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js +0 -2
- package/lib/module/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/flows/card/UNCardFlows.js +2 -6
- package/lib/module/flows/card/UNCardFlows.js.map +1 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.js +13 -3
- package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView.js +5 -3
- package/lib/module/helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView.js.map +1 -1
- package/lib/module/helpers/pushProvisioningService/hooks/useCardWallet.js.map +1 -1
- package/lib/module/hooks/useEventListener.js +24 -0
- package/lib/module/hooks/useEventListener.js.map +1 -0
- package/lib/module/hooks/useSafeAreaDimensions.js +46 -0
- package/lib/module/hooks/useSafeAreaDimensions.js.map +1 -0
- package/lib/module/messages/webMessages/checkPaymentMessage.js +2 -0
- package/lib/module/messages/webMessages/checkPaymentMessage.js.map +1 -0
- package/lib/module/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js +2 -7
- package/lib/module/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +6 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/store/store.js +0 -2
- package/lib/module/store/store.js.map +1 -1
- package/lib/module/types/internal/bottomSheet.types.js +1 -0
- package/lib/module/types/internal/bottomSheet.types.js.map +1 -1
- 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/payment/checkPayment.types.js +2 -0
- package/lib/module/types/shared/payment/checkPayment.types.js.map +1 -0
- package/lib/module/types/shared/payment/index.js +1 -0
- package/lib/module/types/shared/payment/index.js.map +1 -1
- package/lib/module/types/shared/payment/payments.types.js +1 -0
- package/lib/module/types/shared/payment/payments.types.js.map +1 -1
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdk.constants.js +2 -2
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/module/utils/eventBus/EventBus.js +101 -0
- package/lib/module/utils/eventBus/EventBus.js.map +1 -0
- package/lib/module/utils/eventBus/EventBus.types.js +8 -0
- package/lib/module/utils/eventBus/EventBus.types.js.map +1 -0
- package/lib/module/utils/eventBus/index.js +2 -0
- package/lib/module/utils/eventBus/index.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +25 -20
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +2 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +2 -0
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +2 -0
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNAccountComponent/UNAccountComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNActivityComponent/UNActivityComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +5 -5
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +2 -2
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCardComponent/UNCardComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCheckPaymentComponent/UNCheckPaymentComponent.d.ts +17 -0
- package/lib/typescript/src/components/UNCheckPaymentComponent/UNCheckPaymentComponent.d.ts.map +1 -0
- package/lib/typescript/src/components/UNCheckPaymentComponent/UNCheckPaymentComponent.utils.d.ts +4 -0
- package/lib/typescript/src/components/UNCheckPaymentComponent/UNCheckPaymentComponent.utils.d.ts.map +1 -0
- package/lib/typescript/src/components/UNCheckPaymentComponent/index.d.ts +2 -0
- package/lib/typescript/src/components/UNCheckPaymentComponent/index.d.ts.map +1 -0
- package/lib/typescript/src/components/UNCreateCardComponent/UNCreateCardComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNCreateCardComponent/UNCreateCardComponent.utils.d.ts +1 -1
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts +1 -1
- package/lib/typescript/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts +1 -0
- package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.d.ts +0 -1
- package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +1 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/flows/card/UNCardFlows.d.ts.map +1 -1
- package/lib/typescript/src/helpers/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/lib/typescript/src/helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView.d.ts.map +1 -1
- package/lib/typescript/src/helpers/pushProvisioningService/hooks/useCardWallet.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useEventListener.d.ts +12 -0
- package/lib/typescript/src/hooks/useEventListener.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useSafeAreaDimensions.d.ts +9 -0
- package/lib/typescript/src/hooks/useSafeAreaDimensions.d.ts.map +1 -0
- package/lib/typescript/src/messages/webMessages/checkPaymentMessage.d.ts +6 -0
- package/lib/typescript/src/messages/webMessages/checkPaymentMessage.d.ts.map +1 -0
- package/lib/typescript/src/messages/webMessages/index.d.ts +2 -1
- package/lib/typescript/src/messages/webMessages/index.d.ts.map +1 -1
- package/lib/typescript/src/messages/webMessages/onLoadMessage.d.ts +1 -1
- package/lib/typescript/src/messages/webMessages/onLoadMessage.d.ts.map +1 -1
- package/lib/typescript/src/messages/webMessages/unitComponentsMessages.d.ts +1 -0
- package/lib/typescript/src/messages/webMessages/unitComponentsMessages.d.ts.map +1 -1
- package/lib/typescript/src/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.d.ts.map +1 -1
- package/lib/typescript/src/scripts/html/bodyScript.d.ts +1 -0
- package/lib/typescript/src/scripts/html/bodyScript.d.ts.map +1 -1
- package/lib/typescript/src/store/store.d.ts +0 -98
- package/lib/typescript/src/store/store.d.ts.map +1 -1
- package/lib/typescript/src/types/internal/bottomSheet.types.d.ts +7 -1
- package/lib/typescript/src/types/internal/bottomSheet.types.d.ts.map +1 -1
- package/lib/typescript/src/types/internal/webComponent.types.d.ts +2 -1
- package/lib/typescript/src/types/internal/webComponent.types.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/activity.types.d.ts +1 -1
- package/lib/typescript/src/types/shared/activity.types.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/payment/checkPayment.types.d.ts +38 -0
- package/lib/typescript/src/types/shared/payment/checkPayment.types.d.ts.map +1 -0
- package/lib/typescript/src/types/shared/payment/index.d.ts +1 -0
- package/lib/typescript/src/types/shared/payment/index.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/payment/payments.types.d.ts +3 -1
- package/lib/typescript/src/types/shared/payment/payments.types.d.ts.map +1 -1
- package/lib/typescript/src/types/shared/transaction/UNNegativeBalanceCoverageTransaction.d.ts.map +1 -1
- package/lib/typescript/src/utils/eventBus/EventBus.d.ts +37 -0
- package/lib/typescript/src/utils/eventBus/EventBus.d.ts.map +1 -0
- package/lib/typescript/src/utils/eventBus/EventBus.types.d.ts +37 -0
- package/lib/typescript/src/utils/eventBus/EventBus.types.d.ts.map +1 -0
- package/lib/typescript/src/utils/eventBus/index.d.ts +4 -0
- package/lib/typescript/src/utils/eventBus/index.d.ts.map +1 -0
- package/lib/typescript/src/webComponent/WebComponent.d.ts.map +1 -1
- package/package.json +5 -3
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +53 -12
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +9 -3
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +53 -13
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +8 -2
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +5 -7
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +8 -9
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.ts +31 -13
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +6 -6
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +24 -6
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetNativeComponent/UNBottomSheetNativeComponent.tsx +18 -9
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx +77 -53
- package/src/components/UNCardComponent/UNCardComponent.tsx +7 -8
- package/src/components/UNCheckPaymentComponent/UNCheckPaymentComponent.tsx +110 -0
- package/src/components/UNCheckPaymentComponent/UNCheckPaymentComponent.utils.tsx +31 -0
- package/src/components/UNCheckPaymentComponent/index.ts +1 -0
- package/src/components/UNCreateCardComponent/UNCreateCardComponent.tsx +9 -7
- package/src/components/UNCreateCardComponent/UNCreateCardComponent.utils.ts +1 -1
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.tsx +8 -9
- package/src/components/UNMultipleCardsComponent/UNMultipleCardsComponent.utils.ts +3 -2
- package/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.tsx +12 -15
- package/src/components/UNPayeeManagementComponent/UNPayeeManagementComponent.utils.ts +3 -1
- package/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.tsx +5 -8
- package/src/components/UNWirePaymentComponent/UNWirePaymentComponent.tsx +0 -1
- package/src/components/UNWirePaymentComponent/UNWirePaymentComponent.utils.ts +0 -2
- package/src/components/index.ts +1 -0
- package/src/flows/card/UNCardFlows.ts +2 -3
- package/src/helpers/BottomSheet/BottomSheet.tsx +8 -7
- package/src/helpers/UNKeyboardAvoidingView/UNKeyboardAvoidingView.tsx +7 -4
- package/src/helpers/pushProvisioningService/hooks/useCardWallet.ts +0 -1
- package/src/hooks/useEventListener.ts +30 -0
- package/src/hooks/useSafeAreaDimensions.ts +48 -0
- package/src/messages/webMessages/checkPaymentMessage.ts +8 -0
- package/src/messages/webMessages/index.ts +2 -0
- package/src/messages/webMessages/onLoadMessage.ts +1 -1
- package/src/messages/webMessages/unitComponentsMessages.ts +1 -0
- package/src/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.tsx +5 -7
- package/src/scripts/html/bodyScript.ts +7 -0
- package/src/store/store.ts +0 -2
- package/src/types/internal/bottomSheet.types.ts +8 -0
- package/src/types/internal/webComponent.types.ts +2 -1
- package/src/types/shared/activity.types.ts +1 -1
- package/src/types/shared/payment/checkPayment.types.ts +39 -0
- package/src/types/shared/payment/index.ts +1 -0
- package/src/types/shared/payment/payments.types.ts +3 -1
- package/src/types/shared/transaction/UNNegativeBalanceCoverageTransaction.ts +1 -1
- package/src/unitComponentsSdkManager/UnitComponentsSdk.constants.ts +2 -2
- package/src/unitComponentsSdkManager/UnitComponentsSdkManager.ts +1 -1
- package/src/utils/eventBus/EventBus.ts +106 -0
- package/src/utils/eventBus/EventBus.types.ts +37 -0
- package/src/utils/eventBus/index.ts +3 -0
- package/src/webComponent/WebComponent.tsx +30 -16
- package/src/webComponent/html.ts +1 -1
- package/lib/commonjs/hooks/useListenerToEvent.js +0 -26
- package/lib/commonjs/hooks/useListenerToEvent.js.map +0 -1
- package/lib/commonjs/slices/SharedEventsSlice.js +0 -29
- package/lib/commonjs/slices/SharedEventsSlice.js.map +0 -1
- package/lib/module/hooks/useListenerToEvent.js +0 -19
- package/lib/module/hooks/useListenerToEvent.js.map +0 -1
- package/lib/module/slices/SharedEventsSlice.js +0 -22
- package/lib/module/slices/SharedEventsSlice.js.map +0 -1
- package/lib/typescript/src/hooks/useListenerToEvent.d.ts +0 -10
- package/lib/typescript/src/hooks/useListenerToEvent.d.ts.map +0 -1
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts +0 -81
- package/lib/typescript/src/slices/SharedEventsSlice.d.ts.map +0 -1
- package/src/hooks/useListenerToEvent.ts +0 -32
- package/src/slices/SharedEventsSlice.ts +0 -128
|
@@ -9,10 +9,9 @@ import {
|
|
|
9
9
|
SlotRendering,
|
|
10
10
|
} from '../../types/internal/bottomSheet.types';
|
|
11
11
|
import type { BottomSheetSlotData } from '../../types/internal/bottomSheet.types';
|
|
12
|
-
import {
|
|
12
|
+
import { eventBus } from '../../utils/eventBus';
|
|
13
13
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
14
|
-
import {
|
|
15
|
-
import { useListenerToEvent } from '../../hooks/useListenerToEvent';
|
|
14
|
+
import { useEventListener } from '../../hooks/useEventListener';
|
|
16
15
|
import WebView from 'react-native-webview';
|
|
17
16
|
import {
|
|
18
17
|
getWhiteLabelAppParams,
|
|
@@ -40,8 +39,6 @@ export interface UNWhiteLabelAppComponentProps {
|
|
|
40
39
|
const UNWhiteLabelAppComponent = (props: UNWhiteLabelAppComponentProps) => {
|
|
41
40
|
const webRef = useRef<WebView>(null);
|
|
42
41
|
|
|
43
|
-
const dispatch = useDispatch();
|
|
44
|
-
|
|
45
42
|
const handleWebViewMessage = (message: WebViewMessage) => {
|
|
46
43
|
switch (message.type) {
|
|
47
44
|
case UnitComponentsMessage.UNIT_REQUEST_RENDERING: {
|
|
@@ -56,7 +53,7 @@ const UNWhiteLabelAppComponent = (props: UNWhiteLabelAppComponentProps) => {
|
|
|
56
53
|
data: slotData,
|
|
57
54
|
} as SlotRendering;
|
|
58
55
|
|
|
59
|
-
|
|
56
|
+
eventBus.emit(BottomSheetNativeMessage.REQUEST_RENDERING, data);
|
|
60
57
|
break;
|
|
61
58
|
}
|
|
62
59
|
case UnitComponentsMessage.UNIT_WHITE_LABEL_APP_ON_LOAD: {
|
|
@@ -97,8 +94,8 @@ const UNWhiteLabelAppComponent = (props: UNWhiteLabelAppComponentProps) => {
|
|
|
97
94
|
webRef.current?.injectJavaScript(`dispatchActivityFilterChangedEvent('${query}')`);
|
|
98
95
|
};
|
|
99
96
|
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
useEventListener({ busEventKey: UnitComponentsMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });
|
|
98
|
+
useEventListener({
|
|
102
99
|
busEventKey: ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED,
|
|
103
100
|
action: dispatchActivityFiltersChanged,
|
|
104
101
|
});
|
|
@@ -3,10 +3,8 @@ import { UNWirePaymentComponentProps } from './UNWirePaymentComponent';
|
|
|
3
3
|
|
|
4
4
|
export const getWirePaymentParams = (props: UNWirePaymentComponentProps) => {
|
|
5
5
|
const accountIdParam = props.accountId ? `account-id="${props.accountId}"` : '';
|
|
6
|
-
const feeParam = props.fee ? `fee="${props.fee}"` : '';
|
|
7
6
|
return `
|
|
8
7
|
${accountIdParam}
|
|
9
|
-
${feeParam}
|
|
10
8
|
is-auto-focus="${props.isAutoFocus || false}"
|
|
11
9
|
initial-stage-back-button="${props.initialStageBackButton ?? false}"
|
|
12
10
|
final-stage-done-button="${props.finalStageDoneButton ?? false}"
|
package/src/components/index.ts
CHANGED
|
@@ -5,6 +5,7 @@ export * from './UNBookPaymentComponent';
|
|
|
5
5
|
export * from './UNActivityComponent';
|
|
6
6
|
export * from './UNAccountComponent';
|
|
7
7
|
export * from './UNCheckDepositComponent';
|
|
8
|
+
export * from './UNCheckPaymentComponent';
|
|
8
9
|
export * from './UNACHDebitComponent';
|
|
9
10
|
export * from './UNACHCreditComponent';
|
|
10
11
|
export * from './UNProgramDetailsComponent';
|
|
@@ -3,8 +3,7 @@ import {
|
|
|
3
3
|
BottomSheetRenderingType, NativeComponentRendering,
|
|
4
4
|
} from '../../types/internal/bottomSheet.types';
|
|
5
5
|
import { BottomSheetNativeMessage } from '../../messages/nativeMessages/bottomSheetMessage';
|
|
6
|
-
import {
|
|
7
|
-
import { store } from '../../store/store';
|
|
6
|
+
import { eventBus } from '../../utils/eventBus';
|
|
8
7
|
import {
|
|
9
8
|
UNAddToWalletComponentProps,
|
|
10
9
|
} from '../../nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent';
|
|
@@ -22,7 +21,7 @@ export class UNCardFlows {
|
|
|
22
21
|
},
|
|
23
22
|
},
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
eventBus.emit(BottomSheetNativeMessage.REQUEST_RENDERING, data);
|
|
26
25
|
} catch (error) {
|
|
27
26
|
console.error(error);
|
|
28
27
|
}
|
|
@@ -11,11 +11,7 @@ import {
|
|
|
11
11
|
View,
|
|
12
12
|
} from 'react-native';
|
|
13
13
|
import { CloseIcon } from '../../assets/images';
|
|
14
|
-
import {
|
|
15
|
-
androidStatusBarHeight,
|
|
16
|
-
fullScreenHeight, isAndroid10AndAbove,
|
|
17
|
-
statusBarHeight,
|
|
18
|
-
} from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';
|
|
14
|
+
import { useSafeAreaDimensions } from '../../hooks/useSafeAreaDimensions';
|
|
19
15
|
import { getStylesObject } from './BottomSheet.styles';
|
|
20
16
|
import { useIsBackFromLongBackground } from '../../hooks/useAppStateListener';
|
|
21
17
|
import { BottomSheetNativePlaceType } from '../../types/internal/bottomSheet.types';
|
|
@@ -43,6 +39,9 @@ const BottomSheet = (props: BottomSheetProps) => {
|
|
|
43
39
|
const styles = getStylesObject(fadeAnim);
|
|
44
40
|
const [isPanelOpened, setIsPanelOpened] = useState(props.isOpen);
|
|
45
41
|
const [contentHeight, setContentHeight] = useState<number | undefined>(undefined);
|
|
42
|
+
const { insets, fullScreenHeight, isAndroid10AndAbove, isEdgeToEdgeActive } = useSafeAreaDimensions();
|
|
43
|
+
// Android 15+ (API 35) enforces edge-to-edge, so marginTop calculation differs
|
|
44
|
+
const isAndroid15AndAbove = Platform.OS === 'android' && Platform.Version >= 35;
|
|
46
45
|
|
|
47
46
|
const [currentHeight, setCurrentHeight] = useState<number>(props.sliderMaxHeight);
|
|
48
47
|
|
|
@@ -204,11 +203,13 @@ const BottomSheet = (props: BottomSheetProps) => {
|
|
|
204
203
|
borderTopLeftRadius: isModal ? 0 : styles.container.borderTopLeftRadius,
|
|
205
204
|
borderTopRightRadius: isModal ? 0 : styles.container.borderTopRightRadius,
|
|
206
205
|
height: props.sliderMaxHeight,
|
|
207
|
-
|
|
206
|
+
// Android 15+ (edge-to-edge): fullScreenHeight is already the full screen, no adjustment needed
|
|
207
|
+
// Android 10-14: fullScreenHeight includes status bar, but view starts below it, so subtract insets.top
|
|
208
|
+
marginTop: isModal ? 0 : fullScreenHeight - props.sliderMaxHeight - (isAndroid10AndAbove && !isAndroid15AndAbove ? insets.top : 0),
|
|
208
209
|
transform: [
|
|
209
210
|
{ translateY: panelHeightValue },
|
|
210
211
|
],
|
|
211
|
-
paddingTop: Platform.OS === 'ios'
|
|
212
|
+
paddingTop: isModal && (Platform.OS === 'ios' || isEdgeToEdgeActive) ? insets.top : 0,
|
|
212
213
|
}}
|
|
213
214
|
>
|
|
214
215
|
<View
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { KeyboardAvoidingView, Platform, ViewStyle } from 'react-native';
|
|
1
|
+
import { KeyboardAvoidingView, Platform, StatusBar, ViewStyle } from 'react-native';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { initialWindowMetrics } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
5
|
interface UNKeyboardAvoidingViewProps {
|
|
6
6
|
children: React.ReactNode,
|
|
@@ -8,12 +8,15 @@ interface UNKeyboardAvoidingViewProps {
|
|
|
8
8
|
keyboardVerticalOffset?: number,
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
+
const topInset = initialWindowMetrics?.insets.top ?? 0;
|
|
12
|
+
const defaultOffset = topInset > 0 ? topInset : (StatusBar.currentHeight || 0);
|
|
13
|
+
|
|
11
14
|
const UNKeyboardAvoidingView = ({ children, style, keyboardVerticalOffset }: UNKeyboardAvoidingViewProps) => {
|
|
12
15
|
return (
|
|
13
16
|
<KeyboardAvoidingView
|
|
14
17
|
style={style ?? { height: '100%' }}
|
|
15
18
|
behavior="padding"
|
|
16
|
-
keyboardVerticalOffset={keyboardVerticalOffset ??
|
|
19
|
+
keyboardVerticalOffset={keyboardVerticalOffset ?? defaultOffset}
|
|
17
20
|
enabled={Platform.OS === 'android'}
|
|
18
21
|
>
|
|
19
22
|
{children}
|
|
@@ -21,4 +24,4 @@ const UNKeyboardAvoidingView = ({ children, style, keyboardVerticalOffset }: UNK
|
|
|
21
24
|
);
|
|
22
25
|
};
|
|
23
26
|
|
|
24
|
-
export default UNKeyboardAvoidingView;
|
|
27
|
+
export default UNKeyboardAvoidingView;
|
|
@@ -24,7 +24,6 @@ export const useCardWallet = (cardId: string) => {
|
|
|
24
24
|
const isRecoveringSignedNonceRef = useRef<boolean>(false);
|
|
25
25
|
const customerToken = useSelector((state: RootState) => state.configuration.customerToken);
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
const shouldRecoverVPSDKForError = (errorType: UNVPErrorType) => {
|
|
29
28
|
const recoveringTypes = [UNVPErrorType.PayloadDecryptionFailed, UNVPErrorType.SessionExpired, UNVPErrorType.InvalidNonce];
|
|
30
29
|
return recoveringTypes.includes(errorType);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { eventBus, type EventMap } from '../utils/eventBus';
|
|
3
|
+
|
|
4
|
+
type EventListener<K extends keyof EventMap> = {
|
|
5
|
+
busEventKey: K;
|
|
6
|
+
action: (data: EventMap[K]) => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Hook to listen to events from the EventBus
|
|
11
|
+
* Automatically subscribes on mount and unsubscribes on unmount
|
|
12
|
+
*/
|
|
13
|
+
export const useEventListener = <K extends keyof EventMap>(listener: EventListener<K>) => {
|
|
14
|
+
const actionRef = useRef(listener.action);
|
|
15
|
+
|
|
16
|
+
// Keep action ref up to date
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
actionRef.current = listener.action;
|
|
19
|
+
}, [listener.action]);
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
// Subscribe to the event
|
|
23
|
+
const unsubscribe = eventBus.on(listener.busEventKey, (data) => {
|
|
24
|
+
actionRef.current(data);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// Cleanup: unsubscribe when component unmounts
|
|
28
|
+
return unsubscribe;
|
|
29
|
+
}, [listener.busEventKey]);
|
|
30
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Dimensions, Platform } from 'react-native';
|
|
2
|
+
import { initialWindowMetrics } from 'react-native-safe-area-context';
|
|
3
|
+
|
|
4
|
+
const isAndroid = Platform.OS === 'android';
|
|
5
|
+
const isAndroid10To14 = isAndroid && Platform.Version >= 29 && Platform.Version < 35;
|
|
6
|
+
const isAndroid15AndAbove = isAndroid && Platform.Version >= 35;
|
|
7
|
+
|
|
8
|
+
const insets = initialWindowMetrics?.insets ?? { top: 0, bottom: 0, left: 0, right: 0 };
|
|
9
|
+
const windowHeight = Dimensions.get('window').height;
|
|
10
|
+
const screenHeight = Dimensions.get('screen').height;
|
|
11
|
+
|
|
12
|
+
// Detect edge-to-edge by comparing window to screen height
|
|
13
|
+
// Edge-to-edge ON: windowHeight ≈ screenHeight | OFF: windowHeight < screenHeight
|
|
14
|
+
const heightDifference = Math.abs(screenHeight - windowHeight);
|
|
15
|
+
const isEdgeToEdgeActive = isAndroid15AndAbove && heightDifference < 10;
|
|
16
|
+
|
|
17
|
+
const effectiveBottomInset = isEdgeToEdgeActive ? insets.bottom : 0;
|
|
18
|
+
|
|
19
|
+
const calculateFullScreenHeight = (): number => {
|
|
20
|
+
if (isAndroid15AndAbove) {
|
|
21
|
+
return isEdgeToEdgeActive ? screenHeight : windowHeight;
|
|
22
|
+
} else if (isAndroid10To14) {
|
|
23
|
+
return windowHeight + insets.top;
|
|
24
|
+
}
|
|
25
|
+
return windowHeight;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const fullScreenHeight = calculateFullScreenHeight();
|
|
29
|
+
|
|
30
|
+
const calculateContentHeight = (): number => {
|
|
31
|
+
if (isAndroid15AndAbove && !isEdgeToEdgeActive) {
|
|
32
|
+
return windowHeight;
|
|
33
|
+
}
|
|
34
|
+
return fullScreenHeight - insets.top;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const contentHeight = calculateContentHeight();
|
|
38
|
+
|
|
39
|
+
export const useSafeAreaDimensions = () => {
|
|
40
|
+
return {
|
|
41
|
+
insets,
|
|
42
|
+
fullScreenHeight,
|
|
43
|
+
contentHeight,
|
|
44
|
+
isAndroid10AndAbove: isAndroid && Platform.Version >= 29,
|
|
45
|
+
isEdgeToEdgeActive,
|
|
46
|
+
effectiveBottomInset,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -6,6 +6,7 @@ import type { PaymentMessage } from './paymentsMessage';
|
|
|
6
6
|
import type { UnitEvent, UnitComponentsMessage, MultiFactorAuthenticationFinishedEvent } from './unitComponentsMessages';
|
|
7
7
|
import type { AccountEvent, AccountMessage } from './accountMessage';
|
|
8
8
|
import type { CheckEvent, CheckMessage } from './checkMessage';
|
|
9
|
+
import type { CheckPaymentEvent } from './checkPaymentMessage';
|
|
9
10
|
import type { ActivityEvent, ActivityMessage } from './activityMessage';
|
|
10
11
|
import type { MultipleCardsEvent, MultipleCardsMessage } from './multipleCardsMessage';
|
|
11
12
|
import { PlaidEvent, PlaidMessage } from './plaidMessages';
|
|
@@ -36,6 +37,7 @@ type WebViewEvent =
|
|
|
36
37
|
| ACHEvent
|
|
37
38
|
| AccountEvent
|
|
38
39
|
| CheckEvent
|
|
40
|
+
| CheckPaymentEvent
|
|
39
41
|
| ActivityEvent
|
|
40
42
|
| PlaidEvent
|
|
41
43
|
| PayeeManagementEvent
|
|
@@ -45,7 +45,7 @@ export type ACHOnLoadResponse = {
|
|
|
45
45
|
|
|
46
46
|
export type ActivityOnLoadResponse = {
|
|
47
47
|
[RESPONSE_KEYS.authorizations]: UNComponentsOnLoadResponseData<[UNAuthorization]>,
|
|
48
|
-
[RESPONSE_KEYS.transactions]
|
|
48
|
+
[RESPONSE_KEYS.transactions]?: UNComponentsOnLoadResponseData<[UNTransaction]>
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export type PayeeManagementOnLoadResponse = {
|
package/src/nativeComponents/UNAddToWallet/UNAddToWalletComponent/UNAddToWalletComponent.tsx
CHANGED
|
@@ -6,7 +6,6 @@ import { PresentationMode, WebComponentType } from '../../../types/internal/webC
|
|
|
6
6
|
import { UNCardAddToWalletStatus } from '../../../types/shared/wallet.types';
|
|
7
7
|
import UnitAddToWalletButtonView from '../UnitAddToWalletButtonNativeComponent';
|
|
8
8
|
import WebView from 'react-native-webview';
|
|
9
|
-
import { useDispatch } from 'react-redux';
|
|
10
9
|
import {
|
|
11
10
|
getStylesObject,
|
|
12
11
|
} from './UNAddToWalletBottomSheetItem.styles';
|
|
@@ -15,7 +14,7 @@ import { getAddToWalletParams, getAddToWalletWindowParams } from './UNAddToWalle
|
|
|
15
14
|
import { WebViewMessage } from '../../../messages/webMessages';
|
|
16
15
|
import { UnitComponentsMessage } from '../../../messages/webMessages/unitComponentsMessages';
|
|
17
16
|
import { injectHtmlFullScreenHeight } from '../../../components/UNBottomSheetComponent/UNBottomSheetComponent.utils';
|
|
18
|
-
import {
|
|
17
|
+
import { eventBus } from '../../../utils/eventBus';
|
|
19
18
|
import {
|
|
20
19
|
overFullScreenHeight,
|
|
21
20
|
} from '../../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';
|
|
@@ -33,7 +32,6 @@ export interface UNAddToWalletComponentProps {
|
|
|
33
32
|
}
|
|
34
33
|
|
|
35
34
|
const UNAddToWalletComponent = (props: UNAddToWalletComponentProps) => {
|
|
36
|
-
const dispatch = useDispatch();
|
|
37
35
|
const webRef = useRef<WebView>(null);
|
|
38
36
|
const { currentUNWallet } = useCardWallet(props.cardId);
|
|
39
37
|
const styles = getStylesObject();
|
|
@@ -55,10 +53,10 @@ const UNAddToWalletComponent = (props: UNAddToWalletComponentProps) => {
|
|
|
55
53
|
injectHtmlFullScreenHeight(webRef.current, overFullScreenHeight);
|
|
56
54
|
break;
|
|
57
55
|
case UnitComponentsMessage.UNIT_REQUEST_CLOSE_FLOW:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
eventBus.emit(
|
|
57
|
+
UnitComponentsMessage.UNIT_REQUEST_CLOSE_FLOW,
|
|
58
|
+
{}
|
|
59
|
+
);
|
|
62
60
|
break;
|
|
63
61
|
default:
|
|
64
62
|
break;
|
|
@@ -375,3 +375,10 @@ export const DISPATCH_REQUEST_ACCOUNT_ACTION = `
|
|
|
375
375
|
document.querySelector("unit-elements-account").dispatchEvent(new CustomEvent("unitRequestAccountAction", {detail: {action: action}}))
|
|
376
376
|
}
|
|
377
377
|
`;
|
|
378
|
+
|
|
379
|
+
export const DISPATCH_COUNTERPARTY_DELETED = `
|
|
380
|
+
const dispatchCounterpartyDeletedEvent = (details) => {
|
|
381
|
+
const event = new CustomEvent("unitCounterpartyDeleted",{ detail: { data: details } });
|
|
382
|
+
window.dispatchEvent(event);
|
|
383
|
+
}
|
|
384
|
+
`;
|
package/src/store/store.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { configureStore } from '@reduxjs/toolkit';
|
|
2
2
|
import wallet from '../slices/pushProvisioningSlice';
|
|
3
3
|
import configuration from '../slices/ConfigurationSlice';
|
|
4
|
-
import sharedEvents from '../slices/SharedEventsSlice';
|
|
5
4
|
import bottomSheet from '../slices/BottomSheetSlice';
|
|
6
5
|
|
|
7
6
|
export const store = configureStore({
|
|
8
7
|
reducer: {
|
|
9
8
|
wallet,
|
|
10
9
|
configuration,
|
|
11
|
-
sharedEvents,
|
|
12
10
|
bottomSheet,
|
|
13
11
|
},
|
|
14
12
|
});
|
|
@@ -9,6 +9,7 @@ import { UNCheckDepositComponentProps } from '../../components/UNCheckDepositCom
|
|
|
9
9
|
import { UNBookPaymentComponentProps } from '../../components/UNBookPaymentComponent';
|
|
10
10
|
import { UNWirePaymentComponentProps } from '../../components/UNWirePaymentComponent';
|
|
11
11
|
import { UNCreateCardComponentProps } from '../../components/UNCreateCardComponent';
|
|
12
|
+
import { UNCheckPaymentComponentProps } from '../../components/UNCheckPaymentComponent';
|
|
12
13
|
|
|
13
14
|
export enum BottomSheetNativePlaceType {
|
|
14
15
|
overFullScreen = 'overFullScreen',
|
|
@@ -50,6 +51,7 @@ export enum BottomSheetNativeComponentType {
|
|
|
50
51
|
ACHCreditComponent = 'UNACHCreditComponent',
|
|
51
52
|
ACHDebitComponent = 'UNACHDebitComponent',
|
|
52
53
|
CheckDepositComponent = 'UNCheckDepositComponent',
|
|
54
|
+
CheckPaymentComponent = 'UNCheckPaymentComponent',
|
|
53
55
|
BookPaymentComponent = 'UNBookPaymentComponent',
|
|
54
56
|
WirePaymentComponent = 'UNWirePaymentComponent',
|
|
55
57
|
CreateCardComponent = 'UNCreateCardComponent'
|
|
@@ -75,6 +77,11 @@ export type BottomSheetNativeCheckDepositComponentType = {
|
|
|
75
77
|
props: UNCheckDepositComponentProps
|
|
76
78
|
}
|
|
77
79
|
|
|
80
|
+
export type BottomSheetNativeCheckPaymentComponentType = {
|
|
81
|
+
type: BottomSheetNativeComponentType.CheckPaymentComponent,
|
|
82
|
+
props: UNCheckPaymentComponentProps
|
|
83
|
+
}
|
|
84
|
+
|
|
78
85
|
export type BottomSheetNativeBookPaymentComponentType = {
|
|
79
86
|
type: BottomSheetNativeComponentType.BookPaymentComponent,
|
|
80
87
|
props: UNBookPaymentComponentProps
|
|
@@ -94,6 +101,7 @@ export type BottomSheetNativeComponent = BottomSheetNativeAddToWalletComponentTy
|
|
|
94
101
|
| BottomSheetNativeACHCreditComponentType
|
|
95
102
|
| BottomSheetNativeACHDebitComponentType
|
|
96
103
|
| BottomSheetNativeCheckDepositComponentType
|
|
104
|
+
| BottomSheetNativeCheckPaymentComponentType
|
|
97
105
|
| BottomSheetNativeBookPaymentComponentType
|
|
98
106
|
| BottomSheetNativeWirePaymentComponentType
|
|
99
107
|
| BottomSheetNativeCreateCardComponentType
|
|
@@ -16,7 +16,8 @@ export enum WebComponentType {
|
|
|
16
16
|
whiteLabelApp = 'unit-elements-white-label-app',
|
|
17
17
|
multiFactorAuthentication = 'unit-elements-multi-factor-authentication',
|
|
18
18
|
createCard = 'unit-elements-create-card',
|
|
19
|
-
cardMenu = 'unit-elements-card-menu'
|
|
19
|
+
cardMenu = 'unit-elements-card-menu',
|
|
20
|
+
checkPayment = 'unit-elements-check-payment'
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export enum PresentationMode {
|
|
@@ -9,7 +9,7 @@ export enum UNActivityComponentPaginationType {
|
|
|
9
9
|
|
|
10
10
|
export type UNActivityOnLoadData = {
|
|
11
11
|
[RESPONSE_KEYS.authorizations]: [UNAuthorization],
|
|
12
|
-
[RESPONSE_KEYS.transactions]
|
|
12
|
+
[RESPONSE_KEYS.transactions]?: [UNTransaction],
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export enum UNActivityType {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { UNPaymentType } from './payments.types';
|
|
2
|
+
|
|
3
|
+
export interface UNCheckPayment {
|
|
4
|
+
type: UNPaymentType.CheckPayment
|
|
5
|
+
id: string
|
|
6
|
+
attributes: {
|
|
7
|
+
counterparty: UNCheckPaymentCounterparty
|
|
8
|
+
amount: number
|
|
9
|
+
idempotencyKey: string
|
|
10
|
+
description: string
|
|
11
|
+
memo: string
|
|
12
|
+
}
|
|
13
|
+
relationships: {
|
|
14
|
+
account: {
|
|
15
|
+
data: {
|
|
16
|
+
type: string
|
|
17
|
+
id: string
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
customer: {
|
|
21
|
+
data: {
|
|
22
|
+
type: string
|
|
23
|
+
id: string
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface UNCheckPaymentCounterparty {
|
|
30
|
+
name: string
|
|
31
|
+
address: {
|
|
32
|
+
street: string
|
|
33
|
+
street2?: string
|
|
34
|
+
city: string
|
|
35
|
+
state: string
|
|
36
|
+
postalCode: string
|
|
37
|
+
country: string
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -3,14 +3,16 @@ import { UNACHPayment } from './achPayment.types';
|
|
|
3
3
|
import { UNBillPayment } from './billPayment.types';
|
|
4
4
|
import { UNBookPayment } from './bookPayment.types';
|
|
5
5
|
import { UNWirePayment } from './wirePayment.types';
|
|
6
|
+
import { UNCheckPayment } from './checkPayment.types';
|
|
6
7
|
|
|
7
|
-
export type UNPayment = UNACHPayment | UNBookPayment | UNWirePayment | UNBillPayment
|
|
8
|
+
export type UNPayment = UNACHPayment | UNBookPayment | UNWirePayment | UNBillPayment | UNCheckPayment
|
|
8
9
|
|
|
9
10
|
export enum UNPaymentType {
|
|
10
11
|
AchPayment = 'achPayment',
|
|
11
12
|
BookPayment = 'bookPayment',
|
|
12
13
|
WirePayment = 'wirePayment',
|
|
13
14
|
BillPayment = 'billPayment',
|
|
15
|
+
CheckPayment = 'checkPayment',
|
|
14
16
|
CardToCardPayment = 'cardToCardPayment',
|
|
15
17
|
}
|
|
16
18
|
|
|
@@ -3,8 +3,8 @@ import { UNComponentsSecuritySettings, UNComponentsSnapshotProtectionStrategy }
|
|
|
3
3
|
|
|
4
4
|
const WEB_SDK_RECOMMENDED_STRATEGY: UNComponentsWebVersioningStrategy = {
|
|
5
5
|
type: UNVersioningStrategyType.upToNextMinor,
|
|
6
|
-
major:
|
|
7
|
-
minor:
|
|
6
|
+
major: 3,
|
|
7
|
+
minor: 3,
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
const DEFAULT_SECURITY_SETTINGS: UNComponentsSecuritySettings = {
|
|
@@ -25,7 +25,7 @@ export class UnitComponentsSDK {
|
|
|
25
25
|
protected static fonts?: UNFonts;
|
|
26
26
|
protected static signedNonce?: string;
|
|
27
27
|
protected static pushProvisionModule?: typeof NativeModules;
|
|
28
|
-
protected static sdkVersion = '
|
|
28
|
+
protected static sdkVersion = '3.0.0';
|
|
29
29
|
|
|
30
30
|
public static init = async (
|
|
31
31
|
env: UNComponentsEnvironment,
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { EventMap, SharedEvent } from './EventBus.types';
|
|
2
|
+
|
|
3
|
+
// Type-safe callback that receives the correct data type for the event key
|
|
4
|
+
export type EventCallback<K extends keyof EventMap> = (data: EventMap[K]) => void;
|
|
5
|
+
|
|
6
|
+
class EventBus {
|
|
7
|
+
private debug = false;
|
|
8
|
+
private listeners = new Map<SharedEvent['key'], Set<(data: unknown) => void>>();
|
|
9
|
+
private eventQueue: SharedEvent[] = [];
|
|
10
|
+
private isProcessing = false;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Subscribe to an event
|
|
14
|
+
* @returns Unsubscribe function
|
|
15
|
+
*/
|
|
16
|
+
on<K extends keyof EventMap>(eventKey: K, callback: EventCallback<K>): () => void {
|
|
17
|
+
if (!this.listeners.has(eventKey)) {
|
|
18
|
+
this.listeners.set(eventKey, new Set());
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
this.listeners.get(eventKey)!.add(callback as (data: unknown) => void);
|
|
22
|
+
|
|
23
|
+
if (this.debug) {
|
|
24
|
+
console.log(`[EventBus] Subscribed to: ${eventKey} (${this.listenerCount(eventKey)} listeners)`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// Return unsubscribe function
|
|
28
|
+
return () => {
|
|
29
|
+
const callbacks = this.listeners.get(eventKey);
|
|
30
|
+
if (callbacks) {
|
|
31
|
+
callbacks.delete(callback as (data: unknown) => void);
|
|
32
|
+
if (callbacks.size === 0) {
|
|
33
|
+
this.listeners.delete(eventKey);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Emit an event - queues it for processing to ensure all events are delivered
|
|
41
|
+
*/
|
|
42
|
+
emit<K extends keyof EventMap>(eventKey: K, data: EventMap[K]): void {
|
|
43
|
+
const event = { key: eventKey, data } as SharedEvent;
|
|
44
|
+
|
|
45
|
+
if (this.debug) {
|
|
46
|
+
console.log(`[EventBus] Emitting: ${eventKey} (${this.listenerCount(eventKey)} listeners)`);
|
|
47
|
+
}
|
|
48
|
+
this.eventQueue.push(event);
|
|
49
|
+
this.processQueue();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Process events from queue sequentially
|
|
54
|
+
* This ensures rapid successive events are all delivered
|
|
55
|
+
*/
|
|
56
|
+
private processQueue(): void {
|
|
57
|
+
if (this.isProcessing || this.eventQueue.length === 0) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
this.isProcessing = true;
|
|
62
|
+
|
|
63
|
+
// Process all queued events synchronously to ensure immediate delivery
|
|
64
|
+
while (this.eventQueue.length > 0) {
|
|
65
|
+
const event = this.eventQueue.shift()!;
|
|
66
|
+
const callbacks = this.listeners.get(event.key);
|
|
67
|
+
|
|
68
|
+
if (callbacks && callbacks.size > 0) {
|
|
69
|
+
// Process all listeners for this event
|
|
70
|
+
callbacks.forEach(callback => {
|
|
71
|
+
try {
|
|
72
|
+
callback(event.data);
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error(`Error in event listener for ${event.key}:`, error);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
this.isProcessing = false;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Remove all listeners for an event
|
|
85
|
+
*/
|
|
86
|
+
off<K extends keyof EventMap>(eventKey: K): void {
|
|
87
|
+
this.listeners.delete(eventKey);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Get number of listeners for an event (useful for debugging)
|
|
92
|
+
*/
|
|
93
|
+
listenerCount<K extends keyof EventMap>(eventKey: K): number {
|
|
94
|
+
return this.listeners.get(eventKey)?.size ?? 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Enable or disable debug logging
|
|
99
|
+
*/
|
|
100
|
+
setDebug(enabled: boolean): void {
|
|
101
|
+
this.debug = enabled;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Singleton instance
|
|
106
|
+
export const eventBus = new EventBus();
|