react-native-unit-components 0.1.0 → 1.0.1
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/README.md +157 -2
- package/android/src/main/java/com/unitreactnativecomponents/UnitAddToWalletButtonViewManager.kt +27 -0
- package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsEvent.kt +21 -0
- package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +2 -1
- package/android/src/main/java/com/unitreactnativecomponents/visapresentation/UNGooglePayView.kt +197 -0
- package/android/src/main/res/drawable/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable/un_black_googlepay_button_background.xml +6 -0
- package/android/src/main/res/drawable/un_black_googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable/un_black_googlepay_button_content.xml +48 -0
- package/android/src/main/res/drawable/un_black_googlepay_button_no_shadow_background.xml +6 -0
- package/android/src/main/res/drawable/un_black_googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable/un_black_googlepay_button_overlay.xml +12 -0
- package/android/src/main/res/drawable/un_border.xml +6 -0
- package/android/src/main/res/drawable/un_condensed_googlepay.xml +27 -0
- package/android/src/main/res/drawable/un_googlepay_button_background.xml +18 -0
- package/android/src/main/res/drawable/un_googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable/un_googlepay_button_background_image_focused.9.png +0 -0
- package/android/src/main/res/drawable/un_googlepay_button_background_image_pressed.9.png +0 -0
- package/android/src/main/res/drawable/un_googlepay_button_content.xml +48 -0
- package/android/src/main/res/drawable/un_googlepay_button_no_shadow_background.xml +18 -0
- package/android/src/main/res/drawable/un_googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable/un_googlepay_button_no_shadow_background_image_focused.9.png +0 -0
- package/android/src/main/res/drawable/un_googlepay_button_no_shadow_background_image_pressed.9.png +0 -0
- package/android/src/main/res/drawable/un_googlepay_button_overlay.xml +11 -0
- package/android/src/main/res/drawable/un_ic_launcher_foreground.xml +30 -0
- package/android/src/main/res/drawable/un_ic_unit_logo.xml +25 -0
- package/android/src/main/res/drawable/un_ic_visa.xml +13 -0
- package/android/src/main/res/drawable-bg/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-bg/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-ca/un_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-ca/un_black_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-cs/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-cs/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-da/un_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-da/un_black_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-de/un_add_to_googlepay_button_content.xml +60 -0
- package/android/src/main/res/drawable-de/un_black_add_to_googlepay_button_content.xml +60 -0
- package/android/src/main/res/drawable-el/un_add_to_googlepay_button_content.xml +67 -0
- package/android/src/main/res/drawable-el/un_black_add_to_googlepay_button_content.xml +67 -0
- package/android/src/main/res/drawable-es/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-es/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-et/un_add_to_googlepay_button_content.xml +64 -0
- package/android/src/main/res/drawable-et/un_black_add_to_googlepay_button_content.xml +64 -0
- package/android/src/main/res/drawable-fi/un_add_to_googlepay_button_content.xml +39 -0
- package/android/src/main/res/drawable-fi/un_black_add_to_googlepay_button_content.xml +39 -0
- package/android/src/main/res/drawable-fr/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-fr/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-hr/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-hr/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-hu/un_add_to_googlepay_button_content.xml +64 -0
- package/android/src/main/res/drawable-hu/un_black_add_to_googlepay_button_content.xml +64 -0
- package/android/src/main/res/drawable-in/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-in/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-it/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-it/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-iw/un_add_to_googlepay_button_content.xml +41 -0
- package/android/src/main/res/drawable-iw/un_black_add_to_googlepay_button_content.xml +41 -0
- package/android/src/main/res/drawable-ja/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-ja/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-ko/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-ko/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-lt/un_add_to_googlepay_button_content.xml +70 -0
- package/android/src/main/res/drawable-lt/un_black_add_to_googlepay_button_content.xml +70 -0
- package/android/src/main/res/drawable-lv/un_add_to_googlepay_button_content.xml +61 -0
- package/android/src/main/res/drawable-lv/un_black_add_to_googlepay_button_content.xml +61 -0
- package/android/src/main/res/drawable-ms/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-ms/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-nb/un_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-nb/un_black_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-nl/un_add_to_googlepay_button_content.xml +58 -0
- package/android/src/main/res/drawable-nl/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-pl/un_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-pl/un_black_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-pt/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-pt/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-ro/un_add_to_googlepay_button_content.xml +58 -0
- package/android/src/main/res/drawable-ro/un_black_add_to_googlepay_button_content.xml +58 -0
- package/android/src/main/res/drawable-ru/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-ru/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-sk/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-sk/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-sl/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-sl/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-sr/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-sr/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-sv/un_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-sv/un_black_add_to_googlepay_button_content.xml +30 -0
- package/android/src/main/res/drawable-th/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-th/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-tr/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-tr/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-uk/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-uk/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-v21/un_black_googlepay_button_background.xml +7 -0
- package/android/src/main/res/drawable-v21/un_black_googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/drawable-v21/un_black_googlepay_button_no_shadow_background.xml +7 -0
- package/android/src/main/res/drawable-v21/un_black_googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/drawable-v24/ic_launcher_background.xml +170 -0
- package/android/src/main/res/drawable-v24/un_border.xml +6 -0
- package/android/src/main/res/drawable-v24/un_ic_launcher_foreground.xml +30 -0
- package/android/src/main/res/drawable-v24/un_ic_unit_logo.xml +25 -0
- package/android/src/main/res/drawable-v24/un_ic_visa.xml +13 -0
- package/android/src/main/res/drawable-zh/un_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/drawable-zh/un_black_add_to_googlepay_button_content.xml +54 -0
- package/android/src/main/res/layout/un_black_add_to_googlepay_button.xml +32 -0
- package/android/src/main/res/layout/un_view_google_push_provisioning.xml +45 -0
- package/android/src/main/res/layout/un_white_add_to_googlepay_button.xml +31 -0
- package/android/src/main/res/layout/un_white_add_to_googlepay_button_no_shadow.xml +31 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +5 -0
- package/android/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml +5 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/black_googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/black_googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/googlepay_button_background_image_focused.9.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/googlepay_button_background_image_pressed.9.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/googlepay_button_no_shadow_background_image_focused.9.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/googlepay_button_no_shadow_background_image_pressed.9.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xhdpi/white_googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/black_googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/black_googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/googlepay_button_background_image_focused.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/googlepay_button_background_image_pressed.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/googlepay_button_no_shadow_background_image_focused.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/googlepay_button_no_shadow_background_image_pressed.9.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/black_googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/black_googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/googlepay_button_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/googlepay_button_background_image_focused.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/googlepay_button_background_image_pressed.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/googlepay_button_no_shadow_background_image.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/googlepay_button_no_shadow_background_image_focused.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/googlepay_button_no_shadow_background_image_pressed.9.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.webp +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp +0 -0
- package/android/src/main/res/values/colors.xml +14 -0
- package/android/src/main/res/values/googlepay_strings.xml +7 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/android/src/main/res/values/themes.xml +16 -0
- package/android/src/main/res/values-night/themes.xml +16 -0
- package/ios/UnitReactNativeComponents.xcodeproj/project.pbxproj +8 -8
- package/ios/UnitReactNativeComponentsViewManager.m +3 -2
- package/ios/UnitReactNativeComponentsViewManager.swift +39 -25
- package/lib/commonjs/assets/images/close.png +0 -0
- package/lib/commonjs/assets/images/index.js +16 -0
- package/lib/commonjs/assets/images/index.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +28 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +20 -0
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +39 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +40 -0
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +9 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +195 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +23 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +49 -0
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -0
- package/lib/commonjs/components/{Card/CardComponent.js → UNCardComponent/UNCardComponent.js} +42 -46
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +42 -0
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -0
- package/lib/commonjs/components/index.js +34 -8
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/custom.d.js +2 -0
- package/lib/commonjs/custom.d.js.map +1 -0
- package/lib/commonjs/helpers/{BottomSheet.js → BottomSheet/BottomSheet.js} +38 -83
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js +82 -0
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js.map +1 -0
- package/lib/commonjs/helpers/EventBus.js +5 -13
- package/lib/commonjs/helpers/EventBus.js.map +1 -1
- package/lib/commonjs/hooks/listenerToBus.js +31 -0
- package/lib/commonjs/hooks/listenerToBus.js.map +1 -0
- package/lib/commonjs/hooks/useAppStateListener.js +34 -0
- package/lib/commonjs/hooks/useAppStateListener.js.map +1 -0
- package/lib/commonjs/index.js +33 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/index.js +13 -0
- package/lib/commonjs/messages/nativeMessages/index.js.map +1 -0
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js +13 -0
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -0
- package/lib/commonjs/{webComponent → messages}/webMessages/cardMessage.js +1 -1
- package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/index.js +6 -0
- package/lib/commonjs/messages/webMessages/index.js.map +1 -0
- package/lib/commonjs/{webComponent → messages}/webMessages/pageMessage.js +0 -0
- package/lib/commonjs/messages/webMessages/pageMessage.js.map +1 -0
- package/lib/commonjs/{webComponent → messages}/webMessages/unitMessages.js +0 -0
- package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -0
- package/lib/commonjs/nativeComponent/UNNativeAddToWalletButton.js +13 -0
- package/lib/commonjs/nativeComponent/UNNativeAddToWalletButton.js.map +1 -0
- package/lib/commonjs/scripts/html/bodyHtml.js +52 -0
- package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -0
- package/lib/commonjs/scripts/html/bodyScript.js +78 -0
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -0
- package/lib/commonjs/sharedTypes/bookPayment.types.js +6 -0
- package/lib/commonjs/sharedTypes/bookPayment.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/card.types.js +6 -0
- package/lib/commonjs/sharedTypes/card.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/index.js +32 -0
- package/lib/commonjs/sharedTypes/index.js.map +1 -0
- package/lib/commonjs/sharedTypes/types.js +2 -0
- package/lib/commonjs/sharedTypes/types.js.map +1 -0
- package/lib/commonjs/styles/variables.js +17 -0
- package/lib/commonjs/styles/variables.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js +54 -0
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +51 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -0
- package/lib/commonjs/webComponent/WebComponent.js +47 -15
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +22 -45
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/assets/images/close.png +0 -0
- package/lib/module/assets/images/index.js +2 -0
- package/lib/module/assets/images/index.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +13 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +10 -0
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +23 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +26 -0
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js +2 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +163 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +13 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +29 -0
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js +65 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +24 -0
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -0
- package/lib/module/components/index.js +4 -2
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/custom.d.js +2 -0
- package/lib/module/custom.d.js.map +1 -0
- package/lib/module/helpers/{BottomSheet.js → BottomSheet/BottomSheet.js} +36 -82
- package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -0
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js +70 -0
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js.map +1 -0
- package/lib/module/helpers/EventBus.js +4 -11
- package/lib/module/helpers/EventBus.js.map +1 -1
- package/lib/module/hooks/listenerToBus.js +18 -0
- package/lib/module/hooks/listenerToBus.js.map +1 -0
- package/lib/module/hooks/useAppStateListener.js +23 -0
- package/lib/module/hooks/useAppStateListener.js.map +1 -0
- package/lib/module/index.js +2 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/messages/nativeMessages/index.js +6 -0
- package/lib/module/messages/nativeMessages/index.js.map +1 -0
- package/lib/module/messages/webMessages/bookPaymentMessage.js +6 -0
- package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -0
- package/lib/module/messages/webMessages/cardMessage.js +6 -0
- package/lib/module/messages/webMessages/cardMessage.js.map +1 -0
- package/lib/module/messages/webMessages/index.js +2 -0
- package/lib/module/messages/webMessages/index.js.map +1 -0
- package/lib/module/{webComponent → messages}/webMessages/pageMessage.js +0 -0
- package/lib/module/messages/webMessages/pageMessage.js.map +1 -0
- package/lib/module/{webComponent → messages}/webMessages/unitMessages.js +0 -0
- package/lib/module/messages/webMessages/unitMessages.js.map +1 -0
- package/lib/module/nativeComponent/UNNativeAddToWalletButton.js +4 -0
- package/lib/module/nativeComponent/UNNativeAddToWalletButton.js.map +1 -0
- package/lib/module/scripts/html/bodyHtml.js +42 -0
- package/lib/module/scripts/html/bodyHtml.js.map +1 -0
- package/lib/module/scripts/html/bodyScript.js +64 -0
- package/lib/module/scripts/html/bodyScript.js.map +1 -0
- package/lib/module/sharedTypes/bookPayment.types.js +2 -0
- package/lib/module/sharedTypes/bookPayment.types.js.map +1 -0
- package/lib/module/sharedTypes/card.types.js +2 -0
- package/lib/module/sharedTypes/card.types.js.map +1 -0
- package/lib/module/sharedTypes/index.js +3 -0
- package/lib/module/sharedTypes/index.js.map +1 -0
- package/lib/module/sharedTypes/types.js +2 -0
- package/lib/module/sharedTypes/types.js.map +1 -0
- package/lib/module/styles/variables.js +10 -0
- package/lib/module/styles/variables.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js +37 -0
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js +38 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -0
- package/lib/module/webComponent/WebComponent.js +46 -14
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/html.js +18 -44
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/assets/images/index.d.ts +1 -0
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +6 -0
- package/lib/typescript/components/UNActivityComponent/UNActivityComponent.utils.d.ts +2 -0
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.d.ts +11 -0
- package/lib/typescript/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.d.ts +3 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.d.ts +1 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +7 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.d.ts +9 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts +5 -0
- package/lib/typescript/components/{Card/CardComponent.d.ts → UNCardComponent/UNCardComponent.d.ts} +3 -1
- package/lib/typescript/components/UNCardComponent/UNCardComponent.utils.d.ts +6 -0
- package/lib/typescript/components/index.d.ts +4 -2
- package/lib/typescript/helpers/{BottomSheet.d.ts → BottomSheet/BottomSheet.d.ts} +3 -0
- package/lib/typescript/helpers/BottomSheet/BottomSheet.styles.d.ts +63 -0
- package/lib/typescript/helpers/EventBus.d.ts +5 -7
- package/lib/typescript/hooks/listenerToBus.d.ts +7 -0
- package/lib/typescript/hooks/useAppStateListener.d.ts +1 -0
- package/lib/typescript/index.d.ts +2 -0
- package/lib/typescript/messages/nativeMessages/index.d.ts +3 -0
- package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +8 -0
- package/lib/typescript/{webComponent → messages}/webMessages/cardMessage.d.ts +3 -2
- package/lib/typescript/messages/webMessages/index.d.ts +11 -0
- package/lib/typescript/{webComponent → messages}/webMessages/pageMessage.d.ts +0 -0
- package/lib/typescript/{webComponent → messages}/webMessages/unitMessages.d.ts +0 -0
- package/lib/typescript/nativeComponent/UNNativeAddToWalletButton.d.ts +6 -0
- package/lib/typescript/scripts/html/bodyHtml.d.ts +7 -0
- package/lib/typescript/scripts/html/bodyScript.d.ts +11 -0
- package/lib/typescript/sharedTypes/bookPayment.types.d.ts +26 -0
- package/lib/typescript/sharedTypes/card.types.d.ts +56 -0
- package/lib/typescript/sharedTypes/index.d.ts +2 -0
- package/lib/typescript/sharedTypes/types.d.ts +27 -0
- package/lib/typescript/styles/variables.d.ts +9 -0
- package/lib/typescript/unitSdkManager/UnitSdk.api.d.ts +3 -0
- package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +15 -0
- package/lib/typescript/webComponent/WebComponent.d.ts +9 -11
- package/lib/typescript/webComponent/html.d.ts +6 -1
- package/package.json +9 -5
- package/{unit-react-native-components.podspec → react-native-unit-components.podspec} +1 -1
- package/src/assets/images/close.png +0 -0
- package/src/assets/images/index.ts +1 -0
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +21 -0
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +11 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +37 -0
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +29 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.ts +1 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.ts +13 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +167 -0
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +34 -0
- package/src/components/UNCardComponent/UNCardComponent.tsx +73 -0
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +28 -0
- package/src/components/index.ts +4 -2
- package/src/custom.d.ts +5 -0
- package/src/helpers/BottomSheet/BottomSheet.styles.ts +70 -0
- package/src/helpers/{BottomSheet.tsx → BottomSheet/BottomSheet.tsx} +74 -110
- package/src/helpers/EventBus.ts +13 -13
- package/src/hooks/listenerToBus.ts +23 -0
- package/src/hooks/useAppStateListener.ts +25 -0
- package/src/index.tsx +5 -1
- package/src/messages/nativeMessages/index.ts +3 -0
- package/src/messages/webMessages/bookPaymentMessage.ts +12 -0
- package/src/{webComponent → messages}/webMessages/cardMessage.ts +4 -2
- package/src/messages/webMessages/index.ts +21 -0
- package/src/{webComponent → messages}/webMessages/pageMessage.ts +1 -1
- package/src/{webComponent → messages}/webMessages/unitMessages.ts +1 -0
- package/src/nativeComponent/UNNativeAddToWalletButton.tsx +12 -0
- package/src/scripts/html/bodyHtml.ts +46 -0
- package/src/scripts/html/bodyScript.ts +67 -0
- package/src/sharedTypes/bookPayment.types.ts +27 -0
- package/src/sharedTypes/card.types.ts +59 -0
- package/src/sharedTypes/index.ts +2 -0
- package/src/sharedTypes/types.ts +35 -0
- package/src/styles/variables.ts +9 -0
- package/src/unitSdkManager/UnitSdk.api.ts +31 -0
- package/src/unitSdkManager/UnitSdkManager.ts +33 -0
- package/src/webComponent/WebComponent.tsx +55 -45
- package/src/webComponent/html.ts +22 -46
- package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsViewManager.kt +0 -19
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js +0 -143
- package/lib/commonjs/components/BottomSheet/BottomSheetComponent.js.map +0 -1
- package/lib/commonjs/components/Card/CardComponent.js.map +0 -1
- package/lib/commonjs/helpers/BottomSheet.js.map +0 -1
- package/lib/commonjs/nativeComponenet/NativeComponentExample.js +0 -19
- package/lib/commonjs/nativeComponenet/NativeComponentExample.js.map +0 -1
- package/lib/commonjs/webComponent/webMessages/cardMessage.js.map +0 -1
- package/lib/commonjs/webComponent/webMessages/pageMessage.js.map +0 -1
- package/lib/commonjs/webComponent/webMessages/unitMessages.js.map +0 -1
- package/lib/module/components/BottomSheet/BottomSheetComponent.js +0 -118
- package/lib/module/components/BottomSheet/BottomSheetComponent.js.map +0 -1
- package/lib/module/components/Card/CardComponent.js +0 -75
- package/lib/module/components/Card/CardComponent.js.map +0 -1
- package/lib/module/helpers/BottomSheet.js.map +0 -1
- package/lib/module/nativeComponenet/NativeComponentExample.js +0 -10
- package/lib/module/nativeComponenet/NativeComponentExample.js.map +0 -1
- package/lib/module/webComponent/webMessages/cardMessage.js +0 -6
- package/lib/module/webComponent/webMessages/cardMessage.js.map +0 -1
- package/lib/module/webComponent/webMessages/pageMessage.js.map +0 -1
- package/lib/module/webComponent/webMessages/unitMessages.js.map +0 -1
- package/lib/typescript/components/BottomSheet/BottomSheetComponent.d.ts +0 -1
- package/lib/typescript/nativeComponenet/NativeComponentExample.d.ts +0 -7
- package/src/components/BottomSheet/BottomSheetComponent.tsx +0 -113
- package/src/components/Card/CardComponent.tsx +0 -75
- package/src/nativeComponenet/NativeComponentExample.tsx +0 -26
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Address, FullName, Limits, Relationship, Tags } from "./types"
|
|
2
|
+
|
|
3
|
+
export type UNCardData = IndividualDebitCard | BusinessDebitCard
|
|
4
|
+
|
|
5
|
+
type CardStatus = "Active" | "Inactive" | "Stolen" | "Lost" | "Frozen" | "ClosedByCustomer" | "SuspectedFraud"
|
|
6
|
+
|
|
7
|
+
type IndividualDebitCard = {
|
|
8
|
+
id: string,
|
|
9
|
+
type: "individualDebitCard" | "individualVirtualDebitCard",
|
|
10
|
+
attributes: {
|
|
11
|
+
createdAt: string,
|
|
12
|
+
last4Digits: string,
|
|
13
|
+
expirationDate: string,
|
|
14
|
+
status: CardStatus,
|
|
15
|
+
shippingAddress?: Address, /* not exists in virtual card */
|
|
16
|
+
updatedAt?: string,
|
|
17
|
+
design?: string,
|
|
18
|
+
additionalEmbossedText?: string,
|
|
19
|
+
idempotencyKey?: string,
|
|
20
|
+
tags?: Tags,
|
|
21
|
+
limits?: Limits,
|
|
22
|
+
printOnlyBusinessName?: boolean
|
|
23
|
+
},
|
|
24
|
+
relationships: {
|
|
25
|
+
account: Relationship,
|
|
26
|
+
customer: Relationship
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
type BusinessDebitCard = {
|
|
31
|
+
id: string,
|
|
32
|
+
type: "businessDebitCard" | "businessVirtualDebitCard",
|
|
33
|
+
attributes: {
|
|
34
|
+
fullName: FullName,
|
|
35
|
+
dateOfBirth: string,
|
|
36
|
+
address: Address,
|
|
37
|
+
shippingAddress?: Address,
|
|
38
|
+
phone: string,
|
|
39
|
+
email: string,
|
|
40
|
+
createdAt: string,
|
|
41
|
+
last4Digits: string,
|
|
42
|
+
expirationDate: string,
|
|
43
|
+
status: CardStatus,
|
|
44
|
+
updatedAt?: string,
|
|
45
|
+
ssn?: string,
|
|
46
|
+
passport?: string,
|
|
47
|
+
nationality?: string,
|
|
48
|
+
design?: string,
|
|
49
|
+
additionalEmbossedText?: string,
|
|
50
|
+
idempotencyKey?: string,
|
|
51
|
+
tags?: Record<string, string>
|
|
52
|
+
limits?: Limits,
|
|
53
|
+
printOnlyBusinessName?: boolean
|
|
54
|
+
},
|
|
55
|
+
relationships: {
|
|
56
|
+
account: Relationship,
|
|
57
|
+
customer: Relationship
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type Address = {
|
|
2
|
+
street: string,
|
|
3
|
+
street2?: string,
|
|
4
|
+
city: string,
|
|
5
|
+
state: string,
|
|
6
|
+
postalCode: string,
|
|
7
|
+
country: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type Limits = {
|
|
11
|
+
dailyWithdrawal?: string | number,
|
|
12
|
+
dailyPurchase?: string | number,
|
|
13
|
+
monthlyWithdrawal?: string | number,
|
|
14
|
+
monthlyPurchase?: string | number,
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type Data = {
|
|
18
|
+
type: string,
|
|
19
|
+
id: string
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type Relationship = {
|
|
23
|
+
data:
|
|
24
|
+
| null
|
|
25
|
+
| []
|
|
26
|
+
| Data
|
|
27
|
+
| Data[]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type FullName = {
|
|
31
|
+
first: string,
|
|
32
|
+
last: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type Tags = Record<string, string> // TODO: specify Tag type
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import EventBus from '../helpers/EventBus';
|
|
2
|
+
import { NativeMessage } from '../messages/nativeMessages';
|
|
3
|
+
import { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';
|
|
4
|
+
|
|
5
|
+
let isLoadingScript = false;
|
|
6
|
+
|
|
7
|
+
/** globalUnitScript is exported ONLY to our project components **/
|
|
8
|
+
export let globalUnitScript = '';
|
|
9
|
+
|
|
10
|
+
export const fetchUnitScript = async () => {
|
|
11
|
+
const env = UnitSDK.getEnv();
|
|
12
|
+
if (isLoadingScript || globalUnitScript || !env) {
|
|
13
|
+
// init function is called and success OR in progress
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
isLoadingScript = true;
|
|
17
|
+
try {
|
|
18
|
+
const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);
|
|
19
|
+
const unitScript = await unitScriptRes.text();
|
|
20
|
+
if (unitScript) {
|
|
21
|
+
EventBus.Instance.event(NativeMessage.IS_SCRIPT_FETCHED, { unitScript });
|
|
22
|
+
globalUnitScript = unitScript;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.log(e);
|
|
27
|
+
return null;
|
|
28
|
+
} finally {
|
|
29
|
+
isLoadingScript = false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { fetchUnitScript } from './UnitSdk.api';
|
|
2
|
+
|
|
3
|
+
export enum UNEnvironment {
|
|
4
|
+
sandbox = 'sandbox',
|
|
5
|
+
production = 'production'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const UNIT_SCRIPT_URL = {
|
|
9
|
+
[UNEnvironment.sandbox]: 'https://ui.s.unit.sh/components.js',
|
|
10
|
+
[UNEnvironment.production]: 'https://ui.unit.co/components.js'
|
|
11
|
+
};
|
|
12
|
+
export class UnitSDK {
|
|
13
|
+
protected static env?: UNEnvironment;
|
|
14
|
+
protected static theme?: string;
|
|
15
|
+
|
|
16
|
+
public static init = async (env: UNEnvironment, theme?: string) => {
|
|
17
|
+
try {
|
|
18
|
+
this.env = env;
|
|
19
|
+
this.theme = theme;
|
|
20
|
+
await fetchUnitScript();
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.log(e);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
public static getEnv = () => {
|
|
27
|
+
return this.env;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
public static getTheme = () => {
|
|
31
|
+
return this.theme;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -1,75 +1,85 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from '
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import
|
|
10
|
-
import type {
|
|
11
|
-
import type { PageEvent, PageMessage } from './webMessages/pageMessage';
|
|
12
|
-
import { RequestRefreshEvent, UnitEvent, UnitMessage } from './webMessages/unitMessages';
|
|
13
|
-
|
|
14
|
-
export type WebViewMessageType =
|
|
15
|
-
| PageMessage
|
|
16
|
-
| CardMessage
|
|
17
|
-
| UnitMessage
|
|
18
|
-
|
|
19
|
-
type WebViewEvent =
|
|
20
|
-
| PageEvent
|
|
21
|
-
| UnitEvent
|
|
22
|
-
| CardEvent
|
|
23
|
-
|
|
24
|
-
export interface WebViewMessage {
|
|
25
|
-
type: WebViewMessageType,
|
|
26
|
-
details?: WebViewEvent
|
|
27
|
-
}
|
|
3
|
+
import { WebView, WebViewMessageEvent } from 'react-native-webview';
|
|
4
|
+
import EventBus from '../helpers/EventBus';
|
|
5
|
+
import html, { HTML_PLACEHOLDER } from './html';
|
|
6
|
+
import { RequestRefreshEvent, UnitMessage } from '../messages/webMessages/unitMessages';
|
|
7
|
+
import { useListenerToBus } from '../hooks/listenerToBus';
|
|
8
|
+
import { getHtmlBody, PresentationMode } from '../scripts/html/bodyHtml';
|
|
9
|
+
import { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';
|
|
10
|
+
import { NativeMessage } from '../messages/nativeMessages';
|
|
11
|
+
import type { WebViewMessage } from '../messages/webMessages';
|
|
28
12
|
|
|
29
13
|
export interface WebComponentProps {
|
|
30
14
|
type: WebComponentType;
|
|
15
|
+
presentationMode?: PresentationMode,
|
|
31
16
|
params?: string;
|
|
32
|
-
onMessage
|
|
17
|
+
onMessage?: (message: WebViewMessage) => void;
|
|
33
18
|
script?: string;
|
|
19
|
+
isScrollable?: boolean,
|
|
20
|
+
handleScroll?: (event: any) => void,
|
|
21
|
+
width?: number;
|
|
34
22
|
}
|
|
35
23
|
|
|
36
24
|
export enum WebComponentType {
|
|
37
25
|
card = 'unit-elements-card',
|
|
26
|
+
bookPayment = 'unit-elements-book-payment',
|
|
27
|
+
activity = 'unit-elements-activity',
|
|
38
28
|
slot = 'unit-elements-sdk-slot'
|
|
39
29
|
}
|
|
40
30
|
|
|
41
|
-
export const WebComponent = React.forwardRef<WebView, WebComponentProps>((props, webRef)
|
|
42
|
-
const [
|
|
31
|
+
export const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {
|
|
32
|
+
const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);
|
|
33
|
+
const [sourceHtml, setSourceHtml] = useState<string | null>(null);
|
|
34
|
+
const width = props.width ?? '100%';
|
|
35
|
+
|
|
36
|
+
const listenerAction = (data: { unitScript?: string }) => {
|
|
37
|
+
setUnitScript(data.unitScript);
|
|
38
|
+
};
|
|
43
39
|
|
|
44
|
-
|
|
40
|
+
useListenerToBus([{ busEventKey: NativeMessage.IS_SCRIPT_FETCHED, action: listenerAction }]);
|
|
45
41
|
|
|
46
42
|
useEffect(() => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}, [props.params])
|
|
43
|
+
if (!unitScript) {
|
|
44
|
+
fetchUnitScript();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
52
47
|
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), props.params, props.presentationMode));
|
|
49
|
+
newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');
|
|
50
|
+
setSourceHtml(newHtml);
|
|
51
|
+
|
|
52
|
+
}, [props.params, unitScript]);
|
|
55
53
|
|
|
54
|
+
const onMessage = (e: WebViewMessageEvent) => {
|
|
55
|
+
const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;
|
|
56
56
|
if (message.type == UnitMessage.UNIT_REQUEST_REFRESH && message.details) {
|
|
57
|
-
EventBus.Instance.event(
|
|
57
|
+
EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);
|
|
58
58
|
} else {
|
|
59
|
-
props.onMessage(message)
|
|
59
|
+
props.onMessage && props.onMessage(message);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
if (!sourceHtml) return null;
|
|
64
|
+
|
|
65
|
+
const _onScroll = (event: any) => {
|
|
66
|
+
if (props.handleScroll) {
|
|
67
|
+
props.handleScroll(event);
|
|
60
68
|
}
|
|
61
|
-
}
|
|
62
69
|
|
|
63
|
-
|
|
70
|
+
return null;
|
|
71
|
+
};
|
|
64
72
|
|
|
65
73
|
return (
|
|
66
74
|
<WebView
|
|
67
75
|
ref={webRef}
|
|
68
76
|
cacheEnabled={false}
|
|
69
|
-
scrollEnabled={
|
|
77
|
+
scrollEnabled={props.isScrollable}
|
|
78
|
+
onScroll={_onScroll}
|
|
70
79
|
overScrollMode="never"
|
|
71
|
-
|
|
80
|
+
injectedJavaScript={unitScript}
|
|
81
|
+
style={{ width: width, flex: 1 }}
|
|
72
82
|
source={{ html: sourceHtml }}
|
|
73
83
|
onMessage={onMessage} />
|
|
74
|
-
)
|
|
75
|
-
})
|
|
84
|
+
);
|
|
85
|
+
});
|
package/src/webComponent/html.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import { DISPTACH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT } from '../scripts/html/bodyScript';
|
|
2
|
+
|
|
3
|
+
export const HTML_PLACEHOLDER = {
|
|
4
|
+
SCRIPT_UNIT: '<SCRIPT_UNIT>',
|
|
5
|
+
BODY: '<BODY_HTML_CODE>',
|
|
6
|
+
SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>'
|
|
7
|
+
};
|
|
8
|
+
|
|
1
9
|
const htmlText = `
|
|
2
10
|
<!DOCTYPE html>
|
|
3
11
|
<html lang="en">
|
|
@@ -7,66 +15,34 @@ const htmlText = `
|
|
|
7
15
|
<script>
|
|
8
16
|
window.UnitMobileSDK = true
|
|
9
17
|
</script>
|
|
10
|
-
<script src="https://unit-white-labeled-banking.netlify.app/client-events.js"></script>
|
|
11
18
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
|
|
12
19
|
</html>
|
|
13
20
|
|
|
14
|
-
<body style="margin: 0">
|
|
15
|
-
|
|
21
|
+
<body style="margin: 0;">
|
|
22
|
+
${HTML_PLACEHOLDER.BODY}
|
|
16
23
|
|
|
17
24
|
<script>
|
|
18
|
-
|
|
19
|
-
if ('ReactNativeWebView' in window) {
|
|
20
|
-
const messageString = JSON.stringify(message)
|
|
21
|
-
window['ReactNativeWebView'].postMessage(messageString)
|
|
22
|
-
}
|
|
23
|
-
}
|
|
25
|
+
${POST_MESSAGE_TO_SDK}
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
setTimeout(() => {
|
|
27
|
-
const height = window.document.documentElement.getBoundingClientRect().height + 36
|
|
28
|
-
postMessageToSDK({ type: "pageHeight", details: { height } })
|
|
29
|
-
})
|
|
30
|
-
}
|
|
27
|
+
${POST_PAGE_HEIGHT}
|
|
31
28
|
|
|
32
|
-
|
|
33
|
-
postMessageToSDK({ type: "pageLoaded" })
|
|
34
|
-
});
|
|
29
|
+
${LISTENERS.isPageLoaded}
|
|
35
30
|
|
|
36
|
-
|
|
37
|
-
postMessageToSDK({ type: "unitRequestRendering", details: { data: JSON.stringify(e.detail) }})
|
|
38
|
-
});
|
|
31
|
+
${LISTENERS.onLoad}
|
|
39
32
|
|
|
40
|
-
|
|
41
|
-
postHeight()
|
|
42
|
-
postMessageToSDK({ type: "unitOnLoad" })
|
|
43
|
-
});
|
|
33
|
+
${LISTENERS.requestRendering}
|
|
44
34
|
|
|
45
|
-
|
|
46
|
-
postMessageToSDK({ type: "unitRequestCloseFlow" })
|
|
47
|
-
});
|
|
35
|
+
${LISTENERS.requestOpenLink}
|
|
48
36
|
|
|
49
|
-
|
|
50
|
-
postMessageToSDK({ type: "unitRequestOpenLink", details: e.detail })
|
|
51
|
-
});
|
|
37
|
+
${LISTENERS.requestCloseFlow}
|
|
52
38
|
|
|
53
|
-
|
|
54
|
-
const response = e.detail
|
|
55
|
-
response.then((data) => {
|
|
56
|
-
postMessageToSDK({ type: "cardStatusChanged", details: { card: JSON.stringify(data.data) }})
|
|
57
|
-
}).catch((e) => {
|
|
58
|
-
console.log(e)
|
|
59
|
-
})
|
|
60
|
-
});
|
|
39
|
+
${LISTENERS.cardStatusChange}
|
|
61
40
|
|
|
62
|
-
|
|
63
|
-
const event = new CustomEvent("unitRequestRendering",{ detail: JSON.parse(details) })
|
|
64
|
-
window.dispatchEvent(event)
|
|
65
|
-
}
|
|
41
|
+
${DISPTACH_RENDERING_EVENT}
|
|
66
42
|
|
|
67
|
-
|
|
43
|
+
${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}
|
|
68
44
|
</script>
|
|
69
45
|
</body>
|
|
70
|
-
|
|
46
|
+
`;
|
|
71
47
|
|
|
72
|
-
export default htmlText
|
|
48
|
+
export default htmlText;
|
package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsViewManager.kt
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
package com.unitreactnativecomponents
|
|
2
|
-
import android.graphics.Color
|
|
3
|
-
import android.view.View
|
|
4
|
-
import com.facebook.react.uimanager.SimpleViewManager
|
|
5
|
-
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
-
import com.facebook.react.uimanager.annotations.ReactProp
|
|
7
|
-
|
|
8
|
-
class UnitReactNativeComponentsViewManager : SimpleViewManager<View>() {
|
|
9
|
-
override fun getName() = "UnitReactNativeComponentsView"
|
|
10
|
-
|
|
11
|
-
override fun createViewInstance(reactContext: ThemedReactContext): View {
|
|
12
|
-
return View(reactContext)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@ReactProp(name = "color")
|
|
16
|
-
fun setColor(view: View, color: String) {
|
|
17
|
-
view.setBackgroundColor(Color.parseColor(color))
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UNBottomSheetComponent = void 0;
|
|
7
|
-
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
|
|
10
|
-
var _WebComponent = require("../../webComponent/WebComponent");
|
|
11
|
-
|
|
12
|
-
var _reactNative = require("react-native");
|
|
13
|
-
|
|
14
|
-
var _BottomSheet = _interopRequireDefault(require("../../helpers/BottomSheet"));
|
|
15
|
-
|
|
16
|
-
var _EventBus = _interopRequireWildcard(require("../../helpers/EventBus"));
|
|
17
|
-
|
|
18
|
-
var _pageMessage = require("../../webComponent/webMessages/pageMessage");
|
|
19
|
-
|
|
20
|
-
var _unitMessages = require("../../webComponent/webMessages/unitMessages");
|
|
21
|
-
|
|
22
|
-
var _cardMessage = require("../../webComponent/webMessages/cardMessage");
|
|
23
|
-
|
|
24
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
|
-
|
|
26
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
27
|
-
|
|
28
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
|
-
|
|
30
|
-
const UNBottomSheetComponent = () => {
|
|
31
|
-
const [isActive, setIsActive] = (0, _react.useState)(false);
|
|
32
|
-
const [height, setHeight] = (0, _react.useState)(0);
|
|
33
|
-
const [renderingRequest, setRenderingRequest] = (0, _react.useState)(null);
|
|
34
|
-
const [waitForLoadingNewComponent, setWaitForLoadingNewComponent] = (0, _react.useState)(false);
|
|
35
|
-
const [newHeightMessage, setNewHeightMessage] = (0, _react.useState)(null);
|
|
36
|
-
const webRef = (0, _react.useRef)(null);
|
|
37
|
-
|
|
38
|
-
const _listener = data => {
|
|
39
|
-
setRenderingRequest(data);
|
|
40
|
-
setIsActive(true);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
(0, _react.useEffect)(() => {
|
|
44
|
-
if (!webRef.current) return;
|
|
45
|
-
|
|
46
|
-
if (renderingRequest) {
|
|
47
|
-
var _webRef$current;
|
|
48
|
-
|
|
49
|
-
(_webRef$current = webRef.current) === null || _webRef$current === void 0 ? void 0 : _webRef$current.injectJavaScript(`dispatchRenderingEvent('${renderingRequest}')`);
|
|
50
|
-
}
|
|
51
|
-
}, [webRef.current, renderingRequest]);
|
|
52
|
-
(0, _react.useEffect)(() => {
|
|
53
|
-
if (!isActive) {
|
|
54
|
-
setHeight(0);
|
|
55
|
-
setRenderingRequest(null);
|
|
56
|
-
}
|
|
57
|
-
}, [isActive]);
|
|
58
|
-
(0, _react.useEffect)(() => {
|
|
59
|
-
if (!waitForLoadingNewComponent && newHeightMessage) {
|
|
60
|
-
setWaitForLoadingNewComponent(false);
|
|
61
|
-
setNewHeight(newHeightMessage);
|
|
62
|
-
}
|
|
63
|
-
}, [waitForLoadingNewComponent, newHeightMessage]);
|
|
64
|
-
(0, _react.useEffect)(() => {
|
|
65
|
-
_EventBus.default.Instance.addListener(_EventBus.BusEvent.REQUEST_RENDERING, _listener);
|
|
66
|
-
|
|
67
|
-
return () => {
|
|
68
|
-
_EventBus.default.Instance.removeListener(_listener);
|
|
69
|
-
};
|
|
70
|
-
}, []);
|
|
71
|
-
|
|
72
|
-
const getBottomSheetScript = () => {
|
|
73
|
-
return `
|
|
74
|
-
window.addEventListener("unitRequestRefresh", (e) => {
|
|
75
|
-
postMessageToSDK({ type: "unitRequestRefresh", details: e.detail })
|
|
76
|
-
});
|
|
77
|
-
`;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const setNewHeight = message => {
|
|
81
|
-
if (renderingRequest) {
|
|
82
|
-
const nativePlace = JSON.parse(renderingRequest).nativePlace;
|
|
83
|
-
|
|
84
|
-
if (nativePlace == 'overFullScreen') {
|
|
85
|
-
const windowHeight = _reactNative.Dimensions.get('window').height * 0.94;
|
|
86
|
-
setHeight(windowHeight);
|
|
87
|
-
} else {
|
|
88
|
-
setHeight(message.details.height);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
94
|
-
pointerEvents: isActive ? undefined : 'none',
|
|
95
|
-
style: {
|
|
96
|
-
position: 'absolute',
|
|
97
|
-
top: 0,
|
|
98
|
-
bottom: 0,
|
|
99
|
-
left: 0,
|
|
100
|
-
right: 0
|
|
101
|
-
}
|
|
102
|
-
}, /*#__PURE__*/_react.default.createElement(_BottomSheet.default, {
|
|
103
|
-
isOpen: isActive,
|
|
104
|
-
onClose: () => setIsActive(false),
|
|
105
|
-
onOpen: () => setIsActive(true)
|
|
106
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
107
|
-
style: {
|
|
108
|
-
height,
|
|
109
|
-
paddingTop: height === 0 ? 0 : 10
|
|
110
|
-
}
|
|
111
|
-
}, /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
|
|
112
|
-
ref: webRef,
|
|
113
|
-
type: _WebComponent.WebComponentType.slot,
|
|
114
|
-
script: getBottomSheetScript(),
|
|
115
|
-
onMessage: message => {
|
|
116
|
-
if (renderingRequest && message.type == _pageMessage.PageMessage.PAGE_HEIGHT) {
|
|
117
|
-
setNewHeightMessage(message);
|
|
118
|
-
} else if (message.type == _unitMessages.UnitMessage.UNIT_REQUEST_RENDERING) {
|
|
119
|
-
const {
|
|
120
|
-
data
|
|
121
|
-
} = message.details;
|
|
122
|
-
|
|
123
|
-
if (data != renderingRequest) {
|
|
124
|
-
setHeight(0);
|
|
125
|
-
setRenderingRequest(data);
|
|
126
|
-
setWaitForLoadingNewComponent(true);
|
|
127
|
-
setTimeout(() => setWaitForLoadingNewComponent(false), 400);
|
|
128
|
-
}
|
|
129
|
-
} else if (message.type == _cardMessage.CardMessage.CARD_STATUS_CHANGE) {
|
|
130
|
-
_EventBus.default.Instance.event(_EventBus.BusEvent.CARD_STATUS_CHANGED, message.details.card);
|
|
131
|
-
} else if (message.type == _unitMessages.UnitMessage.UNIT_REQUEST_CLOSE_FLOW) {
|
|
132
|
-
setIsActive(false);
|
|
133
|
-
} else if (message.type == _unitMessages.UnitMessage.UNIT_REQUEST_OPEN_LINK) {
|
|
134
|
-
const href = message.details.href;
|
|
135
|
-
|
|
136
|
-
_reactNative.Linking.openURL(href);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
})))));
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
exports.UNBottomSheetComponent = UNBottomSheetComponent;
|
|
143
|
-
//# sourceMappingURL=BottomSheetComponent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["UNBottomSheetComponent","isActive","setIsActive","useState","height","setHeight","renderingRequest","setRenderingRequest","waitForLoadingNewComponent","setWaitForLoadingNewComponent","newHeightMessage","setNewHeightMessage","webRef","useRef","_listener","data","useEffect","current","injectJavaScript","setNewHeight","EventBus","Instance","addListener","BusEvent","REQUEST_RENDERING","removeListener","getBottomSheetScript","message","nativePlace","JSON","parse","windowHeight","Dimensions","get","details","undefined","position","top","bottom","left","right","paddingTop","WebComponentType","slot","type","PageMessage","PAGE_HEIGHT","UnitMessage","UNIT_REQUEST_RENDERING","setTimeout","CardMessage","CARD_STATUS_CHANGE","event","CARD_STATUS_CHANGED","card","UNIT_REQUEST_CLOSE_FLOW","UNIT_REQUEST_OPEN_LINK","href","Linking","openURL"],"sources":["BottomSheetComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport type WebView from \"react-native-webview\"\nimport { WebComponent, WebComponentType, WebViewMessage } from \"../../webComponent/WebComponent\"\nimport { Dimensions, Linking, View } from \"react-native\"\nimport BottomSheet from \"../../helpers/BottomSheet\"\nimport EventBus, { BusEvent } from \"../../helpers/EventBus\"\nimport { HeightEvent, PageMessage } from \"../../webComponent/webMessages/pageMessage\"\nimport { RequestOpenLinkEvent, RequestRenderingData, RequestRenderingEvent, UnitMessage } from \"../../webComponent/webMessages/unitMessages\"\nimport { CardMessage, CardStatusChangedEvent } from \"../../webComponent/webMessages/cardMessage\"\n\nexport const UNBottomSheetComponent = () => {\n const [isActive, setIsActive] = useState(false)\n const [height, setHeight] = useState(0)\n\n const [renderingRequest, setRenderingRequest] = useState<string | null>(null)\n\n const [waitForLoadingNewComponent, setWaitForLoadingNewComponent] = useState(false)\n const [newHeightMessage, setNewHeightMessage] = useState<WebViewMessage | null>(null)\n\n const webRef = useRef<WebView>(null)\n\n const _listener = (data: string) => {\n setRenderingRequest(data)\n setIsActive(true)\n }\n\n useEffect(() => {\n if (!webRef.current) return\n if (renderingRequest) {\n webRef.current?.injectJavaScript(`dispatchRenderingEvent('${renderingRequest}')`)\n }\n }, [webRef.current, renderingRequest])\n\n useEffect(() => {\n if (!isActive) {\n setHeight(0)\n setRenderingRequest(null)\n }\n }, [isActive])\n\n useEffect(() => {\n if (!waitForLoadingNewComponent && newHeightMessage) {\n setWaitForLoadingNewComponent(false)\n setNewHeight(newHeightMessage)\n }\n }, [waitForLoadingNewComponent, newHeightMessage])\n\n useEffect(() => {\n EventBus.Instance.addListener(BusEvent.REQUEST_RENDERING, _listener)\n\n return (() => {\n EventBus.Instance.removeListener(_listener)\n })\n }, [])\n\n const getBottomSheetScript = () => {\n return `\n window.addEventListener(\"unitRequestRefresh\", (e) => {\n postMessageToSDK({ type: \"unitRequestRefresh\", details: e.detail })\n });\n `\n }\n\n const setNewHeight = (message: WebViewMessage) => {\n if (renderingRequest) {\n const nativePlace = (JSON.parse(renderingRequest) as RequestRenderingData).nativePlace;\n if (nativePlace == 'overFullScreen') {\n const windowHeight = Dimensions.get('window').height * 0.94;\n setHeight(windowHeight)\n } else {\n setHeight((message.details as HeightEvent).height)\n }\n }\n }\n\n return (\n <>\n <View\n pointerEvents={isActive ? undefined : 'none'}\n style={{ position: 'absolute', top: 0, bottom: 0, left: 0, right: 0 }}\n >\n <BottomSheet\n isOpen={isActive}\n onClose={() => setIsActive(false)}\n onOpen={() => setIsActive(true)}\n >\n <View style={{ height, paddingTop: height === 0 ? 0 : 10 }}>\n <WebComponent ref={webRef} type={WebComponentType.slot} script={getBottomSheetScript()} onMessage={message => {\n if (renderingRequest && message.type == PageMessage.PAGE_HEIGHT) {\n setNewHeightMessage(message)\n } else if (message.type == UnitMessage.UNIT_REQUEST_RENDERING) {\n const { data } = (message.details! as RequestRenderingEvent)\n if (data != renderingRequest) {\n setHeight(0)\n setRenderingRequest(data)\n setWaitForLoadingNewComponent(true)\n setTimeout(() => setWaitForLoadingNewComponent(false), 400)\n }\n } else if (message.type == CardMessage.CARD_STATUS_CHANGE) {\n EventBus.Instance.event(BusEvent.CARD_STATUS_CHANGED, (message.details as CardStatusChangedEvent).card)\n } else if (message.type == UnitMessage.UNIT_REQUEST_CLOSE_FLOW) {\n setIsActive(false)\n } else if (message.type == UnitMessage.UNIT_REQUEST_OPEN_LINK) {\n const href = (message.details as RequestOpenLinkEvent).href\n Linking.openURL(href)\n }\n }} />\n </View>\n </BottomSheet>\n </View>\n </>\n )\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,sBAAsB,GAAG,MAAM;EAC1C,MAAM,CAACC,QAAD,EAAWC,WAAX,IAA0B,IAAAC,eAAA,EAAS,KAAT,CAAhC;EACA,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,IAAAF,eAAA,EAAS,CAAT,CAA5B;EAEA,MAAM,CAACG,gBAAD,EAAmBC,mBAAnB,IAA0C,IAAAJ,eAAA,EAAwB,IAAxB,CAAhD;EAEA,MAAM,CAACK,0BAAD,EAA6BC,6BAA7B,IAA8D,IAAAN,eAAA,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EO,IAAIA,OAAO,CAACiB,IAAR,IAAgBG,yBAAA,CAAYC,sBAAhC,EAAwD;QAC7D,MAAM;UAAEjC;QAAF,IAAYY,OAAO,CAACO,OAA1B;;QACA,IAAInB,IAAI,IAAIT,gBAAZ,EAA8B;UAC5BD,SAAS,CAAC,CAAD,CAAT;UACAE,mBAAmB,CAACQ,IAAD,CAAnB;UACAN,6BAA6B,CAAC,IAAD,CAA7B;UACAwC,UAAU,CAAC,MAAMxC,6BAA6B,CAAC,KAAD,CAApC,EAA6C,GAA7C,CAAV;QACD;MACF,CARM,MAQA,IAAIkB,OAAO,CAACiB,IAAR,IAAgBM,wBAAA,CAAYC,kBAAhC,EAAoD;QACzD/B,iBAAA,CAASC,QAAT,CAAkB+B,KAAlB,CAAwB7B,kBAAA,CAAS8B,mBAAjC,EAAuD1B,OAAO,CAACO,OAAT,CAA4CoB,IAAlG;MACD,CAFM,MAEA,IAAI3B,OAAO,CAACiB,IAAR,IAAgBG,yBAAA,CAAYQ,uBAAhC,EAAyD;QAC9DrD,WAAW,CAAC,KAAD,CAAX;MACD,CAFM,MAEA,IAAIyB,OAAO,CAACiB,IAAR,IAAgBG,yBAAA,CAAYS,sBAAhC,EAAwD;QAC7D,MAAMC,IAAI,GAAI9B,OAAO,CAACO,OAAT,CAA0CuB,IAAvD;;QACAC,oBAAA,CAAQC,OAAR,CAAgBF,IAAhB;MACD;IACF;EAnBD,EADF,CALF,CAJF,CADF,CADF;AAqCD,CAtGM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["UNCardComponent","props","height","setHeight","useState","requestRefreshEvent","setRequestRefreshEvent","webRef","useRef","useEffect","EventBus","Instance","addListener","BusEvent","CARD_STATUS_CHANGED","_cardStatusChanged","REQUEST_REFRESH","_requestRefresh","removeListener","card","onStatusChanged","data","dependencies","includes","WebComponentType","valueOf","resourceId","cardId","current","injectJavaScript","JSON","stringify","getCardParams","customerToken","getCardScript","message","type","UnitMessage","UNIT_REQUEST_RENDERING","event","REQUEST_RENDERING","details","PageMessage","PAGE_HEIGHT"],"sources":["CardComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\"\nimport { View } from \"react-native\";\nimport type WebView from \"react-native-webview\";\nimport { HeightEvent, PageMessage } from \"../../webComponent/webMessages/pageMessage\";\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from \"../../webComponent/webMessages/unitMessages\";\nimport EventBus, { BusEvent } from \"../../helpers/EventBus\"\nimport { WebComponent, WebComponentType } from \"../../webComponent/WebComponent\"\n\nexport interface UNCardComponentProps {\n cardId: string;\n customerToken: string;\n onStatusChanged?: (card: any) => void; // TODO - UNCard\n}\n\nexport const UNCardComponent = (props: UNCardComponentProps) => {\n const [height, setHeight] = useState(0)\n const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null)\n\n const webRef = useRef<WebView>(null)\n\n useEffect(() => {\n EventBus.Instance.addListener(BusEvent.CARD_STATUS_CHANGED, _cardStatusChanged)\n EventBus.Instance.addListener(BusEvent.REQUEST_REFRESH, _requestRefresh)\n return (() => {\n EventBus.Instance.removeListener(_cardStatusChanged)\n EventBus.Instance.removeListener(_requestRefresh)\n })\n }, [])\n\n const _cardStatusChanged = (card: any) => {\n if (props.onStatusChanged) {\n props.onStatusChanged(card)\n }\n }\n\n const _requestRefresh = (data: RequestRefreshEvent) => {\n setRequestRefreshEvent(data)\n }\n\n useEffect(() => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == props.cardId) {\n webRef.current?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`)\n }\n }, [requestRefreshEvent])\n\n const getCardParams = () => {\n return `\n cardId=\"${props.cardId}\"\n customerToken=\"${props.customerToken}\"\n src=\"https://d1xlopvhx2cz8k.cloudfront.net/resources/outlay.json\"\n `\n }\n\n const getCardScript = () => {\n return `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"unitRequestRefresh\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n `\n }\n\n return (\n <View style={{ height }}>\n <WebComponent ref={webRef} type={WebComponentType.card} params={getCardParams()} script={getCardScript()} onMessage={message => {\n if (message.type === UnitMessage.UNIT_REQUEST_RENDERING) {\n EventBus.Instance.event(BusEvent.REQUEST_RENDERING, (message.details as RequestRenderingEvent).data)\n }\n if (message.type == PageMessage.PAGE_HEIGHT) {\n setHeight((message.details as HeightEvent).height)\n }\n }} />\n </View>\n )\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAQO,MAAMA,eAAe,GAAIC,KAAD,IAAiC;EAC9D,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,IAAAC,eAAA,EAAS,CAAT,CAA5B;EACA,MAAM,CAACC,mBAAD,EAAsBC,sBAAtB,IAAgD,IAAAF,eAAA,EAAqC,IAArC,CAAtD;EAEA,MAAMG,MAAM,GAAG,IAAAC,aAAA,EAAgB,IAAhB,CAAf;EAEA,IAAAC,gBAAA,EAAU,MAAM;IACdC,iBAAA,CAASC,QAAT,CAAkBC,WAAlB,CAA8BC,kBAAA,CAASC,mBAAvC,EAA4DC,kBAA5D;;IACAL,iBAAA,CAASC,QAAT,CAAkBC,WAAlB,CAA8BC,kBAAA,CAASG,eAAvC,EAAwDC,eAAxD;;IACA,OAAQ,MAAM;MACZP,iBAAA,CAASC,QAAT,CAAkBO,cAAlB,CAAiCH,kBAAjC;;MACAL,iBAAA,CAASC,QAAT,CAAkBO,cAAlB,CAAiCD,eAAjC;IACD,CAHD;EAID,CAPD,EAOG,EAPH;;EASA,MAAMF,kBAAkB,GAAII,IAAD,IAAe;IACxC,IAAIlB,KAAK,CAACmB,eAAV,EAA2B;MACzBnB,KAAK,CAACmB,eAAN,CAAsBD,IAAtB;IACD;EACF,CAJD;;EAMA,MAAMF,eAAe,GAAII,IAAD,IAA+B;IACrDf,sBAAsB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AAT,CAAiCvC,MAAlC,CAAT;MACD;IACF;EAPD,EADF,CADF;AAYD,CA5DM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["BottomSheet","props","panelHeightValue","useRef","Animated","Value","sliderMaxHeight","current","fadeAnim","isPanelOpened","setIsPanelOpened","useState","isOpen","contentHeight","setContentHeight","undefined","currentHeight","setCurrentHeight","dy","setDy","_parentPanResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","_","gestureState","Math","abs","onPanResponderMove","expandToMaxHeightEnabled","setValue","onPanResponderRelease","collapse","setToContentHeight","expand","useEffect","fadeIn","_dismiss","BackHandler","addEventListener","_onBackPress","id","addListener","e","value","removeEventListener","removeListener","timing","toValue","duration","useNativeDriver","start","fadeOut","onClose","animationDuration","easing","Easing","quad","_setSize","newContentHeight","nativeEvent","layout","height","children","position","top","bottom","right","left","backgroundColor","flex","opacity","panHandlers","styles","container","transform","translateY","outerContent","lineContainer","line","innerContent","propTypes","PropTypes","oneOfType","node","bool","number","animation","func","onOpen","defaultProps","Dimensions","get","StyleSheet","marginTop","paddingHorizontal","shadowColor","shadowOffset","width","shadowOpacity","shadowRadius","elevation","borderTopLeftRadius","borderTopRightRadius","alignItems","borderRadius"],"sources":["BottomSheet.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useRef, useState } from 'react';\nimport {\n Animated,\n BackHandler,\n Dimensions,\n Easing,\n // Keyboard,\n LayoutChangeEvent,\n PanResponder,\n StyleSheet,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport PropTypes from 'prop-types';\n\nexport interface BottomSheetProps {\n isOpen: boolean\n children: ReactNode\n sliderMaxHeight: number\n onOpen: () => void\n onClose: () => void\n animationDuration: number,\n expandToMaxHeightEnabled: boolean\n}\n\nconst BottomSheet = (props: BottomSheetProps) => {\n const panelHeightValue = useRef(new Animated.Value(props.sliderMaxHeight)).current;\n const fadeAnim = useRef(new Animated.Value(0)).current;\n\n const [isPanelOpened, setIsPanelOpened] = useState(props.isOpen)\n const [contentHeight, setContentHeight] = useState<number | undefined>(undefined)\n\n const [currentHeight, setCurrentHeight] = useState<number>(props.sliderMaxHeight)\n\n const [dy, setDy] = useState(0)\n\n const _parentPanResponder = PanResponder.create({\n onMoveShouldSetPanResponderCapture: (_, gestureState) => {\n return Math.abs(gestureState.dy) > 10\n },\n onPanResponderMove(_, gestureState) {\n if (currentHeight + gestureState.dy < 0) return\n if (!props.expandToMaxHeightEnabled && currentHeight + gestureState.dy < sliderMaxHeight - contentHeight!) return\n panelHeightValue.setValue(currentHeight + gestureState.dy)\n setDy(gestureState.dy)\n },\n onPanResponderRelease: () => {\n if (dy > 0) {\n collapse()\n } else if (!props.expandToMaxHeightEnabled) {\n setToContentHeight(contentHeight!)\n } else if (dy < 0) {\n expand()\n } else {\n expand()\n }\n }\n });\n\n useEffect(() => {\n if (props.isOpen && !isPanelOpened) {\n fadeIn()\n } else if (isPanelOpened) {\n setContentHeight(0)\n _dismiss()\n }\n }, [props.isOpen])\n\n useEffect(() => {\n BackHandler.addEventListener('hardwareBackPress', _onBackPress);\n const id = panelHeightValue.addListener(e => setCurrentHeight(e.value))\n\n return (() => {\n BackHandler.removeEventListener('hardwareBackPress', _onBackPress);\n panelHeightValue.removeListener(id)\n })\n }, [])\n\n const fadeIn = () => {\n Animated.timing(fadeAnim, {\n toValue: 0.3,\n duration: 500,\n useNativeDriver: false\n }).start(() => { setIsPanelOpened(true) });\n };\n\n const fadeOut = () => {\n Animated.timing(fadeAnim, {\n toValue: 0,\n duration: 500,\n useNativeDriver: false\n }).start(() => {\n setIsPanelOpened(false)\n props.onClose()\n });\n };\n\n const setToContentHeight = (contentHeight: number) => {\n Animated.timing(panelHeightValue, {\n duration: props.animationDuration,\n easing: Easing.quad,\n toValue: sliderMaxHeight - contentHeight!,\n useNativeDriver: false,\n }).start()\n }\n\n const expand = () => {\n const { animationDuration } = props;\n\n if (currentHeight > (sliderMaxHeight - contentHeight!)) {\n setToContentHeight(contentHeight!)\n return\n }\n\n Animated.timing(panelHeightValue, {\n duration: animationDuration,\n easing: Easing.quad,\n toValue: 0,\n useNativeDriver: false,\n }).start()\n }\n\n const collapse = () => {\n if (currentHeight > (sliderMaxHeight - contentHeight!)) {\n _dismiss()\n return\n }\n\n setToContentHeight(contentHeight!)\n\n // Animated.timing(panelHeightValue, {\n // duration: animationDuration,\n // easing: Easing.quad,\n // toValue: sliderMaxHeight - contentHeight!,\n // useNativeDriver: false,\n // }).start(() => {\n // const isPanelOpenedNewValue = !isPanelOpened\n // setIsPanelOpened(isPanelOpenedNewValue)\n // if (isPanelOpenedNewValue) {\n // // onOpen();\n // } else {\n // // onClose();\n // Keyboard.dismiss();\n // }\n // });\n };\n\n const _onBackPress = () => {\n isPanelOpened && collapse();\n return isPanelOpened;\n };\n\n const _setSize = (e: LayoutChangeEvent) => {\n let newContentHeight = e.nativeEvent.layout.height\n if (newContentHeight !== 0) newContentHeight += 42;\n\n setContentHeight(newContentHeight)\n setToContentHeight(newContentHeight)\n };\n\n const _dismiss = () => {\n const { animationDuration } = props\n Animated.timing(panelHeightValue, {\n duration: animationDuration,\n easing: Easing.quad,\n toValue: sliderMaxHeight,\n useNativeDriver: false,\n }).start(() => {\n })\n fadeOut()\n }\n\n const {\n sliderMaxHeight,\n children,\n } = props;\n\n return (\n <>\n <TouchableOpacity\n style={{ position: 'absolute', top: 0, bottom: 0, right: 0, left: 0 }} activeOpacity={1}\n onPress={_dismiss}\n >\n <Animated.View\n style={{ backgroundColor: 'black', flex: 1, opacity: fadeAnim }}\n >\n </Animated.View>\n </TouchableOpacity>\n <Animated.View\n {..._parentPanResponder.panHandlers}\n style={{\n ...styles.container,\n height: sliderMaxHeight,\n transform: [\n { translateY: panelHeightValue },\n ],\n }}\n >\n <View\n style={styles.outerContent}\n >\n <TouchableOpacity activeOpacity={1}>\n <View style={styles.lineContainer}>\n <View style={styles.line} />\n </View>\n </TouchableOpacity>\n <View\n onLayout={_setSize}\n style={[styles.innerContent]}\n >\n {children}\n </View>\n </View>\n </Animated.View>\n </>\n );\n}\n\nBottomSheet.propTypes = {\n children: PropTypes.oneOfType([PropTypes.node]),\n isOpen: PropTypes.bool,\n sliderMaxHeight: PropTypes.number,\n animation: PropTypes.func,\n animationDuration: PropTypes.number,\n onOpen: PropTypes.func,\n onClose: PropTypes.func,\n expandToMaxHeightEnabled: PropTypes.bool\n};\n\nBottomSheet.defaultProps = {\n children: <View />,\n isOpen: true,\n sliderMaxHeight: Dimensions.get('window').height * 0.95,\n animationDuration: 200,\n onOpen: () => null,\n onClose: () => null,\n expandToMaxHeightEnabled: false\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n marginTop: 60,\n paddingHorizontal: 12,\n shadowColor: '#000000',\n shadowOffset: {\n width: 0,\n height: 6,\n },\n shadowOpacity: 0.37,\n shadowRadius: 7.49,\n elevation: 12,\n borderTopLeftRadius: 15,\n borderTopRightRadius: 15,\n backgroundColor: '#ffffff',\n },\n lineContainer: {\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n alignItems: 'center'\n },\n line: {\n width: 35,\n height: 4,\n borderRadius: 2,\n marginTop: 18,\n backgroundColor: '#D5DDE0',\n },\n outerContent: {\n flex: -1,\n },\n innerContent: {\n flex: -1,\n },\n});\n\nexport default BottomSheet;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAYA;;;;;;;;;;AAYA,MAAMA,WAAW,GAAIC,KAAD,IAA6B;EAC/C,MAAMC,gBAAgB,GAAG,IAAAC,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmBJ,KAAK,CAACK,eAAzB,CAAP,EAAkDC,OAA3E;EACA,MAAMC,QAAQ,GAAG,IAAAL,aAAA,EAAO,IAAIC,qBAAA,CAASC,KAAb,CAAmB,CAAnB,CAAP,EAA8BE,OAA/C;EAEA,MAAM,CAACE,aAAD,EAAgBC,gBAAhB,IAAoC,IAAAC,eAAA,EAASV,KAAK,CAACW,MAAf,CAA1C;EACA,MAAM,CAACC,aAAD,EAAg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ADR;IAEbC,oBAAoB,EAAE,EAFT;IAGbC,UAAU,EAAE;EAHC,CAjBgB;EAsB/BzB,IAAI,EAAE;IACJmB,KAAK,EAAE,EADH;IAEJpC,MAAM,EAAE,CAFJ;IAGJ2C,YAAY,EAAE,CAHV;IAIJX,SAAS,EAAE,EAJP;IAKJzB,eAAe,EAAE;EALb,CAtByB;EA6B/BQ,YAAY,EAAE;IACZP,IAAI,EAAE,CAAC;EADK,CA7BiB;EAgC/BU,YAAY,EAAE;IACZV,IAAI,EAAE,CAAC;EADK;AAhCiB,CAAlB,CAAf;;eAqCetE,W"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.UnitReactNativeComponentsView = void 0;
|
|
7
|
-
|
|
8
|
-
var _reactNative = require("react-native");
|
|
9
|
-
|
|
10
|
-
const LINKING_ERROR = `The package 'unit-react-native-components' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
|
|
11
|
-
ios: "- You have run 'pod install'\n",
|
|
12
|
-
default: ''
|
|
13
|
-
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo managed workflow\n';
|
|
14
|
-
const ComponentName = 'UnitReactNativeComponentsView';
|
|
15
|
-
const UnitReactNativeComponentsView = _reactNative.UIManager.getViewManagerConfig(ComponentName) != null ? (0, _reactNative.requireNativeComponent)(ComponentName) : () => {
|
|
16
|
-
throw new Error(LINKING_ERROR);
|
|
17
|
-
};
|
|
18
|
-
exports.UnitReactNativeComponentsView = UnitReactNativeComponentsView;
|
|
19
|
-
//# sourceMappingURL=NativeComponentExample.js.map
|