@bifold/core 1.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/lib/commonjs/App.js +26 -22
  2. package/lib/commonjs/App.js.map +1 -1
  3. package/lib/commonjs/components/inputs/BiometryControl.js +176 -0
  4. package/lib/commonjs/components/inputs/BiometryControl.js.map +1 -0
  5. package/lib/commonjs/components/misc/ConnectionAlert.js +2 -2
  6. package/lib/commonjs/components/misc/ConnectionAlert.js.map +1 -1
  7. package/lib/commonjs/components/misc/InfoBox.js +3 -2
  8. package/lib/commonjs/components/misc/InfoBox.js.map +1 -1
  9. package/lib/commonjs/components/misc/{PINCreateHeader.js → PINHeader.js} +4 -4
  10. package/lib/commonjs/components/misc/PINHeader.js.map +1 -0
  11. package/lib/commonjs/components/misc/PINValidationHelper.js +50 -0
  12. package/lib/commonjs/components/misc/PINValidationHelper.js.map +1 -0
  13. package/lib/commonjs/components/views/PushNotificationsContent.js +52 -0
  14. package/lib/commonjs/components/views/PushNotificationsContent.js.map +1 -0
  15. package/lib/commonjs/components/views/PushNotificationsDisabledContent.js +47 -0
  16. package/lib/commonjs/components/views/PushNotificationsDisabledContent.js.map +1 -0
  17. package/lib/commonjs/container-api.js +8 -3
  18. package/lib/commonjs/container-api.js.map +1 -1
  19. package/lib/commonjs/container-impl.js +25 -21
  20. package/lib/commonjs/container-impl.js.map +1 -1
  21. package/lib/commonjs/contexts/activity.js +17 -41
  22. package/lib/commonjs/contexts/activity.js.map +1 -1
  23. package/lib/commonjs/contexts/auth.js +16 -6
  24. package/lib/commonjs/contexts/auth.js.map +1 -1
  25. package/lib/commonjs/contexts/navigation.js +24 -0
  26. package/lib/commonjs/contexts/navigation.js.map +1 -0
  27. package/lib/commonjs/contexts/reducers/store.js +14 -0
  28. package/lib/commonjs/contexts/reducers/store.js.map +1 -1
  29. package/lib/commonjs/contexts/theme.js +36 -3
  30. package/lib/commonjs/contexts/theme.js.map +1 -1
  31. package/lib/commonjs/hooks/deep-links.js +2 -4
  32. package/lib/commonjs/hooks/deep-links.js.map +1 -1
  33. package/lib/commonjs/hooks/{initialize-agent.js → useBifoldAgentSetup.js} +24 -44
  34. package/lib/commonjs/hooks/useBifoldAgentSetup.js.map +1 -0
  35. package/lib/commonjs/hooks/useOnboardingState.js +3 -3
  36. package/lib/commonjs/hooks/useOnboardingState.js.map +1 -1
  37. package/lib/commonjs/hooks/usePINValidation.js +82 -0
  38. package/lib/commonjs/hooks/usePINValidation.js.map +1 -0
  39. package/lib/commonjs/index.js +34 -33
  40. package/lib/commonjs/index.js.map +1 -1
  41. package/lib/commonjs/localization/en/index.js +31 -25
  42. package/lib/commonjs/localization/en/index.js.map +1 -1
  43. package/lib/commonjs/localization/fr/index.js +18 -6
  44. package/lib/commonjs/localization/fr/index.js.map +1 -1
  45. package/lib/commonjs/localization/pt-br/index.js +43 -37
  46. package/lib/commonjs/localization/pt-br/index.js.map +1 -1
  47. package/lib/commonjs/navigators/MainStack.js +31 -8
  48. package/lib/commonjs/navigators/MainStack.js.map +1 -1
  49. package/lib/commonjs/navigators/OnboardingScreens.js +8 -8
  50. package/lib/commonjs/navigators/OnboardingScreens.js.map +1 -1
  51. package/lib/commonjs/navigators/OnboardingStack.js +20 -12
  52. package/lib/commonjs/navigators/OnboardingStack.js.map +1 -1
  53. package/lib/commonjs/navigators/RootStack.js +27 -30
  54. package/lib/commonjs/navigators/RootStack.js.map +1 -1
  55. package/lib/commonjs/navigators/SettingStack.js +14 -15
  56. package/lib/commonjs/navigators/SettingStack.js.map +1 -1
  57. package/lib/commonjs/navigators/defaultStackOptions.js +13 -2
  58. package/lib/commonjs/navigators/defaultStackOptions.js.map +1 -1
  59. package/lib/commonjs/onboarding.js +12 -5
  60. package/lib/commonjs/onboarding.js.map +1 -1
  61. package/lib/commonjs/screens/Biometry.js +62 -0
  62. package/lib/commonjs/screens/Biometry.js.map +1 -0
  63. package/lib/commonjs/screens/CredentialOffer.js +2 -2
  64. package/lib/commonjs/screens/CredentialOffer.js.map +1 -1
  65. package/lib/commonjs/screens/Onboarding.js.map +1 -1
  66. package/lib/commonjs/screens/PINChange.js +212 -0
  67. package/lib/commonjs/screens/PINChange.js.map +1 -0
  68. package/lib/commonjs/screens/PINCreate.js +47 -224
  69. package/lib/commonjs/screens/PINCreate.js.map +1 -1
  70. package/lib/commonjs/screens/Preface.js.map +1 -1
  71. package/lib/commonjs/screens/ProofRequest.js +112 -33
  72. package/lib/commonjs/screens/ProofRequest.js.map +1 -1
  73. package/lib/commonjs/screens/PushNotifications.js +71 -0
  74. package/lib/commonjs/screens/PushNotifications.js.map +1 -0
  75. package/lib/commonjs/screens/Settings.js +8 -24
  76. package/lib/commonjs/screens/Settings.js.map +1 -1
  77. package/lib/commonjs/screens/Splash.js +7 -23
  78. package/lib/commonjs/screens/Splash.js.map +1 -1
  79. package/lib/commonjs/screens/Terms.js.map +1 -1
  80. package/lib/commonjs/screens/ToggleBiometry.js +135 -0
  81. package/lib/commonjs/screens/ToggleBiometry.js.map +1 -0
  82. package/lib/commonjs/screens/{PushNotification.js → TogglePushNotifications.js} +41 -99
  83. package/lib/commonjs/screens/TogglePushNotifications.js.map +1 -0
  84. package/lib/commonjs/theme.js +4 -2
  85. package/lib/commonjs/theme.js.map +1 -1
  86. package/lib/commonjs/types/navigators.js +5 -2
  87. package/lib/commonjs/types/navigators.js.map +1 -1
  88. package/lib/commonjs/utils/{PINCreationValidation.js → PINValidation.js} +4 -4
  89. package/lib/commonjs/utils/PINValidation.js.map +1 -0
  90. package/lib/commonjs/utils/agent.js.map +1 -1
  91. package/lib/commonjs/utils/helpers.js +2 -0
  92. package/lib/commonjs/utils/helpers.js.map +1 -1
  93. package/lib/module/App.js +24 -20
  94. package/lib/module/App.js.map +1 -1
  95. package/lib/module/components/inputs/BiometryControl.js +167 -0
  96. package/lib/module/components/inputs/BiometryControl.js.map +1 -0
  97. package/lib/module/components/misc/ConnectionAlert.js +2 -2
  98. package/lib/module/components/misc/ConnectionAlert.js.map +1 -1
  99. package/lib/module/components/misc/InfoBox.js +3 -2
  100. package/lib/module/components/misc/InfoBox.js.map +1 -1
  101. package/lib/module/components/misc/{PINCreateHeader.js → PINHeader.js} +4 -4
  102. package/lib/module/components/misc/PINHeader.js.map +1 -0
  103. package/lib/module/components/misc/PINValidationHelper.js +43 -0
  104. package/lib/module/components/misc/PINValidationHelper.js.map +1 -0
  105. package/lib/module/components/views/PushNotificationsContent.js +45 -0
  106. package/lib/module/components/views/PushNotificationsContent.js.map +1 -0
  107. package/lib/module/components/views/PushNotificationsDisabledContent.js +40 -0
  108. package/lib/module/components/views/PushNotificationsDisabledContent.js.map +1 -0
  109. package/lib/module/container-api.js +7 -2
  110. package/lib/module/container-api.js.map +1 -1
  111. package/lib/module/container-impl.js +25 -21
  112. package/lib/module/container-impl.js.map +1 -1
  113. package/lib/module/contexts/activity.js +17 -41
  114. package/lib/module/contexts/activity.js.map +1 -1
  115. package/lib/module/contexts/auth.js +16 -6
  116. package/lib/module/contexts/auth.js.map +1 -1
  117. package/lib/module/contexts/navigation.js +17 -0
  118. package/lib/module/contexts/navigation.js.map +1 -0
  119. package/lib/module/contexts/reducers/store.js +14 -0
  120. package/lib/module/contexts/reducers/store.js.map +1 -1
  121. package/lib/module/contexts/theme.js +36 -4
  122. package/lib/module/contexts/theme.js.map +1 -1
  123. package/lib/module/hooks/deep-links.js +2 -4
  124. package/lib/module/hooks/deep-links.js.map +1 -1
  125. package/lib/module/hooks/{initialize-agent.js → useBifoldAgentSetup.js} +25 -45
  126. package/lib/module/hooks/useBifoldAgentSetup.js.map +1 -0
  127. package/lib/module/hooks/useOnboardingState.js +3 -3
  128. package/lib/module/hooks/useOnboardingState.js.map +1 -1
  129. package/lib/module/hooks/usePINValidation.js +75 -0
  130. package/lib/module/hooks/usePINValidation.js.map +1 -0
  131. package/lib/module/index.js +6 -6
  132. package/lib/module/index.js.map +1 -1
  133. package/lib/module/localization/en/index.js +31 -25
  134. package/lib/module/localization/en/index.js.map +1 -1
  135. package/lib/module/localization/fr/index.js +18 -6
  136. package/lib/module/localization/fr/index.js.map +1 -1
  137. package/lib/module/localization/pt-br/index.js +43 -37
  138. package/lib/module/localization/pt-br/index.js.map +1 -1
  139. package/lib/module/navigators/MainStack.js +32 -9
  140. package/lib/module/navigators/MainStack.js.map +1 -1
  141. package/lib/module/navigators/OnboardingScreens.js +8 -8
  142. package/lib/module/navigators/OnboardingScreens.js.map +1 -1
  143. package/lib/module/navigators/OnboardingStack.js +21 -12
  144. package/lib/module/navigators/OnboardingStack.js.map +1 -1
  145. package/lib/module/navigators/RootStack.js +26 -29
  146. package/lib/module/navigators/RootStack.js.map +1 -1
  147. package/lib/module/navigators/SettingStack.js +14 -15
  148. package/lib/module/navigators/SettingStack.js.map +1 -1
  149. package/lib/module/navigators/defaultStackOptions.js +13 -2
  150. package/lib/module/navigators/defaultStackOptions.js.map +1 -1
  151. package/lib/module/onboarding.js +10 -4
  152. package/lib/module/onboarding.js.map +1 -1
  153. package/lib/module/screens/Biometry.js +53 -0
  154. package/lib/module/screens/Biometry.js.map +1 -0
  155. package/lib/module/screens/CredentialOffer.js +2 -2
  156. package/lib/module/screens/CredentialOffer.js.map +1 -1
  157. package/lib/module/screens/Onboarding.js.map +1 -1
  158. package/lib/module/screens/PINChange.js +203 -0
  159. package/lib/module/screens/PINChange.js.map +1 -0
  160. package/lib/module/screens/PINCreate.js +49 -226
  161. package/lib/module/screens/PINCreate.js.map +1 -1
  162. package/lib/module/screens/Preface.js.map +1 -1
  163. package/lib/module/screens/ProofRequest.js +113 -34
  164. package/lib/module/screens/ProofRequest.js.map +1 -1
  165. package/lib/module/screens/PushNotifications.js +63 -0
  166. package/lib/module/screens/PushNotifications.js.map +1 -0
  167. package/lib/module/screens/Settings.js +9 -25
  168. package/lib/module/screens/Settings.js.map +1 -1
  169. package/lib/module/screens/Splash.js +7 -23
  170. package/lib/module/screens/Splash.js.map +1 -1
  171. package/lib/module/screens/Terms.js.map +1 -1
  172. package/lib/module/screens/ToggleBiometry.js +126 -0
  173. package/lib/module/screens/ToggleBiometry.js.map +1 -0
  174. package/lib/module/screens/TogglePushNotifications.js +112 -0
  175. package/lib/module/screens/TogglePushNotifications.js.map +1 -0
  176. package/lib/module/theme.js +3 -1
  177. package/lib/module/theme.js.map +1 -1
  178. package/lib/module/types/navigators.js +5 -2
  179. package/lib/module/types/navigators.js.map +1 -1
  180. package/lib/module/utils/{PINCreationValidation.js → PINValidation.js} +2 -2
  181. package/lib/module/utils/PINValidation.js.map +1 -0
  182. package/lib/module/utils/agent.js.map +1 -1
  183. package/lib/module/utils/helpers.js +2 -0
  184. package/lib/module/utils/helpers.js.map +1 -1
  185. package/lib/typescript/src/App.d.ts +3 -3
  186. package/lib/typescript/src/App.d.ts.map +1 -1
  187. package/lib/typescript/src/components/inputs/BiometryControl.d.ts +9 -0
  188. package/lib/typescript/src/components/inputs/BiometryControl.d.ts.map +1 -0
  189. package/lib/typescript/src/components/misc/ConnectionAlert.d.ts +1 -1
  190. package/lib/typescript/src/components/misc/ConnectionAlert.d.ts.map +1 -1
  191. package/lib/typescript/src/components/misc/InfoBox.d.ts +1 -0
  192. package/lib/typescript/src/components/misc/InfoBox.d.ts.map +1 -1
  193. package/lib/typescript/src/components/misc/PINHeader.d.ts +6 -0
  194. package/lib/typescript/src/components/misc/PINHeader.d.ts.map +1 -0
  195. package/lib/typescript/src/components/misc/PINValidationHelper.d.ts +8 -0
  196. package/lib/typescript/src/components/misc/PINValidationHelper.d.ts.map +1 -0
  197. package/lib/typescript/src/components/views/PushNotificationsContent.d.ts +4 -0
  198. package/lib/typescript/src/components/views/PushNotificationsContent.d.ts.map +1 -0
  199. package/lib/typescript/src/components/views/PushNotificationsDisabledContent.d.ts +4 -0
  200. package/lib/typescript/src/components/views/PushNotificationsDisabledContent.d.ts.map +1 -0
  201. package/lib/typescript/src/container-api.d.ts +24 -13
  202. package/lib/typescript/src/container-api.d.ts.map +1 -1
  203. package/lib/typescript/src/container-impl.d.ts +4 -2
  204. package/lib/typescript/src/container-impl.d.ts.map +1 -1
  205. package/lib/typescript/src/contexts/activity.d.ts.map +1 -1
  206. package/lib/typescript/src/contexts/auth.d.ts +3 -1
  207. package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
  208. package/lib/typescript/src/contexts/navigation.d.ts +8 -0
  209. package/lib/typescript/src/contexts/navigation.d.ts.map +1 -0
  210. package/lib/typescript/src/contexts/reducers/store.d.ts +3 -1
  211. package/lib/typescript/src/contexts/reducers/store.d.ts.map +1 -1
  212. package/lib/typescript/src/contexts/theme.d.ts +9 -3
  213. package/lib/typescript/src/contexts/theme.d.ts.map +1 -1
  214. package/lib/typescript/src/hooks/deep-links.d.ts.map +1 -1
  215. package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts +10 -0
  216. package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts.map +1 -0
  217. package/lib/typescript/src/hooks/useOnboardingState.d.ts +2 -1
  218. package/lib/typescript/src/hooks/useOnboardingState.d.ts.map +1 -1
  219. package/lib/typescript/src/hooks/usePINValidation.d.ts +20 -0
  220. package/lib/typescript/src/hooks/usePINValidation.d.ts.map +1 -0
  221. package/lib/typescript/src/index.d.ts +9 -7
  222. package/lib/typescript/src/index.d.ts.map +1 -1
  223. package/lib/typescript/src/localization/en/index.d.ts +23 -17
  224. package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
  225. package/lib/typescript/src/localization/fr/index.d.ts +14 -2
  226. package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
  227. package/lib/typescript/src/localization/pt-br/index.d.ts +23 -17
  228. package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
  229. package/lib/typescript/src/navigators/MainStack.d.ts.map +1 -1
  230. package/lib/typescript/src/navigators/OnboardingScreens.d.ts +3 -3
  231. package/lib/typescript/src/navigators/OnboardingScreens.d.ts.map +1 -1
  232. package/lib/typescript/src/navigators/OnboardingStack.d.ts +7 -1
  233. package/lib/typescript/src/navigators/OnboardingStack.d.ts.map +1 -1
  234. package/lib/typescript/src/navigators/RootStack.d.ts.map +1 -1
  235. package/lib/typescript/src/navigators/SettingStack.d.ts.map +1 -1
  236. package/lib/typescript/src/navigators/defaultStackOptions.d.ts.map +1 -1
  237. package/lib/typescript/src/onboarding.d.ts +4 -2
  238. package/lib/typescript/src/onboarding.d.ts.map +1 -1
  239. package/lib/typescript/src/screens/Biometry.d.ts +4 -0
  240. package/lib/typescript/src/screens/Biometry.d.ts.map +1 -0
  241. package/lib/typescript/src/screens/{PushNotification.d.ts → PINChange.d.ts} +3 -3
  242. package/lib/typescript/src/screens/PINChange.d.ts.map +1 -0
  243. package/lib/typescript/src/screens/PINCreate.d.ts.map +1 -1
  244. package/lib/typescript/src/screens/ProofRequest.d.ts.map +1 -1
  245. package/lib/typescript/src/screens/PushNotifications.d.ts +4 -0
  246. package/lib/typescript/src/screens/PushNotifications.d.ts.map +1 -0
  247. package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
  248. package/lib/typescript/src/screens/Splash.d.ts +7 -4
  249. package/lib/typescript/src/screens/Splash.d.ts.map +1 -1
  250. package/lib/typescript/src/screens/ToggleBiometry.d.ts +4 -0
  251. package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -0
  252. package/lib/typescript/src/screens/TogglePushNotifications.d.ts +4 -0
  253. package/lib/typescript/src/screens/TogglePushNotifications.d.ts.map +1 -0
  254. package/lib/typescript/src/theme.d.ts +3 -1
  255. package/lib/typescript/src/theme.d.ts.map +1 -1
  256. package/lib/typescript/src/types/navigators.d.ts +11 -13
  257. package/lib/typescript/src/types/navigators.d.ts.map +1 -1
  258. package/lib/typescript/src/types/state.d.ts +1 -0
  259. package/lib/typescript/src/types/state.d.ts.map +1 -1
  260. package/lib/typescript/src/utils/{PINCreationValidation.d.ts → PINValidation.d.ts} +2 -2
  261. package/lib/typescript/src/utils/PINValidation.d.ts.map +1 -0
  262. package/lib/typescript/src/utils/agent.d.ts +1 -2
  263. package/lib/typescript/src/utils/agent.d.ts.map +1 -1
  264. package/lib/typescript/src/utils/helpers.d.ts.map +1 -1
  265. package/package.json +5 -5
  266. package/src/App.tsx +41 -40
  267. package/src/components/inputs/BiometryControl.tsx +176 -0
  268. package/src/components/misc/ConnectionAlert.tsx +3 -3
  269. package/src/components/misc/InfoBox.tsx +3 -1
  270. package/src/components/misc/{PINCreateHeader.tsx → PINHeader.tsx} +4 -4
  271. package/src/components/misc/PINValidationHelper.tsx +48 -0
  272. package/src/components/views/PushNotificationsContent.tsx +51 -0
  273. package/src/components/views/PushNotificationsDisabledContent.tsx +47 -0
  274. package/src/container-api.ts +27 -11
  275. package/src/container-impl.ts +31 -27
  276. package/src/contexts/activity.tsx +17 -42
  277. package/src/contexts/auth.tsx +18 -6
  278. package/src/contexts/navigation.tsx +19 -0
  279. package/src/contexts/reducers/store.ts +12 -0
  280. package/src/contexts/theme.tsx +51 -0
  281. package/src/hooks/deep-links.ts +2 -4
  282. package/src/hooks/{initialize-agent.ts → useBifoldAgentSetup.ts} +32 -54
  283. package/src/hooks/useOnboardingState.ts +10 -3
  284. package/src/hooks/usePINValidation.ts +98 -0
  285. package/src/index.ts +12 -14
  286. package/src/localization/en/index.ts +26 -20
  287. package/src/localization/fr/index.ts +32 -20
  288. package/src/localization/pt-br/index.ts +39 -33
  289. package/src/navigators/MainStack.tsx +29 -8
  290. package/src/navigators/OnboardingScreens.ts +11 -11
  291. package/src/navigators/OnboardingStack.tsx +26 -14
  292. package/src/navigators/RootStack.tsx +31 -25
  293. package/src/navigators/SettingStack.tsx +15 -16
  294. package/src/navigators/defaultStackOptions.tsx +13 -2
  295. package/src/onboarding.ts +12 -5
  296. package/src/screens/Biometry.tsx +57 -0
  297. package/src/screens/CredentialOffer.tsx +2 -2
  298. package/src/screens/Onboarding.tsx +2 -2
  299. package/src/screens/PINChange.tsx +250 -0
  300. package/src/screens/PINCreate.tsx +51 -267
  301. package/src/screens/Preface.tsx +2 -2
  302. package/src/screens/ProofRequest.tsx +140 -48
  303. package/src/screens/PushNotifications.tsx +59 -0
  304. package/src/screens/Settings.tsx +5 -10
  305. package/src/screens/Splash.tsx +10 -22
  306. package/src/screens/Terms.tsx +2 -2
  307. package/src/screens/ToggleBiometry.tsx +167 -0
  308. package/src/screens/TogglePushNotifications.tsx +118 -0
  309. package/src/theme.ts +5 -1
  310. package/src/types/navigators.ts +11 -12
  311. package/src/types/state.ts +1 -0
  312. package/src/utils/{PINCreationValidation.ts → PINValidation.ts} +1 -1
  313. package/src/utils/agent.ts +1 -2
  314. package/src/utils/helpers.ts +2 -0
  315. package/lib/commonjs/components/misc/ActivityLogLink.js +0 -44
  316. package/lib/commonjs/components/misc/ActivityLogLink.js.map +0 -1
  317. package/lib/commonjs/components/misc/PINCreateHeader.js.map +0 -1
  318. package/lib/commonjs/components/modals/NotificationModal.js +0 -121
  319. package/lib/commonjs/components/modals/NotificationModal.js.map +0 -1
  320. package/lib/commonjs/components/texts/Label.js +0 -57
  321. package/lib/commonjs/components/texts/Label.js.map +0 -1
  322. package/lib/commonjs/components/texts/Title.js +0 -29
  323. package/lib/commonjs/components/texts/Title.js.map +0 -1
  324. package/lib/commonjs/components/views/ModularView.js +0 -41
  325. package/lib/commonjs/components/views/ModularView.js.map +0 -1
  326. package/lib/commonjs/hooks/initialize-agent.js.map +0 -1
  327. package/lib/commonjs/screens/PushNotification.js.map +0 -1
  328. package/lib/commonjs/screens/UseBiometry.js +0 -315
  329. package/lib/commonjs/screens/UseBiometry.js.map +0 -1
  330. package/lib/commonjs/utils/PINCreationValidation.js.map +0 -1
  331. package/lib/module/components/misc/ActivityLogLink.js +0 -37
  332. package/lib/module/components/misc/ActivityLogLink.js.map +0 -1
  333. package/lib/module/components/misc/PINCreateHeader.js.map +0 -1
  334. package/lib/module/components/modals/NotificationModal.js +0 -112
  335. package/lib/module/components/modals/NotificationModal.js.map +0 -1
  336. package/lib/module/components/texts/Label.js +0 -50
  337. package/lib/module/components/texts/Label.js.map +0 -1
  338. package/lib/module/components/texts/Title.js +0 -22
  339. package/lib/module/components/texts/Title.js.map +0 -1
  340. package/lib/module/components/views/ModularView.js +0 -34
  341. package/lib/module/components/views/ModularView.js.map +0 -1
  342. package/lib/module/hooks/initialize-agent.js.map +0 -1
  343. package/lib/module/screens/PushNotification.js +0 -170
  344. package/lib/module/screens/PushNotification.js.map +0 -1
  345. package/lib/module/screens/UseBiometry.js +0 -306
  346. package/lib/module/screens/UseBiometry.js.map +0 -1
  347. package/lib/module/utils/PINCreationValidation.js.map +0 -1
  348. package/lib/typescript/src/components/misc/ActivityLogLink.d.ts +0 -4
  349. package/lib/typescript/src/components/misc/ActivityLogLink.d.ts.map +0 -1
  350. package/lib/typescript/src/components/misc/PINCreateHeader.d.ts +0 -6
  351. package/lib/typescript/src/components/misc/PINCreateHeader.d.ts.map +0 -1
  352. package/lib/typescript/src/components/modals/NotificationModal.d.ts +0 -17
  353. package/lib/typescript/src/components/modals/NotificationModal.d.ts.map +0 -1
  354. package/lib/typescript/src/components/texts/Label.d.ts +0 -9
  355. package/lib/typescript/src/components/texts/Label.d.ts.map +0 -1
  356. package/lib/typescript/src/components/texts/Title.d.ts +0 -8
  357. package/lib/typescript/src/components/texts/Title.d.ts.map +0 -1
  358. package/lib/typescript/src/components/views/ModularView.d.ts +0 -9
  359. package/lib/typescript/src/components/views/ModularView.d.ts.map +0 -1
  360. package/lib/typescript/src/hooks/initialize-agent.d.ts +0 -7
  361. package/lib/typescript/src/hooks/initialize-agent.d.ts.map +0 -1
  362. package/lib/typescript/src/screens/PushNotification.d.ts.map +0 -1
  363. package/lib/typescript/src/screens/UseBiometry.d.ts +0 -4
  364. package/lib/typescript/src/screens/UseBiometry.d.ts.map +0 -1
  365. package/lib/typescript/src/utils/PINCreationValidation.d.ts.map +0 -1
  366. package/src/components/misc/ActivityLogLink.tsx +0 -34
  367. package/src/components/modals/NotificationModal.tsx +0 -127
  368. package/src/components/texts/Label.tsx +0 -51
  369. package/src/components/texts/Title.tsx +0 -25
  370. package/src/components/views/ModularView.tsx +0 -35
  371. package/src/contexts/theme.ts +0 -9
  372. package/src/screens/PushNotification.tsx +0 -186
  373. package/src/screens/UseBiometry.tsx +0 -357
@@ -1 +0,0 @@
1
- {"version":3,"names":["useNavigation","React","useEffect","useState","useTranslation","StyleSheet","TouchableOpacity","View","SafeAreaView","Icon","hitSlop","useTheme","Screens","testIdWithKey","Button","ButtonType","ThemedText","SafeAreaModal","NotificationModal","title","doneTitle","doneType","Primary","doneAccessibilityLabel","onDone","onHome","doneVisible","homeVisible","testID","visible","children","t","navigation","modalVisible","setModalVisible","ColorPallet","TextTheme","styles","create","container","flex","backgroundColor","brand","primaryBackground","childContainer","flexGrow","justifyContent","alignItems","padding","buttonContainer","marginBottom","marginHorizontal","iconContainer","width","flexDirection","iconButton","paddingVertical","undefined","close","closeHome","navigate","Home","createElement","transparent","style","accessible","accessibilityLabel","accessibilityRole","onPress","name","size","color","notification","infoText","variant","fontWeight","normal","textAlign","buttonType"],"sourceRoot":"../../../../src","sources":["components/modals/NotificationModal.tsx"],"mappings":"AAAA,SAASA,aAAa,QAAQ,0BAA0B;AAExD,OAAOC,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACjE,SAASC,YAAY,QAAQ,gCAAgC;AAC7D,OAAOC,IAAI,MAAM,yCAAyC;AAE1D,SAASC,OAAO,QAAQ,iBAAiB;AACzC,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAA0BC,OAAO,QAAQ,wBAAwB;AACjE,SAASC,aAAa,QAAQ,sBAAsB;AACpD,OAAOC,MAAM,IAAIC,UAAU,QAAQ,mBAAmB;AACtD,SAASC,UAAU,QAAQ,qBAAqB;AAChD,OAAOC,aAAa,MAAM,iBAAiB;AAe3C,MAAMC,iBAAmD,GAAGA,CAAC;EAC3DC,KAAK;EACLC,SAAS;E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AAA,CAACvD,IAAI;IAACyD,KAAK,EAAE3B,MAAM,CAACY;EAAgB,gBAClChD,KAAA,CAAA6D,aAAA,CAAChD,MAAM;IACLK,KAAK,EAAEC,SAAS,IAAIW,CAAC,CAAC,aAAa,CAAE;IACrCmC,kBAAkB,EAAE3C,sBAAsB,IAAIQ,CAAC,CAAC,aAAa,CAAE;IAC/DH,MAAM,EAAEf,aAAa,CAAC,MAAM,CAAE;IAC9BiE,UAAU,EAAEzD,QAAS;IACrB+C,OAAO,EAAE5C,MAAM,IAAIkC;EAAM,CAClB,CACL,CAAC,GACL,IACQ,CACD,CAAC;AAEpB,CAAC;AAED,eAAexC,iBAAiB","ignoreList":[]}
@@ -1,50 +0,0 @@
1
- import React from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
- import { useTheme } from '../../contexts/theme';
4
- import Text from './Text';
5
- const Label = ({
6
- title,
7
- subtitle,
8
- label
9
- }) => {
10
- const {
11
- TextTheme
12
- } = useTheme();
13
- const styles = StyleSheet.create({
14
- container: {
15
- flexDirection: 'row',
16
- justifyContent: 'space-between',
17
- alignItems: 'center',
18
- width: '90%',
19
- marginTop: 10
20
- },
21
- titleContainer: {
22
- flexDirection: 'row',
23
- alignItems: 'center'
24
- },
25
- title: {
26
- ...TextTheme.labelTitle,
27
- marginRight: 7
28
- },
29
- subtitle: {
30
- ...TextTheme.labelSubtitle
31
- },
32
- label: {
33
- marginLeft: 10,
34
- ...TextTheme.labelText
35
- }
36
- });
37
- return /*#__PURE__*/React.createElement(View, {
38
- style: styles.container
39
- }, /*#__PURE__*/React.createElement(View, {
40
- style: styles.titleContainer
41
- }, /*#__PURE__*/React.createElement(Text, {
42
- style: styles.title
43
- }, title, ":"), /*#__PURE__*/React.createElement(Text, {
44
- style: styles.subtitle
45
- }, subtitle)), /*#__PURE__*/React.createElement(Text, {
46
- style: styles.label
47
- }, label));
48
- };
49
- export default Label;
50
- //# sourceMappingURL=Label.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","View","StyleSheet","useTheme","Text","Label","title","subtitle","label","TextTheme","styles","create","container","flexDirection","justifyContent","alignItems","width","marginTop","titleContainer","labelTitle","marginRight","labelSubtitle","marginLeft","labelText","createElement","style"],"sourceRoot":"../../../../src","sources":["components/texts/Label.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAE/C,SAASC,QAAQ,QAAQ,sBAAsB;AAE/C,OAAOC,IAAI,MAAM,QAAQ;AAQzB,MAAMC,KAAsB,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EAC7D,MAAM;IAAEC;EAAU,CAAC,GAAGN,QAAQ,CAAC,CAAC;EAChC,MAAMO,MAAM,GAAGR,UAAU,CAACS,MAAM,CAAC;IAC/BC,SAAS,EAAE;MACTC,aAAa,EAAE,KAAK;MACpBC,cAAc,EAAE,eAAe;MAC/BC,UAAU,EAAE,QAAQ;MACpBC,KAAK,EAAE,KAAK;MACZC,SAAS,EAAE;IACb,CAAC;IACDC,cAAc,EAAE;MACdL,aAAa,EAAE,KAAK;MACpBE,UAAU,EAAE;IACd,CAAC;IACDT,KAAK,EAAE;MACL,GAAGG,SAAS,CAACU,UAAU;MACvBC,WAAW,EAAE;IACf,CAAC;IACDb,QAAQ,EAAE;MACR,GAAGE,SAAS,CAACY;IACf,CAAC;IACDb,KAAK,EAAE;MACLc,UAAU,EAAE,EAAE;MACd,GAAGb,SAAS,CAACc;IACf;EACF,CAAC,CAAC;EACF,oBACEvB,KAAA,CAAAwB,aAAA,CAACvB,IAAI;IAACwB,KAAK,EAAEf,MAAM,CAACE;EAAU,gBAC5BZ,KAAA,CAAAwB,aAAA,CAACvB,IAAI;IAACwB,KAAK,EAAEf,MAAM,CAACQ;EAAe,gBACjClB,KAAA,CAAAwB,aAAA,CAACpB,IAAI;IAACqB,KAAK,EAAEf,MAAM,CAACJ;EAAM,GAAEA,KAAK,EAAC,GAAO,CAAC,eAC1CN,KAAA,CAAAwB,aAAA,CAACpB,IAAI;IAACqB,KAAK,EAAEf,MAAM,CAACH;EAAS,GAAEA,QAAe,CAC1C,CAAC,eACPP,KAAA,CAAAwB,aAAA,CAACpB,IAAI;IAACqB,KAAK,EAAEf,MAAM,CAACF;EAAM,GAAEA,KAAY,CACpC,CAAC;AAEX,CAAC;AAED,eAAeH,KAAK","ignoreList":[]}
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import { Text, StyleSheet } from 'react-native';
3
- import { useTheme } from '../../contexts/theme';
4
- const Title = ({
5
- children,
6
- style
7
- }) => {
8
- const {
9
- TextTheme
10
- } = useTheme();
11
- const styles = StyleSheet.create({
12
- title: {
13
- ...TextTheme.title
14
- }
15
- });
16
- return /*#__PURE__*/React.createElement(Text, {
17
- adjustsFontSizeToFit: true,
18
- style: [styles.title, style]
19
- }, children);
20
- };
21
- export default Title;
22
- //# sourceMappingURL=Title.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Text","StyleSheet","useTheme","Title","children","style","TextTheme","styles","create","title","createElement","adjustsFontSizeToFit"],"sourceRoot":"../../../../src","sources":["components/texts/Title.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAE/C,SAASC,QAAQ,QAAQ,sBAAsB;AAO/C,MAAMC,KAAsB,GAAGA,CAAC;EAAEC,QAAQ;EAAEC;AAAM,CAAC,KAAK;EACtD,MAAM;IAAEC;EAAU,CAAC,GAAGJ,QAAQ,CAAC,CAAC;EAChC,MAAMK,MAAM,GAAGN,UAAU,CAACO,MAAM,CAAC;IAC/BC,KAAK,EAAE;MACL,GAAGH,SAAS,CAACG;IACf;EACF,CAAC,CAAC;EACF,oBACEV,KAAA,CAAAW,aAAA,CAACV,IAAI;IAACW,oBAAoB;IAACN,KAAK,EAAE,CAACE,MAAM,CAACE,KAAK,EAAEJ,KAAK;EAAE,GACrDD,QACG,CAAC;AAEX,CAAC;AAED,eAAeD,KAAK","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- import React from 'react';
2
- import { View, StyleSheet } from 'react-native';
3
- import { useTheme } from '../../contexts/theme';
4
- import { ThemedText } from '../texts/ThemedText';
5
- const ModularView = ({
6
- title,
7
- subtitle,
8
- content
9
- }) => {
10
- const {
11
- borderRadius,
12
- ColorPallet
13
- } = useTheme();
14
- const styles = StyleSheet.create({
15
- container: {
16
- borderRadius,
17
- backgroundColor: ColorPallet.notification.info,
18
- margin: 20,
19
- padding: 20
20
- },
21
- content: {
22
- marginTop: 10
23
- }
24
- });
25
- return /*#__PURE__*/React.createElement(View, {
26
- style: styles.container
27
- }, /*#__PURE__*/React.createElement(ThemedText, {
28
- variant: "headingFour"
29
- }, title), /*#__PURE__*/React.createElement(ThemedText, null, subtitle), typeof content === 'string' ? /*#__PURE__*/React.createElement(ThemedText, {
30
- style: styles.content
31
- }, content) : content);
32
- };
33
- export default ModularView;
34
- //# sourceMappingURL=ModularView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","View","StyleSheet","useTheme","ThemedText","ModularView","title","subtitle","content","borderRadius","ColorPallet","styles","create","container","backgroundColor","notification","info","margin","padding","marginTop","createElement","style","variant"],"sourceRoot":"../../../../src","sources":["components/views/ModularView.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAE/C,SAASC,QAAQ,QAAQ,sBAAsB;AAC/C,SAASC,UAAU,QAAQ,qBAAqB;AAQhD,MAAMC,WAA4B,GAAGA,CAAC;EAAEC,KAAK;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,KAAK;EACrE,MAAM;IAAEC,YAAY;IAAEC;EAAY,CAAC,GAAGP,QAAQ,CAAC,CAAC;EAChD,MAAMQ,MAAM,GAAGT,UAAU,CAACU,MAAM,CAAC;IAC/BC,SAAS,EAAE;MACTJ,YAAY;MACZK,eAAe,EAAEJ,WAAW,CAACK,YAAY,CAACC,IAAI;MAC9CC,MAAM,EAAE,EAAE;MACVC,OAAO,EAAE;IACX,CAAC;IACDV,OAAO,EAAE;MACPW,SAAS,EAAE;IACb;EACF,CAAC,CAAC;EACF,oBACEnB,KAAA,CAAAoB,aAAA,CAACnB,IAAI;IAACoB,KAAK,EAAEV,MAAM,CAACE;EAAU,gBAC5Bb,KAAA,CAAAoB,aAAA,CAAChB,UAAU;IAACkB,OAAO,EAAC;EAAa,GAAEhB,KAAkB,CAAC,eACtDN,KAAA,CAAAoB,aAAA,CAAChB,UAAU,QAAEG,QAAqB,CAAC,EAClC,OAAOC,OAAO,KAAK,QAAQ,gBAAGR,KAAA,CAAAoB,aAAA,CAAChB,UAAU;IAACiB,KAAK,EAAEV,MAAM,CAACH;EAAQ,GAAEA,OAAoB,CAAC,GAAGA,OACvF,CAAC;AAEX,CAAC;AAED,eAAeH,WAAW","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["Agent","HttpOutboundTransport","WsOutboundTransport","IndyVdrPoolService","useAgent","agentDependencies","GetCredentialDefinitionRequest","GetSchemaRequest","useCallback","Config","CachesDirectoryPath","TOKENS","useServices","DispatchAction","useStore","getAgentModules","createLinkSecretIfRequired","migrateToAskar","useInitializeAgent","agent","setAgent","store","dispatch","cacheSchemas","cacheCredDefs","logger","indyLedgers","CACHE_SCHEMAS","CACHE_CRED_DEFS","UTIL_LOGGER","UTIL_LEDGERS","restartExistingAgent","walletSecret","isInitialized","info","wallet","open","id","key","initialize","warn","createNewAgent","newAgent","config","label","preferences","walletName","walletConfig","autoUpdateStorageOnStartup","dependencies","modules","indyNetworks","mediatorInvitationUrl","MEDIATOR_URL","txnCache","capacity","expiryOffsetMs","path","wsTransport","httpTransport","registerOutboundTransport","migrateIfRequired","migration","didMigrateToAskar","debug","type","DID_MIGRATE_TO_ASKAR","warmUpCache","poolService","dependencyManager","resolve","forEach","did","pool","getPoolForDid","context","credDefRequest","credentialDefinitionId","submitRequest","schemaRequest","schemaId","initializeAgent","existingAgent","error"],"sourceRoot":"../../../src","sources":["hooks/initialize-agent.ts"],"mappings":"AAAA,SAASA,KAAK,EAAEC,qBAAqB,EAAEC,mBAAmB,QAAQ,gBAAgB;AAClF,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,iBAAiB,QAAQ,wBAAwB;AAC1D,SAASC,8BAA8B,EAAEC,gBAAgB,QAAQ,8BAA8B;AAC/F,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,mBAAmB,QAAQ,iBAAiB;AAErD,SAASC,MAAM,EAAEC,WAAW,QAAQ,kBAAkB;AACtD,SAASC,cAAc,QAAQ,4BAA4B;AAC3D,SAASC,QAAQ,QAAQ,mBAAmB;AAC5C,SAASC,eAAe,EAAEC,0BAA0B,QAAQ,gBAAgB;AAC5E,SAASC,cAAc,QAAQ,oBAAoB;AAGnD,MAAMC,kBAAkB,GAAGA,CAAA,KAAM;EAC/B,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAC,GAAGhB,QAAQ,CAAC,CAAC;EACtC,MAAM,CAACiB,KAAK,EAAEC,QAAQ,CAAC,GAAGR,QAAQ,CAAC,CAAC;EACpC,MAAM,CAACS,YAAY,EAAEC,aAAa,EAAEC,MAAM,EAAEC,WAAW,CAAC,GAAGd,WAAW,CAAC,CACrED,MAAM,CAACgB,aAAa,EACpBhB,MAAM,CAACiB,eAAe,EACtBjB,MAAM,CAACkB,WAAW,EAClBlB,MAAM,CAACmB,YAAY,CACpB,CAAC;EAEF,MAAMC,oBAAoB,GAAGvB,WAAW,CACtC,MAAOwB,YAA0B,IAAK;IACpC;IACA,IAAI,CAACb,KAAK,IAAIA,KAAK,CAACc,aAAa,EAAE;MACjC;IACF;IAEAR,MAAM,CAACS,IAAI,CAAC,sCAAsC,CAAC;IACnD,IAAI;MACF,MAAMf,KAAK,CAAC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 @@
1
- import { useAgent } from '@credo-ts/react-hooks';
2
- import React, { useEffect, useState } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import { AppState, Linking, ScrollView, StyleSheet, Switch, View } from 'react-native';
5
- import { SafeAreaView } from 'react-native-safe-area-context';
6
- import Button, { ButtonType } from '../components/buttons/Button';
7
- import { DispatchAction } from '../contexts/reducers/store';
8
- import { useStore } from '../contexts/store';
9
- import { useTheme } from '../contexts/theme';
10
- import { testIdWithKey } from '../utils/testable';
11
- import { TOKENS, useServices } from '../container-api';
12
- import { ThemedText } from '../components/texts/ThemedText';
13
- const PushNotification = ({
14
- route
15
- }) => {
16
- var _route$params;
17
- const {
18
- t
19
- } = useTranslation();
20
- const [store, dispatch] = useStore();
21
- const {
22
- agent
23
- } = useAgent();
24
- const {
25
- TextTheme,
26
- ColorPallet,
27
- Assets
28
- } = useTheme();
29
- const [{
30
- enablePushNotifications
31
- }] = useServices([TOKENS.CONFIG]);
32
- const [notificationState, setNotificationState] = useState(store.preferences.usePushNotifications);
33
- const [notificationStatus, setNotificationStatus] = useState('unknown');
34
- const isMenu = (_route$params = route.params) === null || _route$params === void 0 ? void 0 : _route$params.isMenu;
35
- if (!enablePushNotifications) {
36
- throw new Error('Push notification configuration not found');
37
- }
38
- const style = StyleSheet.create({
39
- screenContainer: {
40
- flex: 1,
41
- padding: 30
42
- },
43
- image: {
44
- height: 200,
45
- marginBottom: 20
46
- },
47
- heading: {
48
- marginBottom: 20
49
- },
50
- listItem: {
51
- ...TextTheme.normal,
52
- flex: 1,
53
- paddingLeft: 5
54
- }
55
- });
56
- const list = [t('PushNotifications.BulletOne'), t('PushNotifications.BulletTwo'), t('PushNotifications.BulletThree'), t('PushNotifications.BulletFour')];
57
- const settingsInstructions = [t('PushNotifications.InstructionsOne'), t('PushNotifications.InstructionsTwo'), t('PushNotifications.InstructionsThree')];
58
- useEffect(() => {
59
- const updateNotificationState = async () => {
60
- const status = await enablePushNotifications.status();
61
- setNotificationStatus(status);
62
- };
63
- updateNotificationState();
64
- const subscription = AppState.addEventListener('change', updateNotificationState);
65
- return () => subscription.remove();
66
- }, [enablePushNotifications]);
67
- const hasNotificationsDisabled = notificationStatus === 'denied' && store.onboarding.didConsiderPushNotifications;
68
- const activatePushNotifications = async () => {
69
- const state = await enablePushNotifications.setup();
70
- dispatch({
71
- type: DispatchAction.USE_PUSH_NOTIFICATIONS,
72
- payload: [state === 'granted']
73
- });
74
- };
75
- const toggleSwitch = async () => {
76
- if (agent) {
77
- if (!notificationState) {
78
- const res = await enablePushNotifications.setup();
79
- if (res === 'denied') {
80
- return;
81
- }
82
- }
83
- dispatch({
84
- type: DispatchAction.USE_PUSH_NOTIFICATIONS,
85
- payload: [!notificationState]
86
- });
87
- enablePushNotifications.toggle(!notificationState, agent);
88
- setNotificationState(!notificationState);
89
- }
90
- };
91
- return /*#__PURE__*/React.createElement(SafeAreaView, {
92
- style: {
93
- flex: 1
94
- },
95
- edges: ['left', 'right', 'bottom']
96
- }, /*#__PURE__*/React.createElement(ScrollView, {
97
- contentContainerStyle: {
98
- flexGrow: 1
99
- }
100
- }, /*#__PURE__*/React.createElement(View, {
101
- style: style.screenContainer
102
- }, !hasNotificationsDisabled && /*#__PURE__*/React.createElement(View, {
103
- style: style.image
104
- }, /*#__PURE__*/React.createElement(Assets.svg.pushNotificationImg, null)), /*#__PURE__*/React.createElement(ThemedText, {
105
- variant: "headingThree",
106
- style: style.heading
107
- }, t('PushNotifications.EnableNotifiactions')), hasNotificationsDisabled ? /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(ThemedText, null, t('PushNotifications.NotificationsOffMessage'))) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ThemedText, null, t('PushNotifications.BeNotified')), list.map((item, index) => /*#__PURE__*/React.createElement(View, {
108
- style: {
109
- flexDirection: 'row',
110
- marginTop: 20
111
- },
112
- key: index
113
- }, /*#__PURE__*/React.createElement(ThemedText, null, '\u2022'), /*#__PURE__*/React.createElement(ThemedText, {
114
- style: style.listItem
115
- }, item)))), isMenu ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
116
- style: {
117
- marginTop: 25
118
- }
119
- }, hasNotificationsDisabled ? /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(ThemedText, {
120
- variant: "bold"
121
- }, t('PushNotifications.NotificationsOffTitle')), /*#__PURE__*/React.createElement(ThemedText, null, t('PushNotifications.NotificationsInstructionTitle')), settingsInstructions.map((item, index) => /*#__PURE__*/React.createElement(View, {
122
- style: {
123
- flexDirection: 'row',
124
- marginTop: 20
125
- },
126
- key: index
127
- }, /*#__PURE__*/React.createElement(ThemedText, null, `${index + 1}. `), /*#__PURE__*/React.createElement(ThemedText, {
128
- style: style.listItem
129
- }, item)))) : /*#__PURE__*/React.createElement(View, {
130
- style: {
131
- display: 'flex',
132
- flexDirection: 'row',
133
- justifyContent: 'space-between'
134
- }
135
- }, /*#__PURE__*/React.createElement(ThemedText, null, t('PushNotifications.ReceiveNotifications')), /*#__PURE__*/React.createElement(Switch, {
136
- trackColor: {
137
- false: ColorPallet.grayscale.lightGrey,
138
- true: ColorPallet.brand.primaryDisabled
139
- },
140
- thumbColor: notificationState ? ColorPallet.brand.primary : ColorPallet.grayscale.mediumGrey,
141
- ios_backgroundColor: ColorPallet.grayscale.lightGrey,
142
- onValueChange: toggleSwitch,
143
- accessibilityLabel: t('PushNotifications.ReceiveNotifications'),
144
- accessibilityRole: "switch",
145
- testID: testIdWithKey('PushNotificationSwitch'),
146
- value: notificationState
147
- }))), hasNotificationsDisabled && /*#__PURE__*/React.createElement(View, {
148
- style: {
149
- marginTop: 'auto'
150
- }
151
- }, /*#__PURE__*/React.createElement(Button, {
152
- buttonType: ButtonType.Primary,
153
- title: t('PushNotifications.OpenSettings'),
154
- accessibilityLabel: t('PushNotifications.OpenSettings'),
155
- testID: testIdWithKey('PushNotificationSettings'),
156
- onPress: () => Linking.openSettings()
157
- }))) : /*#__PURE__*/React.createElement(View, {
158
- style: {
159
- marginTop: 'auto'
160
- }
161
- }, /*#__PURE__*/React.createElement(Button, {
162
- buttonType: ButtonType.Primary,
163
- title: t('Global.Continue'),
164
- accessibilityLabel: t('Global.Continue'),
165
- testID: testIdWithKey('PushNotificationContinue'),
166
- onPress: activatePushNotifications
167
- })))));
168
- };
169
- export default PushNotification;
170
- //# sourceMappingURL=PushNotification.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["useAgent","React","useEffect","useState","useTranslation","AppState","Linking","ScrollView","StyleSheet","Switch","View","SafeAreaView","Button","ButtonType","DispatchAction","useStore","useTheme","testIdWithKey","TOKENS","useServices","ThemedText","PushNotification","route","_route$params","t","store","dispatch","agent","TextTheme","ColorPallet","Assets","enablePushNotifications","CONFIG","notificationState","setNotificationState","preferences","usePushNotifications","notificationStatus","setNotificationStatus","isMenu","params","Error","style","create","screenContainer","flex","padding","image","height","marginBottom","heading","listItem","normal","paddingLeft","list","settingsInstructions","updateNotificationState","status","subscription","addEventListener","remove","hasNotificationsDisabled","onboarding","didConsiderPushNotifications","activatePushNotifications","state","setup","type","USE_PUSH_NOTIFICATIONS","payload","toggleSwitch","res","toggle","createElement","edges","contentContainerStyle","flexGrow","svg","pushNotificationImg","variant","Fragment","map","item","index","flexDirection","marginTop","key","display","justifyContent","trackColor","false","grayscale","lightGrey","true","brand","primaryDisabled","thumbColor","primary","mediumGrey","ios_backgroundColor","onValueChange","accessibilityLabel","accessibilityRole","testID","value","buttonType","Primary","title","onPress","openSettings"],"sourceRoot":"../../../src","sources":["screens/PushNotification.tsx"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,uBAAuB;AAGhD,OAAOC,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,UAAU,EAAEC,UAAU,EAAEC,MAAM,EAAEC,IAAI,QAAQ,cAAc;AACtF,SAASC,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KAAA,CAAAwE,aAAA,CAAC7D,MAAM;IACL6F,UAAU,EAAE5F,UAAU,CAAC6F,OAAQ;IAC/BC,KAAK,EAAEnF,CAAC,CAAC,gCAAgC,CAAE;IAC3C6E,kBAAkB,EAAE7E,CAAC,CAAC,gCAAgC,CAAE;IACxD+E,MAAM,EAAEtF,aAAa,CAAC,0BAA0B,CAAE;IAClD2F,OAAO,EAAEA,CAAA,KAAMtG,OAAO,CAACuG,YAAY,CAAC;EAAE,CAC/B,CACL,CAER,CAAC,gBAEH5G,KAAA,CAAAwE,aAAA,CAAC/D,IAAI;IAACgC,KAAK,EAAE;MAAE2C,SAAS,EAAE;IAAO;EAAE,gBACjCpF,KAAA,CAAAwE,aAAA,CAAC7D,MAAM;IACL6F,UAAU,EAAE5F,UAAU,CAAC6F,OAAQ;IAC/BC,KAAK,EAAEnF,CAAC,CAAC,iBAAiB,CAAE;IAC5B6E,kBAAkB,EAAE7E,CAAC,CAAC,iBAAiB,CAAE;IACzC+E,MAAM,EAAEtF,aAAa,CAAC,0BAA0B,CAAE;IAClD2F,OAAO,EAAE5C;EAA0B,CAC5B,CACL,CAEJ,CACI,CACA,CAAC;AAEnB,CAAC;AAED,eAAe3C,gBAAgB","ignoreList":[]}
@@ -1,306 +0,0 @@
1
- import { Header, useHeaderHeight, HeaderBackButton } from '@react-navigation/elements';
2
- import React, { useState, useEffect, useCallback, useMemo } from 'react';
3
- import { useTranslation } from 'react-i18next';
4
- import { StyleSheet, View, ScrollView, Linking, Platform } from 'react-native';
5
- import { PERMISSIONS, RESULTS, request, check } from 'react-native-permissions';
6
- import { SafeAreaView } from 'react-native-safe-area-context';
7
- import Button, { ButtonType } from '../components/buttons/Button';
8
- import ToggleButton from '../components/buttons/ToggleButton';
9
- import DismissiblePopupModal from '../components/modals/DismissiblePopupModal';
10
- import SafeAreaModal from '../components/modals/SafeAreaModal';
11
- import { useAnimatedComponents } from '../contexts/animated-components';
12
- import { useAuth } from '../contexts/auth';
13
- import { DispatchAction } from '../contexts/reducers/store';
14
- import { useStore } from '../contexts/store';
15
- import { useTheme } from '../contexts/theme';
16
- import { useAppAgent } from '../utils/agent';
17
- import { testIdWithKey } from '../utils/testable';
18
- import PINEnter, { PINEntryUsage } from './PINEnter';
19
- import { TOKENS, useServices } from '../container-api';
20
- import { HistoryCardType } from '../modules/history/types';
21
- import { ThemedText } from '../components/texts/ThemedText';
22
- var UseBiometryUsage = /*#__PURE__*/function (UseBiometryUsage) {
23
- UseBiometryUsage[UseBiometryUsage["InitialSetup"] = 0] = "InitialSetup";
24
- UseBiometryUsage[UseBiometryUsage["ToggleOnOff"] = 1] = "ToggleOnOff";
25
- return UseBiometryUsage;
26
- }(UseBiometryUsage || {});
27
- const BackButton = ({
28
- setCanSeeCheckPIN
29
- }) => /*#__PURE__*/React.createElement(HeaderBackButton, {
30
- onPress: () => setCanSeeCheckPIN(false),
31
- tintColor: "white",
32
- labelVisible: false
33
- });
34
- const UseBiometry = () => {
35
- const [store, dispatch] = useStore();
36
- const {
37
- agent
38
- } = useAppAgent();
39
- const {
40
- t
41
- } = useTranslation();
42
- const [logger, historyManagerCurried, historyEnabled, historyEventsLogger] = useServices([TOKENS.UTIL_LOGGER, TOKENS.FN_LOAD_HISTORY, TOKENS.HISTORY_ENABLED, TOKENS.HISTORY_EVENTS_LOGGER]);
43
- const {
44
- isBiometricsActive,
45
- commitWalletToKeychain,
46
- disableBiometrics
47
- } = useAuth();
48
- const [biometryAvailable, setBiometryAvailable] = useState(false);
49
- const [biometryEnabled, setBiometryEnabled] = useState(store.preferences.useBiometry);
50
- const [continueEnabled, setContinueEnabled] = useState(true);
51
- const [settingsPopupConfig, setSettingsPopupConfig] = useState(null);
52
- const [canSeeCheckPIN, setCanSeeCheckPIN] = useState(false);
53
- const {
54
- TextTheme,
55
- ColorPallet,
56
- Assets
57
- } = useTheme();
58
- const {
59
- ButtonLoading
60
- } = useAnimatedComponents();
61
- const screenUsage = useMemo(() => {
62
- return store.onboarding.didCompleteOnboarding ? UseBiometryUsage.ToggleOnOff : UseBiometryUsage.InitialSetup;
63
- }, [store.onboarding.didCompleteOnboarding]);
64
- const headerHeight = useHeaderHeight();
65
- const BIOMETRY_PERMISSION = PERMISSIONS.IOS.FACE_ID;
66
- const styles = StyleSheet.create({
67
- container: {
68
- height: '100%',
69
- padding: 20,
70
- backgroundColor: ColorPallet.brand.primaryBackground
71
- },
72
- image: {
73
- minWidth: 200,
74
- minHeight: 200,
75
- marginBottom: 66
76
- },
77
- biometryAvailableRowGap: {
78
- rowGap: 20
79
- }
80
- });
81
- useEffect(() => {
82
- isBiometricsActive().then(result => {
83
- setBiometryAvailable(result);
84
- });
85
- }, [isBiometricsActive]);
86
- useEffect(() => {
87
- if (screenUsage === UseBiometryUsage.InitialSetup) {
88
- return;
89
- }
90
- if (biometryEnabled) {
91
- commitWalletToKeychain(biometryEnabled).then(() => {
92
- dispatch({
93
- type: DispatchAction.USE_BIOMETRY,
94
- payload: [biometryEnabled]
95
- });
96
- });
97
- } else {
98
- disableBiometrics().then(() => {
99
- dispatch({
100
- type: DispatchAction.USE_BIOMETRY,
101
- payload: [biometryEnabled]
102
- });
103
- });
104
- }
105
- }, [screenUsage, biometryEnabled, commitWalletToKeychain, disableBiometrics, dispatch]);
106
- const logHistoryRecord = useCallback(type => {
107
- try {
108
- if (!(agent && historyEnabled)) {
109
- logger.trace(`[${UseBiometry.name}]:[logHistoryRecord] Skipping history log, either history function disabled or agent undefined!`);
110
- return;
111
- }
112
- const historyManager = historyManagerCurried(agent);
113
-
114
- /** Save history record for card accepted */
115
- const recordData = {
116
- type: type,
117
- message: type,
118
- createdAt: new Date()
119
- };
120
- historyManager.saveHistory(recordData);
121
- } catch (err) {
122
- logger.error(`[${UseBiometry.name}]:[logHistoryRecord] Error saving history: ${err}`);
123
- }
124
- }, [agent, historyEnabled, logger, historyManagerCurried]);
125
- const continueTouched = useCallback(async () => {
126
- setContinueEnabled(false);
127
- await commitWalletToKeychain(biometryEnabled);
128
- dispatch({
129
- type: DispatchAction.USE_BIOMETRY,
130
- payload: [biometryEnabled]
131
- });
132
- }, [biometryEnabled, commitWalletToKeychain, dispatch]);
133
- const onOpenSettingsTouched = async () => {
134
- await Linking.openSettings();
135
- onOpenSettingsDismissed();
136
- };
137
- const onOpenSettingsDismissed = () => {
138
- setSettingsPopupConfig(null);
139
- };
140
- const onSwitchToggleAllowed = useCallback(newValue => {
141
- if (screenUsage === UseBiometryUsage.ToggleOnOff) {
142
- setCanSeeCheckPIN(true);
143
- if (historyEventsLogger.logToggleBiometry && store.onboarding.didAgreeToTerms && store.onboarding.didConsiderBiometry) {
144
- const type = HistoryCardType.ActivateBiometry;
145
- logHistoryRecord(type);
146
- }
147
- } else {
148
- setBiometryEnabled(newValue);
149
- }
150
- }, [screenUsage, historyEventsLogger.logToggleBiometry, logHistoryRecord, store.onboarding.didAgreeToTerms, store.onboarding.didConsiderBiometry]);
151
- const onRequestSystemBiometrics = useCallback(async newToggleValue => {
152
- const permissionResult = await request(BIOMETRY_PERMISSION);
153
- switch (permissionResult) {
154
- case RESULTS.GRANTED:
155
- case RESULTS.LIMITED:
156
- // Granted
157
- onSwitchToggleAllowed(newToggleValue);
158
- break;
159
- default:
160
- break;
161
- }
162
- }, [onSwitchToggleAllowed, BIOMETRY_PERMISSION]);
163
- const onCheckSystemBiometrics = useCallback(async () => {
164
- if (Platform.OS === 'android') {
165
- // Android doesn't need to prompt biometric permission
166
- // for an app to use it.
167
- return biometryAvailable ? RESULTS.GRANTED : RESULTS.UNAVAILABLE;
168
- } else if (Platform.OS === 'ios') {
169
- return await check(BIOMETRY_PERMISSION);
170
- }
171
- return RESULTS.UNAVAILABLE;
172
- }, [biometryAvailable, BIOMETRY_PERMISSION]);
173
- const toggleSwitch = useCallback(async () => {
174
- const newValue = !biometryEnabled;
175
- if (!newValue) {
176
- // Turning off doesn't require OS'es biometrics enabled
177
- onSwitchToggleAllowed(newValue);
178
- return;
179
- }
180
-
181
- // If the user is turning it on, they need
182
- // to first authenticate the OS'es biometrics before this action is accepted
183
- const permissionResult = await onCheckSystemBiometrics();
184
- switch (permissionResult) {
185
- case RESULTS.GRANTED:
186
- case RESULTS.LIMITED:
187
- // Already granted
188
- onSwitchToggleAllowed(newValue);
189
- break;
190
- case RESULTS.UNAVAILABLE:
191
- setSettingsPopupConfig({
192
- title: t('Biometry.SetupBiometricsTitle'),
193
- description: t('Biometry.SetupBiometricsDesc')
194
- });
195
- break;
196
- case RESULTS.BLOCKED:
197
- // Previously denied
198
- setSettingsPopupConfig({
199
- title: t('Biometry.AllowBiometricsTitle'),
200
- description: t('Biometry.AllowBiometricsDesc')
201
- });
202
- break;
203
- case RESULTS.DENIED:
204
- // Has not been requested
205
- await onRequestSystemBiometrics(newValue);
206
- break;
207
- default:
208
- break;
209
- }
210
- }, [onSwitchToggleAllowed, onRequestSystemBiometrics, onCheckSystemBiometrics, biometryEnabled, t]);
211
- const onAuthenticationComplete = useCallback(status => {
212
- // If successfully authenticated the toggle may proceed.
213
- if (status) {
214
- setBiometryEnabled(previousState => !previousState);
215
- }
216
- if (historyEventsLogger.logToggleBiometry && store.onboarding.didAgreeToTerms && store.onboarding.didConsiderBiometry) {
217
- const type = HistoryCardType.DeactivateBiometry;
218
- logHistoryRecord(type);
219
- }
220
- setCanSeeCheckPIN(false);
221
- }, [historyEventsLogger.logToggleBiometry, logHistoryRecord, store.onboarding.didAgreeToTerms, store.onboarding.didConsiderBiometry]);
222
- const renderHeaderLeft = useCallback(() => /*#__PURE__*/React.createElement(BackButton, {
223
- setCanSeeCheckPIN: () => setCanSeeCheckPIN(false)
224
- }), [setCanSeeCheckPIN]);
225
- return /*#__PURE__*/React.createElement(SafeAreaView, {
226
- edges: ['left', 'right', 'bottom']
227
- }, settingsPopupConfig && /*#__PURE__*/React.createElement(DismissiblePopupModal, {
228
- title: settingsPopupConfig.title,
229
- description: settingsPopupConfig.description,
230
- onCallToActionLabel: t('Biometry.OpenSettings'),
231
- onCallToActionPressed: onOpenSettingsTouched,
232
- onDismissPressed: onOpenSettingsDismissed
233
- }), /*#__PURE__*/React.createElement(ScrollView, {
234
- style: styles.container
235
- }, /*#__PURE__*/React.createElement(View, {
236
- style: {
237
- alignItems: 'center'
238
- }
239
- }, /*#__PURE__*/React.createElement(Assets.svg.biometrics, {
240
- style: styles.image
241
- })), biometryAvailable ? /*#__PURE__*/React.createElement(View, {
242
- style: styles.biometryAvailableRowGap
243
- }, /*#__PURE__*/React.createElement(ThemedText, null, t('Biometry.EnabledText1')), /*#__PURE__*/React.createElement(ThemedText, null, t('Biometry.EnabledText2'), /*#__PURE__*/React.createElement(ThemedText, {
244
- variant: "bold"
245
- }, " ", t('Biometry.Warning')))) : /*#__PURE__*/React.createElement(View, {
246
- style: styles.biometryAvailableRowGap
247
- }, /*#__PURE__*/React.createElement(ThemedText, null, t('Biometry.NotEnabledText1')), /*#__PURE__*/React.createElement(ThemedText, null, t('Biometry.NotEnabledText2'))), /*#__PURE__*/React.createElement(View, {
248
- style: {
249
- flexDirection: 'row',
250
- marginVertical: 20
251
- }
252
- }, /*#__PURE__*/React.createElement(View, {
253
- style: {
254
- flexShrink: 1,
255
- marginRight: 10,
256
- justifyContent: 'center'
257
- }
258
- }, /*#__PURE__*/React.createElement(ThemedText, {
259
- variant: "bold"
260
- }, t('Biometry.UseToUnlock'))), /*#__PURE__*/React.createElement(View, {
261
- style: {
262
- justifyContent: 'center'
263
- }
264
- }, /*#__PURE__*/React.createElement(ToggleButton, {
265
- testID: testIdWithKey('ToggleBiometrics'),
266
- isEnabled: biometryEnabled,
267
- isAvailable: true,
268
- toggleAction: toggleSwitch,
269
- disabled: false,
270
- enabledIcon: "check",
271
- disabledIcon: "close"
272
- })))), /*#__PURE__*/React.createElement(View, {
273
- style: {
274
- marginTop: 'auto',
275
- margin: 20
276
- }
277
- }, store.onboarding.didCompleteOnboarding || /*#__PURE__*/React.createElement(Button, {
278
- title: t('Global.Continue'),
279
- accessibilityLabel: 'Continue',
280
- testID: testIdWithKey('Continue'),
281
- onPress: continueTouched,
282
- buttonType: ButtonType.Primary,
283
- disabled: !continueEnabled
284
- }, !continueEnabled && /*#__PURE__*/React.createElement(ButtonLoading, null))), /*#__PURE__*/React.createElement(SafeAreaModal, {
285
- style: {
286
- backgroundColor: ColorPallet.brand.primaryBackground
287
- },
288
- visible: canSeeCheckPIN,
289
- transparent: false,
290
- animationType: 'slide',
291
- presentationStyle: "fullScreen"
292
- }, /*#__PURE__*/React.createElement(Header, {
293
- title: t('Screens.EnterPIN'),
294
- headerTitleStyle: TextTheme.headerTitle,
295
- headerStyle: {
296
- height: headerHeight
297
- },
298
- headerLeft: renderHeaderLeft
299
- }), /*#__PURE__*/React.createElement(PINEnter, {
300
- usage: PINEntryUsage.ChangeBiometrics,
301
- setAuthenticated: onAuthenticationComplete,
302
- onCancelAuth: setCanSeeCheckPIN
303
- })));
304
- };
305
- export default UseBiometry;
306
- //# sourceMappingURL=UseBiometry.js.map