@bifold/core 2.1.2 → 2.1.4

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 (123) hide show
  1. package/lib/commonjs/components/inputs/BiometryControl.js +14 -4
  2. package/lib/commonjs/components/inputs/BiometryControl.js.map +1 -1
  3. package/lib/commonjs/components/inputs/PINInput.js +6 -2
  4. package/lib/commonjs/components/inputs/PINInput.js.map +1 -1
  5. package/lib/commonjs/components/modals/CommonRemoveModal.js +10 -4
  6. package/lib/commonjs/components/modals/CommonRemoveModal.js.map +1 -1
  7. package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -1
  8. package/lib/commonjs/container-impl.js +1 -0
  9. package/lib/commonjs/container-impl.js.map +1 -1
  10. package/lib/commonjs/contexts/activity.js +2 -2
  11. package/lib/commonjs/contexts/activity.js.map +1 -1
  12. package/lib/commonjs/contexts/auth.js +13 -5
  13. package/lib/commonjs/contexts/auth.js.map +1 -1
  14. package/lib/commonjs/hooks/useBifoldAgentSetup.js +31 -3
  15. package/lib/commonjs/hooks/useBifoldAgentSetup.js.map +1 -1
  16. package/lib/commonjs/index.js +14 -0
  17. package/lib/commonjs/index.js.map +1 -1
  18. package/lib/commonjs/localization/en/en.json +928 -0
  19. package/lib/commonjs/localization/en/index.js +3 -929
  20. package/lib/commonjs/localization/en/index.js.map +1 -1
  21. package/lib/commonjs/localization/fr/fr.json +910 -0
  22. package/lib/commonjs/localization/fr/index.js +3 -909
  23. package/lib/commonjs/localization/fr/index.js.map +1 -1
  24. package/lib/commonjs/localization/pt-br/index.js +3 -886
  25. package/lib/commonjs/localization/pt-br/index.js.map +1 -1
  26. package/lib/commonjs/localization/pt-br/pt-br.json +887 -0
  27. package/lib/commonjs/modules/openid/screens/OpenIDCredentialOffer.js +2 -1
  28. package/lib/commonjs/modules/openid/screens/OpenIDCredentialOffer.js.map +1 -1
  29. package/lib/commonjs/screens/NameWallet.js.map +1 -1
  30. package/lib/commonjs/screens/RenameWallet.js.map +1 -1
  31. package/lib/commonjs/screens/Settings.js +9 -0
  32. package/lib/commonjs/screens/Settings.js.map +1 -1
  33. package/lib/commonjs/screens/Splash.js +8 -8
  34. package/lib/commonjs/screens/Splash.js.map +1 -1
  35. package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
  36. package/lib/commonjs/services/keychain.js +4 -0
  37. package/lib/commonjs/services/keychain.js.map +1 -1
  38. package/lib/module/components/inputs/BiometryControl.js +14 -4
  39. package/lib/module/components/inputs/BiometryControl.js.map +1 -1
  40. package/lib/module/components/inputs/PINInput.js +7 -3
  41. package/lib/module/components/inputs/PINInput.js.map +1 -1
  42. package/lib/module/components/modals/CommonRemoveModal.js +10 -4
  43. package/lib/module/components/modals/CommonRemoveModal.js.map +1 -1
  44. package/lib/module/components/modals/DeveloperModal.js.map +1 -1
  45. package/lib/module/container-impl.js +1 -0
  46. package/lib/module/container-impl.js.map +1 -1
  47. package/lib/module/contexts/activity.js +3 -3
  48. package/lib/module/contexts/activity.js.map +1 -1
  49. package/lib/module/contexts/auth.js +12 -4
  50. package/lib/module/contexts/auth.js.map +1 -1
  51. package/lib/module/hooks/useBifoldAgentSetup.js +33 -5
  52. package/lib/module/hooks/useBifoldAgentSetup.js.map +1 -1
  53. package/lib/module/index.js +3 -2
  54. package/lib/module/index.js.map +1 -1
  55. package/lib/module/localization/en/en.json +928 -0
  56. package/lib/module/localization/en/index.js +2 -929
  57. package/lib/module/localization/en/index.js.map +1 -1
  58. package/lib/module/localization/fr/fr.json +910 -0
  59. package/lib/module/localization/fr/index.js +2 -909
  60. package/lib/module/localization/fr/index.js.map +1 -1
  61. package/lib/module/localization/pt-br/index.js +2 -886
  62. package/lib/module/localization/pt-br/index.js.map +1 -1
  63. package/lib/module/localization/pt-br/pt-br.json +887 -0
  64. package/lib/module/modules/openid/screens/OpenIDCredentialOffer.js +2 -1
  65. package/lib/module/modules/openid/screens/OpenIDCredentialOffer.js.map +1 -1
  66. package/lib/module/screens/NameWallet.js.map +1 -1
  67. package/lib/module/screens/RenameWallet.js.map +1 -1
  68. package/lib/module/screens/Settings.js +9 -0
  69. package/lib/module/screens/Settings.js.map +1 -1
  70. package/lib/module/screens/Splash.js +9 -9
  71. package/lib/module/screens/Splash.js.map +1 -1
  72. package/lib/module/screens/ToggleBiometry.js.map +1 -1
  73. package/lib/module/services/keychain.js +4 -0
  74. package/lib/module/services/keychain.js.map +1 -1
  75. package/lib/typescript/src/components/inputs/BiometryControl.d.ts.map +1 -1
  76. package/lib/typescript/src/components/inputs/PINInput.d.ts.map +1 -1
  77. package/lib/typescript/src/components/modals/CommonRemoveModal.d.ts +1 -0
  78. package/lib/typescript/src/components/modals/CommonRemoveModal.d.ts.map +1 -1
  79. package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -1
  80. package/lib/typescript/src/container-impl.d.ts.map +1 -1
  81. package/lib/typescript/src/contexts/auth.d.ts +5 -1
  82. package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
  83. package/lib/typescript/src/hooks/useBifoldAgentSetup.d.ts.map +1 -1
  84. package/lib/typescript/src/index.d.ts +3 -2
  85. package/lib/typescript/src/index.d.ts.map +1 -1
  86. package/lib/typescript/src/localization/en/index.d.ts +2 -926
  87. package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
  88. package/lib/typescript/src/localization/fr/index.d.ts +2 -908
  89. package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
  90. package/lib/typescript/src/localization/pt-br/index.d.ts +2 -885
  91. package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
  92. package/lib/typescript/src/modules/openid/screens/OpenIDCredentialOffer.d.ts.map +1 -1
  93. package/lib/typescript/src/screens/NameWallet.d.ts.map +1 -1
  94. package/lib/typescript/src/screens/RenameWallet.d.ts.map +1 -1
  95. package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
  96. package/lib/typescript/src/screens/Splash.d.ts.map +1 -1
  97. package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
  98. package/lib/typescript/src/services/keychain.d.ts.map +1 -1
  99. package/lib/typescript/src/theme.d.ts.map +1 -1
  100. package/package.json +4 -4
  101. package/src/components/inputs/BiometryControl.tsx +16 -5
  102. package/src/components/inputs/PINInput.tsx +7 -3
  103. package/src/components/modals/CommonRemoveModal.tsx +9 -4
  104. package/src/components/modals/DeveloperModal.tsx +5 -2
  105. package/src/container-impl.ts +1 -0
  106. package/src/contexts/activity.tsx +3 -3
  107. package/src/contexts/auth.tsx +20 -14
  108. package/src/hooks/useBifoldAgentSetup.ts +40 -7
  109. package/src/index.ts +3 -1
  110. package/src/localization/en/en.json +928 -0
  111. package/src/localization/en/index.ts +2 -927
  112. package/src/localization/fr/fr.json +910 -0
  113. package/src/localization/fr/index.ts +2 -909
  114. package/src/localization/pt-br/index.ts +2 -886
  115. package/src/localization/pt-br/pt-br.json +887 -0
  116. package/src/modules/openid/screens/OpenIDCredentialOffer.tsx +1 -0
  117. package/src/screens/NameWallet.tsx +1 -3
  118. package/src/screens/RenameWallet.tsx +8 -7
  119. package/src/screens/Settings.tsx +8 -0
  120. package/src/screens/Splash.tsx +11 -10
  121. package/src/screens/ToggleBiometry.tsx +2 -3
  122. package/src/services/keychain.ts +3 -0
  123. package/src/theme.ts +9 -9
@@ -183,6 +183,7 @@ const OpenIDCredentialOffer: React.FC<OpenIDCredentialDetailsProps> = ({ navigat
183
183
  visible={isRemoveModalDisplayed}
184
184
  onSubmit={handleDeclineTouched}
185
185
  onCancel={toggleDeclineModalVisible}
186
+ extraDetails={display.issuer.name}
186
187
  />
187
188
  </ScreenLayout>
188
189
  )
@@ -3,9 +3,7 @@ import React from 'react'
3
3
  import WalletNameForm from '../components/forms/WalletNameForm'
4
4
 
5
5
  const NameWallet: React.FC = () => {
6
- return (
7
- <WalletNameForm />
8
- )
6
+ return <WalletNameForm />
9
7
  }
10
8
 
11
9
  export default NameWallet
@@ -12,14 +12,15 @@ const RenameWallet: React.FC = () => {
12
12
  navigation.goBack()
13
13
  }, [navigation])
14
14
 
15
- const onSubmitSuccess = useCallback((name: string) => {
16
- agent.config.label = name
17
- navigation.goBack()
18
- }, [navigation, agent])
19
-
20
- return (
21
- <WalletNameForm isRenaming onCancel={onCancel} onSubmitSuccess={onSubmitSuccess} />
15
+ const onSubmitSuccess = useCallback(
16
+ (name: string) => {
17
+ agent.config.label = name
18
+ navigation.goBack()
19
+ },
20
+ [navigation, agent]
22
21
  )
22
+
23
+ return <WalletNameForm isRenaming onCancel={onCancel} onSubmitSuccess={onSubmitSuccess} />
23
24
  }
24
25
 
25
26
  export default RenameWallet
@@ -1,6 +1,7 @@
1
1
  import { StackScreenProps } from '@react-navigation/stack'
2
2
  import React from 'react'
3
3
  import { useTranslation } from 'react-i18next'
4
+ import { LockoutReason, useAuth } from '../contexts/auth'
4
5
  import {
5
6
  ScrollView,
6
7
  SectionList,
@@ -33,6 +34,7 @@ type SettingsProps = StackScreenProps<SettingStackParams>
33
34
  const Settings: React.FC<SettingsProps> = ({ navigation }) => {
34
35
  const { t, i18n } = useTranslation()
35
36
  const [store] = useStore()
37
+ const { lockOutUser } = useAuth()
36
38
  const onDevModeTriggered = () => {
37
39
  Vibration.vibrate()
38
40
  navigation.navigate(Screens.Developer)
@@ -216,6 +218,12 @@ const Settings: React.FC<SettingsProps> = ({ navigation }) => {
216
218
  testID: testIdWithKey('DeveloperOptions'),
217
219
  onPress: () => navigation.navigate(Screens.Developer),
218
220
  },
221
+ {
222
+ title: t('Settings.Logout'),
223
+ accessibilityLabel: t('Settings.Logout'),
224
+ testID: testIdWithKey('Logout'),
225
+ onPress: () => lockOutUser(LockoutReason.Logout),
226
+ },
219
227
  ]
220
228
  }
221
229
  }
@@ -1,5 +1,5 @@
1
1
  import { RemoteOCABundleResolver } from '@bifold/oca/build/legacy'
2
- import React, { useEffect } from 'react'
2
+ import React, { useEffect, useRef } from 'react'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { DeviceEventEmitter, StyleSheet } from 'react-native'
5
5
  import { SafeAreaView } from 'react-native-safe-area-context'
@@ -27,6 +27,7 @@ const Splash: React.FC<SplashProps> = ({ initializeAgent }) => {
27
27
  const [store] = useStore()
28
28
  const { ColorPallet } = useTheme()
29
29
  const { LoadingIndicator } = useAnimatedComponents()
30
+ const initializing = useRef(false)
30
31
  const [logger, ocaBundleResolver] = useServices([TOKENS.UTIL_LOGGER, TOKENS.UTIL_OCA_RESOLVER])
31
32
 
32
33
  const styles = StyleSheet.create({
@@ -39,19 +40,19 @@ const Splash: React.FC<SplashProps> = ({ initializeAgent }) => {
39
40
  })
40
41
 
41
42
  useEffect(() => {
43
+ if (initializing.current || !store.authentication.didAuthenticate) {
44
+ return
45
+ }
46
+
47
+ if (!walletSecret) {
48
+ throw new Error('Wallet secret is missing')
49
+ }
50
+ initializing.current = true
51
+
42
52
  const initAgentAsyncEffect = async (): Promise<void> => {
43
53
  try {
44
54
  await (ocaBundleResolver as RemoteOCABundleResolver).checkForUpdates?.()
45
55
 
46
- // User hasn't authenticated yet, no point in trying to initialize wallet agent
47
- if (!store.authentication.didAuthenticate) {
48
- return
49
- }
50
-
51
- if (!walletSecret) {
52
- throw new Error('Wallet secret is missing')
53
- }
54
-
55
56
  await initializeAgent(walletSecret)
56
57
  } catch (err: unknown) {
57
58
  const error = new BifoldError(
@@ -14,7 +14,6 @@ import { useAppAgent } from '../utils/agent'
14
14
  import PINVerify, { PINEntryUsage } from './PINVerify'
15
15
  import { SafeAreaView } from 'react-native-safe-area-context'
16
16
 
17
-
18
17
  const ToggleBiometry: React.FC = () => {
19
18
  const [store, dispatch] = useStore()
20
19
  const { agent } = useAppAgent()
@@ -138,8 +137,8 @@ const ToggleBiometry: React.FC = () => {
138
137
  animationType={'slide'}
139
138
  presentationStyle={'fullScreen'}
140
139
  >
141
- <SafeAreaView edges={['top']} style={{ backgroundColor: NavigationTheme.colors.primary }}/>
142
- <FauxHeader title={t('Screens.EnterPIN')} onBackPressed={onBackPressed}/>
140
+ <SafeAreaView edges={['top']} style={{ backgroundColor: NavigationTheme.colors.primary }} />
141
+ <FauxHeader title={t('Screens.EnterPIN')} onBackPressed={onBackPressed} />
143
142
  <PINVerify
144
143
  usage={PINEntryUsage.ChangeBiometrics}
145
144
  setAuthenticated={onAuthenticationComplete}
@@ -175,6 +175,9 @@ export const loadWalletSecret = async (title?: string, description?: string): Pr
175
175
  return secret
176
176
  }
177
177
 
178
+ // This function checks if the biometrics on a device have been configured
179
+ // If fingerprints or a face scan is setup, this will return true
180
+ // If the device supports biometrics but they have not been configured, it will return false
178
181
  export const isBiometricsActive = async (): Promise<boolean> => {
179
182
  const result = await getSupportedBiometryType()
180
183
  return Boolean(result)
package/src/theme.ts CHANGED
@@ -730,21 +730,21 @@ export interface ITabTheme {
730
730
  shadowOpacity: number
731
731
  borderTopWidth: number
732
732
  paddingBottom: number
733
- },
734
- tabBarContainerStyle: ViewStyle,
735
- tabBarActiveTintColor: string,
736
- tabBarInactiveTintColor: string,
733
+ }
734
+ tabBarContainerStyle: ViewStyle
735
+ tabBarActiveTintColor: string
736
+ tabBarInactiveTintColor: string
737
737
  tabBarTextStyle: TextStyle & {
738
738
  fontSize: number
739
- },
739
+ }
740
740
  tabBarButtonIconStyle: {
741
741
  color: string
742
- },
743
- focusTabIconStyle: ViewStyle,
742
+ }
743
+ focusTabIconStyle: ViewStyle
744
744
  focusTabActiveTintColor: {
745
745
  backgroundColor: string
746
- },
747
- tabBarSecondaryBackgroundColor: string,
746
+ }
747
+ tabBarSecondaryBackgroundColor: string
748
748
  }
749
749
 
750
750
  export const TabTheme: ITabTheme = {