react-native-unit-components 1.3.0 → 1.4.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.
Files changed (116) hide show
  1. package/README.md +0 -375
  2. package/ios/Camera/Camera.swift +22 -0
  3. package/ios/Camera/CameraExportModule.m +7 -0
  4. package/ios/UNAppInfo/UNAppInfo.swift +19 -0
  5. package/ios/UNAppInfo/UNAppInfoExportModule.m +7 -0
  6. package/ios/UnitReactNativeComponentsViewManager.swift +7 -7
  7. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js +3 -0
  8. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  9. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js +7 -1
  10. package/lib/commonjs/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  11. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js +8 -0
  12. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  13. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js +6 -1
  14. package/lib/commonjs/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  15. package/lib/commonjs/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  16. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js +4 -0
  17. package/lib/commonjs/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  18. package/lib/commonjs/components/UNCardComponent/UNCardComponent.js.map +1 -1
  19. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js +97 -0
  20. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -0
  21. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js +45 -0
  22. package/lib/commonjs/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js.map +1 -0
  23. package/lib/commonjs/components/index.js +11 -0
  24. package/lib/commonjs/components/index.js.map +1 -1
  25. package/lib/commonjs/hooks/listenerToBus.js +4 -1
  26. package/lib/commonjs/hooks/listenerToBus.js.map +1 -1
  27. package/lib/commonjs/messages/webMessages/activityMessage.js +12 -0
  28. package/lib/commonjs/messages/webMessages/activityMessage.js.map +1 -0
  29. package/lib/commonjs/messages/webMessages/checkMessage.js +13 -0
  30. package/lib/commonjs/messages/webMessages/checkMessage.js.map +1 -0
  31. package/lib/commonjs/messages/webMessages/index.js.map +1 -1
  32. package/lib/commonjs/scripts/html/bodyScript.js +20 -1
  33. package/lib/commonjs/scripts/html/bodyScript.js.map +1 -1
  34. package/lib/commonjs/sharedTypes/account.types.js +8 -1
  35. package/lib/commonjs/sharedTypes/account.types.js.map +1 -1
  36. package/lib/commonjs/sharedTypes/checkDeposit.types.js +22 -0
  37. package/lib/commonjs/sharedTypes/checkDeposit.types.js.map +1 -0
  38. package/lib/commonjs/sharedTypes/index.js +11 -0
  39. package/lib/commonjs/sharedTypes/index.js.map +1 -1
  40. package/lib/commonjs/webComponent/WebComponent.js +33 -1
  41. package/lib/commonjs/webComponent/WebComponent.js.map +1 -1
  42. package/lib/commonjs/webComponent/html.js +8 -1
  43. package/lib/commonjs/webComponent/html.js.map +1 -1
  44. package/lib/module/components/UNAccountComponent/UNAccountComponent.js +4 -1
  45. package/lib/module/components/UNAccountComponent/UNAccountComponent.js.map +1 -1
  46. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js +5 -0
  47. package/lib/module/components/UNAccountComponent/UNAccountComponent.utils.js.map +1 -1
  48. package/lib/module/components/UNActivityComponent/UNActivityComponent.js +9 -1
  49. package/lib/module/components/UNActivityComponent/UNActivityComponent.js.map +1 -1
  50. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js +4 -0
  51. package/lib/module/components/UNActivityComponent/UNActivityComponent.utils.js.map +1 -1
  52. package/lib/module/components/UNBookPaymentComponent/UNBookPaymentComponent.js.map +1 -1
  53. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js +4 -0
  54. package/lib/module/components/UNBottomSheetComponent/UNBottomSheetComponent.js.map +1 -1
  55. package/lib/module/components/UNCardComponent/UNCardComponent.js.map +1 -1
  56. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js +88 -0
  57. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.js.map +1 -0
  58. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js +37 -0
  59. package/lib/module/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.js.map +1 -0
  60. package/lib/module/components/index.js +1 -0
  61. package/lib/module/components/index.js.map +1 -1
  62. package/lib/module/hooks/listenerToBus.js +4 -1
  63. package/lib/module/hooks/listenerToBus.js.map +1 -1
  64. package/lib/module/messages/webMessages/activityMessage.js +5 -0
  65. package/lib/module/messages/webMessages/activityMessage.js.map +1 -0
  66. package/lib/module/messages/webMessages/checkMessage.js +6 -0
  67. package/lib/module/messages/webMessages/checkMessage.js.map +1 -0
  68. package/lib/module/messages/webMessages/index.js.map +1 -1
  69. package/lib/module/scripts/html/bodyScript.js +17 -0
  70. package/lib/module/scripts/html/bodyScript.js.map +1 -1
  71. package/lib/module/sharedTypes/account.types.js +6 -0
  72. package/lib/module/sharedTypes/account.types.js.map +1 -1
  73. package/lib/module/sharedTypes/checkDeposit.types.js +15 -0
  74. package/lib/module/sharedTypes/checkDeposit.types.js.map +1 -0
  75. package/lib/module/sharedTypes/index.js +1 -0
  76. package/lib/module/sharedTypes/index.js.map +1 -1
  77. package/lib/module/webComponent/WebComponent.js +32 -1
  78. package/lib/module/webComponent/WebComponent.js.map +1 -1
  79. package/lib/module/webComponent/html.js +9 -2
  80. package/lib/module/webComponent/html.js.map +1 -1
  81. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.d.ts +4 -0
  82. package/lib/typescript/components/UNAccountComponent/UNAccountComponent.utils.d.ts +2 -0
  83. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.d.ts +2 -1
  84. package/lib/typescript/components/UNActivityComponent/UNActivityComponent.utils.d.ts +1 -0
  85. package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.d.ts +12 -0
  86. package/lib/typescript/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.d.ts +3 -0
  87. package/lib/typescript/components/index.d.ts +1 -0
  88. package/lib/typescript/messages/webMessages/activityMessage.d.ts +5 -0
  89. package/lib/typescript/messages/webMessages/checkMessage.d.ts +8 -0
  90. package/lib/typescript/messages/webMessages/index.d.ts +4 -2
  91. package/lib/typescript/scripts/html/bodyScript.d.ts +3 -0
  92. package/lib/typescript/sharedTypes/account.types.d.ts +5 -0
  93. package/lib/typescript/sharedTypes/checkDeposit.types.d.ts +46 -0
  94. package/lib/typescript/sharedTypes/index.d.ts +1 -0
  95. package/lib/typescript/webComponent/WebComponent.d.ts +1 -0
  96. package/package.json +3 -3
  97. package/src/components/UNAccountComponent/UNAccountComponent.tsx +13 -1
  98. package/src/components/UNAccountComponent/UNAccountComponent.utils.ts +7 -0
  99. package/src/components/UNActivityComponent/UNActivityComponent.tsx +14 -2
  100. package/src/components/UNActivityComponent/UNActivityComponent.utils.ts +5 -0
  101. package/src/components/UNBookPaymentComponent/UNBookPaymentComponent.tsx +1 -0
  102. package/src/components/UNBottomSheetComponent/UNBottomSheetComponent.tsx +4 -0
  103. package/src/components/UNCardComponent/UNCardComponent.tsx +2 -0
  104. package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.tsx +112 -0
  105. package/src/components/UNCheckDepositComponent/UNCheckDepositComponent.utils.ts +40 -0
  106. package/src/components/index.ts +1 -0
  107. package/src/hooks/listenerToBus.ts +4 -1
  108. package/src/messages/webMessages/activityMessage.ts +8 -0
  109. package/src/messages/webMessages/checkMessage.ts +14 -0
  110. package/src/messages/webMessages/index.ts +6 -0
  111. package/src/scripts/html/bodyScript.ts +20 -1
  112. package/src/sharedTypes/account.types.ts +13 -7
  113. package/src/sharedTypes/checkDeposit.types.ts +50 -0
  114. package/src/sharedTypes/index.ts +1 -0
  115. package/src/webComponent/WebComponent.tsx +33 -1
  116. package/src/webComponent/html.ts +9 -2
package/README.md CHANGED
@@ -69,378 +69,3 @@ export default function YourRootComponent() {
69
69
  );
70
70
  }
71
71
  ```
72
-
73
- ### Components
74
-
75
- #### Card Component
76
-
77
- ##### UNCardComponent props:
78
- | Name | Type | Required | Description |
79
- | ---------------------- | ---------------------------- | --------- | -------------------------------------------------------- |
80
- | customerToken | string | YES | A Unit Customer token. |
81
- | cardId | string | YES | Unit card id. |
82
- | theme | string | NO | A URL that specifies the UI configuration. |
83
- | hide-actions-menu-button | boolean | NO | Hide menu button in case value is true |
84
- | hide-card-title | boolean | NO | Hide card title in case value is true |
85
- | hide-sensitive-data-button | boolean | NO | Hide sensitive data button in case value is true |
86
- | onStatusChanged | (card: UNCardData) => void | NO | Callback for card status changes. |
87
- | onCardActivated | (card: UNCardData) => void | No | Callback for card activated |
88
- | pushProvisioningModule | typeof NativeModules | NO | A Native Module that implements Visa's push provisioning |
89
- | onLoad | (response: UNOnLoadResponse<UNCardData>) => void | No | Callback for a loaded component |
90
-
91
- ##### Example:
92
- ```js
93
- import React from 'react';
94
- import { UNCardComponent, UNCardData } from 'react-native-unit-components';
95
- import { NativeModules } from 'react-native';
96
- const { PushProvisioningModule } = NativeModules;
97
-
98
- export default function YourComponent() {
99
- return (
100
- <UNCardComponent
101
- cardId={'632197'}
102
- customerToken={''}
103
- onStatusChanged={(card: UNCardData) => { console.log(card) }}
104
- onCardActivated={(card: UNCardData) => { console.log(card) }}
105
- pushProvisioningModule={PushProvisioningModule}
106
- onLoad={(response: UNOnLoadResponse<UNCardData>) => { console.log(response) }}
107
- />
108
- );
109
- }
110
- ```
111
-
112
- ##### Incoming Events:
113
- - In some cases, the default menu button won't fit into the design of an application.
114
- By using the `openActionsMenu()` method, it's possible to open the card actions bottom sheet from a custom button.
115
-
116
- Important Note: one can use the `openActionsMenu()` only after UNCardComponent is loaded. (can be verified by onLoad callback)
117
-
118
- - It's also possible to create your own menu and call card actions from it.
119
- Use `openAction(action: UNCardMenuAction)` method and send inside an action you want to perform.
120
- Use API Docs in order to understand which actions could be applied for any particular card statuses.
121
-
122
- #### Example:
123
- ```js
124
- import { UNCardComponent, CardRef, UNCardMenuAction } from 'react-native-unit-components';
125
-
126
- ...
127
-
128
- const cardRef = useRef<CardRef>(null);
129
-
130
- ...
131
-
132
- const openActionsMenu = () => {
133
- cardRef.current?.openActionsMenu();
134
- };
135
-
136
- const openAction = (action: UNCardMenuAction) => {
137
- cardRef.current?.openAction(action);
138
- };
139
-
140
-
141
- ...
142
-
143
- <UNCardComponent
144
- ref={cardRef}
145
- cardId={"4242"}
146
- customerToken={''}
147
- />
148
-
149
- ```
150
-
151
-
152
-
153
- ##### Add card to wallet capability - Optional
154
-
155
- [Complete the add to wallet guide for React Native](https://guides.unit.co/add-to-mobile-wallet#react-native), skipping the [last module access from javascript](https://guides.unit.co/add-to-mobile-wallet#module-access-from-javascript-1), to use this capability.
156
-
157
- Call `UnitSDK.setSignedNonce` with the signedNonce response you obtained from the `launchInitialize` method of the `PushProvisioningModule` in Javascript.
158
-
159
- Then pass the `PushProvisioningModule` as a prop to [Unit's Card Component](#card-component). This will let the SDK get wallets and start card provisioning for you once the native add to wallet button was pressed.
160
-
161
-
162
- ###### Input:
163
- | Name | Type | Required | Description |
164
- | --------------- | ---------------------------- | --------- | -------------------------------------------- |
165
- | signedNonce | string | YES | A signed nonce obtained from Visa. |
166
-
167
- ###### Example:
168
- ```js
169
- import React from "react";
170
- import { UnitSDK } from "react-native-unit-components";
171
- import { NativeModules } from 'react-native';
172
- const { PushProvisioningModule } = NativeModules;
173
-
174
- export default function YourRootComponent() {
175
- useEffect(() => {
176
- const launchInitialize = async () => {
177
- try {
178
- // To call the module method to use SDK method initialize
179
- const response = await PushProvisioningModule.launchInitialize();
180
- const signedNonce = JSON.parse(response).signedNonce;
181
- UnitSDK.setSignedNonce(signedNonce);
182
- } catch (error) {
183
- // Manage errors
184
- }
185
- };
186
-
187
- launchInitialize();
188
- }, []);
189
- };
190
- ```
191
-
192
- #### Book Payment Component
193
-
194
- ##### UNBookPaymentComponent props:
195
- | Name | Type | Required | Description |
196
- | --------------------- | -------------------------------------- | --------- | ---------------------------------------------- |
197
- | customerToken | string | YES | A Unit Customer token. |
198
- | accountId | string | YES | Unit account id. The account from which money is being sent. |
199
- | counterPartyAccountId | string | YES | Unit account id. The account which will receive money. |
200
- | counterPartyName | string | YES | Name of the counterparty. This is the name that will be displayed in the Book Payment UI during the transfer.|
201
- | isSameCustomer | boolean | NO | Stating whether both accounts belong to the same customer. Allows fetching additional information about the counterparty account. Default "false" |
202
- | theme | string | NO | A URL that specifies the UI configuration. |
203
- | onPaymentCreated | (bookPayment: UNBookPaymentData) => void | NO | Callback for the created bookPayment. |
204
- | onLoad | (response: UNOnLoadResponse<UNAccountData>) => void | NO | Callback for a loaded component
205
-
206
-
207
-
208
- ##### Example:
209
- ```js
210
- import React from 'react';
211
- import { UNBookPaymentComponent, UNBookPaymentData } from 'react-native-unit-components';
212
-
213
- export default function YourComponent() {
214
- return (
215
- <UNBookPaymentComponent
216
- customerToken={''}
217
- accountId={'1105561'}
218
- counterPartyAccountId={'1105562'}
219
- counterPartyName={'Peter Parker"'}
220
- isSameCustomer={true}
221
- onPaymentCreated={(bookPayment: UNBookPaymentData) => { console.log(bookPayment) }}
222
- onLoad={(response: UNOnLoadResponse<UNBookPaymentData>) => { console.log(response) }}
223
- />
224
- );
225
- }
226
- ```
227
-
228
- #### Activity Component
229
-
230
- ##### UNActivityComponent props:
231
- | Name | Type | Required | Description |
232
- | --------------------- | -------------------------------------- | --------- | ---------------------------------------------- |
233
- | customerToken | string | YES | A Unit Customer token. |
234
- | accountId | string | NO | Unit account id. The account for which the activity will be shown. If not specified: the activity of the customer (all accounts) will be shown |
235
- | theme | string | NO | A URL that specifies the UI configuration. |
236
-
237
-
238
- ##### Example:
239
- ```js
240
- import React from 'react';
241
- import { UNActivityComponent } from 'react-native-unit-components';
242
-
243
- export default function YourComponent() {
244
- return (
245
- <UNActivityComponent
246
- customerToken={''}
247
- accountId={'1105561'}
248
- />
249
- );
250
- }
251
- ```
252
-
253
- #### Account Component
254
-
255
- ##### UNAccountComponent props:
256
- | Name | Type | Required | Description |
257
- | --------------------- | -------------------------------------- | --------- | ---------------------------------------------- |
258
- | customerToken | string | YES | A Unit Customer token. |
259
- | accountId | string | NO | Unit account id. The account to show, when not provided, one of the customer's accounts will be shown. |
260
- | theme | string | NO | A URL that specifies the UI configuration. |
261
- | onAccountChanged | (account: UNAccountData) => Void | NO | Callback for account changes. |
262
- | onLoad | (response: UNOnLoadResponse<[UNAccountData]>) => void | NO | Callback for a loaded component |
263
-
264
-
265
- ##### Example:
266
- ```js
267
- import React from 'react';
268
- import { UNAccountComponent } from 'react-native-unit-components';
269
-
270
- export default function YourComponent() {
271
- return (
272
- <UNAccountComponent
273
- customerToken={''}
274
- accountId={'1105561'}
275
- onAccountChanged={(account: UNAccountData) => console.log('Account changed', account)}/>
276
- onLoad={(response: UNOnLoadResponse<UNAccountData>) => { console.log(response) }}
277
- />
278
- );
279
- }
280
- ```
281
-
282
- #### ACH Credit Payment Component
283
-
284
- ##### UNACHCreditComponent props:
285
- | Name | Type | Required | Description |
286
- | --------------------- | -------------------------------------- | --------- | ---------------------------------------------- |
287
- | customerToken | string | YES | A Unit Customer token. |
288
- | accountId | string | YES | Unit account id. The account from which money is being sent. |
289
- | theme | string | No | A URL that specifies the UI configuration. |
290
- | fee | number | NO | Bill your counterparty for his activity. |
291
- | is-auto-focus | boolean | NO | Auto-focus the 'add new recipient' button once the component is mounted. Default "false" |
292
- | onPaymentCreated | (data: UNACHData) => Void | NO | Callback for ACH payment created |
293
- | onLoad | (response: UNOnLoadResponse<UNACHOnLoadData>) => void | NO | Callback for a loaded component |
294
-
295
-
296
-
297
- ##### Example:
298
- ```js
299
- import React from 'react';
300
- import { UNACHCreditComponent, UNACHData, UNACHOnLoadData } from 'react-native-unit-components';
301
- export default function YourComponent() {
302
- return (
303
- <UNACHCreditComponent
304
- customerToken={''}
305
- accountId={'1105561'}
306
- onPaymentCreated={(payment: UNACHData) => { console.log(payment) }}
307
- onLoad={(response: UNOnLoadResponse<UNACHOnLoadData>) => { console.log(response) }}
308
- />
309
- );
310
- }
311
- ```
312
-
313
- #### ACH Debit Payment Component
314
-
315
- ##### Prerequirements
316
-
317
- ###### Installation of the SDK
318
- In your project directory, run:
319
-
320
- With npm:
321
-
322
- ```
323
- npm install --save react-native-plaid-link-sdk
324
- ```
325
-
326
- With yarn:
327
-
328
- ```
329
- yarn add react-native-plaid-link-sdk
330
- ```
331
-
332
- ###### Installation for iOS
333
-
334
-
335
- Add Plaid to your project’s Podfile as follows (likely located at ios/Podfile).
336
-
337
- ```
338
- pod 'Plaid', '~> <insert latest version>'
339
- ```
340
-
341
- Then install your CocoaPods dependencies:
342
-
343
- ```
344
- (cd ios && pod install)
345
- ```
346
-
347
- ###### Installation for Android
348
-
349
- Register your app id with Plaid:
350
-
351
- - Log in to the [Plaid dashboard](https://dashboard.plaid.com/signin) and go to Team Settings -> API.
352
-
353
- - Next to Allowed Android package names, click Configure, then Add New Android Package Name.
354
-
355
- - Enter your package name, for example com.plaid.example.
356
-
357
-
358
- ##### UNACHDebitComponent props:
359
- | Name | Type | Required | Description |
360
- | --------------------- | -------------------------------------- | --------- | ---------------------------------------------- |
361
- | customerToken | string | YES | A Unit Customer token. |
362
- | accountId | string | YES | Unit account id. The account from which money is being sent. |
363
- | theme | string | No | A URL that specifies the UI configuration. |
364
- | fee | number | NO | Bill your counterparty for his activity. |
365
- | is-auto-focus | boolean | NO | Auto-focus the 'add new recipient' button once the component is mounted. Default "false" |
366
- | onPaymentCreated | (data: UNACHData) => Void | NO | Callback for ACH payment created |
367
- | onLoad | (response: UNOnLoadResponse<UNACHOnLoadData>) | NO | Callback for a loaded component |
368
-
369
-
370
- ##### Example:
371
- ```js
372
- import React from 'react';
373
- import { UNACHDebitComponent, UNACHData, UNACHOnLoadData } from 'react-native-unit-components';
374
- export default function YourComponent() {
375
- return (
376
- <UNACHDebitComponent
377
- customerToken={''}
378
- accountId={'1105561'}
379
- onPaymentCreated={(payment: UNACHData) => { console.log(payment) }}
380
- onLoad={(response: UNOnLoadResponse<UNACHOnLoadData>) => { console.log(response) }}
381
- />
382
- );
383
- }
384
- ```
385
-
386
-
387
- #### Error Handling
388
-
389
- By using unitOnLoad callback you can get a Swift.Result about the requested component.
390
- OnError - you will get an enum UNError that consist of several cases.
391
-
392
- #### UNError:
393
-
394
- fields | Description |
395
- | --------------------- | --------------------------- | ------------------------------------------------------------ |
396
- errors: UNErrorData[] | Report UNError on errors that happen in loading time |
397
-
398
-
399
- #### UNErrorData:
400
- | Name | Type | Description |
401
- | --------------------- | -------------------------------------------| --------------------------------------------------------------------------- |
402
- | status | String | A Unit-specific code, uniquely identifying the error type |
403
- | title | String? | The title of the error type |
404
- | detail | String? | Additional information about the error. |
405
- | details | String? | Additional information about the error. |
406
- | meta | { supportId: String }? | meta.supportId unique error identifier to be used for further investigation |
407
-
408
- Note: An "error object" MUST contain a title and the HTTP status code members.
409
-
410
- #### Example:
411
- ```ts
412
- import { UNCardComponent, UNCardData, UNOnLoadResponse } from 'react-native-unit-components';
413
-
414
- ....
415
-
416
- const handleCardOnLoad = (response: UNOnLoadResponse<UNCardData>) => {
417
- if ('errors' in response) {
418
- console.error('ERROR unitOnLoad: ', response.errors);
419
- return;
420
- }
421
-
422
- if ('data' in response) {
423
- const cardData: UNCardData = response.data;
424
- console.log('Success, data:', cardData)
425
- return;
426
- }
427
-
428
- return;
429
- }
430
-
431
-
432
- ....
433
-
434
- return (
435
- ...
436
-
437
- <UNCardComponent
438
- cardId={'632197'}
439
- customerToken={''}
440
- onLoad={handleCardOnLoad}
441
- />
442
-
443
- ...
444
- )
445
- ```
446
-
@@ -0,0 +1,22 @@
1
+ // CameraAccess.swift
2
+
3
+ import Foundation
4
+ import AVFoundation
5
+
6
+ @objc(Camera)
7
+ class Camera: NSObject {
8
+
9
+ @objc static func requiresMainQueueSetup() -> Bool {
10
+ return true
11
+ }
12
+
13
+ @objc func requestAccess(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
14
+ AVCaptureDevice.requestAccess(for: .video) { (granted: Bool) in
15
+ if granted {
16
+ resolve("Camera access granted")
17
+ } else {
18
+ reject("ERROR", "Camera access denied", nil)
19
+ }
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,7 @@
1
+ #import <React/RCTViewManager.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(Camera, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(requestAccess: (RCTPromiseResolveBlock)resolve rejecter: (RCTPromiseRejectBlock)reject)
6
+
7
+ @end
@@ -0,0 +1,19 @@
1
+ // AppInfo.swift
2
+
3
+ import Foundation
4
+
5
+ @objc(UNAppInfo)
6
+ class UNAppInfo: NSObject {
7
+
8
+ @objc static func requiresMainQueueSetup() -> Bool {
9
+ return true
10
+ }
11
+
12
+ @objc func getBundleName(_ resolve: @escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) {
13
+ if let bundleName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String {
14
+ resolve(bundleName)
15
+ } else {
16
+ reject("ERROR", "Could not get bundle name", nil)
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,7 @@
1
+ #import <React/RCTBridgeModule.h>
2
+
3
+ @interface RCT_EXTERN_MODULE(UNAppInfo, NSObject)
4
+
5
+ RCT_EXTERN_METHOD(getBundleName: (RCTPromiseResolveBlock)resolve rejecter: (RCTPromiseRejectBlock)reject)
6
+
7
+ @end
@@ -15,17 +15,17 @@ class UnitAddToWalletButtonViewManager: RCTViewManager {
15
15
 
16
16
  class UnitAddToWalletButtonView : UIView {
17
17
  @objc var onAddToWalletClicked: RCTDirectEventBlock?
18
-
18
+
19
19
  override init(frame: CGRect) {
20
20
  super.init(frame: frame)
21
21
  self.addSubview(addPassButton)
22
22
  center(addPassButton: addPassButton)
23
23
  }
24
-
24
+
25
25
  required init?(coder: NSCoder) {
26
26
  super.init(coder: coder)
27
27
  }
28
-
28
+
29
29
  lazy var addPassButton: PKAddPassButton = {
30
30
  let button = PKAddPassButton(addPassButtonStyle: PKAddPassButtonStyle.black)
31
31
  button.addTarget(
@@ -35,7 +35,7 @@ class UnitAddToWalletButtonView : UIView {
35
35
 
36
36
  return button
37
37
  }()
38
-
38
+
39
39
  func center(addPassButton: PKAddPassButton) {
40
40
  addPassButton.translatesAutoresizingMaskIntoConstraints = false
41
41
  NSLayoutConstraint.activate([
@@ -45,9 +45,9 @@ class UnitAddToWalletButtonView : UIView {
45
45
  addPassButton.bottomAnchor.constraint(equalTo: self.bottomAnchor)
46
46
  ])
47
47
  }
48
-
49
-
50
-
48
+
49
+
50
+
51
51
  @objc func sendUpdate(_ sender: UITapGestureRecognizer? = nil) {
52
52
  self.onAddToWalletClicked?(nil)
53
53
  }
@@ -65,6 +65,9 @@ const UNAccountComponent = /*#__PURE__*/_react.default.forwardRef(function UNAcc
65
65
  (0, _react.useImperativeHandle)(accountRef, () => ({
66
66
  openActionsMenu() {
67
67
  (0, _UNAccountComponent.injectOpenActionsMenuScript)(webRef.current);
68
+ },
69
+ openAction(action) {
70
+ (0, _UNAccountComponent.injectRequestAccountActionScript)(webRef.current, action);
68
71
  }
69
72
  }));
70
73
  const handleMessage = message => {
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_pageMessage","_unitMessages","_EventBus","_interopRequireDefault","_WebComponent","_UNAccountComponent","_bodyHtml","_listenerToBus","_accountMessage","_onLoadMessage","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AccountAction","exports","UNAccountComponent","React","forwardRef","props","accountRef","height","setHeight","useState","windowWidth","Dimensions","width","requestRefreshEvent","setRequestRefreshEvent","webRef","useRef","handleAccountChanged","account","onAccountChanged","requestRefresh","data","handleUnitOnLoad","response","onLoad","RESPONSE_KEYS","errors","console","error","useListenerToBus","busEventKey","UnitMessage","UNIT_REQUEST_REFRESH","action","AccountMessage","UNIT_ACCOUNT_CHANGED","useEffect","injectRefreshEventIfNeeded","current","useImperativeHandle","openActionsMenu","injectOpenActionsMenuScript","handleMessage","message","type","UNIT_ON_LOAD","details","UNIT_REQUEST_RENDERING","event","componentName","WebComponentType","componentResourceId","accountId","requestRenderingEvent","EventBus","Instance","PageMessage","PAGE_HEIGHT","createElement","View","style","WebComponent","ref","presentationMode","PresentationMode","Default","params","getAccountParams","script","getAccountScript","theme","onMessage","isScrollable"],"sources":["UNAccountComponent.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type WebView from 'react-native-webview';\nimport { HeightEvent, PageMessage } from '../..//messages/webMessages/pageMessage';\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport EventBus from '../../helpers/EventBus';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { getAccountParams, getAccountScript, injectOpenActionsMenuScript, injectRefreshEventIfNeeded } from './UNAccountComponent.utils';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport type { BottomSheetSlotData } from '../UNBottomSheetComponent/UNBottomSheetComponent';\nimport type { UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../sharedTypes';\nimport { useListenerToBus } from '../../hooks/listenerToBus';\nimport type { UNAccountData } from '../../sharedTypes/account.types';\nimport { AccountMessage } from '../../messages/webMessages/accountMessage';\nimport { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';\n\nexport interface UNAccountComponentProps {\n accountId?: string;\n customerToken: string;\n theme?: string;\n onLoad?: (response: UNOnLoadResponse<[UNAccountData]>) => void;\n onAccountChanged?: (account: UNAccountData) => void;\n}\n\nexport interface UNAccountRef {\n openActionsMenu: () => void;\n}\n\nexport enum AccountAction {\n List = 'account-list',\n Menu = 'account-menu'\n}\n\nexport const UNAccountComponent = React.forwardRef<UNAccountRef, UNAccountComponentProps>(function UNAccountComponent(props, accountRef) {\n const [height, setHeight] = useState(0);\n const windowWidth = Dimensions.get('window').width;\n\n const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null);\n\n const webRef = useRef<WebView>(null);\n\n const handleAccountChanged = (account: UNAccountData) => {\n props.onAccountChanged && props.onAccountChanged(account);\n };\n\n const requestRefresh = (data: RequestRefreshEvent) => {\n setRequestRefreshEvent(data);\n };\n\n const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {\n if (!props.onLoad) {\n return;\n }\n\n if (RESPONSE_KEYS.errors in response) {\n props.onLoad(response as UNError);\n return;\n }\n\n if (RESPONSE_KEYS.account in response) {\n // AccountsOnLoadResponse;\n props.onLoad(response[RESPONSE_KEYS.account] as UNOnLoadResponseData<[UNAccountData]>);\n return;\n }\n\n console.error('On Load Error: unexpected response type.');\n return;\n };\n\n useListenerToBus({ busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });\n useListenerToBus({ busEventKey: AccountMessage.UNIT_ACCOUNT_CHANGED, action: handleAccountChanged });\n\n useEffect(() => {\n injectRefreshEventIfNeeded(webRef.current, requestRefreshEvent);\n }, [requestRefreshEvent]);\n\n useImperativeHandle(accountRef, () => ({\n openActionsMenu() {\n injectOpenActionsMenuScript(webRef.current);\n }\n }));\n\n const handleMessage = (message: WebViewMessage) => {\n switch (message.type) {\n case UnitMessage.UNIT_ON_LOAD:\n handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);\n break;\n case UnitMessage.UNIT_REQUEST_RENDERING: {\n const event: BottomSheetSlotData = {\n componentName: WebComponentType.account,\n componentResourceId: props.accountId,\n requestRenderingEvent: message.details as RequestRenderingEvent\n };\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_RENDERING, event);\n break;\n }\n case PageMessage.PAGE_HEIGHT:\n setHeight((message.details as HeightEvent).height);\n break;\n }\n };\n\n return (\n <View style={{ height }}>\n <WebComponent\n ref={webRef}\n type={WebComponentType.account}\n presentationMode={PresentationMode.Default}\n params={getAccountParams(props)}\n script={getAccountScript()}\n theme={props.theme}\n onMessage={message => handleMessage(message)}\n width={windowWidth}\n isScrollable={false}\n />\n </View>\n );\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAEA,IAAAO,mBAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAGA,IAAAS,cAAA,GAAAT,OAAA;AAEA,IAAAU,eAAA,GAAAV,OAAA;AACA,IAAAW,cAAA,GAAAX,OAAA;AAAkG,SAAAK,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAjB,wBAAAa,GAAA,EAAAI,WAAA,SAAAA,WAAA,IAAAJ,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAQ,KAAA,GAAAL,wBAAA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Native","_pageMessage","_unitMessages","_EventBus","_interopRequireDefault","_WebComponent","_UNAccountComponent","_bodyHtml","_listenerToBus","_accountMessage","_onLoadMessage","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AccountAction","exports","UNAccountComponent","React","forwardRef","props","accountRef","height","setHeight","useState","windowWidth","Dimensions","width","requestRefreshEvent","setRequestRefreshEvent","webRef","useRef","handleAccountChanged","account","onAccountChanged","requestRefresh","data","handleUnitOnLoad","response","onLoad","RESPONSE_KEYS","errors","console","error","useListenerToBus","busEventKey","UnitMessage","UNIT_REQUEST_REFRESH","action","AccountMessage","UNIT_ACCOUNT_CHANGED","useEffect","injectRefreshEventIfNeeded","current","useImperativeHandle","openActionsMenu","injectOpenActionsMenuScript","openAction","injectRequestAccountActionScript","handleMessage","message","type","UNIT_ON_LOAD","details","UNIT_REQUEST_RENDERING","event","componentName","WebComponentType","componentResourceId","accountId","requestRenderingEvent","EventBus","Instance","PageMessage","PAGE_HEIGHT","createElement","View","style","WebComponent","ref","presentationMode","PresentationMode","Default","params","getAccountParams","script","getAccountScript","theme","onMessage","isScrollable"],"sources":["UNAccountComponent.tsx"],"sourcesContent":["import React, { useEffect, useImperativeHandle, useRef, useState } from 'react';\nimport { Dimensions, View } from 'react-native';\nimport type WebView from 'react-native-webview';\nimport { HeightEvent, PageMessage } from '../..//messages/webMessages/pageMessage';\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport EventBus from '../../helpers/EventBus';\nimport { WebComponent, WebComponentType } from '../../webComponent/WebComponent';\nimport type { WebViewMessage } from '../../messages/webMessages';\nimport { getAccountParams, getAccountScript, injectOpenActionsMenuScript, injectRefreshEventIfNeeded, injectRequestAccountActionScript } from './UNAccountComponent.utils';\nimport { PresentationMode } from '../../scripts/html/bodyHtml';\nimport type { BottomSheetSlotData } from '../UNBottomSheetComponent/UNBottomSheetComponent';\nimport type { UNError, UNOnLoadResponse, UNOnLoadResponseData } from '../../sharedTypes';\nimport { useListenerToBus } from '../../hooks/listenerToBus';\nimport type { UNAccountData } from '../../sharedTypes/account.types';\nimport { AccountMessage } from '../../messages/webMessages/accountMessage';\nimport { RESPONSE_KEYS, UnitOnLoadResponseEvent } from '../../messages/webMessages/onLoadMessage';\nimport type { UNAccountMenuAction } from '../../sharedTypes';\n\nexport interface UNAccountComponentProps {\n // inputs\n accountId?: string;\n customerToken: string;\n\n // ui\n theme?: string;\n hideActionsMenuButton?: boolean;\n hideSelectionMenuButton?: boolean;\n\n // events\n onLoad?: (response: UNOnLoadResponse<[UNAccountData]>) => void;\n onAccountChanged?: (account: UNAccountData) => void;\n}\n\nexport interface UNAccountRef {\n openActionsMenu: () => void;\n openAction: (action: UNAccountMenuAction) => void;\n}\n\nexport enum AccountAction {\n List = 'account-list',\n Menu = 'account-menu'\n}\n\nexport const UNAccountComponent = React.forwardRef<UNAccountRef, UNAccountComponentProps>(function UNAccountComponent(props, accountRef) {\n const [height, setHeight] = useState(0);\n const windowWidth = Dimensions.get('window').width;\n\n const [requestRefreshEvent, setRequestRefreshEvent] = useState<RequestRefreshEvent | null>(null);\n\n const webRef = useRef<WebView>(null);\n\n const handleAccountChanged = (account: UNAccountData) => {\n props.onAccountChanged && props.onAccountChanged(account);\n };\n\n const requestRefresh = (data: RequestRefreshEvent) => {\n setRequestRefreshEvent(data);\n };\n\n const handleUnitOnLoad = (response: UnitOnLoadResponseEvent) => {\n if (!props.onLoad) {\n return;\n }\n\n if (RESPONSE_KEYS.errors in response) {\n props.onLoad(response as UNError);\n return;\n }\n\n if (RESPONSE_KEYS.account in response) {\n // AccountsOnLoadResponse;\n props.onLoad(response[RESPONSE_KEYS.account] as UNOnLoadResponseData<[UNAccountData]>);\n return;\n }\n\n console.error('On Load Error: unexpected response type.');\n return;\n };\n\n useListenerToBus({ busEventKey: UnitMessage.UNIT_REQUEST_REFRESH, action: requestRefresh });\n useListenerToBus({ busEventKey: AccountMessage.UNIT_ACCOUNT_CHANGED, action: handleAccountChanged });\n\n useEffect(() => {\n injectRefreshEventIfNeeded(webRef.current, requestRefreshEvent);\n }, [requestRefreshEvent]);\n\n useImperativeHandle(accountRef, () => ({\n openActionsMenu() {\n injectOpenActionsMenuScript(webRef.current);\n },\n openAction(action: UNAccountMenuAction) {\n injectRequestAccountActionScript(webRef.current, action);\n }\n }));\n\n const handleMessage = (message: WebViewMessage) => {\n switch (message.type) {\n case UnitMessage.UNIT_ON_LOAD:\n handleUnitOnLoad(message.details as UnitOnLoadResponseEvent);\n break;\n case UnitMessage.UNIT_REQUEST_RENDERING: {\n const event: BottomSheetSlotData = {\n componentName: WebComponentType.account,\n componentResourceId: props.accountId,\n requestRenderingEvent: message.details as RequestRenderingEvent\n };\n EventBus.Instance.event(UnitMessage.UNIT_REQUEST_RENDERING, event);\n break;\n }\n case PageMessage.PAGE_HEIGHT:\n setHeight((message.details as HeightEvent).height);\n break;\n }\n };\n\n return (\n <View style={{ height }}>\n <WebComponent\n ref={webRef}\n type={WebComponentType.account}\n presentationMode={PresentationMode.Default}\n params={getAccountParams(props)}\n script={getAccountScript()}\n theme={props.theme}\n onMessage={message => handleMessage(message)}\n width={windowWidth}\n isScrollable={false}\n />\n </View>\n );\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AAEA,IAAAO,mBAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AAGA,IAAAS,cAAA,GAAAT,OAAA;AAEA,IAAAU,eAAA,GAAAV,OAAA;AACA,IA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B,OAAA,CAAAgF,aAAA,CAAC7F,YAAA,CAAA8F,IAAI;IAACC,KAAK,EAAE;MAAEvD;IAAO;EAAE,gBACtB3C,MAAA,CAAAgB,OAAA,CAAAgF,aAAA,CAACxF,aAAA,CAAA2F,YAAY;IACXC,GAAG,EAAEjD,MAAO;IACZ+B,IAAI,EAAEM,8BAAgB,CAAClC,OAAQ;IAC/B+C,gBAAgB,EAAEC,0BAAgB,CAACC,OAAQ;IAC3CC,MAAM,EAAE,IAAAC,oCAAgB,EAAChE,KAAK,CAAE;IAChCiE,MAAM,EAAE,IAAAC,oCAAgB,GAAG;IAC3BC,KAAK,EAAEnE,KAAK,CAACmE,KAAM;IACnBC,SAAS,EAAE5B,OAAO,IAAID,aAAa,CAACC,OAAO,CAAE;IAC7CjC,KAAK,EAAEF,WAAY;IACnBgE,YAAY,EAAE;EAAM,EACpB,CACG;AAEX,CAAC,CAAC;AAACzE,OAAA,CAAAC,kBAAA,GAAAA,kBAAA"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.injectRefreshEventIfNeeded = exports.injectOpenActionsMenuScript = exports.getAccountScript = exports.getAccountParams = exports.getAccountActionType = void 0;
6
+ exports.injectRequestAccountActionScript = exports.injectRefreshEventIfNeeded = exports.injectOpenActionsMenuScript = exports.getAccountScript = exports.getAccountParams = exports.getAccountActionType = void 0;
7
7
  var _UNAccountComponent = require("./UNAccountComponent");
8
8
  var _unitMessages = require("../../messages/webMessages/unitMessages");
9
9
  var _WebComponent = require("../../webComponent/WebComponent");
@@ -11,6 +11,8 @@ const getAccountParams = props => {
11
11
  return `
12
12
  account-id="${props.accountId}"
13
13
  customer-token="${props.customerToken}"
14
+ hide-actions-menu-button="${props.hideActionsMenuButton || false}"
15
+ hide-selection-menu-button="${props.hideSelectionMenuButton || false}"
14
16
  `;
15
17
  };
16
18
  exports.getAccountParams = getAccountParams;
@@ -27,6 +29,10 @@ const injectOpenActionsMenuScript = currentWeb => {
27
29
  currentWeb === null || currentWeb === void 0 ? void 0 : currentWeb.injectJavaScript(`dispatchOpenActionsMenu('${_WebComponent.WebComponentType.account}')`);
28
30
  };
29
31
  exports.injectOpenActionsMenuScript = injectOpenActionsMenuScript;
32
+ const injectRequestAccountActionScript = (currentWeb, action) => {
33
+ currentWeb === null || currentWeb === void 0 ? void 0 : currentWeb.injectJavaScript(`dispatchRequestAccountAction('${action}')`);
34
+ };
35
+ exports.injectRequestAccountActionScript = injectRequestAccountActionScript;
30
36
  const injectRefreshEventIfNeeded = (currentWeb, requestRefreshEvent) => {
31
37
  if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(_WebComponent.WebComponentType.account.valueOf())) {
32
38
  currentWeb === null || currentWeb === void 0 ? void 0 : currentWeb.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
@@ -1 +1 @@
1
- {"version":3,"names":["_UNAccountComponent","require","_unitMessages","_WebComponent","getAccountParams","props","accountId","customerToken","exports","getAccountScript","UnitMessage","UNIT_REQUEST_REFRESH","injectOpenActionsMenuScript","currentWeb","injectJavaScript","WebComponentType","account","injectRefreshEventIfNeeded","requestRefreshEvent","dependencies","includes","valueOf","JSON","stringify","getAccountActionType","requestRendering","data","nativeComponent","AccountAction","List","Menu"],"sources":["UNAccountComponent.utils.ts"],"sourcesContent":["import { AccountAction, UNAccountComponentProps } from './UNAccountComponent';\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport type WebView from 'react-native-webview';\nimport { WebComponentType } from '../../webComponent/WebComponent';\n\nexport const getAccountParams = (props: UNAccountComponentProps) => {\n return `\n account-id=\"${props.accountId}\"\n customer-token=\"${props.customerToken}\"\n `;\n};\n\nexport const getAccountScript = () => {\n return `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n `;\n};\n\nexport const injectOpenActionsMenuScript = (currentWeb: WebView | null) => {\n currentWeb?.injectJavaScript(`dispatchOpenActionsMenu('${WebComponentType.account}')`);\n};\n\nexport const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null) => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.account.valueOf())) {\n currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);\n }\n};\n\nexport const getAccountActionType = (requestRendering: RequestRenderingEvent) => {\n return requestRendering.data.nativeComponent.includes(AccountAction.List) ? AccountAction.List : AccountAction.Menu;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAEO,MAAMG,gBAAgB,GAAIC,KAA8B,IAAK;EAClE,OAAQ;AACV,kBAAkBA,KAAK,CAACC,SAAU;AAClC,sBAAsBD,KAAK,CAACE,aAAc;AAC1C,GAAG;AACH,CAAC;AAACC,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA;AAEK,MAAMK,gBAAgB,GAAGA,CAAA,KAAM;EACpC,OAAQ;AACV;AACA,qCAAqCC,yBAAW,CAACC,oBAAqB;AACtE;AACA;AACA,GAAG;AACH,CAAC;AAACH,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAEK,MAAMG,2BAA2B,GAAIC,UAA0B,IAAK;EACzEA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,4BAA2BC,8BAAgB,CAACC,OAAQ,IAAG,CAAC;AACxF,CAAC;AAACR,OAAA,CAAAI,2BAAA,GAAAA,2BAAA;AAEK,MAAMK,0BAA0B,GAAGA,CAACJ,UAA0B,EAAEK,mBAA+C,KAAK;EACzH,IAAIA,mBAAmB,IAAIA,mBAAmB,CAACC,YAAY,CAACC,QAAQ,CAACL,8BAAgB,CAACC,OAAO,CAACK,OAAO,EAAE,CAAC,EAAE;IACxGR,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,yBAAwBQ,IAAI,CAACC,SAAS,CAACL,mBAAmB,CAAE,IAAG,CAAC;EAChG;AACF,CAAC;AAACV,OAAA,CAAAS,0BAAA,GAAAA,0BAAA;AAEK,MAAMO,oBAAoB,GAAIC,gBAAuC,IAAK;EAC/E,OAAOA,gBAAgB,CAACC,IAAI,CAACC,eAAe,CAACP,QAAQ,CAACQ,iCAAa,CAACC,IAAI,CAAC,GAAGD,iCAAa,CAACC,IAAI,GAAGD,iCAAa,CAACE,IAAI;AACrH,CAAC;AAACtB,OAAA,CAAAgB,oBAAA,GAAAA,oBAAA"}
1
+ {"version":3,"names":["_UNAccountComponent","require","_unitMessages","_WebComponent","getAccountParams","props","accountId","customerToken","hideActionsMenuButton","hideSelectionMenuButton","exports","getAccountScript","UnitMessage","UNIT_REQUEST_REFRESH","injectOpenActionsMenuScript","currentWeb","injectJavaScript","WebComponentType","account","injectRequestAccountActionScript","action","injectRefreshEventIfNeeded","requestRefreshEvent","dependencies","includes","valueOf","JSON","stringify","getAccountActionType","requestRendering","data","nativeComponent","AccountAction","List","Menu"],"sources":["UNAccountComponent.utils.ts"],"sourcesContent":["import { AccountAction, UNAccountComponentProps } from './UNAccountComponent';\nimport { RequestRefreshEvent, RequestRenderingEvent, UnitMessage } from '../../messages/webMessages/unitMessages';\nimport type WebView from 'react-native-webview';\nimport { WebComponentType } from '../../webComponent/WebComponent';\nimport type { UNAccountMenuAction } from 'src/sharedTypes';\n\nexport const getAccountParams = (props: UNAccountComponentProps) => {\n return `\n account-id=\"${props.accountId}\"\n customer-token=\"${props.customerToken}\"\n hide-actions-menu-button=\"${props.hideActionsMenuButton || false}\"\n hide-selection-menu-button=\"${props.hideSelectionMenuButton || false}\"\n `;\n};\n\nexport const getAccountScript = () => {\n return `\n const dispatchRefreshEvent = (details) => {\n const event = new CustomEvent(\"${UnitMessage.UNIT_REQUEST_REFRESH}\",{ detail: JSON.parse(details) })\n window.dispatchEvent(event)\n }\n `;\n};\n\nexport const injectOpenActionsMenuScript = (currentWeb: WebView | null) => {\n currentWeb?.injectJavaScript(`dispatchOpenActionsMenu('${WebComponentType.account}')`);\n};\n\nexport const injectRequestAccountActionScript = (currentWeb: WebView | null, action: UNAccountMenuAction) => {\n currentWeb?.injectJavaScript(`dispatchRequestAccountAction('${action}')`);\n};\n\nexport const injectRefreshEventIfNeeded = (currentWeb: WebView | null, requestRefreshEvent: RequestRefreshEvent | null) => {\n if (requestRefreshEvent && requestRefreshEvent.dependencies.includes(WebComponentType.account.valueOf())) {\n currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);\n }\n};\n\nexport const getAccountActionType = (requestRendering: RequestRenderingEvent) => {\n return requestRendering.data.nativeComponent.includes(AccountAction.List) ? AccountAction.List : AccountAction.Menu;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AAGO,MAAMG,gBAAgB,GAAIC,KAA8B,IAAK;EAClE,OAAQ;AACV,kBAAkBA,KAAK,CAACC,SAAU;AAClC,sBAAsBD,KAAK,CAACE,aAAc;AAC1C,gCAAgCF,KAAK,CAACG,qBAAqB,IAAI,KAAM;AACrE,kCAAkCH,KAAK,CAACI,uBAAuB,IAAI,KAAM;AACzE,GAAG;AACH,CAAC;AAACC,OAAA,CAAAN,gBAAA,GAAAA,gBAAA;AAEK,MAAMO,gBAAgB,GAAGA,CAAA,KAAM;EACpC,OAAQ;AACV;AACA,qCAAqCC,yBAAW,CAACC,oBAAqB;AACtE;AACA;AACA,GAAG;AACH,CAAC;AAACH,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAEK,MAAMG,2BAA2B,GAAIC,UAA0B,IAAK;EACzEA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,4BAA2BC,8BAAgB,CAACC,OAAQ,IAAG,CAAC;AACxF,CAAC;AAACR,OAAA,CAAAI,2BAAA,GAAAA,2BAAA;AAEK,MAAMK,gCAAgC,GAAGA,CAACJ,UAA0B,EAAEK,MAA2B,KAAK;EAC3GL,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,iCAAgCI,MAAO,IAAG,CAAC;AAC3E,CAAC;AAACV,OAAA,CAAAS,gCAAA,GAAAA,gCAAA;AAEK,MAAME,0BAA0B,GAAGA,CAACN,UAA0B,EAAEO,mBAA+C,KAAK;EACzH,IAAIA,mBAAmB,IAAIA,mBAAmB,CAACC,YAAY,CAACC,QAAQ,CAACP,8BAAgB,CAACC,OAAO,CAACO,OAAO,EAAE,CAAC,EAAE;IACxGV,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,gBAAgB,CAAE,yBAAwBU,IAAI,CAACC,SAAS,CAACL,mBAAmB,CAAE,IAAG,CAAC;EAChG;AACF,CAAC;AAACZ,OAAA,CAAAW,0BAAA,GAAAA,0BAAA;AAEK,MAAMO,oBAAoB,GAAIC,gBAAuC,IAAK;EAC/E,OAAOA,gBAAgB,CAACC,IAAI,CAACC,eAAe,CAACP,QAAQ,CAACQ,iCAAa,CAACC,IAAI,CAAC,GAAGD,iCAAa,CAACC,IAAI,GAAGD,iCAAa,CAACE,IAAI;AACrH,CAAC;AAACxB,OAAA,CAAAkB,oBAAA,GAAAA,oBAAA"}
@@ -14,6 +14,7 @@ var _WebComponent = require("../../webComponent/WebComponent");
14
14
  var _UNActivityComponent = require("./UNActivityComponent.utils");
15
15
  var _EventBus = _interopRequireDefault(require("../../helpers/EventBus"));
16
16
  var _onLoadMessage = require("../../messages/webMessages/onLoadMessage");
17
+ var _activityMessage = require("../../messages/webMessages/activityMessage");
17
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
19
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
20
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -24,10 +25,17 @@ const UNActivityComponent = props => {
24
25
  const requestRefresh = data => {
25
26
  (0, _UNActivityComponent.injectRefreshEventIfNeeded)(webRef.current, data);
26
27
  };
28
+ const dispatchActivityFiltersChanged = query => {
29
+ (0, _UNActivityComponent.injectFiltersChanged)(webRef.current, query);
30
+ };
27
31
  (0, _listenerToBus.useListenerToBus)({
28
32
  busEventKey: _unitMessages.UnitMessage.UNIT_REQUEST_REFRESH,
29
33
  action: requestRefresh
30
34
  });
35
+ (0, _listenerToBus.useListenerToBus)({
36
+ busEventKey: _activityMessage.ActivityMessage.UNIT_ACTIVITY_FILTERS_CHANGED,
37
+ action: dispatchActivityFiltersChanged
38
+ });
31
39
  const handleUnitOnLoad = response => {
32
40
  if (!props.onLoad) {
33
41
  return;