react-native-unit-components 3.1.2-beta.2 → 3.1.2-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js +1 -14
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -2
- package/lib/commonjs/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js +1 -14
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -2
- package/lib/commonjs/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +4 -1
- package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +10 -1
- package/lib/commonjs/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +38 -0
- package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -1
- package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js +10 -2
- package/lib/commonjs/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js.map +1 -1
- package/lib/commonjs/messages/webMessages/accountMessage.js +2 -0
- package/lib/commonjs/messages/webMessages/accountMessage.js.map +1 -1
- package/lib/commonjs/scripts/html/bodyScript.js +24 -2
- package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/commonjs/unitComponentsSdkManager/UnitComponentsSdkManager.utils.internal.js.map +1 -1
- package/lib/commonjs/webComponent/WebComponent.js +6 -2
- package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
- package/lib/commonjs/webComponent/html.js +4 -0
- package/lib/commonjs/webComponent/html.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js +2 -14
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.js.map +1 -1
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js +1 -2
- package/lib/module/components/UNACHCreditComponent/UNACHCreditComponent.utils.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js +2 -14
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.js.map +1 -1
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js +1 -2
- package/lib/module/components/UNACHDebitComponent/UNACHDebitComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js +4 -1
- package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.js.map +1 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js +10 -1
- package/lib/module/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.js.map +1 -1
- package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js +39 -1
- package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.js.map +1 -1
- package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js +9 -2
- package/lib/module/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.js.map +1 -1
- package/lib/module/messages/webMessages/accountMessage.js +2 -0
- package/lib/module/messages/webMessages/accountMessage.js.map +1 -1
- package/lib/module/scripts/html/bodyScript.js +23 -1
- package/lib/module/scripts/html/bodyScript.js.map +1 -1
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.js +1 -1
- package/lib/module/unitComponentsSdkManager/UnitComponentsSdkManager.utils.internal.js.map +1 -1
- package/lib/module/utils/eventBus/EventBus.types.js.map +1 -1
- package/lib/module/webComponent/WebComponent.js +6 -2
- package/lib/module/webComponent/WebComponent.js.map +1 -1
- package/lib/module/webComponent/html.js +5 -1
- package/lib/module/webComponent/html.js.map +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts +1 -1
- package/lib/typescript/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts +1 -1
- package/lib/typescript/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.d.ts.map +1 -1
- package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.d.ts +1 -0
- package/lib/typescript/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.d.ts.map +1 -1
- package/lib/typescript/src/messages/webMessages/accountMessage.d.ts +3 -1
- package/lib/typescript/src/messages/webMessages/accountMessage.d.ts.map +1 -1
- package/lib/typescript/src/scripts/html/bodyScript.d.ts +4 -0
- package/lib/typescript/src/scripts/html/bodyScript.d.ts.map +1 -1
- package/lib/typescript/src/unitComponentsSdkManager/UnitComponentsSdkManager.utils.internal.d.ts.map +1 -1
- package/lib/typescript/src/utils/eventBus/EventBus.types.d.ts +2 -0
- package/lib/typescript/src/utils/eventBus/EventBus.types.d.ts.map +1 -1
- package/lib/typescript/src/webComponent/WebComponent.d.ts.map +1 -1
- package/lib/typescript/src/webComponent/html.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.tsx +2 -15
- package/src/components/UNACHCreditComponent/UNACHCreditComponent.utils.ts +1 -2
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.tsx +2 -15
- package/src/components/UNACHDebitComponent/UNACHDebitComponent.utils.ts +1 -2
- package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.utils.ts +4 -1
- package/src/components/UNBottomSheetComponent/components/UNBottomSheetSlotComponent/UNBottomSheetSlotComponent.tsx +13 -5
- package/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.tsx +36 -1
- package/src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.ts +10 -2
- package/src/messages/webMessages/accountMessage.ts +4 -3
- package/src/scripts/html/bodyScript.ts +26 -2
- package/src/unitComponentsSdkManager/UnitComponentsSdkManager.ts +1 -1
- package/src/unitComponentsSdkManager/UnitComponentsSdkManager.utils.internal.ts +4 -1
- package/src/utils/eventBus/EventBus.types.ts +2 -0
- package/src/webComponent/WebComponent.tsx +6 -2
- package/src/webComponent/html.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UNWhiteLabelAppComponent.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAG3E,eAAO,MAAM,sBAAsB,UAAW,6BAA6B,WAe1E,CAAC;AAEF,eAAO,MAAM,0BAA0B,eAAgB,OAAO,GAAG,IAAI,uBAAuB,mBAAmB,GAAG,IAAI,SAIrH,CAAC;AAEF,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"UNWhiteLabelAppComponent.utils.d.ts","sourceRoot":"","sources":["../../../../../src/components/UNWhiteLabelAppComponent/UNWhiteLabelAppComponent.utils.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,sBAAsB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mDAAmD,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAG3E,eAAO,MAAM,sBAAsB,UAAW,6BAA6B,WAe1E,CAAC;AAEF,eAAO,MAAM,0BAA0B,eAAgB,OAAO,GAAG,IAAI,uBAAuB,mBAAmB,GAAG,IAAI,SAIrH,CAAC;AAEF,eAAO,MAAM,2DAA2D,eAAgB,OAAO,GAAG,IAAI,SAErG,CAAC;AAEF,eAAO,MAAM,sBAAsB,cAUlC,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { UNAccount } from '../../types/shared';
|
|
2
2
|
export declare enum AccountMessage {
|
|
3
|
-
UNIT_ACCOUNT_CHANGED = "unitAccountChanged"
|
|
3
|
+
UNIT_ACCOUNT_CHANGED = "unitAccountChanged",
|
|
4
|
+
UNIT_ACCOUNT_CREATED = "unitAccountCreated",
|
|
5
|
+
UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT = "unitAccountCreationActionsOpenPlaidForLinkExternalAccount"
|
|
4
6
|
}
|
|
5
7
|
export interface AccountChangedEvent {
|
|
6
8
|
account: UNAccount;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountMessage.d.ts","sourceRoot":"","sources":["../../../../../src/messages/webMessages/accountMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,oBAAY,cAAc;IACxB,oBAAoB,uBAAuB;
|
|
1
|
+
{"version":3,"file":"accountMessage.d.ts","sourceRoot":"","sources":["../../../../../src/messages/webMessages/accountMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,oBAAY,cAAc;IACxB,oBAAoB,uBAAuB;IAC3C,oBAAoB,uBAAuB;IAC3C,kEAAkE,8DAA8D;CACjI;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,MAAM,MAAM,YAAY,GAAG,mBAAmB,CAAC"}
|
|
@@ -18,6 +18,7 @@ export declare const LISTENERS: {
|
|
|
18
18
|
unitPaymentFinalStageDoneButtonClicked: string;
|
|
19
19
|
unitPlaidTokenCreated: string;
|
|
20
20
|
unitAccountChanged: string;
|
|
21
|
+
unitAccountCreated: string;
|
|
21
22
|
unitActivityFiltersChanged: string;
|
|
22
23
|
unitMultipleCardsFiltersChanged: string;
|
|
23
24
|
unitMultiFactorAuthFinished: string;
|
|
@@ -29,9 +30,11 @@ export declare const LISTENERS: {
|
|
|
29
30
|
unitMicroDepositConnectionCreated: string;
|
|
30
31
|
unitMicroDepositConnectionRejected: string;
|
|
31
32
|
unitOpenPlaid: string;
|
|
33
|
+
unitAccountCreationActionsOpenPlaidForLinkExternalAccount: string;
|
|
32
34
|
};
|
|
33
35
|
export declare const DISPATCH_RENDERING_EVENT: string;
|
|
34
36
|
export declare const DISPATCH_EVENT_TO_CONTINUE: string;
|
|
37
|
+
export declare const DISPATCH_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT: string;
|
|
35
38
|
export declare const DISPATCH_CARD_STATUS_CHANGED: string;
|
|
36
39
|
export declare const DISPATCH_REQUEST_REFRESH: string;
|
|
37
40
|
export declare const SET_ITEM_IN_WINDOW_UNIT_STORE = "\n const setItemInWindowUnitStore = (key, value) => {\n window.UnitStore[key] = value;\n }\n";
|
|
@@ -46,5 +49,6 @@ export declare const DISPATCH_REQUEST_CARD_ACTION = "\n const dispatchRequest
|
|
|
46
49
|
export declare const DISPATCH_REQUEST_HIDE_SENSITIVE_DATA = "\n const dispatchRequestHideSensitiveData = (componentName) => {\n document.querySelector(componentName).dispatchEvent(new CustomEvent(\"unitRequestHideSensitiveData\"))\n }\n";
|
|
47
50
|
export declare const DISPATCH_REQUEST_SHOW_SENSITIVE_DATA = "\n const dispatchRequestShowSensitiveData = (componentName) => {\n document.querySelector(componentName).dispatchEvent(new CustomEvent(\"unitRequestShowSensitiveData\"))\n }\n";
|
|
48
51
|
export declare const DISPATCH_REQUEST_ACCOUNT_ACTION = "\n const dispatchRequestAccountAction = (action) => {\n document.querySelector(\"unit-elements-account\").dispatchEvent(new CustomEvent(\"unitRequestAccountAction\", {detail: {action: action}}))\n }\n";
|
|
52
|
+
export declare const DISPATCH_ACCOUNT_CREATED_EVENT: string;
|
|
49
53
|
export declare const DISPATCH_COUNTERPARTY_DELETED = "\n const dispatchCounterpartyDeletedEvent = (details) => {\n const event = new CustomEvent(\"unitCounterpartyDeleted\",{ detail: { data: details } });\n window.dispatchEvent(event);\n }\n";
|
|
50
54
|
//# sourceMappingURL=bodyScript.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodyScript.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/html/bodyScript.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,mBAAmB,6NAO/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAO5B,CAAC;AAEF,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"bodyScript.d.ts","sourceRoot":"","sources":["../../../../../src/scripts/html/bodyScript.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,mBAAmB,6NAO/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,QAO5B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8PrB,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAKpC,CAAC;AAEF,eAAO,MAAM,0BAA0B,QAKtC,CAAC;AAEF,eAAO,MAAM,sEAAsE,QAIlF,CAAC;AAEF,eAAO,MAAM,4BAA4B,QAKxC,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAWpC,CAAC;AAEF,eAAO,MAAM,6BAA6B,4GAIzC,CAAC;AAEF,eAAO,MAAM,sCAAsC,QAKlD,CAAC;AAEF,eAAO,MAAM,4CAA4C,QAKxD,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAMvC,CAAC;AAEF,eAAO,MAAM,uBAAuB,QAKnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAK/B,CAAC;AAEF,eAAO,MAAM,mBAAmB,QAK/B,CAAC;AAEF,eAAO,MAAM,0BAA0B,oLAItC,CAAC;AAEF,eAAO,MAAM,4BAA4B,+MAIxC,CAAC;AAEF,eAAO,MAAM,oCAAoC,gMAIhD,CAAC;AAEF,eAAO,MAAM,oCAAoC,iMAIhD,CAAC;AAEF,eAAO,MAAM,+BAA+B,wNAI3C,CAAC;AAEF,eAAO,MAAM,8BAA8B,QAI1C,CAAC;AAEF,eAAO,MAAM,6BAA6B,wMAKzC,CAAC"}
|
package/lib/typescript/src/unitComponentsSdkManager/UnitComponentsSdkManager.utils.internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnitComponentsSdkManager.utils.internal.d.ts","sourceRoot":"","sources":["../../../../src/unitComponentsSdkManager/UnitComponentsSdkManager.utils.internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"UnitComponentsSdkManager.utils.internal.d.ts","sourceRoot":"","sources":["../../../../src/unitComponentsSdkManager/UnitComponentsSdkManager.utils.internal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAGpE,eAAO,MAAM,gBAAgB,QACtB,uBAAuB,yBACL,iCAAiC,WAczD,CAAC"}
|
|
@@ -17,6 +17,7 @@ export type EventMap = {
|
|
|
17
17
|
[CardMessage.CARD_ACTIVATED]: UNCard;
|
|
18
18
|
[CardMessage.CARD_CREATED]: CardCreatedEvent;
|
|
19
19
|
[AccountMessage.UNIT_ACCOUNT_CHANGED]: UNAccount;
|
|
20
|
+
[AccountMessage.UNIT_ACCOUNT_CREATED]: Record<PropertyKey, never>;
|
|
20
21
|
[ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED]: ActivityFiltersChangedEvent;
|
|
21
22
|
[MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED]: UNCard;
|
|
22
23
|
[MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED]: MultipleCardsFiltersChangedEvent;
|
|
@@ -26,6 +27,7 @@ export type EventMap = {
|
|
|
26
27
|
[UnitComponentsMessage.UNIT_MULTI_FACTOR_AUTH_FINISHED]: MultiFactorAuthenticationFinishedEvent;
|
|
27
28
|
[PageMessage.PAGE_HEIGHT]: number;
|
|
28
29
|
[PlaidMessage.UNIT_OPEN_PLAID]: OpenPlaidEvent;
|
|
30
|
+
[AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT]: Record<PropertyKey, never>;
|
|
29
31
|
[PayeeManagementMessage.UNIT_COUNTERPARTY_DELETED]: UNCounterparty;
|
|
30
32
|
};
|
|
31
33
|
export type SharedEvent = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventBus.types.d.ts","sourceR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;IAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"WebComponent.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/WebComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAGhF,OAAO,EAAE,OAAO,EAAuB,MAAM,sBAAsB,CAAC;AAapE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAU1F,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,YAAY,uFAyLvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/html.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["../../../../src/webComponent/html.ts"],"names":[],"mappings":"AAoBA,eAAO,MAAM,gBAAgB;;;;;;CAM5B,CAAC;AAEF,QAAA,MAAM,QAAQ,QAqGb,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState,
|
|
1
|
+
import React, { useState, useRef } from 'react';
|
|
2
2
|
import { WebComponent } from '../../webComponent/WebComponent';
|
|
3
3
|
import type { WebViewMessage } from '../../messages/webMessages';
|
|
4
4
|
import type {
|
|
@@ -12,7 +12,6 @@ import type {
|
|
|
12
12
|
UNAccount
|
|
13
13
|
} from '../../types/shared';
|
|
14
14
|
import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
|
|
15
|
-
import { Platform } from 'react-native';
|
|
16
15
|
import { getACHCreditParams, getACHCreditScript, injectRequestCounterpartyDeletedScript, injectUnitPlaidResponse } from './UNACHCreditComponent.utils';
|
|
17
16
|
import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
|
|
18
17
|
import type { ACHEvent } from '../../messages/webMessages/achCreditMessage';
|
|
@@ -26,7 +25,6 @@ import {
|
|
|
26
25
|
} from '../../messages/webMessages/unitComponentsMessages';
|
|
27
26
|
import { LinkExit, LinkSuccess, open as openPlaidLink, create as createPlaidLink } from 'react-native-plaid-link-sdk';
|
|
28
27
|
import type WebView from 'react-native-webview';
|
|
29
|
-
import AppInfo from '../../utils/AppInfo';
|
|
30
28
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
31
29
|
import { withReduxStore } from '../../helpers/store/helpers';
|
|
32
30
|
import { PlaidMessage } from '../../messages/webMessages/plaidMessages';
|
|
@@ -61,19 +59,8 @@ export interface UNACHCreditComponentProps {
|
|
|
61
59
|
const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
|
|
62
60
|
const [height, setHeight] = useState<number>(0);
|
|
63
61
|
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
64
|
-
const [appPackageName, setAppPackageName] = useState<string>();
|
|
65
62
|
const webRef = useRef<WebView>(null);
|
|
66
63
|
|
|
67
|
-
useEffect(() => {
|
|
68
|
-
const setPackageNameForAndroid = async () => {
|
|
69
|
-
if (Platform.OS === 'android') {
|
|
70
|
-
const packageName = await AppInfo.getAppIdentifier();
|
|
71
|
-
setAppPackageName(packageName);
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
setPackageNameForAndroid();
|
|
75
|
-
}, []);
|
|
76
|
-
|
|
77
64
|
const handleCounterpartyDeleted = (data: UNCounterparty) => {
|
|
78
65
|
injectRequestCounterpartyDeletedScript(webRef.current, data);
|
|
79
66
|
};
|
|
@@ -197,7 +184,7 @@ const UNACHCreditComponent = (props: UNACHCreditComponentProps) => {
|
|
|
197
184
|
type={WebComponentType.achCreditPayment}
|
|
198
185
|
presentationMode={presentationMode}
|
|
199
186
|
params={getACHCreditParams(props)}
|
|
200
|
-
script={getACHCreditScript(
|
|
187
|
+
script={getACHCreditScript()}
|
|
201
188
|
onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
|
|
202
189
|
isScrollable={true}
|
|
203
190
|
theme={props.theme}
|
|
@@ -24,10 +24,9 @@ export const getACHCreditParams = (props: UNACHCreditComponentProps) => {
|
|
|
24
24
|
`;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
-
export const getACHCreditScript = (
|
|
27
|
+
export const getACHCreditScript = () => {
|
|
28
28
|
return `
|
|
29
29
|
${LISTENERS.unitPlaidTokenCreated}
|
|
30
|
-
${appPackageName && `window.UnitMobileSDKConfig.androidPackageName='${appPackageName}'`}
|
|
31
30
|
${LISTENERS.unitPaymentCreated}
|
|
32
31
|
${LISTENERS.unitPaymentInitialStageBackButtonClicked}
|
|
33
32
|
${LISTENERS.unitPaymentFinalStageDoneButtonClicked}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
2
|
import { WebComponent } from '../../webComponent/WebComponent';
|
|
3
3
|
import type { WebViewMessage } from '../../messages/webMessages';
|
|
4
4
|
import type {
|
|
@@ -12,7 +12,6 @@ import type {
|
|
|
12
12
|
UNAccount
|
|
13
13
|
} from '../../types/shared';
|
|
14
14
|
import { HeightEvent, PageMessage } from '../../messages/webMessages/pageMessage';
|
|
15
|
-
import { Platform } from 'react-native';
|
|
16
15
|
import {
|
|
17
16
|
PlaidLinkTokenData,
|
|
18
17
|
PlaidTokenCreatedEvent,
|
|
@@ -26,7 +25,6 @@ import type WebView from 'react-native-webview';
|
|
|
26
25
|
import { PaymentMessage } from '../../messages/webMessages/paymentsMessage';
|
|
27
26
|
import type { ACHEvent } from '../../messages/webMessages/achCreditMessage';
|
|
28
27
|
import { ACHOnLoadResponse, RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';
|
|
29
|
-
import AppInfo from '../../utils/AppInfo';
|
|
30
28
|
import { PresentationMode, WebComponentType } from '../../types/internal/webComponent.types';
|
|
31
29
|
import { withReduxStore } from '../../helpers/store/helpers';
|
|
32
30
|
import { PlaidMessage } from '../../messages/webMessages/plaidMessages';
|
|
@@ -58,20 +56,9 @@ export interface UNACHDebitComponentProps {
|
|
|
58
56
|
|
|
59
57
|
const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
|
|
60
58
|
const [height, setHeight] = useState<number>(0);
|
|
61
|
-
const [appPackageName, setAppPackageName] = useState<string>('');
|
|
62
59
|
const webRef = useRef<WebView>(null);
|
|
63
60
|
const [presentationMode, setPresentationMode] = useState<PresentationMode>(PresentationMode.Inherit);
|
|
64
61
|
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const setPackageNameForAndroid = async () => {
|
|
67
|
-
if (Platform.OS === 'android') {
|
|
68
|
-
const packageName = await AppInfo.getAppIdentifier();
|
|
69
|
-
setAppPackageName(packageName);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
setPackageNameForAndroid();
|
|
73
|
-
}, []);
|
|
74
|
-
|
|
75
62
|
const handleCounterpartyDeleted = (data: UNCounterparty) => {
|
|
76
63
|
injectRequestCounterpartyDeletedScript(webRef.current, data);
|
|
77
64
|
};
|
|
@@ -195,7 +182,7 @@ const UNACHDebitComponent = (props: UNACHDebitComponentProps) => {
|
|
|
195
182
|
type={WebComponentType.achDebitPayment}
|
|
196
183
|
presentationMode={presentationMode}
|
|
197
184
|
params={getACHDebitParams(props)}
|
|
198
|
-
script={getACHDebitScript(
|
|
185
|
+
script={getACHDebitScript()}
|
|
199
186
|
onMessage={(message: WebViewMessage) => handleWebViewMessage(message)}
|
|
200
187
|
isScrollable={true}
|
|
201
188
|
theme={props.theme}
|
|
@@ -23,10 +23,9 @@ export const getACHDebitParams = (props: UNACHDebitComponentProps) => {
|
|
|
23
23
|
`;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
export const getACHDebitScript = (
|
|
26
|
+
export const getACHDebitScript = () => {
|
|
27
27
|
return `
|
|
28
28
|
${LISTENERS.unitPlaidTokenCreated}
|
|
29
|
-
${androidPackageName && `window.UnitMobileSDKConfig.androidPackageName='${androidPackageName}'`}
|
|
30
29
|
${LISTENERS.unitPaymentCreated}
|
|
31
30
|
${LISTENERS.unitPaymentInitialStageBackButtonClicked}
|
|
32
31
|
${LISTENERS.unitPaymentFinalStageDoneButtonClicked}
|
|
@@ -19,7 +19,10 @@ import { WebComponentType } from '../../types/internal/webComponent.types';
|
|
|
19
19
|
import { parseUNAccountFilters, parseUNCreateCardTypes } from '../../types/shared';
|
|
20
20
|
|
|
21
21
|
export const getBottomSheetScript = () => {
|
|
22
|
-
return
|
|
22
|
+
return `
|
|
23
|
+
${LISTENERS.requestRefresh}
|
|
24
|
+
${LISTENERS.unitAccountCreationActionsOpenPlaidForLinkExternalAccount}
|
|
25
|
+
`;
|
|
23
26
|
};
|
|
24
27
|
|
|
25
28
|
export const renderingBottomSheetRequest = (currentWebView: WebView, renderingRequest: RequestRenderingEvent) => {
|
|
@@ -96,7 +96,7 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
96
96
|
scrollStateForSlot();
|
|
97
97
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98
98
|
}, [props.componentName, props.requestRenderingEvent.data.nativePlace]);
|
|
99
|
-
|
|
99
|
+
|
|
100
100
|
const _onWebMessage = (message: WebViewMessage) => {
|
|
101
101
|
switch (message.type) {
|
|
102
102
|
case PageMessage.PAGE_LOADED:
|
|
@@ -122,7 +122,7 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
122
122
|
break;
|
|
123
123
|
}
|
|
124
124
|
case BottomSheetNativePlaceType.menu: case BottomSheetNativePlaceType.contentHeight: {
|
|
125
|
-
const adjustedHeight = props.requestRenderingEvent.data.isPaddingIncluded
|
|
125
|
+
const adjustedHeight = props.requestRenderingEvent.data.isPaddingIncluded
|
|
126
126
|
? height + effectiveBottomInset
|
|
127
127
|
: height + VERTICAL_PADDING + effectiveBottomInset;
|
|
128
128
|
const maxHeight = props.requestRenderingEvent.data.isPaddingIncluded
|
|
@@ -154,12 +154,17 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
154
154
|
);
|
|
155
155
|
break;
|
|
156
156
|
|
|
157
|
-
case PlaidMessage.UNIT_OPEN_PLAID:
|
|
157
|
+
case PlaidMessage.UNIT_OPEN_PLAID: {
|
|
158
|
+
const openPlaidDetails = message.details as OpenPlaidEvent;
|
|
158
159
|
eventBus.emit(
|
|
159
160
|
PlaidMessage.UNIT_OPEN_PLAID,
|
|
160
|
-
|
|
161
|
+
openPlaidDetails
|
|
161
162
|
);
|
|
162
163
|
break;
|
|
164
|
+
}
|
|
165
|
+
case AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT:
|
|
166
|
+
eventBus.emit(AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT, {});
|
|
167
|
+
break;
|
|
163
168
|
|
|
164
169
|
case CardMessage.CARD_STATUS_CHANGED:
|
|
165
170
|
eventBus.emit(
|
|
@@ -173,6 +178,9 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
173
178
|
(message.details as AccountChangedEvent).account
|
|
174
179
|
);
|
|
175
180
|
break;
|
|
181
|
+
case AccountMessage.UNIT_ACCOUNT_CREATED:
|
|
182
|
+
eventBus.emit(AccountMessage.UNIT_ACCOUNT_CREATED, {});
|
|
183
|
+
break;
|
|
176
184
|
case ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED:
|
|
177
185
|
eventBus.emit(
|
|
178
186
|
ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED,
|
|
@@ -211,7 +219,7 @@ const UNBottomSheetSlotComponent = (props: UNBottomSheetSlotComponentProps) => {
|
|
|
211
219
|
dispatch(setShouldEnableBottomSheetScroll(false));
|
|
212
220
|
}
|
|
213
221
|
};
|
|
214
|
-
|
|
222
|
+
|
|
215
223
|
// If isPaddingIncluded is true, we don't need to add padding to the web component
|
|
216
224
|
const paddingStyle = !props.requestRenderingEvent.data.isPaddingIncluded ? {
|
|
217
225
|
paddingTop: TOP_PADDING,
|
|
@@ -16,6 +16,7 @@ import WebView from 'react-native-webview';
|
|
|
16
16
|
import {
|
|
17
17
|
getWhiteLabelAppParams,
|
|
18
18
|
getWhiteLabelAppScript,
|
|
19
|
+
injectAccountCreationActionsOpenPlaidForLinkExternalAccount,
|
|
19
20
|
injectRefreshEventIfNeeded,
|
|
20
21
|
} from './UNWhiteLabelAppComponent.utils';
|
|
21
22
|
import { UserDataKeys } from '../../types/internal/unitStore.types';
|
|
@@ -25,6 +26,10 @@ import { ActivityMessage } from '../../messages/webMessages/activityMessage';
|
|
|
25
26
|
import { setItemInWindowUnitStore } from '../../utils/windowUnitStore';
|
|
26
27
|
import { UNBaseView } from '../../nativeComponents/UNBaseView';
|
|
27
28
|
import { UnitComponentsSDK } from '../../unitComponentsSdkManager/UnitComponentsSdkManager';
|
|
29
|
+
import { AccountMessage } from '../../messages/webMessages/accountMessage';
|
|
30
|
+
import { OpenPlaidEvent, PlaidMessage } from '../../messages/webMessages/plaidMessages';
|
|
31
|
+
import { injectUnitPlaidExit, injectUnitPlaidResponse } from '../UNPayeeManagementComponent/UNPayeeManagementComponent.utils';
|
|
32
|
+
import { LinkExit, LinkSuccess, open as openPlaidLink, create as createPlaidLink } from 'react-native-plaid-link-sdk';
|
|
28
33
|
|
|
29
34
|
export interface UNWhiteLabelAppComponentProps {
|
|
30
35
|
// inputs
|
|
@@ -66,9 +71,12 @@ const UNWhiteLabelAppComponent = (props: UNWhiteLabelAppComponentProps) => {
|
|
|
66
71
|
}
|
|
67
72
|
break;
|
|
68
73
|
}
|
|
69
|
-
|
|
70
74
|
case PageMessage.PAGE_LOADED:
|
|
71
75
|
updateWindowUnitStore();
|
|
76
|
+
break;
|
|
77
|
+
case PlaidMessage.UNIT_OPEN_PLAID:
|
|
78
|
+
openPlaid(message.details as OpenPlaidEvent);
|
|
79
|
+
break;
|
|
72
80
|
}
|
|
73
81
|
};
|
|
74
82
|
|
|
@@ -94,11 +102,38 @@ const UNWhiteLabelAppComponent = (props: UNWhiteLabelAppComponentProps) => {
|
|
|
94
102
|
webRef.current?.injectJavaScript(`dispatchActivityFilterChangedEvent('${query}')`);
|
|
95
103
|
};
|
|
96
104
|
|
|
105
|
+
const openPlaid = (openPlaidData: OpenPlaidEvent) => {
|
|
106
|
+
const linkToken = openPlaidData.plaidLinkToken.attributes.linkToken;
|
|
107
|
+
createPlaidLink({ token: linkToken });
|
|
108
|
+
|
|
109
|
+
openPlaidLink({
|
|
110
|
+
onSuccess: (success: LinkSuccess) => {
|
|
111
|
+
injectUnitPlaidResponse(webRef.current, success);
|
|
112
|
+
},
|
|
113
|
+
onExit: (exit: LinkExit) => {
|
|
114
|
+
injectUnitPlaidExit(webRef.current, exit.error);
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
|
|
97
119
|
useEventListener({ busEventKey: UnitComponentsMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });
|
|
98
120
|
useEventListener({
|
|
99
121
|
busEventKey: ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED,
|
|
100
122
|
action: dispatchActivityFiltersChanged,
|
|
101
123
|
});
|
|
124
|
+
useEventListener({
|
|
125
|
+
busEventKey: PlaidMessage.UNIT_OPEN_PLAID,
|
|
126
|
+
action: (details) => {
|
|
127
|
+
openPlaid(details);
|
|
128
|
+
},
|
|
129
|
+
});
|
|
130
|
+
useEventListener({
|
|
131
|
+
busEventKey: AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT,
|
|
132
|
+
action: () => injectAccountCreationActionsOpenPlaidForLinkExternalAccount(webRef.current),
|
|
133
|
+
});
|
|
134
|
+
useEventListener({ busEventKey: AccountMessage.UNIT_ACCOUNT_CREATED, action: () => {
|
|
135
|
+
webRef.current?.injectJavaScript('dispatchAccountCreatedEvent()');
|
|
136
|
+
} });
|
|
102
137
|
|
|
103
138
|
const renderWebView = () => {
|
|
104
139
|
return (
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import WebView from 'react-native-webview';
|
|
2
2
|
import { RequestRefreshEvent } from '../../messages/webMessages/unitComponentsMessages';
|
|
3
3
|
import { UNWhiteLabelAppComponentProps } from './UNWhiteLabelAppComponent';
|
|
4
|
-
import { DISPATCH_REQUEST_REFRESH, LISTENERS } from '../../scripts/html/bodyScript';
|
|
4
|
+
import { DISPATCH_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT, DISPATCH_OPEN_PLAID, DISPATCH_PLAID_EXIT, DISPATCH_PLAID_RESPONSE, DISPATCH_REQUEST_REFRESH, LISTENERS } from '../../scripts/html/bodyScript';
|
|
5
5
|
|
|
6
6
|
export const getWhiteLabelAppParams = (props: UNWhiteLabelAppComponentProps) => {
|
|
7
7
|
// customer token is the preferred way to authenticate
|
|
@@ -26,10 +26,18 @@ export const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRe
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
export const injectAccountCreationActionsOpenPlaidForLinkExternalAccount = (currentWeb: WebView | null) => {
|
|
30
|
+
currentWeb?.injectJavaScript('dispatchAccountCreationActionsOpenPlaidForLinkExternalAccount()');
|
|
31
|
+
};
|
|
32
|
+
|
|
29
33
|
export const getWhiteLabelAppScript = () => {
|
|
30
34
|
return `
|
|
31
35
|
${DISPATCH_REQUEST_REFRESH}
|
|
32
|
-
|
|
36
|
+
${DISPATCH_OPEN_PLAID}
|
|
37
|
+
${DISPATCH_PLAID_RESPONSE}
|
|
38
|
+
${DISPATCH_PLAID_EXIT}
|
|
39
|
+
${DISPATCH_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT}
|
|
33
40
|
${LISTENERS.unitWhiteLabelAppOnLoad}
|
|
41
|
+
${LISTENERS.unitCounterpartyCreated}
|
|
34
42
|
`;
|
|
35
43
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { UNAccount } from '../../types/shared';
|
|
2
2
|
|
|
3
3
|
export enum AccountMessage {
|
|
4
|
-
UNIT_ACCOUNT_CHANGED = 'unitAccountChanged'
|
|
4
|
+
UNIT_ACCOUNT_CHANGED = 'unitAccountChanged',
|
|
5
|
+
UNIT_ACCOUNT_CREATED = 'unitAccountCreated',
|
|
6
|
+
UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT = 'unitAccountCreationActionsOpenPlaidForLinkExternalAccount',
|
|
5
7
|
}
|
|
6
8
|
|
|
7
9
|
export interface AccountChangedEvent {
|
|
8
10
|
account: UNAccount;
|
|
9
11
|
}
|
|
10
12
|
|
|
11
|
-
export type AccountEvent =
|
|
12
|
-
| AccountChangedEvent
|
|
13
|
+
export type AccountEvent = AccountChangedEvent;
|
|
@@ -157,6 +157,12 @@ export const LISTENERS = {
|
|
|
157
157
|
})
|
|
158
158
|
});
|
|
159
159
|
`,
|
|
160
|
+
unitAccountCreated: `
|
|
161
|
+
window.addEventListener("${AccountMessage.UNIT_ACCOUNT_CREATED}", (e) => {
|
|
162
|
+
if (e.detail?.fromSDK) { return }
|
|
163
|
+
postMessageToSDK({ type: "${AccountMessage.UNIT_ACCOUNT_CREATED}" })
|
|
164
|
+
});
|
|
165
|
+
`,
|
|
160
166
|
unitActivityFiltersChanged: `
|
|
161
167
|
window.addEventListener("${ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED}", (e) => {
|
|
162
168
|
postMessageToSDK({ type: "${ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED}", details: e.detail })
|
|
@@ -262,13 +268,19 @@ export const LISTENERS = {
|
|
|
262
268
|
|
|
263
269
|
unitOpenPlaid: `
|
|
264
270
|
window.addEventListener("${PlaidMessage.UNIT_OPEN_PLAID}", async (e) => {
|
|
265
|
-
const response =
|
|
271
|
+
const response = e.detail;
|
|
266
272
|
response.then((data) => {
|
|
267
273
|
postMessageToSDK({ type: "${PlaidMessage.UNIT_OPEN_PLAID}", details: data.data })
|
|
268
274
|
}).catch((e) => {
|
|
269
275
|
console.log(e)
|
|
270
276
|
})
|
|
271
277
|
});
|
|
278
|
+
`,
|
|
279
|
+
unitAccountCreationActionsOpenPlaidForLinkExternalAccount: `
|
|
280
|
+
window.addEventListener("${AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT}", (e) => {
|
|
281
|
+
if (e.detail?.fromSDK) { return }
|
|
282
|
+
postMessageToSDK({ type: "${AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT}" })
|
|
283
|
+
});
|
|
272
284
|
`
|
|
273
285
|
};
|
|
274
286
|
|
|
@@ -286,6 +298,12 @@ export const DISPATCH_EVENT_TO_CONTINUE = `
|
|
|
286
298
|
}
|
|
287
299
|
`;
|
|
288
300
|
|
|
301
|
+
export const DISPATCH_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT = `
|
|
302
|
+
const dispatchAccountCreationActionsOpenPlaidForLinkExternalAccount = () => {
|
|
303
|
+
window.dispatchEvent(new CustomEvent("${AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT}", { detail: { fromSDK: true } }))
|
|
304
|
+
}
|
|
305
|
+
`;
|
|
306
|
+
|
|
289
307
|
export const DISPATCH_CARD_STATUS_CHANGED = `
|
|
290
308
|
const dispatchCardStatusChanged = (details) => {
|
|
291
309
|
const event = new CustomEvent("${CardMessage.CARD_STATUS_CHANGED}",{ detail: JSON.parse(details) })
|
|
@@ -385,9 +403,15 @@ export const DISPATCH_REQUEST_ACCOUNT_ACTION = `
|
|
|
385
403
|
}
|
|
386
404
|
`;
|
|
387
405
|
|
|
406
|
+
export const DISPATCH_ACCOUNT_CREATED_EVENT = `
|
|
407
|
+
const dispatchAccountCreatedEvent = () => {
|
|
408
|
+
window.dispatchEvent(new CustomEvent("${AccountMessage.UNIT_ACCOUNT_CREATED}", { detail: { fromSDK: true } }));
|
|
409
|
+
}
|
|
410
|
+
`;
|
|
411
|
+
|
|
388
412
|
export const DISPATCH_COUNTERPARTY_DELETED = `
|
|
389
413
|
const dispatchCounterpartyDeletedEvent = (details) => {
|
|
390
414
|
const event = new CustomEvent("unitCounterpartyDeleted",{ detail: { data: details } });
|
|
391
415
|
window.dispatchEvent(event);
|
|
392
416
|
}
|
|
393
|
-
`;
|
|
417
|
+
`;
|
|
@@ -26,7 +26,7 @@ export class UnitComponentsSDK {
|
|
|
26
26
|
protected static fonts?: UNFonts;
|
|
27
27
|
protected static signedNonce?: string;
|
|
28
28
|
protected static pushProvisionModule?: typeof NativeModules;
|
|
29
|
-
protected static sdkVersion = '3.1.2-beta.
|
|
29
|
+
protected static sdkVersion = '3.1.2-beta.3';
|
|
30
30
|
static iosFontBase64Map: Record<string, string> = {};
|
|
31
31
|
|
|
32
32
|
public static init = async (
|
|
@@ -2,7 +2,10 @@ import type { UNComponentsWebVersioningStrategy } from '../types/shared';
|
|
|
2
2
|
import { UNComponentsEnvironment } from '../types/shared/env.types';
|
|
3
3
|
import { getWebSdkVersionString } from '../utils/webVersioningStrategy.utils';
|
|
4
4
|
|
|
5
|
-
export const getUnitScriptUrl = (
|
|
5
|
+
export const getUnitScriptUrl = (
|
|
6
|
+
env: UNComponentsEnvironment,
|
|
7
|
+
webVersioningStrategy: UNComponentsWebVersioningStrategy
|
|
8
|
+
) => {
|
|
6
9
|
const webSdkVersionString = getWebSdkVersionString(webVersioningStrategy);
|
|
7
10
|
|
|
8
11
|
switch (env) {
|
|
@@ -19,6 +19,7 @@ export type EventMap = {
|
|
|
19
19
|
[CardMessage.CARD_ACTIVATED]: UNCard;
|
|
20
20
|
[CardMessage.CARD_CREATED]: CardCreatedEvent;
|
|
21
21
|
[AccountMessage.UNIT_ACCOUNT_CHANGED]: UNAccount;
|
|
22
|
+
[AccountMessage.UNIT_ACCOUNT_CREATED]: Record<PropertyKey, never>;
|
|
22
23
|
[ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED]: ActivityFiltersChangedEvent;
|
|
23
24
|
[MultipleCardsMessage.UNIT_MULTIPLE_CARDS_CARD_CLICKED]: UNCard;
|
|
24
25
|
[MultipleCardsMessage.UNIT_MULTIPLE_CARDS_FILTERS_CHANGED]: MultipleCardsFiltersChangedEvent;
|
|
@@ -28,6 +29,7 @@ export type EventMap = {
|
|
|
28
29
|
[UnitComponentsMessage.UNIT_MULTI_FACTOR_AUTH_FINISHED]: MultiFactorAuthenticationFinishedEvent;
|
|
29
30
|
[PageMessage.PAGE_HEIGHT]: number;
|
|
30
31
|
[PlaidMessage.UNIT_OPEN_PLAID]: OpenPlaidEvent;
|
|
32
|
+
[AccountMessage.UNIT_ACCOUNT_CREATION_ACTIONS_OPEN_PLAID_FOR_LINK_EXTERNAL_ACCOUNT]: Record<PropertyKey, never>;
|
|
31
33
|
[PayeeManagementMessage.UNIT_COUNTERPARTY_DELETED]: UNCounterparty;
|
|
32
34
|
};
|
|
33
35
|
|
|
@@ -49,6 +49,7 @@ export const WebComponent = React.forwardRef<WebView, WebComponentProps>(functio
|
|
|
49
49
|
const customerToken = useSelector((state: RootState) => state.configuration.customerToken);
|
|
50
50
|
const [sourceHtml, setSourceHtml] = useState<string | null>(null);
|
|
51
51
|
const [baseName, setBaseName] = useState<string>();
|
|
52
|
+
const [androidPackageName, setAndroidPackageName] = useState<string>();
|
|
52
53
|
const [infoParams, setInfoParams] = useState<{ [key: string]: string }>({});
|
|
53
54
|
|
|
54
55
|
const webRef = useRef(null);
|
|
@@ -65,6 +66,8 @@ export const WebComponent = React.forwardRef<WebView, WebComponentProps>(functio
|
|
|
65
66
|
setBaseName(name.replace(/ /g, '-'));
|
|
66
67
|
} else { // android
|
|
67
68
|
setBaseName('unit');
|
|
69
|
+
const packageName = await AppInfo.getAppIdentifier();
|
|
70
|
+
setAndroidPackageName(packageName);
|
|
68
71
|
}
|
|
69
72
|
} catch (error: any) {
|
|
70
73
|
console.error(error);
|
|
@@ -104,6 +107,7 @@ export const WebComponent = React.forwardRef<WebView, WebComponentProps>(functio
|
|
|
104
107
|
|
|
105
108
|
const windowInfoParams = `window.UnitMobileSDKConfig['info'] = ${JSON.stringify(infoParams)};`;
|
|
106
109
|
const plaidRedirectUriParam = (Platform.OS == 'ios' && UnitComponentsSDK.helpers.redirectUri) ? `window.UnitMobileSDKConfig['plaidRedirectUri'] = '${UnitComponentsSDK.helpers.redirectUri}/plaid';` : '';
|
|
110
|
+
const androidPackageNameParam = androidPackageName ? `window.UnitMobileSDKConfig.androidPackageName='${androidPackageName}';` : '';
|
|
107
111
|
const unitSessionIdParam = `window.UnitSessionStore.unitSessionId = '${UnitComponentsSDK.helpers.unitSessionId}';`;
|
|
108
112
|
|
|
109
113
|
const unitVerifiedCustomerToken = await UNStoreManagerHelper.getValue(UserDataKeys.unitVerifiedCustomerToken);
|
|
@@ -111,7 +115,7 @@ export const WebComponent = React.forwardRef<WebView, WebComponentProps>(functio
|
|
|
111
115
|
const windowVerifiedCustomerToken = unitVerifiedCustomerToken ? `window.UnitStore['${UserDataKeys.unitVerifiedCustomerToken}'] = '${unitVerifiedCustomerToken}';` : '';
|
|
112
116
|
const windowAppFormVerifiedToken = unitAppFormVerifiedToken ? `window.UnitStore['${UserDataKeys.unitApplicationFormVerifiedToken}'] = '${unitAppFormVerifiedToken}';` : '';
|
|
113
117
|
|
|
114
|
-
const windowParams = `${windowInfoParams} ${unitSessionIdParam} ${plaidRedirectUriParam} ${windowVerifiedCustomerToken} ${windowAppFormVerifiedToken} ${props.windowParams || ''}`;
|
|
118
|
+
const windowParams = `${windowInfoParams} ${unitSessionIdParam} ${plaidRedirectUriParam} ${androidPackageNameParam} ${windowVerifiedCustomerToken} ${windowAppFormVerifiedToken} ${props.windowParams || ''}`;
|
|
115
119
|
|
|
116
120
|
let newHtml = html.replace(HTML_PLACEHOLDER.BODY, getHtmlBody(props.type.valueOf(), componentParams, props.presentationMode));
|
|
117
121
|
newHtml = newHtml.replace(HTML_PLACEHOLDER.FONT_FACES, fontFaces);
|
|
@@ -122,7 +126,7 @@ export const WebComponent = React.forwardRef<WebView, WebComponentProps>(functio
|
|
|
122
126
|
|
|
123
127
|
updateSourceHTML();
|
|
124
128
|
|
|
125
|
-
}, [props.params, unitScript, props.presentationMode, props.script, props.windowParams, globalTheme, globalLanguage, customerToken, infoParams]);
|
|
129
|
+
}, [props.params, unitScript, props.presentationMode, props.script, props.windowParams, globalTheme, globalLanguage, customerToken, infoParams, androidPackageName]);
|
|
126
130
|
|
|
127
131
|
// Listen and update the live webComponents
|
|
128
132
|
const handleMultiFactorAuthFinished = (data: MultiFactorAuthenticationFinishedEvent) => {
|
package/src/webComponent/html.ts
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
DISPATCH_CARD_STATUS_CHANGED,
|
|
16
16
|
DISPATCH_MULTIPLE_CARDS_FILTER_CHANGED_EVENT,
|
|
17
17
|
DISPATCH_CARD_CREATED_EVENT,
|
|
18
|
+
DISPATCH_ACCOUNT_CREATED_EVENT,
|
|
18
19
|
} from '../scripts/html/bodyScript';
|
|
19
20
|
|
|
20
21
|
export const HTML_PLACEHOLDER = {
|
|
@@ -86,6 +87,8 @@ const htmlText = `
|
|
|
86
87
|
|
|
87
88
|
${LISTENERS.unitAccountChanged}
|
|
88
89
|
|
|
90
|
+
${LISTENERS.unitAccountCreated}
|
|
91
|
+
|
|
89
92
|
${LISTENERS.unitActivityFiltersChanged}
|
|
90
93
|
|
|
91
94
|
${LISTENERS.unitMultipleCardsFiltersChanged}
|
|
@@ -116,6 +119,8 @@ const htmlText = `
|
|
|
116
119
|
|
|
117
120
|
${DISPATCH_REQUEST_ACCOUNT_ACTION}
|
|
118
121
|
|
|
122
|
+
${DISPATCH_ACCOUNT_CREATED_EVENT}
|
|
123
|
+
|
|
119
124
|
${SET_ITEM_IN_WINDOW_UNIT_STORE}
|
|
120
125
|
|
|
121
126
|
${HTML_PLACEHOLDER.SCRIPT_FROM_NATIVE}
|