react-native-unit-components 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/unitreactnativecomponents/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/components/UNActivityComponent/UNActivityComponent.js +39 -8
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +0 -3
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +41 -10
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +0 -3
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +39 -6
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +2 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +0 -3
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js +7 -6
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/index.js +1 -0
- package/lib/commonjs/messages/nativeMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/pageMessage.js.map +1 -1
- package/lib/commonjs/nativeComponent/UNNativeAddToWalletButton.js +13 -0
- package/lib/commonjs/nativeComponent/UNNativeAddToWalletButton.js.map +1 -0
- package/lib/commonjs/scripts/html/bodyHtml.js +1 -1
- package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +8 -0
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.js +31 -6
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +33 -7
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +0 -2
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +36 -9
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +0 -2
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +37 -5
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js +2 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +0 -2
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.js +7 -6
- package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/messages/nativeMessages/index.js +1 -0
- package/lib/module/messages/nativeMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/pageMessage.js.map +1 -1
- package/lib/module/nativeComponent/UNNativeAddToWalletButton.js +4 -0
- package/lib/module/nativeComponent/UNNativeAddToWalletButton.js.map +1 -0
- package/lib/module/scripts/html/bodyHtml.js +1 -1
- package/lib/module/scripts/html/bodyHtml.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdkManager.js +3 -0
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/webComponent/WebComponent.js +29 -6
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +6 -0
- package/lib/typescript/helpers/BottomSheet/BottomSheet.d.ts +2 -0
- package/lib/typescript/messages/nativeMessages/index.d.ts +2 -1
- package/lib/typescript/nativeComponent/UNNativeAddToWalletButton.d.ts +6 -0
- package/lib/typescript/unitSdkManager/UnitSdkManager.d.ts +1 -1
- package/lib/typescript/webComponent/WebComponent.d.ts +5 -2
- package/package.json +1 -1
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +33 -7
- package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +0 -2
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +35 -9
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +0 -2
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +35 -4
- package/src/components/UNCardComponent/UNCardComponent.tsx +2 -1
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +0 -2
- package/src/helpers/BottomSheet/BottomSheet.tsx +7 -5
- package/src/messages/nativeMessages/index.ts +2 -1
- package/src/messages/webMessages/pageMessage.ts +1 -1
- package/src/nativeComponent/UNNativeAddToWalletButton.tsx +12 -0
- package/src/scripts/html/bodyHtml.ts +1 -1
- package/src/unitSdkManager/UnitSdkManager.ts +4 -1
- package/src/webComponent/WebComponent.tsx +33 -9
- package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsViewManager.kt +0 -19
- package/lib/commonjs/nativeComponenet/NativeComponentExample.js +0 -19
- package/lib/commonjs/nativeComponenet/NativeComponentExample.js.map +0 -1
- package/lib/module/nativeComponenet/NativeComponentExample.js +0 -10
- package/lib/module/nativeComponenet/NativeComponentExample.js.map +0 -1
- package/lib/typescript/nativeComponenet/NativeComponentExample.d.ts +0 -7
- package/src/nativeComponenet/NativeComponentExample.tsx +0 -26
|
@@ -5,7 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.UNActivityComponent = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
|
|
10
|
+
var _reactNative = require("react-native");
|
|
11
|
+
|
|
12
|
+
var _pageMessage = require("../../messages/webMessages/pageMessage");
|
|
9
13
|
|
|
10
14
|
var _bodyHtml = require("../../scripts/html/bodyHtml");
|
|
11
15
|
|
|
@@ -13,15 +17,42 @@ var _WebComponent = require("../../webComponent/WebComponent");
|
|
|
13
17
|
|
|
14
18
|
var _UNActivityComponent = require("./UNActivityComponent.utils");
|
|
15
19
|
|
|
16
|
-
function
|
|
20
|
+
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); }
|
|
21
|
+
|
|
22
|
+
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; }
|
|
23
|
+
|
|
24
|
+
const DEFAULT_HEIGHT = _reactNative.Dimensions.get('window').height * 0.5;
|
|
17
25
|
|
|
18
26
|
const UNActivityComponent = props => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
27
|
+
const [defaultHeight, setDefaultHeight] = (0, _react.useState)();
|
|
28
|
+
|
|
29
|
+
const handleWebViewMessage = message => {
|
|
30
|
+
if (message.type === _pageMessage.PageMessage.PAGE_HEIGHT) {
|
|
31
|
+
const currentHeight = message.details.height;
|
|
32
|
+
currentHeight === 0 && setDefaultHeight(DEFAULT_HEIGHT);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const renderActivityWebView = () => {
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
|
|
38
|
+
type: _WebComponent.WebComponentType.activity,
|
|
39
|
+
presentationMode: _bodyHtml.PresentationMode.Inherit,
|
|
40
|
+
params: (0, _UNActivityComponent.getActivityParams)(props),
|
|
41
|
+
onMessage: message => handleWebViewMessage(message),
|
|
42
|
+
nestedScrollEnabled: true,
|
|
43
|
+
theme: props.theme
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
if (!defaultHeight) {
|
|
48
|
+
return renderActivityWebView();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
52
|
+
style: {
|
|
53
|
+
height: defaultHeight
|
|
54
|
+
}
|
|
55
|
+
}, renderActivityWebView());
|
|
25
56
|
};
|
|
26
57
|
|
|
27
58
|
exports.UNActivityComponent = UNActivityComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNActivityComponent","props","WebComponentType","activity","PresentationMode","Inherit","getActivityParams"],"sources":["UNActivityComponent.tsx"],"sourcesContent":["import React from 'react';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { getActivityParams } from './UNActivityComponent.utils';\n\nexport interface UNActivityComponentProps {\n accountId: string;\n customerToken: string;\n theme?: string;\n}\n\nexport const UNActivityComponent = (props: UNActivityComponentProps) => {\n return (\n
|
|
1
|
+
{"version":3,"names":["DEFAULT_HEIGHT","Dimensions","get","height","UNActivityComponent","props","defaultHeight","setDefaultHeight","useState","handleWebViewMessage","message","type","PageMessage","PAGE_HEIGHT","currentHeight","details","renderActivityWebView","WebComponentType","activity","PresentationMode","Inherit","getActivityParams","theme"],"sources":["UNActivityComponent.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { getActivityParams } from './UNActivityComponent.utils';\n\nconst DEFAULT_HEIGHT = Dimensions.get('window').height * 0.5;\nexport interface UNActivityComponentProps {\n accountId: string;\n customerToken: string;\n theme?: string;\n}\n\nexport const UNActivityComponent = (props: UNActivityComponentProps) => {\n const [defaultHeight, setDefaultHeight] = useState<number>();\n const handleWebViewMessage = (message: WebViewMessage) => {\n if (message.type === PageMessage.PAGE_HEIGHT) {\n const currentHeight = (message.details as HeightEvent).height;\n currentHeight === 0 && setDefaultHeight(DEFAULT_HEIGHT);\n }\n };\n\n const renderActivityWebView = () => {\n return (\n <WebComponent\n type={WebComponentType.activity}\n presentationMode={PresentationMode.Inherit}\n params={getActivityParams(props)}\n onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}\n nestedScrollEnabled={true}\n theme={props.theme}\n />\n );\n };\n\n if (!defaultHeight) {\n return renderActivityWebView();\n }\n\n return (\n <View style={{ height: defaultHeight }}>\n {renderActivityWebView()}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,cAAc,GAAGC,uBAAA,CAAWC,GAAX,CAAe,QAAf,EAAyBC,MAAzB,GAAkC,GAAzD;;AAOO,MAAMC,mBAAmB,GAAIC,KAAD,IAAqC;EACtE,MAAM,CAACC,aAAD,EAAgBC,gBAAhB,IAAoC,IAAAC,eAAA,GAA1C;;EACA,MAAMC,oBAAoB,GAAIC,OAAD,IAA6B;IACxD,IAAIA,OAAO,CAACC,IAAR,KAAiBC,wBAAA,CAAYC,WAAjC,EAA8C;MAC5C,MAAMC,aAAa,GAAIJ,OAAO,CAACK,OAAT,CAAiCZ,MAAvD;MACAW,aAAa,KAAK,CAAlB,IAAuBP,gBAAgB,CAACP,cAAD,CAAvC;IACD;EACF,CALD;;EAOA,MAAMgB,qBAAqB,GAAG,MAAM;IAClC,oBACE,6BAAC,0BAAD;MACE,IAAI,EAAEC,8BAAA,CAAiBC,QADzB;MAEE,gBAAgB,EAAEC,0BAAA,CAAiBC,OAFrC;MAGE,MAAM,EAAE,IAAAC,sCAAA,EAAkBhB,KAAlB,CAHV;MAIE,SAAS,EAAGK,OAAD,IAA6BD,oBAAoB,CAACC,OAAD,CAJ9D;MAKE,mBAAmB,EAAE,IALvB;MAME,KAAK,EAAEL,KAAK,CAACiB;IANf,EADF;EAUD,CAXD;;EAaA,IAAI,CAAChB,aAAL,EAAoB;IAClB,OAAOU,qBAAqB,EAA5B;EACD;;EAED,oBACE,6BAAC,iBAAD;IAAM,KAAK,EAAE;MAAEb,MAAM,EAAEG;IAAV;EAAb,GACGU,qBAAqB,EADxB,CADF;AAKD,CA/BM"}
|
|
@@ -5,13 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getActivityParams = void 0;
|
|
7
7
|
|
|
8
|
-
var _UnitSdkManager = require("../../unitSdkManager/UnitSdkManager");
|
|
9
|
-
|
|
10
8
|
const getActivityParams = props => {
|
|
11
9
|
return `
|
|
12
10
|
account-id="${props.accountId}"
|
|
13
11
|
customer-token="${props.customerToken}"
|
|
14
|
-
theme="${props.theme ?? _UnitSdkManager.UnitSDK.getTheme()}"
|
|
15
12
|
style="height: 100%"
|
|
16
13
|
`;
|
|
17
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getActivityParams","props","accountId","customerToken"
|
|
1
|
+
{"version":3,"names":["getActivityParams","props","accountId","customerToken"],"sources":["UNActivityComponent.utils.ts"],"sourcesContent":["import type { UNActivityComponentProps } from './UNActivityComponent';\n\nexport const getActivityParams = (props: UNActivityComponentProps) => {\n return `\n account-id=\"${props.accountId}\"\n customer-token=\"${props.customerToken}\"\n style=\"height: 100%\"\n `;\n};\n"],"mappings":";;;;;;;AAEO,MAAMA,iBAAiB,GAAIC,KAAD,IAAqC;EACpE,OAAQ;AACV,kBAAkBA,KAAK,CAACC,SAAU;AAClC,sBAAsBD,KAAK,CAACE,aAAc;AAC1C;AACA,GAJE;AAKD,CANM"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.UNBookPaymentComponent = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _WebComponent = require("../../webComponent/WebComponent");
|
|
11
11
|
|
|
@@ -15,24 +15,55 @@ var _UNBookPaymentComponent = require("./UNBookPaymentComponent.utils");
|
|
|
15
15
|
|
|
16
16
|
var _bookPaymentMessage = require("../../messages/webMessages/bookPaymentMessage");
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
var _pageMessage = require("../../messages/webMessages/pageMessage");
|
|
19
|
+
|
|
20
|
+
var _reactNative = require("react-native");
|
|
21
|
+
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
19
25
|
|
|
20
26
|
const UNBookPaymentComponent = props => {
|
|
27
|
+
const [height, setHeight] = (0, _react.useState)(0);
|
|
28
|
+
const [presentationMode, setPresentationMode] = (0, _react.useState)(_bodyHtml.PresentationMode.Inherit);
|
|
29
|
+
|
|
21
30
|
const handleWebViewMessage = message => {
|
|
22
31
|
if (message.type === _bookPaymentMessage.BookPaymentMessage.PAYMENT_CREATED && props.onPaymentCreated) {
|
|
23
32
|
const response = message.details;
|
|
24
33
|
props.onPaymentCreated(response.data);
|
|
25
34
|
}
|
|
35
|
+
|
|
36
|
+
if (message.type === _pageMessage.PageMessage.PAGE_HEIGHT) {
|
|
37
|
+
const currentHeight = message.details.height;
|
|
38
|
+
setHeight(currentHeight);
|
|
39
|
+
|
|
40
|
+
if (presentationMode === _bodyHtml.PresentationMode.Inherit && currentHeight === 0) {
|
|
41
|
+
setPresentationMode(_bodyHtml.PresentationMode.Default);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const renderBookPaymentWebView = () => {
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
|
|
48
|
+
type: _WebComponent.WebComponentType.bookPayment,
|
|
49
|
+
presentationMode: presentationMode,
|
|
50
|
+
params: (0, _UNBookPaymentComponent.getBookPaymentParams)(props),
|
|
51
|
+
script: (0, _UNBookPaymentComponent.getBookPaymentScript)(),
|
|
52
|
+
onMessage: message => handleWebViewMessage(message),
|
|
53
|
+
isScrollable: false,
|
|
54
|
+
theme: props.theme
|
|
55
|
+
});
|
|
26
56
|
};
|
|
27
57
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
58
|
+
if (presentationMode === _bodyHtml.PresentationMode.Inherit) {
|
|
59
|
+
return renderBookPaymentWebView();
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
63
|
+
style: {
|
|
64
|
+
height: height
|
|
65
|
+
}
|
|
66
|
+
}, renderBookPaymentWebView());
|
|
36
67
|
};
|
|
37
68
|
|
|
38
69
|
exports.UNBookPaymentComponent = UNBookPaymentComponent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNBookPaymentComponent","props","handleWebViewMessage","message","type","BookPaymentMessage","PAYMENT_CREATED","onPaymentCreated","response","details","data","
|
|
1
|
+
{"version":3,"names":["UNBookPaymentComponent","props","height","setHeight","useState","presentationMode","setPresentationMode","PresentationMode","Inherit","handleWebViewMessage","message","type","BookPaymentMessage","PAYMENT_CREATED","onPaymentCreated","response","details","data","PageMessage","PAGE_HEIGHT","currentHeight","Default","renderBookPaymentWebView","WebComponentType","bookPayment","getBookPaymentParams","getBookPaymentScript","theme"],"sources":["UNBookPaymentComponent.tsx"],"sourcesContent":["import React, { useState } from 'react';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport { getBookPaymentParams, getBookPaymentScript } from './UNBookPaymentComponent.utils';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { BookPaymentEvent, BookPaymentMessage } from '../../messages/webMessages/bookPaymentMessage';\nimport type { UNBookPaymentData } from '../../sharedTypes';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { View } from 'react-native';\n\nexport interface UNBookPaymentComponentProps {\n accountId: string;\n customerToken: string;\n isSameCustomer: boolean;\n counterPartyAccountId: string;\n counterPartyName: string;\n theme?: string;\n onPaymentCreated?: (data: UNBookPaymentData) => void;\n}\n\nexport const UNBookPaymentComponent = (props: UNBookPaymentComponentProps) => {\n const [height, setHeight] = useState<number>(0);\n const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);\n\n const handleWebViewMessage = (message: WebViewMessage) => {\n if (message.type === BookPaymentMessage.PAYMENT_CREATED && props.onPaymentCreated) {\n const response = message.details as BookPaymentEvent;\n props.onPaymentCreated(response.data);\n }\n\n if (message.type === PageMessage.PAGE_HEIGHT) {\n const currentHeight = (message.details as HeightEvent).height;\n setHeight(currentHeight);\n if (presentationMode === PresentationMode.Inherit && currentHeight === 0) {\n setPresentationMode(PresentationMode.Default);\n }\n }\n };\n\n const renderBookPaymentWebView = () => {\n return (\n <WebComponent\n type={WebComponentType.bookPayment}\n presentationMode={presentationMode}\n params={getBookPaymentParams(props)}\n script={getBookPaymentScript()}\n onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}\n isScrollable={false}\n theme={props.theme}\n />\n );\n };\n\n if (presentationMode === PresentationMode.Inherit) {\n return renderBookPaymentWebView();\n }\n\n return (\n <View style={{ height: height }}>\n {renderBookPaymentWebView()}\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAEA;;AAEA;;AACA;;;;;;AAYO,MAAMA,sBAAsB,GAAIC,KAAD,IAAwC;EAC5E,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,IAAAC,eAAA,EAAiB,CAAjB,CAA5B;EACA,MAAM,CAACC,gBAAD,EAAmBC,mBAAnB,IA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exports.getBookPaymentScript = exports.getBookPaymentParams = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _bookPaymentMessage = require("../../messages/webMessages/bookPaymentMessage");
|
|
9
9
|
|
|
10
|
-
var _UnitSdkManager = require("../../unitSdkManager/UnitSdkManager");
|
|
11
|
-
|
|
12
10
|
const getBookPaymentParams = props => {
|
|
13
11
|
return `
|
|
14
12
|
account-id="${props.accountId}"
|
|
@@ -16,7 +14,6 @@ const getBookPaymentParams = props => {
|
|
|
16
14
|
is-same-customer="${props.isSameCustomer}"
|
|
17
15
|
counterparty-account-id="${props.counterPartyAccountId}"
|
|
18
16
|
counterparty-name="${props.counterPartyName}"
|
|
19
|
-
theme="${props.theme ?? _UnitSdkManager.UnitSDK.getTheme()}"
|
|
20
17
|
style="height: 100%"
|
|
21
18
|
`;
|
|
22
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getBookPaymentParams","props","accountId","customerToken","isSameCustomer","counterPartyAccountId","counterPartyName","
|
|
1
|
+
{"version":3,"names":["getBookPaymentParams","props","accountId","customerToken","isSameCustomer","counterPartyAccountId","counterPartyName","getBookPaymentScript","BookPaymentMessage","PAYMENT_CREATED"],"sources":["UNBookPaymentComponent.utils.ts"],"sourcesContent":["import type { UNBookPaymentComponentProps } from './UNBookPaymentComponent';\n\nimport { BookPaymentMessage } from '../../messages/webMessages/bookPaymentMessage';\n\nexport const getBookPaymentParams = (props: UNBookPaymentComponentProps) => {\n return `\n account-id=\"${props.accountId}\"\n customer-token=\"${props.customerToken}\"\n is-same-customer=\"${props.isSameCustomer}\"\n counterparty-account-id=\"${props.counterPartyAccountId}\"\n counterparty-name=\"${props.counterPartyName}\"\n style=\"height: 100%\"\n `;\n};\n\nexport const getBookPaymentScript = () => {\n return `\n window.addEventListener(\"${BookPaymentMessage.PAYMENT_CREATED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${BookPaymentMessage.PAYMENT_CREATED}\", details: { data: JSON.stringify(data.data) }})\n }).catch((e) => {\n console.log(e)\n })\n });\n `;\n};\n"],"mappings":";;;;;;;AAEA;;AAEO,MAAMA,oBAAoB,GAAIC,KAAD,IAAwC;EAC1E,OAAQ;AACV,kBAAkBA,KAAK,CAACC,SAAU;AAClC,sBAAsBD,KAAK,CAACE,aAAc;AAC1C,wBAAwBF,KAAK,CAACG,cAAe;AAC7C,+BAA+BH,KAAK,CAACI,qBAAsB;AAC3D,yBAAyBJ,KAAK,CAACK,gBAAiB;AAChD;AACA,GAPE;AAQD,CATM;;;;AAWA,MAAMC,oBAAoB,GAAG,MAAM;EACxC,OAAQ;AACV,+BAA+BC,sCAAA,CAAmBC,eAAgB;AAClE;AACA;AACA,sCAAsCD,sCAAA,CAAmBC,eAAgB;AACzE;AACA;AACA;AACA;AACA,GATE;AAUD,CAXM"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.UNBottomSheetComponent = void 0;
|
|
6
|
+
exports.UNBottomSheetComponent = exports.ScrollState = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
@@ -37,11 +37,22 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
37
37
|
|
|
38
38
|
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; }
|
|
39
39
|
|
|
40
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
41
|
+
let ScrollState;
|
|
42
|
+
exports.ScrollState = ScrollState;
|
|
43
|
+
|
|
44
|
+
(function (ScrollState) {
|
|
45
|
+
ScrollState["onTop"] = "onTop";
|
|
46
|
+
ScrollState["onlyWebView"] = "webViewScroll";
|
|
47
|
+
ScrollState["onlyBottomSheet"] = "onlyBottomSheet";
|
|
48
|
+
ScrollState["unScrollable"] = "unScrollable";
|
|
49
|
+
})(ScrollState || (exports.ScrollState = ScrollState = {}));
|
|
50
|
+
|
|
40
51
|
const UNBottomSheetComponent = () => {
|
|
41
52
|
const [isBottomSheetActive, setIsBottomSheetActive] = (0, _react.useState)(false);
|
|
42
53
|
const [height, setHeight] = (0, _react.useState)(0);
|
|
43
54
|
const [renderingRequest, setRenderingRequest] = (0, _react.useState)(null);
|
|
44
|
-
const [
|
|
55
|
+
const [scrollState, setScrollState] = (0, _react.useState)(ScrollState.onTop);
|
|
45
56
|
const [waitForLoadingNewComponent, setWaitForLoadingNewComponent] = (0, _react.useState)(false);
|
|
46
57
|
const [newHeightMessage, setNewHeightMessage] = (0, _react.useState)(null);
|
|
47
58
|
const isAppActive = (0, _useAppStateListener.useAppStateListener)();
|
|
@@ -70,6 +81,7 @@ const UNBottomSheetComponent = () => {
|
|
|
70
81
|
webRef.current && (0, _UNBottomSheetComponent.resetHtml)(webRef.current);
|
|
71
82
|
setHeight(0);
|
|
72
83
|
setRenderingRequest(null);
|
|
84
|
+
setScrollState(ScrollState.onTop);
|
|
73
85
|
}
|
|
74
86
|
}, [isBottomSheetActive]);
|
|
75
87
|
(0, _react.useEffect)(() => {
|
|
@@ -90,10 +102,10 @@ const UNBottomSheetComponent = () => {
|
|
|
90
102
|
if (nativePlace == 'overFullScreen') {
|
|
91
103
|
const bottomSheetNewHeight = (0, _UNBottomSheetComponent.handleHtmlFullHeight)(webRef.current, _reactNative.Dimensions.get('window').height);
|
|
92
104
|
setHeight(bottomSheetNewHeight);
|
|
93
|
-
|
|
105
|
+
setScrollState(ScrollState.onTop);
|
|
94
106
|
} else {
|
|
95
107
|
setHeight(message.details.height);
|
|
96
|
-
|
|
108
|
+
setScrollState(ScrollState.unScrollable);
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
};
|
|
@@ -140,6 +152,24 @@ const UNBottomSheetComponent = () => {
|
|
|
140
152
|
}
|
|
141
153
|
};
|
|
142
154
|
|
|
155
|
+
const onScrollWebView = event => {
|
|
156
|
+
if (scrollState === ScrollState.unScrollable) return;
|
|
157
|
+
const currY = event.nativeEvent.contentOffset.y;
|
|
158
|
+
|
|
159
|
+
if (ScrollState.onTop && currY < 5) {
|
|
160
|
+
setScrollState(ScrollState.onlyBottomSheet);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
if (scrollState !== ScrollState.onlyWebView && scrollState === ScrollState.onTop && currY > 5) {
|
|
164
|
+
setScrollState(ScrollState.onlyWebView);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const handleWebViewScroll = () => {
|
|
169
|
+
if (scrollState === ScrollState.unScrollable) return;
|
|
170
|
+
setScrollState(ScrollState.onlyWebView);
|
|
171
|
+
};
|
|
172
|
+
|
|
143
173
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
144
174
|
pointerEvents: isBottomSheetActive ? undefined : 'none',
|
|
145
175
|
style: styles.container
|
|
@@ -147,14 +177,17 @@ const UNBottomSheetComponent = () => {
|
|
|
147
177
|
isOpen: isBottomSheetActive,
|
|
148
178
|
height: height,
|
|
149
179
|
onClose: () => setIsBottomSheetActive(false),
|
|
150
|
-
onOpen: () => setIsBottomSheetActive(true)
|
|
180
|
+
onOpen: () => setIsBottomSheetActive(true),
|
|
181
|
+
handleWebViewScroll: () => handleWebViewScroll(),
|
|
182
|
+
shouldEnableBottomSheetScroll: scrollState !== ScrollState.onlyWebView
|
|
151
183
|
}, isAppActive && /*#__PURE__*/_react.default.createElement(_WebComponent.WebComponent, {
|
|
152
184
|
ref: webRef,
|
|
153
185
|
type: _WebComponent.WebComponentType.slot,
|
|
154
186
|
presentationMode: _bodyHtml.PresentationMode.CoverInjectedHeight,
|
|
155
187
|
script: (0, _UNBottomSheetComponent.getBottomSheetScript)(),
|
|
156
188
|
onMessage: onWebMessage,
|
|
157
|
-
|
|
189
|
+
isScrollable: scrollState === ScrollState.onlyWebView || scrollState === ScrollState.onTop,
|
|
190
|
+
handleScroll: onScrollWebView
|
|
158
191
|
}))));
|
|
159
192
|
};
|
|
160
193
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNBottomSheetComponent","isBottomSheetActive","setIsBottomSheetActive","useState","height","setHeight","renderingRequest","setRenderingRequest","shouldEnableWebViewScroll","setShouldEnableWebViewScroll","waitForLoadingNewComponent","setWaitForLoadingNewComponent","newHeightMessage","setNewHeightMessage","isAppActive","useAppStateListener","styles","getStylesObject","webRef","useRef","listenerAction","data","useEffect","current","renderingBottomSheetRequest","resetHtml","setNewHeight","useListenerToBus","busEventKey","UnitMessage","UNIT_REQUEST_RENDERING","action","message","nativePlace","JSON","parse","bottomSheetNewHeight","handleHtmlFullHeight","Dimensions","get","details","onWebMessage","type","PageMessage","PAGE_HEIGHT","setTimeout","CardMessage","CARD_STATUS_CHANGED","EventBus","Instance","event","card","UNIT_REQUEST_CLOSE_FLOW","UNIT_REQUEST_OPEN_LINK","href","Linking","openURL","undefined","container","WebComponentType","slot","PresentationMode","CoverInjectedHeight","getBottomSheetScript"],"sources":["UNBottomSheetComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport type WebView from 'react-native-webview';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { Dimensions, Linking, View } from 'react-native';\nimport BottomSheet from '../../helpers/BottomSheet/BottomSheet';\nimport EventBus from '../../helpers/EventBus';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { RequestOpenLinkEvent, RequestRenderingData, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { CardMessage, CardStatusChangedEvent } from '../../messages/webMessages/cardMessage';\nimport { useListenerToBus } from '../../hooks/listenerToBus';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { getBottomSheetScript, handleHtmlFullHeight, renderingBottomSheetRequest, resetHtml } from './UNBottomSheetComponent.utils';\nimport { getStylesObject } from './UNBottomSheetComponent.styles';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport { useAppStateListener } from '../../hooks/useAppStateListener';\n\nexport const UNBottomSheetComponent = () => {\n const [isBottomSheetActive, setIsBottomSheetActive] = useState(false);\n const [height, setHeight] = useState(0);\n\n const [renderingRequest, setRenderingRequest] = useState<string | null>(null);\n const [shouldEnableWebViewScroll, setShouldEnableWebViewScroll] = useState(false);\n\n const [waitForLoadingNewComponent, setWaitForLoadingNewComponent] = useState(false);\n const [newHeightMessage, setNewHeightMessage] = useState<WebViewMessage | null>(null);\n\n const isAppActive = useAppStateListener();\n\n const styles = getStylesObject();\n\n const webRef = useRef<WebView>(null);\n\n const listenerAction = (data: string) => {\n setRenderingRequest(data);\n setIsBottomSheetActive(true);\n };\n\n useEffect(() => {\n if (!isAppActive) {\n setIsBottomSheetActive(false);\n }\n }, [isAppActive]);\n\n useEffect(() => {\n if (!webRef.current) return;\n if (renderingRequest) {\n renderingBottomSheetRequest(webRef.current, renderingRequest);\n }\n }, [webRef.current, renderingRequest]);\n\n useEffect(() => {\n if (!isBottomSheetActive) {\n webRef.current && resetHtml(webRef.current);\n setHeight(0);\n setRenderingRequest(null);\n }\n }, [isBottomSheetActive]);\n\n useEffect(() => {\n if (!waitForLoadingNewComponent && newHeightMessage) {\n setWaitForLoadingNewComponent(false);\n setNewHeight(newHeightMessage);\n }\n }, [waitForLoadingNewComponent, newHeightMessage]);\n\n useListenerToBus([{ busEventKey: UnitMessage.UNIT_REQUEST_RENDERING, action: listenerAction }]);\n\n const setNewHeight = (message: WebViewMessage) => {\n if (renderingRequest) {\n const nativePlace = (JSON.parse(renderingRequest) as RequestRenderingData).nativePlace;\n if (nativePlace == 'overFullScreen') {\n const bottomSheetNewHeight = handleHtmlFullHeight(webRef.current, Dimensions.get('window').height);\n setHeight(bottomSheetNewHeight);\n setShouldEnableWebViewScroll(true);\n } else {\n setHeight((message.details as HeightEvent).height);\n setShouldEnableWebViewScroll(false);\n }\n }\n };\n\n const onWebMessage = (message: WebViewMessage) => {\n switch (message.type) {\n case PageMessage.PAGE_HEIGHT:\n renderingRequest && setNewHeightMessage(message);\n break;\n case UnitMessage.UNIT_REQUEST_RENDERING:\n // eslint-disable-next-line no-case-declarations\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 break;\n case CardMessage.CARD_STATUS_CHANGED:\n EventBus.Instance.event(CardMessage.CARD_STATUS_CHANGED, (message.details as CardStatusChangedEvent).card);\n break;\n case UnitMessage.UNIT_REQUEST_CLOSE_FLOW:\n setIsBottomSheetActive(false);\n break;\n case UnitMessage.UNIT_REQUEST_OPEN_LINK:\n // eslint-disable-next-line no-case-declarations\n const { href } = (message.details as RequestOpenLinkEvent);\n Linking.openURL(href);\n break;\n }\n };\n\n return (\n <>\n <View\n pointerEvents={isBottomSheetActive ? undefined : 'none'}\n style={styles.container}\n >\n <BottomSheet\n isOpen={isBottomSheetActive}\n height={height}\n onClose={() => setIsBottomSheetActive(false)}\n onOpen={() => setIsBottomSheetActive(true)}\n >\n { isAppActive && (\n <WebComponent\n ref={webRef}\n type={WebComponentType.slot}\n presentationMode={PresentationMode.CoverInjectedHeight}\n script={getBottomSheetScript()}\n onMessage={onWebMessage}\n shouldEnableWebViewScroll={shouldEnableWebViewSc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AAI,EAAEyC,8BAAA,CAAiBC,IAFzB;IAGE,gBAAgB,EAAEC,0BAAA,CAAiBC,mBAHrC;IAIE,MAAM,EAAE,IAAAC,4CAAA,GAJV;IAKE,SAAS,EAAEtB,YALb;IAME,yBAAyB,EAAEjC;EAN7B,EAPJ,CAJF,CADF,CADF;AAyBD,CAvHM"}
|
|
1
|
+
{"version":3,"names":["ScrollState","UNBottomSheetComponent","isBottomSheetActive","setIsBottomSheetActive","useState","height","setHeight","renderingRequest","setRenderingRequest","scrollState","setScrollState","onTop","waitForLoadingNewComponent","setWaitForLoadingNewComponent","newHeightMessage","setNewHeightMessage","isAppActive","useAppStateListener","styles","getStylesObject","webRef","useRef","listenerAction","data","useEffect","current","renderingBottomSheetRequest","resetHtml","setNewHeight","useListenerToBus","busEventKey","UnitMessage","UNIT_REQUEST_RENDERING","action","message","nativePlace","JSON","parse","bottomSheetNewHeight","handleHtmlFullHeight","Dimensions","get","details","unScrollable","onWebMessage","type","PageMessage","PAGE_HEIGHT","setTimeout","CardMessage","CARD_STATUS_CHANGED","EventBus","Instance","event","card","UNIT_REQUEST_CLOSE_FLOW","UNIT_REQUEST_OPEN_LINK","href","Linking","openURL","onScrollWebView","currY","nativeEvent","contentOffset","y","onlyBottomSheet","onlyWebView","handleWebViewScroll","undefined","container","WebComponentType","slot","PresentationMode","CoverInjectedHeight","getBottomSheetScript"],"sources":["UNBottomSheetComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useRef, useState } from 'react';\nimport type WebView from 'react-native-webview';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { Dimensions, Linking, View } from 'react-native';\nimport BottomSheet from '../../helpers/BottomSheet/BottomSheet';\nimport EventBus from '../../helpers/EventBus';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { RequestOpenLinkEvent, RequestRenderingData, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport { CardMessage, CardStatusChangedEvent } from '../../messages/webMessages/cardMessage';\nimport { useListenerToBus } from '../../hooks/listenerToBus';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { getBottomSheetScript, handleHtmlFullHeight, renderingBottomSheetRequest, resetHtml } from './UNBottomSheetComponent.utils';\nimport { getStylesObject } from './UNBottomSheetComponent.styles';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport { useAppStateListener } from '../../hooks/useAppStateListener';\n\nexport enum ScrollState {\n onTop = 'onTop',\n onlyWebView = 'webViewScroll',\n onlyBottomSheet = 'onlyBottomSheet',\n unScrollable = 'unScrollable'\n}\n\nexport const UNBottomSheetComponent = () => {\n const [isBottomSheetActive, setIsBottomSheetActive] = useState(false);\n const [height, setHeight] = useState(0);\n\n const [renderingRequest, setRenderingRequest] = useState<string | null>(null);\n const [scrollState, setScrollState] = useState<ScrollState>(ScrollState.onTop);\n\n const [waitForLoadingNewComponent, setWaitForLoadingNewComponent] = useState(false);\n const [newHeightMessage, setNewHeightMessage] = useState<WebViewMessage | null>(null);\n\n const isAppActive = useAppStateListener();\n\n const styles = getStylesObject();\n\n const webRef = useRef<WebView>(null);\n\n const listenerAction = (data: string) => {\n setRenderingRequest(data);\n setIsBottomSheetActive(true);\n };\n\n useEffect(() => {\n if (!isAppActive) {\n setIsBottomSheetActive(false);\n }\n }, [isAppActive]);\n\n useEffect(() => {\n if (!webRef.current) return;\n if (renderingRequest) {\n renderingBottomSheetRequest(webRef.current, renderingRequest);\n }\n }, [webRef.current, renderingRequest]);\n\n useEffect(() => {\n if (!isBottomSheetActive) {\n webRef.current && resetHtml(webRef.current);\n setHeight(0);\n setRenderingRequest(null);\n setScrollState(ScrollState.onTop);\n }\n }, [isBottomSheetActive]);\n\n useEffect(() => {\n if (!waitForLoadingNewComponent && newHeightMessage) {\n setWaitForLoadingNewComponent(false);\n setNewHeight(newHeightMessage);\n }\n }, [waitForLoadingNewComponent, newHeightMessage]);\n\n useListenerToBus([{ busEventKey: UnitMessage.UNIT_REQUEST_RENDERING, action: listenerAction }]);\n\n const setNewHeight = (message: WebViewMessage) => {\n if (renderingRequest) {\n const nativePlace = (JSON.parse(renderingRequest) as RequestRenderingData).nativePlace;\n if (nativePlace == 'overFullScreen') {\n const bottomSheetNewHeight = handleHtmlFullHeight(webRef.current, Dimensions.get('window').height);\n setHeight(bottomSheetNewHeight);\n setScrollState(ScrollState.onTop);\n } else {\n setHeight((message.details as HeightEvent).height);\n setScrollState(ScrollState.unScrollable);\n }\n }\n };\n\n const onWebMessage = (message: WebViewMessage) => {\n switch (message.type) {\n case PageMessage.PAGE_HEIGHT:\n renderingRequest && setNewHeightMessage(message);\n break;\n case UnitMessage.UNIT_REQUEST_RENDERING:\n // eslint-disable-next-line no-case-declarations\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 break;\n case CardMessage.CARD_STATUS_CHANGED:\n EventBus.Instance.event(CardMessage.CARD_STATUS_CHANGED, (message.details as CardStatusChangedEvent).card);\n break;\n case UnitMessage.UNIT_REQUEST_CLOSE_FLOW:\n setIsBottomSheetActive(false);\n break;\n case UnitMessage.UNIT_REQUEST_OPEN_LINK:\n // eslint-disable-next-line no-case-declarations\n const { href } = (message.details as RequestOpenLinkEvent);\n Linking.openURL(href);\n break;\n }\n };\n\n const onScrollWebView = (event: any) => {\n if (scrollState === ScrollState.unScrollable) return;\n\n const currY = event.nativeEvent.contentOffset.y;\n\n if (ScrollState.onTop && currY < 5) {\n setScrollState(ScrollState.onlyBottomSheet);\n }\n\n if ( scrollState !== ScrollState.onlyWebView && scrollState === ScrollState.onTop && currY > 5) {\n setScrollState(ScrollState.onlyWebView);\n }\n };\n\n const handleWebViewScroll = () => {\n if (scrollState === ScrollState.unScrollable) return;\n setScrollState(ScrollState.onlyWebView);\n };\n\n return (\n <>\n <View\n pointerEvents={isBottomSheetActive ? undefined : 'none'}\n style={styles.container}\n >\n <BottomSheet\n isOpen={isBottomSheetActive}\n height={height}\n onClose={() => setIsBottomSheetActive(false)}\n onOpen={() => setIsBottomSheetActive(true)}\n handleWebViewScroll={() => handleWebViewScroll()}\n shouldEnableBottomSheetScroll={scrollState !== ScrollState.onlyWebView}\n >\n { isAppActive && (\n <WebComponent\n ref={webRef}\n type={WebComponentType.slot}\n presentationMode={PresentationMode.CoverInjectedHeight}\n script={getBottomSheetScript()}\n onMessage={onWebMessage}\n isScrollable={scrollState === ScrollState.onlyWebView || scrollState === ScrollState.onTop}\n handleScroll={onScrollWebView}\n />)}\n </BottomSheet>\n </View>\n </>\n );\n};\n"],"mappings":";;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;;;;;;;AAfA;IAiBYA,W;;;WAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,2BAAAA,W;;AAOL,MAAMC,sBAAsB,GAAG,MAAM;EAC1C,MAAM,CAACC,mBAAD,EAAsBC,sBAAtB,IAAgD,IAAAC,eAAA,EAAS,KAAT,CAAtD;EACA,MAAM,CAACC,MAAD,EAASC,SAAT,IAAsB,IAAAF,eAAA,EAAS,CAAT,CAA5B;EAEA,MAAM,CAACG,gBAAD,EAAmBC,mBAAnB,IAA0C,IAAAJ,eAAA,EAAwB,IAAxB,CAAhD;EACA,MAAM,CAACK,WAAD,EAAcC,cAAd,IAAgC,IAAAN,eAAA,EAAsBJ,WAAW,CAACW,KAAlC,CAAtC;EAEA,MAAM,CAACC,0BAAD,EAA6BC,6BAA7B,IAA8D,IAAAT,eAAA,EAAS,KAAT,CAApE;EACA,MAAM,CAACU,gBAAD,EAAmBC,mBAAnB,IAA0C,IAAAX,eAAA,EAAgC,IAAhC,CAAhD;EAEA,MAAMY,WAAW,GAAG,IAAAC,wCAAA,GAApB;EAEA,MAAMC,MAAM,GAAG,IAAAC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BACX,6BAAC,0BAAD;IACE,GAAG,EAAEI,MADP;IAEE,IAAI,EAAEkD,8BAAA,CAAiBC,IAFzB;IAGE,gBAAgB,EAAEC,0BAAA,CAAiBC,mBAHrC;IAIE,MAAM,EAAE,IAAAC,4CAAA,GAJV;IAKE,SAAS,EAAE9B,YALb;IAME,YAAY,EAAEnC,WAAW,KAAKT,WAAW,CAACkE,WAA5B,IAA2CzD,WAAW,KAAKT,WAAW,CAACW,KANvF;IAOE,YAAY,EAAEiD;EAPhB,EATJ,CAJF,CADF,CADF;AA4BD,CA9IM"}
|
|
@@ -82,10 +82,11 @@ const UNCardComponent = props => {
|
|
|
82
82
|
type: _WebComponent.WebComponentType.card,
|
|
83
83
|
presentationMode: _bodyHtml.PresentationMode.Default,
|
|
84
84
|
params: (0, _UNCardComponent.getCardParams)(props),
|
|
85
|
+
theme: props.theme,
|
|
85
86
|
script: (0, _UNCardComponent.getCardScript)(),
|
|
86
87
|
onMessage: message => handleMessage(message),
|
|
87
88
|
width: windowWidth,
|
|
88
|
-
|
|
89
|
+
isScrollable: false
|
|
89
90
|
}));
|
|
90
91
|
};
|
|
91
92
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNCardComponent","props","height","setHeight","useState","requestRefreshEvent","setRequestRefreshEvent","windowWidth","Dimensions","get","width","webRef","useRef","cardStatusChanged","card","onStatusChanged","requestRefresh","data","useListenerToBus","busEventKey","CardMessage","CARD_STATUS_CHANGED","action","UnitMessage","UNIT_REQUEST_REFRESH","useEffect","injectRefreshEventIfNeeded","current","cardId","handleMessage","message","type","UNIT_REQUEST_RENDERING","EventBus","Instance","event","details","PageMessage","PAGE_HEIGHT","WebComponentType","PresentationMode","Default","getCardParams","getCardScript"],"sources":["UNCardComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type WebView from 'react-native-webview';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport EventBus from '../../helpers/EventBus';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { useListenerToBus } from '../../hooks/listenerToBus';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { getCardParams, getCardScript, injectRefreshEventIfNeeded } from './UNCardComponent.utils';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport type { UNCardData } from '../../sharedTypes';\nimport { CardMessage } from '../../messages/webMessages/cardMessage';\n\nexport interface UNCardComponentProps {\n cardId: string;\n customerToken: string;\n theme?: string;\n onStatusChanged?: (card: UNCardData) => void;\n}\n\nexport const UNCardComponent = (props: UNCardComponentProps) => {\n const [height, setHeight] = useState(0);\n const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null);\n const windowWidth = Dimensions.get('window').width;\n\n const webRef = useRef<WebView>(null);\n\n const cardStatusChanged = (card: UNCardData) => {\n if (props.onStatusChanged) {\n props.onStatusChanged(card);\n }\n };\n\n const requestRefresh = (data: RequestRefreshEvent) => {\n setRequestRefreshEvent(data);\n };\n\n useListenerToBus([\n { busEventKey: CardMessage.CARD_STATUS_CHANGED, action: cardStatusChanged },\n { busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh },\n ]);\n\n useEffect(() => {\n injectRefreshEventIfNeeded(webRef.current, requestRefreshEvent, props.cardId);\n }, [requestRefreshEvent]);\n\n const handleMessage = (message: WebViewMessage) => {\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_RENDERING:\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_RENDERING, (message.details as RequestRenderingEvent).data);\n break;\n case PageMessage.PAGE_HEIGHT:\n setHeight((message.details as HeightEvent).height);\n break;\n }\n };\n\n return (\n <View style={{ height }}>\n <WebComponent\n ref={webRef}\n type={WebComponentType.card}\n presentationMode={PresentationMode.Default}\n params={getCardParams(props)}\n script={getCardScript()}\n onMessage={message => handleMessage(message)}\n width={windowWidth}\n
|
|
1
|
+
{"version":3,"names":["UNCardComponent","props","height","setHeight","useState","requestRefreshEvent","setRequestRefreshEvent","windowWidth","Dimensions","get","width","webRef","useRef","cardStatusChanged","card","onStatusChanged","requestRefresh","data","useListenerToBus","busEventKey","CardMessage","CARD_STATUS_CHANGED","action","UnitMessage","UNIT_REQUEST_REFRESH","useEffect","injectRefreshEventIfNeeded","current","cardId","handleMessage","message","type","UNIT_REQUEST_RENDERING","EventBus","Instance","event","details","PageMessage","PAGE_HEIGHT","WebComponentType","PresentationMode","Default","getCardParams","theme","getCardScript"],"sources":["UNCardComponent.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type WebView from 'react-native-webview';\nimport { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport EventBus from '../../helpers/EventBus';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport { useListenerToBus } from '../../hooks/listenerToBus';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { getCardParams, getCardScript, injectRefreshEventIfNeeded } from './UNCardComponent.utils';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport type { UNCardData } from '../../sharedTypes';\nimport { CardMessage } from '../../messages/webMessages/cardMessage';\n\nexport interface UNCardComponentProps {\n cardId: string;\n customerToken: string;\n theme?: string;\n onStatusChanged?: (card: UNCardData) => void;\n}\n\nexport const UNCardComponent = (props: UNCardComponentProps) => {\n const [height, setHeight] = useState(0);\n const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null);\n const windowWidth = Dimensions.get('window').width;\n\n const webRef = useRef<WebView>(null);\n\n const cardStatusChanged = (card: UNCardData) => {\n if (props.onStatusChanged) {\n props.onStatusChanged(card);\n }\n };\n\n const requestRefresh = (data: RequestRefreshEvent) => {\n setRequestRefreshEvent(data);\n };\n\n useListenerToBus([\n { busEventKey: CardMessage.CARD_STATUS_CHANGED, action: cardStatusChanged },\n { busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh },\n ]);\n\n useEffect(() => {\n injectRefreshEventIfNeeded(webRef.current, requestRefreshEvent, props.cardId);\n }, [requestRefreshEvent]);\n\n const handleMessage = (message: WebViewMessage) => {\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_RENDERING:\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_RENDERING, (message.details as RequestRenderingEvent).data);\n break;\n case PageMessage.PAGE_HEIGHT:\n setHeight((message.details as HeightEvent).height);\n break;\n }\n };\n\n return (\n <View style={{ height }}>\n <WebComponent\n ref={webRef}\n type={WebComponentType.card}\n presentationMode={PresentationMode.Default}\n params={getCardParams(props)}\n theme={props.theme}\n script={getCardScript()}\n onMessage={message => handleMessage(message)}\n width={windowWidth}\n isScrollable={false}\n />\n </View>\n );\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AAEA;;;;;;;;AASO,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;;EACA,MAAMG,WAAW,GAAGC,uBAAA,CAAWC,GAAX,CAAe,QAAf,EAAyBC,KAA7C;;EAEA,MAAMC,MAAM,GAAG,IAAAC,aAAA,EAAgB,IAAhB,CAAf;;EAEA,MAAMC,iBAAiB,GAAIC,IAAD,IAAsB;IAC9C,IAAIb,KAAK,CAACc,eAAV,EAA2B;MACzBd,KAAK,CAACc,eAAN,CAAsBD,IAAtB;IACD;EACF,CAJD;;EAMA,MAAME,cAAc,GAAIC,IAAD,IAA+B;IACpDX,sBAAsB,CAACW,IAAD,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/WebComponent");
|
|
|
9
9
|
|
|
10
10
|
var _unitMessages = require("../../messages/webMessages/unitMessages");
|
|
11
11
|
|
|
12
|
-
var _UnitSdkManager = require("../../unitSdkManager/UnitSdkManager");
|
|
13
|
-
|
|
14
12
|
const getCardParams = props => {
|
|
15
13
|
return `
|
|
16
14
|
card-id="${props.cardId}"
|
|
17
15
|
customer-token="${props.customerToken}"
|
|
18
|
-
theme="${props.theme ?? _UnitSdkManager.UnitSDK.getTheme()}"
|
|
19
16
|
`;
|
|
20
17
|
};
|
|
21
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getCardParams","props","cardId","customerToken","
|
|
1
|
+
{"version":3,"names":["getCardParams","props","cardId","customerToken","getCardScript","UnitMessage","UNIT_REQUEST_REFRESH","injectRefreshEventIfNeeded","currentWeb","requestRefreshEvent","dependencies","includes","WebComponentType","card","valueOf","resourceId","injectJavaScript","JSON","stringify"],"sources":["UNCardComponent.utils.ts"],"sourcesContent":["import type WebView from 'react-native-webview';\nimport type { UNCardComponentProps } from './UNCardComponent';\nimport { WebComponentType } from '../../webComponent/WebComponent';\nimport { RequestRefreshEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\n\nexport const getCardParams = (props: UNCardComponentProps) => {\n return `\n card-id=\"${props.cardId}\"\n customer-token=\"${props.customerToken}\"\n `;\n};\n\nexport const getCardScript = () => {\n return `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n `;\n};\n\nexport const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null, cardId: string) => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.card.valueOf()) && requestRefreshEvent.resourceId == cardId) {\n currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);\n }\n};\n"],"mappings":";;;;;;;AAEA;;AACA;;AAEO,MAAMA,aAAa,GAAIC,KAAD,IAAiC;EAC5D,OAAQ;AACV,eAAeA,KAAK,CAACC,MAAO;AAC5B,sBAAsBD,KAAK,CAACE,aAAc;AAC1C,GAHE;AAID,CALM;;;;AAOA,MAAMC,aAAa,GAAG,MAAM;EACjC,OAAQ;AACV;AACA,qCAAqCC,yBAAA,CAAYC,oBAAqB;AACtE;AACA;AACA,GALE;AAMD,CAPM;;;;AASA,MAAMC,0BAA0B,GAAG,CAACC,UAAD,EAA6BC,mBAA7B,EAA8EP,MAA9E,KAAiG;EACzI,IAAIO,mBAAmB,IAAIA,mBAAmB,CAACC,YAApB,CAAiCC,QAAjC,CAA0CC,8BAAA,CAAiBC,IAAjB,CAAsBC,OAAtB,EAA1C,CAAvB,IAAqGL,mBAAmB,CAACM,UAApB,IAAkCb,MAA3I,EAAmJ;IACjJM,UAAU,SAAV,IAAAA,UAAU,WAAV,YAAAA,UAAU,CAAEQ,gBAAZ,CAA8B,yBAAwBC,IAAI,CAACC,SAAL,CAAeT,mBAAf,CAAoC,IAA1F;EACD;AACF,CAJM"}
|
|
@@ -35,13 +35,15 @@ const BottomSheet = props => {
|
|
|
35
35
|
const [dy, setDy] = (0, _react.useState)(0);
|
|
36
36
|
|
|
37
37
|
const _parentPanResponder = _reactNative.PanResponder.create({
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//gestureState) => {
|
|
41
|
-
return false; // return Math.abs(gestureState.dy) > 10
|
|
38
|
+
onMoveShouldSetPanResponderCapture: (_, gestureState) => {
|
|
39
|
+
return props.shouldEnableBottomSheetScroll && Math.abs(gestureState.dy) > 10;
|
|
42
40
|
},
|
|
43
41
|
|
|
44
42
|
onPanResponderMove(_, gestureState) {
|
|
43
|
+
if (props.shouldEnableBottomSheetScroll && gestureState.dy < 5) {
|
|
44
|
+
props.handleWebViewScroll();
|
|
45
|
+
}
|
|
46
|
+
|
|
45
47
|
if (currentHeight + gestureState.dy < 0) return;
|
|
46
48
|
if (!props.expandToMaxHeightEnabled && contentHeight && currentHeight + gestureState.dy < sliderMaxHeight - contentHeight) return;
|
|
47
49
|
panelHeightValue.setValue(currentHeight + gestureState.dy);
|
|
@@ -193,8 +195,7 @@ const BottomSheet = props => {
|
|
|
193
195
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
194
196
|
source: _images.CloseIcon
|
|
195
197
|
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
196
|
-
onLayout: _setSize
|
|
197
|
-
style: [styles.innerContent]
|
|
198
|
+
onLayout: _setSize
|
|
198
199
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.KeyboardAvoidingView, {
|
|
199
200
|
behavior: "padding",
|
|
200
201
|
style: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BottomSheet","props","panelHeightValue","useRef","Animated","Value","sliderMaxHeight","current","fadeAnim","styles","getStylesObject","isPanelOpened","setIsPanelOpened","useState","isOpen","contentHeight","setContentHeight","undefined","currentHeight","setCurrentHeight","dy","setDy","_parentPanResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","_","onPanResponderMove","gestureState","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","outsideContainer","animation","panHandlers","container","transform","translateY","outerContent","closeButton","CloseIcon","innerContent","BOTTOM_SHEET_MAX_PRECANTAGE_SIZE","propTypes","PropTypes","oneOfType","node","bool","number","func","onOpen","defaultProps","Dimensions","get"],"sources":["BottomSheet.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useRef, useState } from 'react';\nimport {\n Animated,\n BackHandler,\n Dimensions,\n Easing,\n Image,\n KeyboardAvoidingView,\n LayoutChangeEvent,\n PanResponder,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport PropTypes from 'prop-types';\nimport { CloseIcon } from '../../assets/images';\nimport { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';\nimport { getStylesObject } from './BottomSheet.styles';\n\nexport interface BottomSheetProps {\n isOpen: boolean\n children: ReactNode\n sliderMaxHeight: number\n onOpen: () => void\n onClose: () => void\n height: number,\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 const styles = getStylesObject(fadeAnim);\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onMoveShouldSetPanResponderCapture: (_,) => { //gestureState) => {\n return false;\n // return Math.abs(gestureState.dy) > 10\n },\n onPanResponderMove(_, gestureState) {\n if (currentHeight + gestureState.dy < 0) return;\n if (!props.expandToMaxHeightEnabled && contentHeight && 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 contentHeight && 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 (contentHeight && 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 (contentHeight && currentHeight > (sliderMaxHeight - contentHeight)) {\n _dismiss();\n return;\n }\n\n contentHeight && setToContentHeight(contentHeight);\n };\n\n const _onBackPress = () => {\n isPanelOpened && collapse();\n return isPanelOpened;\n };\n\n const _setSize = (e: LayoutChangeEvent) => {\n const newContentHeight = e.nativeEvent.layout.height;\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 null;\n });\n fadeOut();\n };\n\n const {\n sliderMaxHeight,\n children,\n } = props;\n\n return (\n <>\n <TouchableOpacity\n style={styles.outsideContainer} activeOpacity={1}\n onPress={_dismiss}\n >\n <Animated.View\n style={styles.animation}\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\n activeOpacity={1}\n style={styles.closeButton}\n onPress={_dismiss}\n >\n <Image source={CloseIcon} />\n </TouchableOpacity>\n\n <View\n onLayout={_setSize}\n style={[styles.innerContent]}\n >\n <KeyboardAvoidingView\n behavior=\"padding\"\n style={{ height: props.height }}\n keyboardVerticalOffset={props.height * (1 - BOTTOM_SHEET_MAX_PRECANTAGE_SIZE)}\n >\n {children}\n </KeyboardAvoidingView>\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 * BOTTOM_SHEET_MAX_PRECANTAGE_SIZE,\n animationDuration: 200,\n onOpen: () => null,\n onClose: () => null,\n expandToMaxHeightEnabled: false\n};\n\nexport default BottomSheet;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAYA;;AACA;;AACA;;AACA;;;;;;;;;;AAaA,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;EACA,MAAME,MAAM,GAAG,IAAAC,4BAAA,EAAgBF,QAAhB,CAAf;EACA,MAAM,CAACG,aAAD,EAAgBC,gBAAhB,IAAoC,IAAAC,eAAA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,EAAEa,kBAAA,CAAUC,SAAV,CAAoB,CAACD,kBAAA,CAAUE,IAAX,CAApB,CADY;EAEtBhE,MAAM,EAAE8D,kBAAA,CAAUG,IAFI;EAGtBzE,eAAe,EAAEsE,kBAAA,CAAUI,MAHL;EAItBf,SAAS,EAAEW,kBAAA,CAAUK,IAJC;EAKtB3B,iBAAiB,EAAEsB,kBAAA,CAAUI,MALP;EAMtBE,MAAM,EAAEN,kBAAA,CAAUK,IANI;EAOtB5B,OAAO,EAAEuB,kBAAA,CAAUK,IAPG;EAQtBpD,wBAAwB,EAAE+C,kBAAA,CAAUG;AARd,CAAxB;AAWA/E,WAAW,CAACmF,YAAZ,GAA2B;EACzBpB,QAAQ,eAAE,6BAAC,iBAAD,OADe;EAEzBjD,MAAM,EAAE,IAFiB;EAGzBR,eAAe,EAAE8E,uBAAA,CAAWC,GAAX,CAAe,QAAf,EAAyBvB,MAAzB,GAAkCY,wDAH1B;EAIzBpB,iBAAiB,EAAE,GAJM;EAKzB4B,MAAM,EAAE,MAAM,IALW;EAMzB7B,OAAO,EAAE,MAAM,IANU;EAOzBxB,wBAAwB,EAAE;AAPD,CAA3B;eAUe7B,W"}
|
|
1
|
+
{"version":3,"names":["BottomSheet","props","panelHeightValue","useRef","Animated","Value","sliderMaxHeight","current","fadeAnim","styles","getStylesObject","isPanelOpened","setIsPanelOpened","useState","isOpen","contentHeight","setContentHeight","undefined","currentHeight","setCurrentHeight","dy","setDy","_parentPanResponder","PanResponder","create","onMoveShouldSetPanResponderCapture","_","gestureState","shouldEnableBottomSheetScroll","Math","abs","onPanResponderMove","handleWebViewScroll","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","outsideContainer","animation","panHandlers","container","transform","translateY","outerContent","closeButton","CloseIcon","BOTTOM_SHEET_MAX_PRECANTAGE_SIZE","propTypes","PropTypes","oneOfType","node","bool","number","func","onOpen","defaultProps","Dimensions","get"],"sources":["BottomSheet.tsx"],"sourcesContent":["import React, { ReactNode, useEffect, useRef, useState } from 'react';\nimport {\n Animated,\n BackHandler,\n Dimensions,\n Easing,\n Image,\n KeyboardAvoidingView,\n LayoutChangeEvent,\n PanResponder,\n TouchableOpacity,\n View,\n} from 'react-native';\nimport PropTypes from 'prop-types';\nimport { CloseIcon } from '../../assets/images';\nimport { BOTTOM_SHEET_MAX_PRECANTAGE_SIZE } from '../../components/UNBottomSheetComponent/UNBottomSheetComponent.constants';\nimport { getStylesObject } from './BottomSheet.styles';\n\nexport interface BottomSheetProps {\n isOpen: boolean\n children: ReactNode\n sliderMaxHeight: number\n onOpen: () => void\n onClose: () => void\n height: number,\n animationDuration: number,\n expandToMaxHeightEnabled: boolean\n handleWebViewScroll: () => void\n shouldEnableBottomSheetScroll: 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 const styles = getStylesObject(fadeAnim);\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 props.shouldEnableBottomSheetScroll && Math.abs(gestureState.dy) > 10;\n },\n onPanResponderMove(_, gestureState) {\n if (props.shouldEnableBottomSheetScroll && gestureState.dy < 5) {\n props.handleWebViewScroll();\n }\n if (currentHeight + gestureState.dy < 0) return;\n if (!props.expandToMaxHeightEnabled && contentHeight && 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 contentHeight && 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 (contentHeight && 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 (contentHeight && currentHeight > (sliderMaxHeight - contentHeight)) {\n _dismiss();\n return;\n }\n\n contentHeight && setToContentHeight(contentHeight);\n };\n\n const _onBackPress = () => {\n isPanelOpened && collapse();\n return isPanelOpened;\n };\n\n const _setSize = (e: LayoutChangeEvent) => {\n const newContentHeight = e.nativeEvent.layout.height;\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 null;\n });\n fadeOut();\n };\n\n const {\n sliderMaxHeight,\n children,\n } = props;\n\n return (\n <>\n <TouchableOpacity\n style={styles.outsideContainer} activeOpacity={1}\n onPress={_dismiss}\n >\n <Animated.View\n style={styles.animation}\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\n activeOpacity={1}\n style={styles.closeButton}\n onPress={_dismiss}\n >\n <Image source={CloseIcon} />\n </TouchableOpacity>\n\n <View\n onLayout={_setSize}\n >\n <KeyboardAvoidingView\n behavior=\"padding\"\n style={{ height: props.height }}\n keyboardVerticalOffset={props.height * (1 - BOTTOM_SHEET_MAX_PRECANTAGE_SIZE)}\n >\n {children}\n </KeyboardAvoidingView>\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 * BOTTOM_SHEET_MAX_PRECANTAGE_SIZE,\n animationDuration: 200,\n onOpen: () => null,\n onClose: () => null,\n expandToMaxHeightEnabled: false\n};\n\nexport default BottomSheet;\n"],"mappings":";;;;;;;AAAA;;AACA;;AAYA;;AACA;;AACA;;AACA;;;;;;;;;;AAeA,MAAMA,WAAW,GAAIC,KAAD,IAA6B;EAC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6 @@ exports.NativeMessage = NativeMessage;
|
|
|
9
9
|
|
|
10
10
|
(function (NativeMessage) {
|
|
11
11
|
NativeMessage["IS_SCRIPT_FETCHED"] = "isScriptFetched";
|
|
12
|
+
NativeMessage["IS_SDK_INITIALIZED"] = "isSdkInitialized";
|
|
12
13
|
})(NativeMessage || (exports.NativeMessage = NativeMessage = {}));
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeMessage"],"sources":["index.ts"],"sourcesContent":["export enum NativeMessage {\n IS_SCRIPT_FETCHED = 'isScriptFetched'\n}\n"],"mappings":";;;;;;IAAYA,a;;;WAAAA,a;EAAAA,a;GAAAA,a,6BAAAA,a"}
|
|
1
|
+
{"version":3,"names":["NativeMessage"],"sources":["index.ts"],"sourcesContent":["export enum NativeMessage {\n IS_SCRIPT_FETCHED = 'isScriptFetched',\n IS_SDK_INITIALIZED = 'isSdkInitialized'\n}\n"],"mappings":";;;;;;IAAYA,a;;;WAAAA,a;EAAAA,a;EAAAA,a;GAAAA,a,6BAAAA,a"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PageMessage"],"sources":["pageMessage.ts"],"sourcesContent":["export enum PageMessage {\n PAGE_LOADED = 'pageLoaded',\n PAGE_HEIGHT = 'pageHeight'
|
|
1
|
+
{"version":3,"names":["PageMessage"],"sources":["pageMessage.ts"],"sourcesContent":["export enum PageMessage {\n PAGE_LOADED = 'pageLoaded',\n PAGE_HEIGHT = 'pageHeight',\n}\n\nexport interface HeightEvent {\n height: number;\n}\n\nexport type PageEvent =\n | HeightEvent\n"],"mappings":";;;;;;IAAYA,W;;;WAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,2BAAAA,W"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
|
|
10
|
+
const UnitAddToWalletButtonView = (0, _reactNative.requireNativeComponent)('UnitAddToWalletButtonView');
|
|
11
|
+
var _default = UnitAddToWalletButtonView;
|
|
12
|
+
exports.default = _default;
|
|
13
|
+
//# sourceMappingURL=UNNativeAddToWalletButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UnitAddToWalletButtonView","requireNativeComponent"],"sources":["UNNativeAddToWalletButton.tsx"],"sourcesContent":["import {\n requireNativeComponent,\n} from 'react-native';\n\ntype UnitAddToWalletButtonViewProps = {\n style: object;\n onAddToWalletClicked: () => void;\n};\n\nconst UnitAddToWalletButtonView = requireNativeComponent<UnitAddToWalletButtonViewProps>('UnitAddToWalletButtonView');\n\nexport default UnitAddToWalletButtonView;\n"],"mappings":";;;;;;;AAAA;;AASA,MAAMA,yBAAyB,GAAG,IAAAC,mCAAA,EAAuD,2BAAvD,CAAlC;eAEeD,yB"}
|
|
@@ -16,7 +16,7 @@ exports.PresentationMode = PresentationMode;
|
|
|
16
16
|
})(PresentationMode || (exports.PresentationMode = PresentationMode = {}));
|
|
17
17
|
|
|
18
18
|
const getHtmlBody = (unitComponent, unitComponentProps, presentationMode) => {
|
|
19
|
-
const currentComponent = `<${unitComponent} ${unitComponentProps || ''}> </${unitComponent}>`;
|
|
19
|
+
const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;
|
|
20
20
|
|
|
21
21
|
switch (presentationMode) {
|
|
22
22
|
case PresentationMode.CoverInjectedHeight:
|