@bifold/core 2.1.2 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/lib/commonjs/components/inputs/PINInput.js +6 -2
  2. package/lib/commonjs/components/inputs/PINInput.js.map +1 -1
  3. package/lib/commonjs/components/modals/CommonRemoveModal.js +10 -4
  4. package/lib/commonjs/components/modals/CommonRemoveModal.js.map +1 -1
  5. package/lib/commonjs/components/modals/DeveloperModal.js.map +1 -1
  6. package/lib/commonjs/container-impl.js +1 -0
  7. package/lib/commonjs/container-impl.js.map +1 -1
  8. package/lib/commonjs/contexts/activity.js +2 -2
  9. package/lib/commonjs/contexts/activity.js.map +1 -1
  10. package/lib/commonjs/contexts/auth.js +13 -5
  11. package/lib/commonjs/contexts/auth.js.map +1 -1
  12. package/lib/commonjs/index.js +7 -0
  13. package/lib/commonjs/index.js.map +1 -1
  14. package/lib/commonjs/localization/en/index.js +5 -2
  15. package/lib/commonjs/localization/en/index.js.map +1 -1
  16. package/lib/commonjs/localization/fr/index.js +4 -1
  17. package/lib/commonjs/localization/fr/index.js.map +1 -1
  18. package/lib/commonjs/localization/pt-br/index.js +5 -2
  19. package/lib/commonjs/localization/pt-br/index.js.map +1 -1
  20. package/lib/commonjs/modules/openid/screens/OpenIDCredentialOffer.js +2 -1
  21. package/lib/commonjs/modules/openid/screens/OpenIDCredentialOffer.js.map +1 -1
  22. package/lib/commonjs/screens/NameWallet.js.map +1 -1
  23. package/lib/commonjs/screens/RenameWallet.js.map +1 -1
  24. package/lib/commonjs/screens/Settings.js +9 -0
  25. package/lib/commonjs/screens/Settings.js.map +1 -1
  26. package/lib/commonjs/screens/Splash.js +8 -8
  27. package/lib/commonjs/screens/Splash.js.map +1 -1
  28. package/lib/commonjs/screens/ToggleBiometry.js.map +1 -1
  29. package/lib/module/components/inputs/PINInput.js +7 -3
  30. package/lib/module/components/inputs/PINInput.js.map +1 -1
  31. package/lib/module/components/modals/CommonRemoveModal.js +10 -4
  32. package/lib/module/components/modals/CommonRemoveModal.js.map +1 -1
  33. package/lib/module/components/modals/DeveloperModal.js.map +1 -1
  34. package/lib/module/container-impl.js +1 -0
  35. package/lib/module/container-impl.js.map +1 -1
  36. package/lib/module/contexts/activity.js +3 -3
  37. package/lib/module/contexts/activity.js.map +1 -1
  38. package/lib/module/contexts/auth.js +12 -4
  39. package/lib/module/contexts/auth.js.map +1 -1
  40. package/lib/module/index.js +1 -0
  41. package/lib/module/index.js.map +1 -1
  42. package/lib/module/localization/en/index.js +5 -2
  43. package/lib/module/localization/en/index.js.map +1 -1
  44. package/lib/module/localization/fr/index.js +4 -1
  45. package/lib/module/localization/fr/index.js.map +1 -1
  46. package/lib/module/localization/pt-br/index.js +5 -2
  47. package/lib/module/localization/pt-br/index.js.map +1 -1
  48. package/lib/module/modules/openid/screens/OpenIDCredentialOffer.js +2 -1
  49. package/lib/module/modules/openid/screens/OpenIDCredentialOffer.js.map +1 -1
  50. package/lib/module/screens/NameWallet.js.map +1 -1
  51. package/lib/module/screens/RenameWallet.js.map +1 -1
  52. package/lib/module/screens/Settings.js +9 -0
  53. package/lib/module/screens/Settings.js.map +1 -1
  54. package/lib/module/screens/Splash.js +9 -9
  55. package/lib/module/screens/Splash.js.map +1 -1
  56. package/lib/module/screens/ToggleBiometry.js.map +1 -1
  57. package/lib/typescript/src/components/inputs/PINInput.d.ts.map +1 -1
  58. package/lib/typescript/src/components/modals/CommonRemoveModal.d.ts +1 -0
  59. package/lib/typescript/src/components/modals/CommonRemoveModal.d.ts.map +1 -1
  60. package/lib/typescript/src/components/modals/DeveloperModal.d.ts.map +1 -1
  61. package/lib/typescript/src/container-impl.d.ts.map +1 -1
  62. package/lib/typescript/src/contexts/auth.d.ts +5 -1
  63. package/lib/typescript/src/contexts/auth.d.ts.map +1 -1
  64. package/lib/typescript/src/index.d.ts +1 -0
  65. package/lib/typescript/src/index.d.ts.map +1 -1
  66. package/lib/typescript/src/localization/en/index.d.ts +3 -0
  67. package/lib/typescript/src/localization/en/index.d.ts.map +1 -1
  68. package/lib/typescript/src/localization/fr/index.d.ts +3 -0
  69. package/lib/typescript/src/localization/fr/index.d.ts.map +1 -1
  70. package/lib/typescript/src/localization/pt-br/index.d.ts +3 -0
  71. package/lib/typescript/src/localization/pt-br/index.d.ts.map +1 -1
  72. package/lib/typescript/src/modules/openid/screens/OpenIDCredentialOffer.d.ts.map +1 -1
  73. package/lib/typescript/src/screens/NameWallet.d.ts.map +1 -1
  74. package/lib/typescript/src/screens/RenameWallet.d.ts.map +1 -1
  75. package/lib/typescript/src/screens/Settings.d.ts.map +1 -1
  76. package/lib/typescript/src/screens/Splash.d.ts.map +1 -1
  77. package/lib/typescript/src/screens/ToggleBiometry.d.ts.map +1 -1
  78. package/lib/typescript/src/theme.d.ts.map +1 -1
  79. package/package.json +3 -3
  80. package/src/components/inputs/PINInput.tsx +7 -3
  81. package/src/components/modals/CommonRemoveModal.tsx +9 -4
  82. package/src/components/modals/DeveloperModal.tsx +5 -2
  83. package/src/container-impl.ts +1 -0
  84. package/src/contexts/activity.tsx +3 -3
  85. package/src/contexts/auth.tsx +20 -14
  86. package/src/index.ts +1 -0
  87. package/src/localization/en/index.ts +3 -0
  88. package/src/localization/fr/index.ts +3 -0
  89. package/src/localization/pt-br/index.ts +3 -0
  90. package/src/modules/openid/screens/OpenIDCredentialOffer.tsx +1 -0
  91. package/src/screens/NameWallet.tsx +1 -3
  92. package/src/screens/RenameWallet.tsx +8 -7
  93. package/src/screens/Settings.tsx +8 -0
  94. package/src/screens/Splash.tsx +11 -10
  95. package/src/screens/ToggleBiometry.tsx +2 -3
  96. package/src/theme.ts +9 -9
@@ -239,6 +239,7 @@ const translation = {
239
239
  "PINDisclaimer": "Se você o esquecer, você precisará redefinir sua carteira e readicionar seus cards.",
240
240
  "Show": "Mostrar PIN",
241
241
  "Hide": "Esconder PIN",
242
+ "Masked": "PIN Masked for privacy (PT-BR)",
242
243
  },
243
244
  "PINChange": {
244
245
  "PinChangeSuccessTitle": "Seu PIN foi alterado com sucesso",
@@ -626,6 +627,7 @@ const translation = {
626
627
  "ShareFollowingInformation_one": "está compartilhando as seguintes informações de credenciais {{count}}.",
627
628
  "ShareFollowingInformation_other": "está compartilhando as seguintes informações de credenciais {{count}}.",
628
629
  "DeclineParagraph1": "Para receber novamente a oferta de credencial, você precisara iniciar novamente o processo de emissão com o serviço emissor.",
630
+ "DeclineParagraph1WithIssuerName": "If you change your mind you will need to request the card from {{ issuer }} again. (PT-BR)",
629
631
  "DeclineParagraph2": "Você tem certeza que quer recusar esta oferta de credencial?",
630
632
  "CustomOfferTitle": "Remover esta oferta?",
631
633
  "CustomOfferParagraph1": "Remover esta oferta irá remover a notificação de sua lista.",
@@ -713,6 +715,7 @@ const translation = {
713
715
  "ScanMyQR": "Scanear meu QR code",
714
716
  "Developer": "Opções de Desenvolvedor",
715
717
  "AutoLockTime": "Auto lock time (PT-BR)",
718
+ "Logout": "Sair",
716
719
  },
717
720
  "AutoLockTimes": {
718
721
  "FiveMinutes": "Five Minutes (PT-BR)",
@@ -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}
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 = {