react-native-unit-components 1.0.4 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -8
- package/android/src/main/java/com/unitreactnativecomponents/UnitReactNativeComponentsPackage.kt +6 -1
- package/android/src/main/java/com/unitreactnativecomponents/getapplicationid/UNAppInfoModule.kt +35 -0
- package/lib/commonjs/assets/images/index.js +0 -2
- package/lib/commonjs/assets/images/index.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +64 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +31 -0
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +108 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +58 -0
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -0
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +3 -29
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +0 -11
- package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +2 -22
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +0 -8
- package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -23
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +3 -9
- package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +4 -59
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js +0 -3
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +0 -10
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +2 -24
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.styles.js +0 -3
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.styles.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js +13 -41
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js +3 -17
- package/lib/commonjs/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js +0 -2
- package/lib/commonjs/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +1 -1
- package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js +2 -9
- package/lib/commonjs/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/commonjs/components/index.js +22 -10
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js +5 -47
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js +0 -5
- package/lib/commonjs/helpers/BottomSheet/BottomSheet.styles.js.map +1 -1
- package/lib/commonjs/helpers/EventBus.js +4 -17
- package/lib/commonjs/helpers/EventBus.js.map +1 -1
- package/lib/commonjs/hooks/listenerToBus.js +14 -14
- package/lib/commonjs/hooks/listenerToBus.js.map +1 -1
- package/lib/commonjs/hooks/useAppStateListener.js +1 -6
- package/lib/commonjs/hooks/useAppStateListener.js.map +1 -1
- package/lib/commonjs/index.js +0 -5
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/cardMessage.js +0 -5
- package/lib/commonjs/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/nativeMessages/sdkMessage.js +0 -1
- package/lib/commonjs/messages/nativeMessages/sdkMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/achCreditMessage.js +6 -0
- package/lib/commonjs/messages/webMessages/achCreditMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js +0 -7
- package/lib/commonjs/messages/webMessages/bookPaymentMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/cardMessage.js +0 -1
- package/lib/commonjs/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/index.js.map +1 -1
- package/lib/commonjs/messages/webMessages/pageMessage.js +0 -1
- package/lib/commonjs/messages/webMessages/pageMessage.js.map +1 -1
- package/lib/commonjs/messages/webMessages/paymentsMessage.js +12 -0
- package/lib/commonjs/messages/webMessages/paymentsMessage.js.map +1 -0
- package/lib/commonjs/messages/webMessages/unitMessages.js +3 -1
- package/lib/commonjs/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/commonjs/nativeComponent/UnitAddToWalletButton.js +0 -2
- package/lib/commonjs/nativeComponent/UnitAddToWalletButton.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyHtml.js +0 -8
- package/lib/commonjs/scripts/html/bodyHtml.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +24 -6
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/sharedTypes/achCredit.types.js +6 -0
- package/lib/commonjs/sharedTypes/achCredit.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/bookPayment.types.js.map +1 -1
- package/lib/commonjs/sharedTypes/index.js +22 -6
- package/lib/commonjs/sharedTypes/index.js.map +1 -1
- package/lib/commonjs/sharedTypes/payments.types.js +12 -0
- package/lib/commonjs/sharedTypes/payments.types.js.map +1 -0
- package/lib/commonjs/sharedTypes/wallet.types.js +0 -3
- package/lib/commonjs/sharedTypes/wallet.types.js.map +1 -1
- package/lib/commonjs/styles/variables.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js +1 -15
- package/lib/commonjs/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js +3 -20
- package/lib/commonjs/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.js +7 -36
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.utils.js +0 -7
- package/lib/commonjs/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +7 -8
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/assets/images/index.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +55 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +23 -0
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +99 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +48 -0
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -0
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js +3 -11
- package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
- package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js +2 -9
- package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
- package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js +2 -11
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js +3 -3
- package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.constants.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +4 -35
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.styles.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js +2 -7
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.styles.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.js +13 -20
- package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js +3 -1
- package/lib/module/components/UNCardComponent/UNCardComponent.utils.js.map +1 -1
- package/lib/module/components/UNCardComponent/networking/common/UNNetworkConstants.js.map +1 -1
- package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js +1 -2
- package/lib/module/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.js.map +1 -1
- package/lib/module/components/index.js +2 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.js +5 -31
- package/lib/module/helpers/BottomSheet/BottomSheet.js.map +1 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js +2 -1
- package/lib/module/helpers/BottomSheet/BottomSheet.styles.js.map +1 -1
- package/lib/module/helpers/EventBus.js +4 -15
- package/lib/module/helpers/EventBus.js.map +1 -1
- package/lib/module/hooks/listenerToBus.js +14 -10
- package/lib/module/hooks/listenerToBus.js.map +1 -1
- package/lib/module/hooks/useAppStateListener.js +0 -2
- package/lib/module/hooks/useAppStateListener.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/messages/nativeMessages/cardMessage.js +0 -5
- package/lib/module/messages/nativeMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/nativeMessages/sdkMessage.js +0 -1
- package/lib/module/messages/nativeMessages/sdkMessage.js.map +1 -1
- package/lib/module/messages/webMessages/achCreditMessage.js +2 -0
- package/lib/module/messages/webMessages/achCreditMessage.js.map +1 -0
- package/lib/module/messages/webMessages/bookPaymentMessage.js +1 -5
- package/lib/module/messages/webMessages/bookPaymentMessage.js.map +1 -1
- package/lib/module/messages/webMessages/cardMessage.js +0 -1
- package/lib/module/messages/webMessages/cardMessage.js.map +1 -1
- package/lib/module/messages/webMessages/index.js.map +1 -1
- package/lib/module/messages/webMessages/pageMessage.js +0 -1
- package/lib/module/messages/webMessages/pageMessage.js.map +1 -1
- package/lib/module/messages/webMessages/paymentsMessage.js +5 -0
- package/lib/module/messages/webMessages/paymentsMessage.js.map +1 -0
- package/lib/module/messages/webMessages/unitMessages.js +3 -1
- package/lib/module/messages/webMessages/unitMessages.js.map +1 -1
- package/lib/module/nativeComponent/UnitAddToWalletButton.js.map +1 -1
- package/lib/module/scripts/html/bodyHtml.js +0 -7
- package/lib/module/scripts/html/bodyHtml.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +22 -1
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/sharedTypes/achCredit.types.js +2 -0
- package/lib/module/sharedTypes/achCredit.types.js.map +1 -0
- package/lib/module/sharedTypes/bookPayment.types.js.map +1 -1
- package/lib/module/sharedTypes/index.js +2 -0
- package/lib/module/sharedTypes/index.js.map +1 -1
- package/lib/module/sharedTypes/payments.types.js +5 -0
- package/lib/module/sharedTypes/payments.types.js.map +1 -0
- package/lib/module/sharedTypes/wallet.types.js +0 -3
- package/lib/module/sharedTypes/wallet.types.js.map +1 -1
- package/lib/module/styles/variables.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdk.api.js +1 -6
- package/lib/module/unitSdkManager/UnitSdk.api.js.map +1 -1
- package/lib/module/unitSdkManager/UnitSdkManager.js +3 -12
- package/lib/module/unitSdkManager/UnitSdkManager.js.map +1 -1
- package/lib/module/webComponent/WebComponent.js +7 -18
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/WebComponent.utils.js +0 -1
- package/lib/module/webComponent/WebComponent.utils.js.map +1 -1
- package/lib/module/webComponent/html.js +7 -5
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.d.ts +11 -0
- package/lib/typescript/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +3 -0
- package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.d.ts +11 -0
- package/lib/typescript/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +7 -0
- package/lib/typescript/components/UNBottomSheetComponent/UNBottomSheetComponent.d.ts +1 -1
- package/lib/typescript/components/UNCardComponent/UNCardComponent.d.ts +4 -1
- package/lib/typescript/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +2 -0
- package/lib/typescript/helpers/EventBus.d.ts +1 -1
- package/lib/typescript/hooks/listenerToBus.d.ts +2 -2
- package/lib/typescript/messages/nativeMessages/cardMessage.d.ts +1 -1
- package/lib/typescript/messages/nativeMessages/index.d.ts +2 -2
- package/lib/typescript/messages/nativeMessages/sdkMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/achCreditMessage.d.ts +5 -0
- package/lib/typescript/messages/webMessages/bookPaymentMessage.d.ts +1 -4
- package/lib/typescript/messages/webMessages/cardMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/index.d.ts +5 -3
- package/lib/typescript/messages/webMessages/pageMessage.d.ts +1 -1
- package/lib/typescript/messages/webMessages/paymentsMessage.d.ts +3 -0
- package/lib/typescript/messages/webMessages/unitMessages.d.ts +20 -2
- package/lib/typescript/nativeComponent/UnitAddToWalletButton.d.ts +1 -1
- package/lib/typescript/scripts/html/bodyScript.d.ts +3 -0
- package/lib/typescript/sharedTypes/achCredit.types.d.ts +31 -0
- package/lib/typescript/sharedTypes/bookPayment.types.d.ts +3 -4
- package/lib/typescript/sharedTypes/card.types.d.ts +4 -4
- package/lib/typescript/sharedTypes/index.d.ts +2 -0
- package/lib/typescript/sharedTypes/onLoadResponse.types.d.ts +3 -3
- package/lib/typescript/sharedTypes/payments.types.d.ts +12 -0
- package/lib/typescript/sharedTypes/types.d.ts +6 -6
- package/lib/typescript/webComponent/WebComponent.d.ts +3 -1
- package/package.json +4 -2
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +73 -0
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +26 -0
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +117 -0
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +48 -0
- package/src/components/UNAccountComponent/UNAccountComponent.tsx +2 -4
- package/src/components/UNActivityComponent/UNActivityComponent.tsx +1 -3
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +3 -2
- package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.utils.ts +3 -3
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +2 -4
- package/src/components/UNBottomSheetComponent/components/UNAddToWalletBottomSheetItem.tsx +1 -3
- package/src/components/UNCardComponent/UNCardComponent.tsx +14 -7
- package/src/components/UNCardComponent/UNCardComponent.utils.ts +3 -0
- package/src/components/UNCardComponent/networking/requests/UNWalletPayloadRequest.ts +1 -1
- package/src/components/index.ts +2 -0
- package/src/helpers/BottomSheet/BottomSheet.tsx +3 -7
- package/src/hooks/listenerToBus.ts +15 -10
- package/src/messages/webMessages/achCreditMessage.ts +8 -0
- package/src/messages/webMessages/bookPaymentMessage.ts +0 -4
- package/src/messages/webMessages/index.ts +7 -2
- package/src/messages/webMessages/paymentsMessage.ts +3 -0
- package/src/messages/webMessages/unitMessages.ts +25 -1
- package/src/scripts/html/bodyScript.ts +23 -1
- package/src/sharedTypes/achCredit.types.ts +32 -0
- package/src/sharedTypes/bookPayment.types.ts +2 -3
- package/src/sharedTypes/index.ts +2 -0
- package/src/sharedTypes/payments.types.ts +14 -0
- package/src/webComponent/WebComponent.tsx +5 -5
- package/src/webComponent/html.ts +7 -5
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export let UnitMessage;
|
|
2
|
-
|
|
3
2
|
(function (UnitMessage) {
|
|
4
3
|
UnitMessage["UNIT_REQUEST_RENDERING"] = "unitRequestRendering";
|
|
5
4
|
UnitMessage["UNIT_REQUEST_REFRESH"] = "unitRequestRefresh";
|
|
@@ -7,5 +6,8 @@ export let UnitMessage;
|
|
|
7
6
|
UnitMessage["UNIT_REQUEST_OPEN_LINK"] = "unitRequestOpenLink";
|
|
8
7
|
UnitMessage["UNIT_ON_LOAD"] = "unitOnLoad";
|
|
9
8
|
UnitMessage["UNIT_REQUEST_DOWNLOAD"] = "unitRequestDownload";
|
|
9
|
+
UnitMessage["UNIT_PLAID_TOKEN_CREATED"] = "unitPlaidLinkTokenCreated";
|
|
10
|
+
UnitMessage["UNIT_REQUEST_EXTERNAL_SDK"] = "unitRequestExternalSdk";
|
|
11
|
+
UnitMessage["UNIT_PLAID_RESPONSE"] = "unitPlaidResponse";
|
|
10
12
|
})(UnitMessage || (UnitMessage = {}));
|
|
11
13
|
//# sourceMappingURL=unitMessages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UnitMessage"],"sources":["unitMessages.ts"],"sourcesContent":["import type { ResponseUnitOnLoadEvent } from '../../sharedTypes';\n\nexport enum UnitMessage {\n UNIT_REQUEST_RENDERING = 'unitRequestRendering',\n UNIT_REQUEST_REFRESH = 'unitRequestRefresh',\n UNIT_REQUEST_CLOSE_FLOW = 'unitRequestCloseFlow',\n UNIT_REQUEST_OPEN_LINK = 'unitRequestOpenLink',\n UNIT_ON_LOAD = 'unitOnLoad',\n UNIT_REQUEST_DOWNLOAD = 'unitRequestDownload'\n}\nexport interface RequestRenderingEvent {\n data: RequestRenderingEventData\n}\n\nexport interface RequestRenderingEventData {\n actionType?: string,\n nativePlace: string,\n nativeComponent: string,\n}\n\nexport interface RequestRefreshEvent {\n refEvent: string;\n dependencies: string[];\n resourceId: string;\n}\n\nexport interface RequestOpenLinkEvent {\n href: string;\n target: string\n}\n\nexport interface RequestDownloadEvent {\n url: string\n accessToken: string\n fileType: string\n responseType: string\n fileName: string\n}\n\nexport type UnitEvent =\n | RequestRenderingEvent\n | RequestRefreshEvent\n | RequestOpenLinkEvent\n | ResponseUnitOnLoadEvent\n | RequestDownloadEvent\n"],"mappings":"AAEA,WAAYA,
|
|
1
|
+
{"version":3,"names":["UnitMessage"],"sources":["unitMessages.ts"],"sourcesContent":["import type { ResponseUnitOnLoadEvent } from '../../sharedTypes';\n\nexport enum UnitMessage {\n UNIT_REQUEST_RENDERING = 'unitRequestRendering',\n UNIT_REQUEST_REFRESH = 'unitRequestRefresh',\n UNIT_REQUEST_CLOSE_FLOW = 'unitRequestCloseFlow',\n UNIT_REQUEST_OPEN_LINK = 'unitRequestOpenLink',\n UNIT_ON_LOAD = 'unitOnLoad',\n UNIT_REQUEST_DOWNLOAD = 'unitRequestDownload',\n UNIT_PLAID_TOKEN_CREATED = 'unitPlaidLinkTokenCreated',\n UNIT_REQUEST_EXTERNAL_SDK = 'unitRequestExternalSdk',\n UNIT_PLAID_RESPONSE = 'unitPlaidResponse'\n\n}\nexport interface RequestRenderingEvent {\n data: RequestRenderingEventData\n}\n\nexport interface RequestRenderingEventData {\n actionType?: string,\n nativePlace: string,\n nativeComponent: string,\n}\n\nexport interface RequestRefreshEvent {\n refEvent: string;\n dependencies: string[];\n resourceId: string;\n}\n\nexport interface RequestOpenLinkEvent {\n href: string;\n target: string\n}\n\nexport interface RequestDownloadEvent {\n url: string\n accessToken: string\n fileType: string\n responseType: string\n fileName: string\n}\n\nexport interface PlaidTokenCreatedEvent {\n linkToken: PlaidLinkTokenData\n}\n\nexport interface PlaidLinkTokenData {\n type: string,\n attributes: PlaidLinkTokenAttributes\n}\n\ninterface PlaidLinkTokenAttributes {\n linkToken: string,\n expiration: string\n}\n\nexport interface RequestExternalSdkEvent {\n type: string\n}\n\nexport type UnitEvent =\n | RequestRenderingEvent\n | RequestRefreshEvent\n | RequestOpenLinkEvent\n | ResponseUnitOnLoadEvent\n | RequestDownloadEvent\n | PlaidTokenCreatedEvent\n | RequestExternalSdkEvent\n"],"mappings":"AAEA,WAAYA,WAAW;AAWtB,WAXWA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;AAAA,GAAXA,WAAW,KAAXA,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["requireNativeComponent","UnitAddToWalletButtonView"],"sources":["UnitAddToWalletButton.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,SACEA,
|
|
1
|
+
{"version":3,"names":["requireNativeComponent","UnitAddToWalletButtonView"],"sources":["UnitAddToWalletButton.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,SACEA,sBAAsB,QACjB,cAAc;AAOrB,MAAMC,yBAAyB,GAAGD,sBAAsB,CAAiC,2BAA2B,CAAC;AAErH,eAAeC,yBAAyB"}
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
export const webViewId = 'webViewContainer';
|
|
2
2
|
export let PresentationMode;
|
|
3
|
-
|
|
4
3
|
(function (PresentationMode) {
|
|
5
4
|
PresentationMode["CoverInjectedHeight"] = "coverInjectedHeight";
|
|
6
5
|
PresentationMode["Inherit"] = "inherit";
|
|
7
6
|
PresentationMode["Default"] = "deafult";
|
|
8
7
|
})(PresentationMode || (PresentationMode = {}));
|
|
9
|
-
|
|
10
8
|
export const getHtmlBody = (unitComponent, unitComponentProps, presentationMode) => {
|
|
11
9
|
const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;
|
|
12
|
-
|
|
13
10
|
switch (presentationMode) {
|
|
14
11
|
case PresentationMode.CoverInjectedHeight:
|
|
15
12
|
return getCoverInjectedHeightBodyScript(currentComponent);
|
|
16
|
-
|
|
17
13
|
case PresentationMode.Inherit:
|
|
18
14
|
return getInheritParentSizeScript(currentComponent);
|
|
19
|
-
|
|
20
15
|
default:
|
|
21
16
|
return currentComponent;
|
|
22
17
|
}
|
|
23
18
|
};
|
|
24
|
-
|
|
25
19
|
const getCoverInjectedHeightBodyScript = currentUnitScript => {
|
|
26
20
|
return `
|
|
27
21
|
<div id=${webViewId}>
|
|
@@ -31,7 +25,6 @@ const getCoverInjectedHeightBodyScript = currentUnitScript => {
|
|
|
31
25
|
</div>
|
|
32
26
|
`;
|
|
33
27
|
};
|
|
34
|
-
|
|
35
28
|
const getInheritParentSizeScript = currentUnitScript => {
|
|
36
29
|
return `
|
|
37
30
|
<div style="height: 100vh">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["webViewId","PresentationMode","getHtmlBody","unitComponent","unitComponentProps","presentationMode","currentComponent","CoverInjectedHeight","getCoverInjectedHeightBodyScript","Inherit","getInheritParentSizeScript","currentUnitScript"],"sources":["bodyHtml.ts"],"sourcesContent":["export const webViewId = 'webViewContainer';\n\nexport enum PresentationMode {\n /*\n CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.\n\n Inherit - inherit the parent size by style of 100 view height\n\n Default - return the unit component script\n */\n\n CoverInjectedHeight = 'coverInjectedHeight',\n Inherit = 'inherit',\n Default = 'deafult'\n}\n\nexport const getHtmlBody = (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => {\n const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;\n\n switch (presentationMode) {\n case PresentationMode.CoverInjectedHeight:\n return getCoverInjectedHeightBodyScript(currentComponent);\n case PresentationMode.Inherit:\n return getInheritParentSizeScript(currentComponent);\n default:\n return currentComponent;\n }\n};\n\nconst getCoverInjectedHeightBodyScript = (currentUnitScript: string) => {\n return `\n <div id=${webViewId}>\n <div style=\"height: 100%; display: block; padding: 1px;\">\n ${currentUnitScript}\n </div>\n </div>\n `;\n};\n\nconst getInheritParentSizeScript = (currentUnitScript: string) => {\n return `\n <div style=\"height: 100vh\">\n ${currentUnitScript}\n </div>\n `;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG,
|
|
1
|
+
{"version":3,"names":["webViewId","PresentationMode","getHtmlBody","unitComponent","unitComponentProps","presentationMode","currentComponent","CoverInjectedHeight","getCoverInjectedHeightBodyScript","Inherit","getInheritParentSizeScript","currentUnitScript"],"sources":["bodyHtml.ts"],"sourcesContent":["export const webViewId = 'webViewContainer';\n\nexport enum PresentationMode {\n /*\n CoverInjectedHeight - give id (<webViewId> param) to enable style injection to the root. Then cover the injected height.\n\n Inherit - inherit the parent size by style of 100 view height\n\n Default - return the unit component script\n */\n\n CoverInjectedHeight = 'coverInjectedHeight',\n Inherit = 'inherit',\n Default = 'deafult'\n}\n\nexport const getHtmlBody = (unitComponent: string, unitComponentProps?: string, presentationMode?: PresentationMode) => {\n const currentComponent = `<${unitComponent} ${unitComponentProps || ''} }> </${unitComponent}>`;\n\n switch (presentationMode) {\n case PresentationMode.CoverInjectedHeight:\n return getCoverInjectedHeightBodyScript(currentComponent);\n case PresentationMode.Inherit:\n return getInheritParentSizeScript(currentComponent);\n default:\n return currentComponent;\n }\n};\n\nconst getCoverInjectedHeightBodyScript = (currentUnitScript: string) => {\n return `\n <div id=${webViewId}>\n <div style=\"height: 100%; display: block; padding: 1px;\">\n ${currentUnitScript}\n </div>\n </div>\n `;\n};\n\nconst getInheritParentSizeScript = (currentUnitScript: string) => {\n return `\n <div style=\"height: 100vh\">\n ${currentUnitScript}\n </div>\n `;\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG,kBAAkB;AAE3C,WAAYC,gBAAgB;AAY3B,WAZWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB;AAc5B,OAAO,MAAMC,WAAW,GAAGA,CAACC,aAAqB,EAAEC,kBAA2B,EAAEC,gBAAmC,KAAK;EACtH,MAAMC,gBAAgB,GAAI,IAAGH,aAAc,IAAGC,kBAAkB,IAAI,EAAG,SAAQD,aAAc,GAAE;EAE/F,QAAQE,gBAAgB;IACtB,KAAKJ,gBAAgB,CAACM,mBAAmB;MACvC,OAAOC,gCAAgC,CAACF,gBAAgB,CAAC;IAC3D,KAAKL,gBAAgB,CAACQ,OAAO;MAC3B,OAAOC,0BAA0B,CAACJ,gBAAgB,CAAC;IACrD;MACE,OAAOA,gBAAgB;EAAC;AAE9B,CAAC;AAED,MAAME,gCAAgC,GAAIG,iBAAyB,IAAK;EACtE,OAAQ;AACV,cAAcX,SAAU;AACxB;AACA,UAAUW,iBAAkB;AAC5B;AACA;AACA,GAAG;AACH,CAAC;AAED,MAAMD,0BAA0B,GAAIC,iBAAyB,IAAK;EAChE,OAAQ;AACV;AACA,QAAQA,iBAAkB;AAC1B;AACA,GAAG;AACH,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
|
|
1
2
|
import { CardMessage } from '../../messages/webMessages/cardMessage';
|
|
2
3
|
import { PageMessage } from '../../messages/webMessages/pageMessage';
|
|
3
4
|
import { UnitMessage } from '../../messages/webMessages/unitMessages';
|
|
@@ -63,7 +64,21 @@ export const LISTENERS = {
|
|
|
63
64
|
console.log(e)
|
|
64
65
|
})
|
|
65
66
|
});
|
|
66
|
-
|
|
67
|
+
`,
|
|
68
|
+
unitRequestExternalSdk: `
|
|
69
|
+
window.addEventListener("${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}", (e) => {
|
|
70
|
+
postMessageToSDK({ type: "${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}", details: e.detail })
|
|
71
|
+
});
|
|
72
|
+
`,
|
|
73
|
+
unitPaymentCreated: `
|
|
74
|
+
window.addEventListener("${PaymentMessage.PAYMENT_CREATED}", (e) => {
|
|
75
|
+
const response = e.detail
|
|
76
|
+
response.then((data) => {
|
|
77
|
+
postMessageToSDK({ type: "${PaymentMessage.PAYMENT_CREATED}", details: { data: JSON.stringify(data.data) }})
|
|
78
|
+
}).catch((e) => {
|
|
79
|
+
console.log(e)
|
|
80
|
+
})
|
|
81
|
+
});`
|
|
67
82
|
};
|
|
68
83
|
export const DISPATCH_RENDERING_EVENT = `
|
|
69
84
|
const dispatchRenderingEvent = (details) => {
|
|
@@ -77,4 +92,10 @@ export const DISPATCH_REQUEST_REFRESH = `
|
|
|
77
92
|
window.dispatchEvent(event)
|
|
78
93
|
}
|
|
79
94
|
`;
|
|
95
|
+
export const DISPATCH_PLAID_RESPONSE = `
|
|
96
|
+
const dispatchPlaidEvent = (details) => {
|
|
97
|
+
const event = new CustomEvent("${UnitMessage.UNIT_PLAID_RESPONSE}",{ detail: details })
|
|
98
|
+
window.dispatchEvent(event)
|
|
99
|
+
}
|
|
100
|
+
`;
|
|
80
101
|
//# sourceMappingURL=bodyScript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CardMessage","PageMessage","UnitMessage","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","PAGE_HEIGHT","LISTENERS","isPageLoaded","PAGE_LOADED","requestRendering","UNIT_REQUEST_RENDERING","requestRefresh","UNIT_REQUEST_REFRESH","onLoad","UNIT_ON_LOAD","requestCloseFlow","UNIT_REQUEST_CLOSE_FLOW","requestOpenLink","UNIT_REQUEST_OPEN_LINK","unitRequestDownload","UNIT_REQUEST_DOWNLOAD","cardStatusChange","CARD_STATUS_CHANGED","DISPATCH_RENDERING_EVENT","DISPATCH_REQUEST_REFRESH"],"sources":["bodyScript.ts"],"sourcesContent":["import { CardMessage } from '../../messages/webMessages/cardMessage';\nimport { PageMessage } from '../../messages/webMessages/pageMessage';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\n\nexport const POST_MESSAGE_TO_SDK = `\n const postMessageToSDK = (message) => {\n if ('ReactNativeWebView' in window) {\n const messageString = JSON.stringify(message)\n window['ReactNativeWebView'].postMessage(messageString)\n }\n }\n`;\n\nexport const POST_PAGE_HEIGHT = `\n const postHeight = () => {\n setTimeout(() => {\n const height = window.document.documentElement.getBoundingClientRect().height\n postMessageToSDK({ type: \"${PageMessage.PAGE_HEIGHT}\", details: { height } })\n })\n }\n`;\n\nexport const LISTENERS = {\n isPageLoaded: `\n window.addEventListener('DOMContentLoaded', e => {\n postMessageToSDK({ type: \"${PageMessage.PAGE_LOADED}\" })\n });\n `,\n requestRendering: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_RENDERING}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_RENDERING}\", details: { data: e.detail }})\n });\n `,\n requestRefresh: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_REFRESH}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_REFRESH}\", details: e.detail })\n });\n `,\n onLoad: `\n window.addEventListener(\"${UnitMessage.UNIT_ON_LOAD}\", (e) => {\n postHeight()\n postMessageToSDK({ type: \"${UnitMessage.UNIT_ON_LOAD}\", details: e.detail })\n });\n `,\n requestCloseFlow: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\" })\n });\n `,\n requestOpenLink: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", details: e.detail })\n });\n `,\n unitRequestDownload: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", details: e.detail })\n });\n `,\n cardStatusChange: `\n window.addEventListener(\"${CardMessage.CARD_STATUS_CHANGED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${CardMessage.CARD_STATUS_CHANGED}\", details: { card: JSON.stringify(data.data) }})\n }).catch((e) => {\n console.log(e)\n })\n });\n `\n};\n\nexport const DISPATCH_RENDERING_EVENT = `\n const dispatchRenderingEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_RENDERING}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n\nexport const DISPATCH_REQUEST_REFRESH = `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n"],"mappings":"AAAA,SAASA,
|
|
1
|
+
{"version":3,"names":["PaymentMessage","CardMessage","PageMessage","UnitMessage","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","PAGE_HEIGHT","LISTENERS","isPageLoaded","PAGE_LOADED","requestRendering","UNIT_REQUEST_RENDERING","requestRefresh","UNIT_REQUEST_REFRESH","onLoad","UNIT_ON_LOAD","requestCloseFlow","UNIT_REQUEST_CLOSE_FLOW","requestOpenLink","UNIT_REQUEST_OPEN_LINK","unitRequestDownload","UNIT_REQUEST_DOWNLOAD","cardStatusChange","CARD_STATUS_CHANGED","unitRequestExternalSdk","UNIT_REQUEST_EXTERNAL_SDK","unitPaymentCreated","PAYMENT_CREATED","DISPATCH_RENDERING_EVENT","DISPATCH_REQUEST_REFRESH","DISPATCH_PLAID_RESPONSE","UNIT_PLAID_RESPONSE"],"sources":["bodyScript.ts"],"sourcesContent":["import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';\nimport { CardMessage } from '../../messages/webMessages/cardMessage';\nimport { PageMessage } from '../../messages/webMessages/pageMessage';\nimport { UnitMessage } from '../../messages/webMessages/unitMessages';\n\nexport const POST_MESSAGE_TO_SDK = `\n const postMessageToSDK = (message) => {\n if ('ReactNativeWebView' in window) {\n const messageString = JSON.stringify(message)\n window['ReactNativeWebView'].postMessage(messageString)\n }\n }\n`;\n\nexport const POST_PAGE_HEIGHT = `\n const postHeight = () => {\n setTimeout(() => {\n const height = window.document.documentElement.getBoundingClientRect().height\n postMessageToSDK({ type: \"${PageMessage.PAGE_HEIGHT}\", details: { height } })\n })\n }\n`;\n\nexport const LISTENERS = {\n isPageLoaded: `\n window.addEventListener('DOMContentLoaded', e => {\n postMessageToSDK({ type: \"${PageMessage.PAGE_LOADED}\" })\n });\n `,\n requestRendering: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_RENDERING}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_RENDERING}\", details: { data: e.detail }})\n });\n `,\n requestRefresh: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_REFRESH}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_REFRESH}\", details: e.detail })\n });\n `,\n onLoad: `\n window.addEventListener(\"${UnitMessage.UNIT_ON_LOAD}\", (e) => {\n postHeight()\n postMessageToSDK({ type: \"${UnitMessage.UNIT_ON_LOAD}\", details: e.detail })\n });\n `,\n requestCloseFlow: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_CLOSE_FLOW}\" })\n });\n `,\n requestOpenLink: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_OPEN_LINK}\", details: e.detail })\n });\n `,\n unitRequestDownload: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_DOWNLOAD}\", details: e.detail })\n });\n `,\n cardStatusChange: `\n window.addEventListener(\"${CardMessage.CARD_STATUS_CHANGED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${CardMessage.CARD_STATUS_CHANGED}\", details: { card: JSON.stringify(data.data) }})\n }).catch((e) => {\n console.log(e)\n })\n });\n `,\n unitRequestExternalSdk: `\n window.addEventListener(\"${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}\", (e) => {\n postMessageToSDK({ type: \"${UnitMessage.UNIT_REQUEST_EXTERNAL_SDK}\", details: e.detail })\n });\n`,\n unitPaymentCreated:`\n window.addEventListener(\"${PaymentMessage.PAYMENT_CREATED}\", (e) => {\n const response = e.detail\n response.then((data) => {\n postMessageToSDK({ type: \"${PaymentMessage.PAYMENT_CREATED}\", details: { data: JSON.stringify(data.data) }})\n }).catch((e) => {\n console.log(e)\n })\n });`\n};\n\nexport const DISPATCH_RENDERING_EVENT = `\n const dispatchRenderingEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_RENDERING}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n\nexport const DISPATCH_REQUEST_REFRESH = `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n`;\n\nexport const DISPATCH_PLAID_RESPONSE = `\n const dispatchPlaidEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_PLAID_RESPONSE}\",{ detail: details })\n window.dispatchEvent(event)\n }\n`;\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,4CAA4C;AAC3E,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,WAAW,QAAQ,wCAAwC;AACpE,SAASC,WAAW,QAAQ,yCAAyC;AAErE,OAAO,MAAMC,mBAAmB,GAAI;AACpC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,gBAAgB,GAAI;AACjC;AACA;AACA;AACA,kCAAkCH,WAAW,CAACI,WAAY;AAC1D;AACA;AACA,CAAC;AAED,OAAO,MAAMC,SAAS,GAAG;EACvBC,YAAY,EAAG;AACjB;AACA,kCAAkCN,WAAW,CAACO,WAAY;AAC1D;AACA,GAAG;EACDC,gBAAgB,EAAG;AACrB,+BAA+BP,WAAW,CAACQ,sBAAuB;AAClE,kCAAkCR,WAAW,CAACQ,sBAAuB;AACrE;AACA,GAAG;EACDC,cAAc,EAAG;AACnB,+BAA+BT,WAAW,CAACU,oBAAqB;AAChE,kCAAkCV,WAAW,CAACU,oBAAqB;AACnE;AACA,GAAG;EACDC,MAAM,EAAG;AACX,+BAA+BX,WAAW,CAACY,YAAa;AACxD;AACA,kCAAkCZ,WAAW,CAACY,YAAa;AAC3D;AACA,GAAG;EACDC,gBAAgB,EAAG;AACrB,+BAA+Bb,WAAW,CAACc,uBAAwB;AACnE,kCAAkCd,WAAW,CAACc,uBAAwB;AACtE;AACA,GAAG;EACDC,eAAe,EAAG;AACpB,+BAA+Bf,WAAW,CAACgB,sBAAuB;AAClE,kCAAkChB,WAAW,CAACgB,sBAAuB;AACrE;AACA,GAAG;EACDC,mBAAmB,EAAG;AACxB,+BAA+BjB,WAAW,CAACkB,qBAAsB;AACjE,kCAAkClB,WAAW,CAACkB,qBAAsB;AACpE;AACA,GAAG;EACDC,gBAAgB,EAAG;AACrB,+BAA+BrB,WAAW,CAACsB,mBAAoB;AAC/D;AACA;AACA,oCAAoCtB,WAAW,CAACsB,mBAAoB;AACpE;AACA;AACA;AACA;AACA,GAAG;EACDC,sBAAsB,EAAG;AAC3B,6BAA6BrB,WAAW,CAACsB,yBAA0B;AACnE,gCAAgCtB,WAAW,CAACsB,yBAA0B;AACtE;AACA,CAAC;EACCC,kBAAkB,EAAE;AACtB,6BAA6B1B,cAAc,CAAC2B,eAAgB;AAC5D;AACA;AACA,oCAAoC3B,cAAc,CAAC2B,eAAgB;AACnE;AACA;AACA;AACA;AACA,CAAC;AAED,OAAO,MAAMC,wBAAwB,GAAI;AACzC;AACA,qCAAqCzB,WAAW,CAACQ,sBAAuB;AACxE;AACA;AACA,CAAC;AAED,OAAO,MAAMkB,wBAAwB,GAAI;AACzC;AACA,qCAAqC1B,WAAW,CAACU,oBAAqB;AACtE;AACA;AACA,CAAC;AAED,OAAO,MAAMiB,uBAAuB,GAAI;AACxC;AACA,qCAAqC3B,WAAW,CAAC4B,mBAAoB;AACrE;AACA;AACA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["achCredit.types.ts"],"sourcesContent":["import type { AchCounterparty, CounterpartyVerificationMethod, PaymentStatus } from './payments.types';\nimport type { Tags, Relationship } from './types';\n\nexport type UNACHData = {\n type: 'achPayment',\n id: string,\n attributes: {\n createdAt: string | Date,\n status: PaymentStatus,\n settlementDate?: Date,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: Tags,\n addenda?: string\n\t\tcounterparty: AchCounterparty\n\t\texpectedCompletionDate?: Date\n\t\tcounterpartyVerificationMethod?:keyof typeof CounterpartyVerificationMethod\n\t\tsameDay?: boolean\n },\n relationships: {\n account: Relationship,\n customer?: Relationship,\n customers?: Relationship,\n counterpartyAccount: Relationship,\n counterpartyCustomer: Relationship,\n transaction: Relationship,\n recurringPayment: Relationship\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["bookPayment.types.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"names":[],"sources":["bookPayment.types.ts"],"sourcesContent":["import type { PaymentStatus } from './payments.types';\nimport type { Tags, Relationship } from './types';\n\nexport type UNBookPaymentData = {\n type: 'bookPayment',\n id: string,\n attributes: {\n createdAt: string | Date,\n status: PaymentStatus,\n reason: string,\n direction: 'Debit' | 'Credit',\n description: string,\n transactionSummaryOverride?: string,\n amount: string,\n tags: Tags,\n },\n relationships: {\n account: Relationship,\n customer?: Relationship,\n customers?: Relationship,\n counterpartyAccount: Relationship,\n counterpartyCustomer: Relationship,\n transaction: Relationship,\n recurringPayment: Relationship\n }\n}\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\n"],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from './bookPayment.types';\nexport * from './card.types';\nexport * from './onLoadResponse.types';\nexport * from './achCredit.types';\nexport * from './payments.types';\n"],"mappings":"AAAA,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,wBAAwB;AACtC,cAAc,mBAAmB;AACjC,cAAc,kBAAkB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CounterpartyVerificationMethod"],"sources":["payments.types.ts"],"sourcesContent":["export type PaymentStatus = 'Sent' | 'Rejected'\n\nexport type AchCounterparty = {\n\tname: string\n\taccountNumber: string\n\troutingNumber: string\n\taccountType: AccountType\n}\n\ntype AccountType = 'Savings' | 'Checking'\n\nexport enum CounterpartyVerificationMethod {\n\tPlaid = 'Plaid',\n}\n"],"mappings":"AAWA,WAAYA,8BAA8B;AAEzC,WAFWA,8BAA8B;EAA9BA,8BAA8B;AAAA,GAA9BA,8BAA8B,KAA9BA,8BAA8B"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
export let UNWalletCode;
|
|
2
|
-
|
|
3
2
|
(function (UNWalletCode) {
|
|
4
3
|
UNWalletCode["Apple"] = "ApplePayPushProvision";
|
|
5
4
|
UNWalletCode["Google"] = "GooglePayPushProvision";
|
|
6
5
|
})(UNWalletCode || (UNWalletCode = {}));
|
|
7
|
-
|
|
8
6
|
export let UNWalletName;
|
|
9
|
-
|
|
10
7
|
(function (UNWalletName) {
|
|
11
8
|
UNWalletName["Apple"] = "APPLE";
|
|
12
9
|
UNWalletName["Google"] = "GOOGLE";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNWalletCode","UNWalletName"],"sources":["wallet.types.ts"],"sourcesContent":["import type { CardAddToWalletStatus } from 'src/messages/nativeMessages/cardMessage';\n\nexport enum UNWalletCode {\n Apple = 'ApplePayPushProvision',\n Google = 'GooglePayPushProvision',\n}\n\nexport enum UNWalletName {\n Apple = 'APPLE',\n Google = 'GOOGLE',\n}\n\nexport interface UNWallet {\n name: string;\n code: string;\n status: CardAddToWalletStatus\n}\n"],"mappings":"AAEA,WAAYA,
|
|
1
|
+
{"version":3,"names":["UNWalletCode","UNWalletName"],"sources":["wallet.types.ts"],"sourcesContent":["import type { CardAddToWalletStatus } from 'src/messages/nativeMessages/cardMessage';\n\nexport enum UNWalletCode {\n Apple = 'ApplePayPushProvision',\n Google = 'GooglePayPushProvision',\n}\n\nexport enum UNWalletName {\n Apple = 'APPLE',\n Google = 'GOOGLE',\n}\n\nexport interface UNWallet {\n name: string;\n code: string;\n status: CardAddToWalletStatus\n}\n"],"mappings":"AAEA,WAAYA,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY;AAKxB,WAAYC,YAAY;AAGvB,WAHWA,YAAY;EAAZA,YAAY;EAAZA,YAAY;AAAA,GAAZA,YAAY,KAAZA,YAAY"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VARIABLES","COLORS","WHITE","BLACK","BLUE","GREY","SILVER_FLAKE"],"sources":["variables.ts"],"sourcesContent":["export const VARIABLES = {\n COLORS: {\n WHITE: '#ffffff',\n BLACK: '#000000',\n BLUE: '#005fF0',\n GREY: '#bbbbbb',\n SILVER_FLAKE: '#D5DDE0'\n }\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG;EACvBC,MAAM,EAAE;IACNC,KAAK,EAAE,
|
|
1
|
+
{"version":3,"names":["VARIABLES","COLORS","WHITE","BLACK","BLUE","GREY","SILVER_FLAKE"],"sources":["variables.ts"],"sourcesContent":["export const VARIABLES = {\n COLORS: {\n WHITE: '#ffffff',\n BLACK: '#000000',\n BLUE: '#005fF0',\n GREY: '#bbbbbb',\n SILVER_FLAKE: '#D5DDE0'\n }\n};\n"],"mappings":"AAAA,OAAO,MAAMA,SAAS,GAAG;EACvBC,MAAM,EAAE;IACNC,KAAK,EAAE,SAAS;IAChBC,KAAK,EAAE,SAAS;IAChBC,IAAI,EAAE,SAAS;IACfC,IAAI,EAAE,SAAS;IACfC,YAAY,EAAE;EAChB;AACF,CAAC"}
|
|
@@ -2,23 +2,19 @@ import EventBus from '../helpers/EventBus';
|
|
|
2
2
|
import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
|
|
3
3
|
import { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';
|
|
4
4
|
let isLoadingScript = false;
|
|
5
|
-
/** globalUnitScript is exported ONLY to our project components **/
|
|
6
5
|
|
|
6
|
+
/** globalUnitScript is exported ONLY to our project components **/
|
|
7
7
|
export let globalUnitScript = '';
|
|
8
8
|
export const fetchUnitScript = async () => {
|
|
9
9
|
const env = UnitSDK.getEnv();
|
|
10
|
-
|
|
11
10
|
if (isLoadingScript || globalUnitScript || !env) {
|
|
12
11
|
// init function is called and success OR in progress
|
|
13
12
|
return null;
|
|
14
13
|
}
|
|
15
|
-
|
|
16
14
|
isLoadingScript = true;
|
|
17
|
-
|
|
18
15
|
try {
|
|
19
16
|
const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);
|
|
20
17
|
const unitScript = await unitScriptRes.text();
|
|
21
|
-
|
|
22
18
|
if (unitScript) {
|
|
23
19
|
const scriptFetchData = {
|
|
24
20
|
unitScript
|
|
@@ -26,7 +22,6 @@ export const fetchUnitScript = async () => {
|
|
|
26
22
|
EventBus.Instance.event(SDKMessage.IS_SCRIPT_FETCHED, scriptFetchData);
|
|
27
23
|
globalUnitScript = unitScript;
|
|
28
24
|
}
|
|
29
|
-
|
|
30
25
|
return null;
|
|
31
26
|
} catch (e) {
|
|
32
27
|
console.log(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EventBus","SDKMessage","UnitSDK","UNIT_SCRIPT_URL","isLoadingScript","globalUnitScript","fetchUnitScript","env","getEnv","unitScriptRes","fetch","unitScript","text","scriptFetchData","Instance","event","IS_SCRIPT_FETCHED","e","console","log"],"sources":["UnitSdk.api.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';\n\nlet isLoadingScript = false;\n\n/** globalUnitScript is exported ONLY to our project components **/\nexport let globalUnitScript = '';\n\nexport const fetchUnitScript = async () => {\n const env = UnitSDK.getEnv();\n if (isLoadingScript || globalUnitScript || !env) {\n // init function is called and success OR in progress\n return null;\n }\n isLoadingScript = true;\n try {\n const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);\n const unitScript = await unitScriptRes.text();\n if (unitScript) {\n const scriptFetchData: SdkScriptFetched = { unitScript };\n EventBus.Instance.event(SDKMessage.IS_SCRIPT_FETCHED, scriptFetchData);\n globalUnitScript = unitScript;\n }\n return null;\n } catch (e) {\n console.log(e);\n return null;\n } finally {\n isLoadingScript = false;\n }\n};\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"names":["EventBus","SDKMessage","UnitSDK","UNIT_SCRIPT_URL","isLoadingScript","globalUnitScript","fetchUnitScript","env","getEnv","unitScriptRes","fetch","unitScript","text","scriptFetchData","Instance","event","IS_SCRIPT_FETCHED","e","console","log"],"sources":["UnitSdk.api.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { UnitSDK, UNIT_SCRIPT_URL } from './UnitSdkManager';\n\nlet isLoadingScript = false;\n\n/** globalUnitScript is exported ONLY to our project components **/\nexport let globalUnitScript = '';\n\nexport const fetchUnitScript = async () => {\n const env = UnitSDK.getEnv();\n if (isLoadingScript || globalUnitScript || !env) {\n // init function is called and success OR in progress\n return null;\n }\n isLoadingScript = true;\n try {\n const unitScriptRes = await fetch(UNIT_SCRIPT_URL[env]);\n const unitScript = await unitScriptRes.text();\n if (unitScript) {\n const scriptFetchData: SdkScriptFetched = { unitScript };\n EventBus.Instance.event(SDKMessage.IS_SCRIPT_FETCHED, scriptFetchData);\n globalUnitScript = unitScript;\n }\n return null;\n } catch (e) {\n console.log(e);\n return null;\n } finally {\n isLoadingScript = false;\n }\n};\n"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,qBAAqB;AAC1C,SAASC,UAAU,QAA0B,uCAAuC;AACpF,SAASC,OAAO,EAAEC,eAAe,QAAQ,kBAAkB;AAE3D,IAAIC,eAAe,GAAG,KAAK;;AAE3B;AACA,OAAO,IAAIC,gBAAgB,GAAG,EAAE;AAEhC,OAAO,MAAMC,eAAe,GAAG,MAAAA,CAAA,KAAY;EACzC,MAAMC,GAAG,GAAGL,OAAO,CAACM,MAAM,EAAE;EAC5B,IAAIJ,eAAe,IAAIC,gBAAgB,IAAI,CAACE,GAAG,EAAE;IAC/C;IACA,OAAO,IAAI;EACb;EACAH,eAAe,GAAG,IAAI;EACtB,IAAI;IACF,MAAMK,aAAa,GAAG,MAAMC,KAAK,CAACP,eAAe,CAACI,GAAG,CAAC,CAAC;IACvD,MAAMI,UAAU,GAAG,MAAMF,aAAa,CAACG,IAAI,EAAE;IAC7C,IAAID,UAAU,EAAE;MACd,MAAME,eAAiC,GAAG;QAAEF;MAAW,CAAC;MACxDX,QAAQ,CAACc,QAAQ,CAACC,KAAK,CAACd,UAAU,CAACe,iBAAiB,EAAEH,eAAe,CAAC;MACtER,gBAAgB,GAAGM,UAAU;IAC/B;IACA,OAAO,IAAI;EACb,CAAC,CAAC,OAAOM,CAAC,EAAE;IACVC,OAAO,CAACC,GAAG,CAACF,CAAC,CAAC;IACd,OAAO,IAAI;EACb,CAAC,SAAS;IACRb,eAAe,GAAG,KAAK;EACzB;AACF,CAAC"}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
4
|
import EventBus from '../helpers/EventBus';
|
|
4
5
|
import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
|
|
5
6
|
import { fetchUnitScript } from './UnitSdk.api';
|
|
6
7
|
export let UNEnvironment;
|
|
7
|
-
|
|
8
8
|
(function (UNEnvironment) {
|
|
9
9
|
UNEnvironment["sandbox"] = "sandbox";
|
|
10
10
|
UNEnvironment["production"] = "production";
|
|
11
11
|
})(UNEnvironment || (UNEnvironment = {}));
|
|
12
|
-
|
|
13
12
|
export const UNIT_SCRIPT_URL = {
|
|
14
13
|
[UNEnvironment.sandbox]: 'https://ui.s.unit.sh/components.js',
|
|
15
14
|
[UNEnvironment.production]: 'https://ui.unit.co/components.js'
|
|
16
15
|
};
|
|
17
16
|
export class UnitSDK {}
|
|
18
|
-
|
|
19
17
|
_defineProperty(UnitSDK, "env", void 0);
|
|
20
|
-
|
|
21
18
|
_defineProperty(UnitSDK, "theme", void 0);
|
|
22
|
-
|
|
23
19
|
_defineProperty(UnitSDK, "signedNonce", void 0);
|
|
24
|
-
|
|
25
20
|
_defineProperty(UnitSDK, "init", async (env, theme) => {
|
|
26
21
|
try {
|
|
27
22
|
UnitSDK.env = env;
|
|
@@ -32,19 +27,15 @@ _defineProperty(UnitSDK, "init", async (env, theme) => {
|
|
|
32
27
|
console.log(e);
|
|
33
28
|
}
|
|
34
29
|
});
|
|
35
|
-
|
|
36
30
|
_defineProperty(UnitSDK, "setSignedNonce", signedNonce => {
|
|
37
31
|
UnitSDK.signedNonce = signedNonce;
|
|
38
32
|
});
|
|
39
|
-
|
|
40
33
|
_defineProperty(UnitSDK, "getEnv", () => {
|
|
41
34
|
return UnitSDK.env;
|
|
42
35
|
});
|
|
43
|
-
|
|
44
36
|
_defineProperty(UnitSDK, "getTheme", () => {
|
|
45
37
|
return UnitSDK.theme;
|
|
46
38
|
});
|
|
47
|
-
|
|
48
39
|
_defineProperty(UnitSDK, "getSignedNonce", () => {
|
|
49
40
|
return UnitSDK.signedNonce;
|
|
50
41
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EventBus","SDKMessage","fetchUnitScript","UNEnvironment","UNIT_SCRIPT_URL","sandbox","production","UnitSDK","env","theme","Instance","event","IS_SDK_INITIALIZED","e","console","log","signedNonce"],"sources":["UnitSdkManager.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage } from '../messages/nativeMessages/sdkMessage';\nimport { fetchUnitScript } from './UnitSdk.api';\n\nexport enum UNEnvironment {\n sandbox = 'sandbox',\n production = 'production'\n}\n\nexport const UNIT_SCRIPT_URL = {\n [UNEnvironment.sandbox]: 'https://ui.s.unit.sh/components.js',\n [UNEnvironment.production]: 'https://ui.unit.co/components.js'\n};\nexport class UnitSDK {\n protected static env?: UNEnvironment;\n protected static theme?: string;\n protected static signedNonce?: string;\n\n public static init = async (env: UNEnvironment, theme?: string) => {\n try {\n this.env = env;\n this.theme = theme;\n await fetchUnitScript();\n EventBus.Instance.event(SDKMessage.IS_SDK_INITIALIZED, {});\n } catch (e) {\n console.log(e);\n }\n };\n\n public static setSignedNonce = (signedNonce: string) => {\n this.signedNonce = signedNonce;\n };\n\n public static getEnv = () => {\n return this.env;\n };\n\n public static getTheme = () => {\n return this.theme;\n };\n\n public static getSignedNonce = () => {\n return this.signedNonce;\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["EventBus","SDKMessage","fetchUnitScript","UNEnvironment","UNIT_SCRIPT_URL","sandbox","production","UnitSDK","_defineProperty","env","theme","Instance","event","IS_SDK_INITIALIZED","e","console","log","signedNonce"],"sources":["UnitSdkManager.ts"],"sourcesContent":["import EventBus from '../helpers/EventBus';\nimport { SDKMessage } from '../messages/nativeMessages/sdkMessage';\nimport { fetchUnitScript } from './UnitSdk.api';\n\nexport enum UNEnvironment {\n sandbox = 'sandbox',\n production = 'production'\n}\n\nexport const UNIT_SCRIPT_URL = {\n [UNEnvironment.sandbox]: 'https://ui.s.unit.sh/components.js',\n [UNEnvironment.production]: 'https://ui.unit.co/components.js'\n};\nexport class UnitSDK {\n protected static env?: UNEnvironment;\n protected static theme?: string;\n protected static signedNonce?: string;\n\n public static init = async (env: UNEnvironment, theme?: string) => {\n try {\n this.env = env;\n this.theme = theme;\n await fetchUnitScript();\n EventBus.Instance.event(SDKMessage.IS_SDK_INITIALIZED, {});\n } catch (e) {\n console.log(e);\n }\n };\n\n public static setSignedNonce = (signedNonce: string) => {\n this.signedNonce = signedNonce;\n };\n\n public static getEnv = () => {\n return this.env;\n };\n\n public static getTheme = () => {\n return this.theme;\n };\n\n public static getSignedNonce = () => {\n return this.signedNonce;\n };\n}\n"],"mappings":";;;AAAA,OAAOA,QAAQ,MAAM,qBAAqB;AAC1C,SAASC,UAAU,QAAQ,uCAAuC;AAClE,SAASC,eAAe,QAAQ,eAAe;AAE/C,WAAYC,aAAa;AAGxB,WAHWA,aAAa;EAAbA,aAAa;EAAbA,aAAa;AAAA,GAAbA,aAAa,KAAbA,aAAa;AAKzB,OAAO,MAAMC,eAAe,GAAG;EAC7B,CAACD,aAAa,CAACE,OAAO,GAAG,oCAAoC;EAC7D,CAACF,aAAa,CAACG,UAAU,GAAG;AAC9B,CAAC;AACD,OAAO,MAAMC,OAAO,CAAC;AA+BpBC,eAAA,CA/BYD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO;AAAAC,eAAA,CAAPD,OAAO,UAKG,OAAOE,GAAkB,EAAEC,KAAc,KAAK;EACjE,IAAI;IANKH,OAAO,CAOTE,GAAG,GAAGA,GAAG;IAPPF,OAAO,CAQTG,KAAK,GAAGA,KAAK;IAClB,MAAMR,eAAe,EAAE;IACvBF,QAAQ,CAACW,QAAQ,CAACC,KAAK,CAACX,UAAU,CAACY,kBAAkB,EAAE,CAAC,CAAC,CAAC;EAC5D,CAAC,CAAC,OAAOC,CAAC,EAAE;IACVC,OAAO,CAACC,GAAG,CAACF,CAAC,CAAC;EAChB;AACF,CAAC;AAAAN,eAAA,CAdUD,OAAO,oBAgBcU,WAAmB,IAAK;EAhB7CV,OAAO,CAiBXU,WAAW,GAAGA,WAAW;AAChC,CAAC;AAAAT,eAAA,CAlBUD,OAAO,YAoBK,MAAM;EAC3B,OArBSA,OAAO,CAqBJE,GAAG;AACjB,CAAC;AAAAD,eAAA,CAtBUD,OAAO,cAwBO,MAAM;EAC7B,OAzBSA,OAAO,CAyBJG,KAAK;AACnB,CAAC;AAAAF,eAAA,CA1BUD,OAAO,oBA4Ba,MAAM;EACnC,OA7BSA,OAAO,CA6BJU,WAAW;AACzB,CAAC"}
|
|
@@ -11,77 +11,66 @@ import { UnitSDK } from '../unitSdkManager/UnitSdkManager';
|
|
|
11
11
|
import { SDKMessage } from '../messages/nativeMessages/sdkMessage';
|
|
12
12
|
import { handleRequestDownload } from './WebComponent.utils';
|
|
13
13
|
export let WebComponentType;
|
|
14
|
-
|
|
15
14
|
(function (WebComponentType) {
|
|
16
15
|
WebComponentType["card"] = "unit-elements-card";
|
|
17
16
|
WebComponentType["bookPayment"] = "unit-elements-book-payment";
|
|
18
17
|
WebComponentType["activity"] = "unit-elements-activity";
|
|
19
18
|
WebComponentType["slot"] = "unit-elements-sdk-slot";
|
|
20
19
|
WebComponentType["account"] = "unit-elements-account";
|
|
20
|
+
WebComponentType["achDebitPayment"] = "unit-elements-ach-debit-payment";
|
|
21
|
+
WebComponentType["achCreditPayment"] = "unit-elements-ach-credit-payment";
|
|
21
22
|
})(WebComponentType || (WebComponentType = {}));
|
|
22
|
-
|
|
23
23
|
export const WebComponent = /*#__PURE__*/React.forwardRef(function WebComponent(props, webRef) {
|
|
24
24
|
const [unitScript, setUnitScript] = useState(globalUnitScript);
|
|
25
25
|
const [sourceHtml, setSourceHtml] = useState(null);
|
|
26
26
|
const [componentCurrentTheme, setComponentCurrentTheme] = useState(props.theme ?? UnitSDK.getTheme());
|
|
27
27
|
const width = props.width ?? '100%';
|
|
28
|
-
|
|
29
28
|
const updateUnitScript = data => {
|
|
30
29
|
setUnitScript(data.unitScript);
|
|
31
30
|
};
|
|
32
|
-
|
|
33
31
|
const updateInitializedParams = () => {
|
|
34
32
|
setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());
|
|
35
33
|
};
|
|
36
|
-
|
|
37
|
-
useListenerToBus([{
|
|
34
|
+
useListenerToBus({
|
|
38
35
|
busEventKey: SDKMessage.IS_SCRIPT_FETCHED,
|
|
39
36
|
action: updateUnitScript
|
|
40
|
-
}
|
|
37
|
+
});
|
|
38
|
+
useListenerToBus({
|
|
41
39
|
busEventKey: SDKMessage.IS_SDK_INITIALIZED,
|
|
42
40
|
action: updateInitializedParams
|
|
43
|
-
}
|
|
41
|
+
});
|
|
44
42
|
useEffect(() => {
|
|
45
43
|
if (!unitScript) {
|
|
46
44
|
fetchUnitScript();
|
|
47
45
|
return;
|
|
48
46
|
}
|
|
49
|
-
|
|
50
47
|
const componentParams = (props.params || '') + (componentCurrentTheme ? ` theme="${componentCurrentTheme}"` : '');
|
|
51
48
|
let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));
|
|
52
49
|
newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');
|
|
53
50
|
setSourceHtml(newHtml);
|
|
54
|
-
}, [props.params, unitScript, props.presentationMode, componentCurrentTheme]);
|
|
55
|
-
|
|
51
|
+
}, [props.params, unitScript, props.presentationMode, componentCurrentTheme, props.script]);
|
|
56
52
|
const onMessage = e => {
|
|
57
53
|
const message = JSON.parse(e.nativeEvent.data);
|
|
58
|
-
|
|
59
54
|
switch (message.type) {
|
|
60
55
|
case UnitMessage.UNIT_REQUEST_REFRESH:
|
|
61
56
|
message.details && EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details);
|
|
62
57
|
break;
|
|
63
|
-
|
|
64
58
|
case UnitMessage.UNIT_REQUEST_DOWNLOAD:
|
|
65
59
|
message.details && handleRequestDownload(message.details, () => {
|
|
66
60
|
EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW);
|
|
67
61
|
});
|
|
68
62
|
break;
|
|
69
|
-
|
|
70
63
|
default:
|
|
71
64
|
props.onMessage && props.onMessage(message);
|
|
72
65
|
}
|
|
73
66
|
};
|
|
74
|
-
|
|
75
67
|
if (!sourceHtml) return null;
|
|
76
|
-
|
|
77
68
|
const _onScroll = event => {
|
|
78
69
|
if (props.handleScroll) {
|
|
79
70
|
props.handleScroll(event);
|
|
80
71
|
}
|
|
81
|
-
|
|
82
72
|
return null;
|
|
83
73
|
};
|
|
84
|
-
|
|
85
74
|
return /*#__PURE__*/React.createElement(WebView, {
|
|
86
75
|
ref: webRef,
|
|
87
76
|
cacheEnabled: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useState","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","WebComponentType","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","width","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","componentParams","params","newHtml","replace","BODY","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","isScrollable","nestedScrollEnabled","flex"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody, PresentationMode } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n width?: number;\n}\n\nexport enum WebComponentType {\n card = 'unit-elements-card',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const width = props.width ?? '100%';\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n };\n\n useListenerToBus(
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","WebView","EventBus","html","HTML_PLACEHOLDER","UnitMessage","useListenerToBus","getHtmlBody","fetchUnitScript","globalUnitScript","UnitSDK","SDKMessage","handleRequestDownload","WebComponentType","WebComponent","forwardRef","props","webRef","unitScript","setUnitScript","sourceHtml","setSourceHtml","componentCurrentTheme","setComponentCurrentTheme","theme","getTheme","width","updateUnitScript","data","updateInitializedParams","busEventKey","IS_SCRIPT_FETCHED","action","IS_SDK_INITIALIZED","componentParams","params","newHtml","replace","BODY","type","valueOf","presentationMode","SCRIPT_FROM_NATIVE","script","onMessage","e","message","JSON","parse","nativeEvent","UNIT_REQUEST_REFRESH","details","Instance","event","UNIT_REQUEST_DOWNLOAD","UNIT_REQUEST_CLOSE_FLOW","_onScroll","handleScroll","createElement","ref","cacheEnabled","scrollEnabled","isScrollable","nestedScrollEnabled","onScroll","overScrollMode","injectedJavaScript","style","flex","source"],"sources":["WebComponent.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport React, { useEffect, useState } from 'react';\nimport { WebView, WebViewMessageEvent } from 'react-native-webview';\nimport EventBus from '../helpers/EventBus';\nimport html, { HTML_PLACEHOLDER } from './html';\nimport { RequestRefreshEvent, UnitMessage, RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nimport { useListenerToBus } from '../hooks/listenerToBus';\nimport { getHtmlBody, PresentationMode } from '../scripts/html/bodyHtml';\nimport { fetchUnitScript, globalUnitScript } from '../unitSdkManager/UnitSdk.api';\nimport { UnitSDK } from '../unitSdkManager/UnitSdkManager';\nimport type { WebViewMessage } from '../messages/webMessages';\nimport { SDKMessage, SdkScriptFetched } from '../messages/nativeMessages/sdkMessage';\nimport { handleRequestDownload } from './WebComponent.utils';\n\nexport interface WebComponentProps {\n type: WebComponentType;\n presentationMode?: PresentationMode,\n params?: string;\n theme?: string;\n onMessage?: (message: WebViewMessage) => void;\n script?: string;\n isScrollable?: boolean,\n nestedScrollEnabled?: boolean,\n handleScroll?: (event: any) => void,\n width?: number;\n}\n\nexport enum WebComponentType {\n card = 'unit-elements-card',\n bookPayment = 'unit-elements-book-payment',\n activity = 'unit-elements-activity',\n slot = 'unit-elements-sdk-slot',\n account = 'unit-elements-account',\n achDebitPayment = 'unit-elements-ach-debit-payment',\n achCreditPayment = 'unit-elements-ach-credit-payment'\n}\n\nexport const WebComponent = React.forwardRef<WebView, WebComponentProps>(function WebComponent(props, webRef) {\n const [unitScript, setUnitScript] = useState<string | undefined>(globalUnitScript);\n const [sourceHtml, setSourceHtml] = useState<string | null>(null);\n const [componentCurrentTheme, setComponentCurrentTheme] = useState<string | undefined>(props.theme ?? UnitSDK.getTheme());\n const width = props.width ?? '100%';\n\n const updateUnitScript = (data: SdkScriptFetched) => {\n setUnitScript(data.unitScript);\n };\n\n const updateInitializedParams = () => {\n setComponentCurrentTheme(props.theme ?? UnitSDK.getTheme());\n };\n\n useListenerToBus({ busEventKey: SDKMessage.IS_SCRIPT_FETCHED, action: updateUnitScript });\n useListenerToBus({ busEventKey: SDKMessage.IS_SDK_INITIALIZED, action: updateInitializedParams });\n\n useEffect(() => {\n if (!unitScript) {\n fetchUnitScript();\n return;\n }\n\n const componentParams = (props.params || '') + (componentCurrentTheme ? ` theme=\"${componentCurrentTheme}\"` : '');\n let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));\n newHtml = newHtml.replace(HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE, props.script || '');\n setSourceHtml(newHtml);\n }, [props.params, unitScript, props.presentationMode, componentCurrentTheme, props.script]);\n\n const onMessage = (e: WebViewMessageEvent) => {\n const message = JSON.parse(e.nativeEvent.data) as WebViewMessage;\n switch (message.type) {\n case UnitMessage.UNIT_REQUEST_REFRESH:\n message.details &&\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_REFRESH, message.details as RequestRefreshEvent);\n break;\n case UnitMessage.UNIT_REQUEST_DOWNLOAD:\n message.details &&\n handleRequestDownload(message.details as RequestDownloadEvent, () => {\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_CLOSE_FLOW);\n });\n break;\n default:\n props.onMessage && props.onMessage(message);\n }\n };\n\n if (!sourceHtml) return null;\n\n const _onScroll = (event: any) => {\n if (props.handleScroll) {\n props.handleScroll(event);\n }\n\n return null;\n };\n\n return (\n <WebView\n ref={webRef}\n cacheEnabled={false}\n scrollEnabled={props.isScrollable}\n nestedScrollEnabled={props.nestedScrollEnabled}\n onScroll={_onScroll}\n overScrollMode=\"never\"\n injectedJavaScript={unitScript}\n style={{ width: width, flex: 1 }}\n source={{ html: sourceHtml }}\n onMessage={onMessage} />\n );\n});\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,OAAO,QAA6B,sBAAsB;AACnE,OAAOC,QAAQ,MAAM,qBAAqB;AAC1C,OAAOC,IAAI,IAAIC,gBAAgB,QAAQ,QAAQ;AAC/C,SAA8BC,WAAW,QAA8B,sCAAsC;AAC7G,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,WAAW,QAA0B,0BAA0B;AACxE,SAASC,eAAe,EAAEC,gBAAgB,QAAQ,+BAA+B;AACjF,SAASC,OAAO,QAAQ,kCAAkC;AAE1D,SAASC,UAAU,QAA0B,uCAAuC;AACpF,SAASC,qBAAqB,QAAQ,sBAAsB;AAe5D,WAAYC,gBAAgB;AAQ3B,WARWA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;AAAA,GAAhBA,gBAAgB,KAAhBA,gBAAgB;AAU5B,OAAO,MAAMC,YAAY,gBAAGhB,KAAK,CAACiB,UAAU,CAA6B,SAASD,YAAYA,CAACE,KAAK,EAAEC,MAAM,EAAE;EAC5G,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGnB,QAAQ,CAAqBS,gBAAgB,CAAC;EAClF,MAAM,CAACW,UAAU,EAAEC,aAAa,CAAC,GAAGrB,QAAQ,CAAgB,IAAI,CAAC;EACjE,MAAM,CAACsB,qBAAqB,EAAEC,wBAAwB,CAAC,GAAGvB,QAAQ,CAAqBgB,KAAK,CAACQ,KAAK,IAAId,OAAO,CAACe,QAAQ,EAAE,CAAC;EACzH,MAAMC,KAAK,GAAGV,KAAK,CAACU,KAAK,IAAI,MAAM;EAEnC,MAAMC,gBAAgB,GAAIC,IAAsB,IAAK;IACnDT,aAAa,CAACS,IAAI,CAACV,UAAU,CAAC;EAChC,CAAC;EAED,MAAMW,uBAAuB,GAAGA,CAAA,KAAM;IACpCN,wBAAwB,CAACP,KAAK,CAACQ,KAAK,IAAId,OAAO,CAACe,QAAQ,EAAE,CAAC;EAC7D,CAAC;EAEDnB,gBAAgB,CAAC;IAAEwB,WAAW,EAAEnB,UAAU,CAACoB,iBAAiB;IAAEC,MAAM,EAAEL;EAAiB,CAAC,CAAC;EACzFrB,gBAAgB,CAAC;IAAEwB,WAAW,EAAEnB,UAAU,CAACsB,kBAAkB;IAAED,MAAM,EAAEH;EAAwB,CAAC,CAAC;EAEjG9B,SAAS,CAAC,MAAM;IACd,IAAI,CAACmB,UAAU,EAAE;MACfV,eAAe,EAAE;MACjB;IACF;IAEA,MAAM0B,eAAe,GAAG,CAAClB,KAAK,CAACmB,MAAM,IAAI,EAAE,KAAKb,qBAAqB,GAAI,WAAUA,qBAAsB,GAAE,GAAG,EAAE,CAAC;IACjH,IAAIc,OAAO,GAAGjC,IAAI,CAACkC,OAAO,CAACjC,gBAAgB,CAACkC,IAAI,EAAE/B,WAAW,CAACS,KAAK,CAACuB,IAAI,CAACC,OAAO,EAAE,EAAEN,eAAe,EAAElB,KAAK,CAACyB,gBAAgB,CAAC,CAAC;IAC7HL,OAAO,GAAGA,OAAO,CAACC,OAAO,CAACjC,gBAAgB,CAACsC,kBAAkB,EAAE1B,KAAK,CAAC2B,MAAM,IAAI,EAAE,CAAC;IAClFtB,aAAa,CAACe,OAAO,CAAC;EACxB,CAAC,EAAE,CAACpB,KAAK,CAACmB,MAAM,EAAEjB,UAAU,EAAEF,KAAK,CAACyB,gBAAgB,EAAEnB,qBAAqB,EAAEN,KAAK,CAAC2B,MAAM,CAAC,CAAC;EAE3F,MAAMC,SAAS,GAAIC,CAAsB,IAAK;IAC5C,MAAMC,OAAO,GAAGC,IAAI,CAACC,KAAK,CAACH,CAAC,CAACI,WAAW,CAACrB,IAAI,CAAmB;IAChE,QAAQkB,OAAO,CAACP,IAAI;MAClB,KAAKlC,WAAW,CAAC6C,oBAAoB;QACnCJ,OAAO,CAACK,OAAO,IACbjD,QAAQ,CAACkD,QAAQ,CAACC,KAAK,CAAChD,WAAW,CAAC6C,oBAAoB,EAAEJ,OAAO,CAACK,OAAO,CAAwB;QACnG;MACF,KAAK9C,WAAW,CAACiD,qBAAqB;QACpCR,OAAO,CAACK,OAAO,IACbvC,qBAAqB,CAACkC,OAAO,CAACK,OAAO,EAA0B,MAAM;UACnEjD,QAAQ,CAACkD,QAAQ,CAACC,KAAK,CAAChD,WAAW,CAACkD,uBAAuB,CAAC;QAC9D,CAAC,CAAC;QACJ;MACF;QACEvC,KAAK,CAAC4B,SAAS,IAAI5B,KAAK,CAAC4B,SAAS,CAACE,OAAO,CAAC;IAAC;EAElD,CAAC;EAED,IAAI,CAAC1B,UAAU,EAAE,OAAO,IAAI;EAE5B,MAAMoC,SAAS,GAAIH,KAAU,IAAK;IAChC,IAAIrC,KAAK,CAACyC,YAAY,EAAE;MACtBzC,KAAK,CAACyC,YAAY,CAACJ,KAAK,CAAC;IAC3B;IAEA,OAAO,IAAI;EACb,CAAC;EAED,oBACEvD,KAAA,CAAA4D,aAAA,CAACzD,OAAO;IACN0D,GAAG,EAAE1C,MAAO;IACZ2C,YAAY,EAAE,KAAM;IACpBC,aAAa,EAAE7C,KAAK,CAAC8C,YAAa;IAClCC,mBAAmB,EAAE/C,KAAK,CAAC+C,mBAAoB;IAC/CC,QAAQ,EAAER,SAAU;IACpBS,cAAc,EAAC,OAAO;IACtBC,kBAAkB,EAAEhD,UAAW;IAC/BiD,KAAK,EAAE;MAAEzC,KAAK,EAAEA,KAAK;MAAE0C,IAAI,EAAE;IAAE,CAAE;IACjCC,MAAM,EAAE;MAAElE,IAAI,EAAEiB;IAAW,CAAE;IAC7BwB,SAAS,EAAEA;EAAU,EAAG;AAE9B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["axios","Share","NativeModules","Platform","RNShareFile","handleRequestDownload","details","onReadyToShare","fileType","res","get","url","headers","accessToken","responseEncoding","responseType","base64Data","request","_response","OS","share","fileName"],"sources":["WebComponent.utils.ts"],"sourcesContent":["import axios from 'axios';\nimport { Share, NativeModules, Platform } from 'react-native';\nimport type { RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nconst { RNShareFile } = NativeModules;\n\nexport const handleRequestDownload = async (details: RequestDownloadEvent, onReadyToShare: () => void) => {\n if (details.fileType === 'application/pdf') {\n const res = await axios.get(details.url, {\n headers: {\n 'Authorization': `Bearer ${details.accessToken}`\n },\n responseEncoding: 'base64',\n responseType: 'arraybuffer'\n });\n\n const base64Data = res.request._response;\n\n onReadyToShare();\n\n if (Platform.OS === 'ios') {\n Share.share({ url: `data:application/pdf;base64,${base64Data}` });\n } else {\n RNShareFile.share(base64Data, details.fileName);\n }\n }\n};\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"names":["axios","Share","NativeModules","Platform","RNShareFile","handleRequestDownload","details","onReadyToShare","fileType","res","get","url","headers","accessToken","responseEncoding","responseType","base64Data","request","_response","OS","share","fileName"],"sources":["WebComponent.utils.ts"],"sourcesContent":["import axios from 'axios';\nimport { Share, NativeModules, Platform } from 'react-native';\nimport type { RequestDownloadEvent } from '../messages/webMessages/unitMessages';\nconst { RNShareFile } = NativeModules;\n\nexport const handleRequestDownload = async (details: RequestDownloadEvent, onReadyToShare: () => void) => {\n if (details.fileType === 'application/pdf') {\n const res = await axios.get(details.url, {\n headers: {\n 'Authorization': `Bearer ${details.accessToken}`\n },\n responseEncoding: 'base64',\n responseType: 'arraybuffer'\n });\n\n const base64Data = res.request._response;\n\n onReadyToShare();\n\n if (Platform.OS === 'ios') {\n Share.share({ url: `data:application/pdf;base64,${base64Data}` });\n } else {\n RNShareFile.share(base64Data, details.fileName);\n }\n }\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,aAAa,EAAEC,QAAQ,QAAQ,cAAc;AAE7D,MAAM;EAAEC;AAAY,CAAC,GAAGF,aAAa;AAErC,OAAO,MAAMG,qBAAqB,GAAG,MAAAA,CAAOC,OAA6B,EAAEC,cAA0B,KAAK;EACxG,IAAID,OAAO,CAACE,QAAQ,KAAK,iBAAiB,EAAE;IAC1C,MAAMC,GAAG,GAAG,MAAMT,KAAK,CAACU,GAAG,CAACJ,OAAO,CAACK,GAAG,EAAE;MACvCC,OAAO,EAAE;QACP,eAAe,EAAG,UAASN,OAAO,CAACO,WAAY;MACjD,CAAC;MACDC,gBAAgB,EAAE,QAAQ;MAC1BC,YAAY,EAAE;IAChB,CAAC,CAAC;IAEF,MAAMC,UAAU,GAAGP,GAAG,CAACQ,OAAO,CAACC,SAAS;IAExCX,cAAc,EAAE;IAEhB,IAAIJ,QAAQ,CAACgB,EAAE,KAAK,KAAK,EAAE;MACzBlB,KAAK,CAACmB,KAAK,CAAC;QAAET,GAAG,EAAG,+BAA8BK,UAAW;MAAE,CAAC,CAAC;IACnE,CAAC,MAAM;MACLZ,WAAW,CAACgB,KAAK,CAACJ,UAAU,EAAEV,OAAO,CAACe,QAAQ,CAAC;IACjD;EACF;AACF,CAAC"}
|
|
@@ -12,11 +12,11 @@ const htmlText = `
|
|
|
12
12
|
<head lang="en">
|
|
13
13
|
<title>Unit Web SDK Demo</title>
|
|
14
14
|
<script>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
window.UnitMobileSDK = true
|
|
16
|
+
window.UnitMobileSDKConfig = {
|
|
17
|
+
os: "${Platform.OS}",
|
|
18
|
+
walletName: "${Platform.OS === 'ios' ? 'Apple' : 'Google'}",
|
|
19
|
+
}
|
|
20
20
|
</script>
|
|
21
21
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0">
|
|
22
22
|
</html>
|
|
@@ -43,6 +43,8 @@ const htmlText = `
|
|
|
43
43
|
|
|
44
44
|
${LISTENERS.cardStatusChange}
|
|
45
45
|
|
|
46
|
+
${LISTENERS.unitRequestExternalSdk}
|
|
47
|
+
|
|
46
48
|
${DISPATCH_RENDERING_EVENT}
|
|
47
49
|
|
|
48
50
|
${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardStatusChange"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT } from '../scripts/html/bodyScript';\n\nexport const HTML_PLACEHOLDER = {\n SCRIPT_UNIT: '<SCRIPT_UNIT>',\n BODY: '<BODY_HTML_CODE>',\n SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>'\n};\n\nconst htmlText = `\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head lang=\"en\">\n <title>Unit Web SDK Demo</title>\n <script>\n
|
|
1
|
+
{"version":3,"names":["Platform","DISPATCH_RENDERING_EVENT","LISTENERS","POST_MESSAGE_TO_SDK","POST_PAGE_HEIGHT","HTML_PLACEHOLDER","SCRIPT_UNIT","BODY","SCRIPT_FROM_NATIVE","htmlText","OS","isPageLoaded","onLoad","unitRequestDownload","requestRendering","requestOpenLink","requestCloseFlow","cardStatusChange","unitRequestExternalSdk"],"sources":["html.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport { DISPATCH_RENDERING_EVENT, LISTENERS, POST_MESSAGE_TO_SDK, POST_PAGE_HEIGHT } from '../scripts/html/bodyScript';\n\nexport const HTML_PLACEHOLDER = {\n SCRIPT_UNIT: '<SCRIPT_UNIT>',\n BODY: '<BODY_HTML_CODE>',\n SCRIPT_FROM_NATIVE: '<SCRIPT_FROM_NATIVE>'\n};\n\nconst htmlText = `\n <!DOCTYPE html>\n <html lang=\"en\">\n\n <head lang=\"en\">\n <title>Unit Web SDK Demo</title>\n <script>\n window.UnitMobileSDK = true\n window.UnitMobileSDKConfig = {\n os: \"${Platform.OS}\",\n walletName: \"${Platform.OS === 'ios' ? 'Apple' : 'Google'}\",\n }\n </script>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0\">\n </html>\n\n <body style=\"margin: 0;\">\n ${HTML_PLACEHOLDER.BODY}\n\n <script>\n ${POST_MESSAGE_TO_SDK}\n\n ${POST_PAGE_HEIGHT}\n\n ${LISTENERS.isPageLoaded}\n\n ${LISTENERS.onLoad}\n\n ${LISTENERS.unitRequestDownload}\n\n ${LISTENERS.requestRendering}\n\n ${LISTENERS.requestOpenLink}\n\n ${LISTENERS.requestCloseFlow}\n\n ${LISTENERS.cardStatusChange}\n\n ${LISTENERS.unitRequestExternalSdk}\n\n ${DISPATCH_RENDERING_EVENT}\n\n ${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}\n </script>\n </body>\n`;\n\nexport default htmlText;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,EAAEC,SAAS,EAAEC,mBAAmB,EAAEC,gBAAgB,QAAQ,4BAA4B;AAEvH,OAAO,MAAMC,gBAAgB,GAAG;EAC9BC,WAAW,EAAE,eAAe;EAC5BC,IAAI,EAAE,kBAAkB;EACxBC,kBAAkB,EAAE;AACtB,CAAC;AAED,MAAMC,QAAQ,GAAI;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAaT,QAAQ,CAACU,EAAG;AACzB,qBAAqBV,QAAQ,CAACU,EAAE,KAAK,KAAK,GAAG,OAAO,GAAG,QAAS;AAChE;AACA;AACA;AACA;AACA;AACA;AACA,MAAML,gBAAgB,CAACE,IAAK;AAC5B;AACA;AACA,QAAQJ,mBAAoB;AAC5B;AACA,QAAQC,gBAAiB;AACzB;AACA,QAAQF,SAAS,CAACS,YAAa;AAC/B;AACA,QAAQT,SAAS,CAACU,MAAO;AACzB;AACA,QAAQV,SAAS,CAACW,mBAAoB;AACtC;AACA,QAAQX,SAAS,CAACY,gBAAiB;AACnC;AACA,QAAQZ,SAAS,CAACa,eAAgB;AAClC;AACA,QAAQb,SAAS,CAACc,gBAAiB;AACnC;AACA,QAAQd,SAAS,CAACe,gBAAiB;AACnC;AACA,QAAQf,SAAS,CAACgB,sBAAuB;AACzC;AACA,QAAQjB,wBAAyB;AACjC;AACA,QAAQI,gBAAgB,CAACG,kBAAmB;AAC5C;AACA;AACA,CAAC;AAED,eAAeC,QAAQ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResponseUnitOnLoadEvent, UNACHData } from '../../sharedTypes';
|
|
2
|
+
export interface UNACHCreditComponentProps {
|
|
3
|
+
accountId: string;
|
|
4
|
+
customerToken: string;
|
|
5
|
+
theme?: string;
|
|
6
|
+
isAutoFocus?: boolean;
|
|
7
|
+
fee?: number;
|
|
8
|
+
onPaymentCreated?: (data: UNACHData) => void;
|
|
9
|
+
onLoad?: (response: ResponseUnitOnLoadEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const UNACHCreditComponent: (props: UNACHCreditComponentProps) => JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResponseUnitOnLoadEvent, UNACHData } from '../../sharedTypes';
|
|
2
|
+
export interface UNACHDebitComponentProps {
|
|
3
|
+
accountId: string;
|
|
4
|
+
customerToken: string;
|
|
5
|
+
theme?: string;
|
|
6
|
+
isAutoFocus?: boolean;
|
|
7
|
+
fee?: number;
|
|
8
|
+
onPaymentCreated?: (data: UNACHData) => void;
|
|
9
|
+
onLoad?: (response: ResponseUnitOnLoadEvent) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const UNACHDebitComponent: (props: UNACHDebitComponentProps) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { UNACHDebitComponentProps } from './UNACHDebitComponent';
|
|
2
|
+
import type WebView from 'react-native-webview';
|
|
3
|
+
import type { LinkSuccess } from 'react-native-plaid-link-sdk';
|
|
4
|
+
export declare const getACHDebitParams: (props: UNACHDebitComponentProps) => string;
|
|
5
|
+
export declare const getAndroidPackageName: () => Promise<any>;
|
|
6
|
+
export declare const getACHDebitScript: (androidPackageName?: string) => string;
|
|
7
|
+
export declare const injectUnitPlaidResponse: (currentWeb: WebView | null, success: LinkSuccess) => void;
|