@procivis/one-react-native-components 0.3.27 → 0.3.50

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 (202) hide show
  1. package/lib/commonjs/components/entity/entity-attributes.js +14 -1
  2. package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
  3. package/lib/commonjs/components/entity/entity-details-with-buttons.js +9 -42
  4. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
  5. package/lib/commonjs/components/entity/entity-details.js +60 -32
  6. package/lib/commonjs/components/entity/entity-details.js.map +1 -1
  7. package/lib/commonjs/components/entity/index.js +2 -15
  8. package/lib/commonjs/components/entity/index.js.map +1 -1
  9. package/lib/commonjs/components/history/history-list-item.js +14 -12
  10. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  11. package/lib/commonjs/components/proof-request/share-credential.js +1 -2
  12. package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
  13. package/lib/commonjs/ui-components/blur/index.js +2 -9
  14. package/lib/commonjs/ui-components/blur/index.js.map +1 -1
  15. package/lib/commonjs/ui-components/buttons/hold-button.js +3 -2
  16. package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -1
  17. package/lib/commonjs/ui-components/camera/index.js +2 -9
  18. package/lib/commonjs/ui-components/camera/index.js.map +1 -1
  19. package/lib/commonjs/ui-components/control/index.js +0 -12
  20. package/lib/commonjs/ui-components/control/index.js.map +1 -1
  21. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +1 -1
  22. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  23. package/lib/commonjs/ui-components/credential/credential-carousel-images.js +15 -8
  24. package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
  25. package/lib/commonjs/ui-components/entity/entity-cluster.js +50 -2
  26. package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
  27. package/lib/commonjs/ui-components/entity/index.js +3 -16
  28. package/lib/commonjs/ui-components/entity/index.js.map +1 -1
  29. package/lib/commonjs/ui-components/history/history-details.js +1 -1
  30. package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
  31. package/lib/commonjs/ui-components/history/index.js +4 -27
  32. package/lib/commonjs/ui-components/history/index.js.map +1 -1
  33. package/lib/commonjs/ui-components/icons/entity.js +10 -13
  34. package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
  35. package/lib/commonjs/ui-components/input/index.js +3 -32
  36. package/lib/commonjs/ui-components/input/index.js.map +1 -1
  37. package/lib/commonjs/ui-components/list/index.js +4 -19
  38. package/lib/commonjs/ui-components/list/index.js.map +1 -1
  39. package/lib/commonjs/ui-components/loader/index.js +2 -13
  40. package/lib/commonjs/ui-components/loader/index.js.map +1 -1
  41. package/lib/commonjs/ui-components/pin/index.js +2 -21
  42. package/lib/commonjs/ui-components/pin/index.js.map +1 -1
  43. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  44. package/lib/commonjs/ui-components/searchbar/index.js +3 -16
  45. package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
  46. package/lib/commonjs/ui-components/settings/index.js +6 -37
  47. package/lib/commonjs/ui-components/settings/index.js.map +1 -1
  48. package/lib/commonjs/ui-components/state/index.js +2 -15
  49. package/lib/commonjs/ui-components/state/index.js.map +1 -1
  50. package/lib/commonjs/utils/date.js +1 -1
  51. package/lib/commonjs/utils/date.js.map +1 -1
  52. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +4 -0
  53. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  54. package/lib/commonjs/utils/hooks/core/backup.js +22 -66
  55. package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
  56. package/lib/commonjs/utils/hooks/core/core-init.js +6 -2
  57. package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
  58. package/lib/commonjs/utils/hooks/core/identifiers.js +23 -1
  59. package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
  60. package/lib/commonjs/utils/hooks/core/proofs.js +24 -14
  61. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  62. package/lib/commonjs/utils/hooks/core/trust-entity.js +56 -14
  63. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
  64. package/lib/commonjs/utils/parsers/credential-sharing.js +6 -15
  65. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  66. package/lib/commonjs/utils/parsers/credential.js +2 -2
  67. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  68. package/lib/commonjs/utils/parsers/query.js +23 -86
  69. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  70. package/lib/module/components/entity/entity-attributes.js +15 -2
  71. package/lib/module/components/entity/entity-attributes.js.map +1 -1
  72. package/lib/module/components/entity/entity-details-with-buttons.js +11 -44
  73. package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
  74. package/lib/module/components/entity/entity-details.js +61 -33
  75. package/lib/module/components/entity/entity-details.js.map +1 -1
  76. package/lib/module/components/entity/index.js +2 -2
  77. package/lib/module/components/entity/index.js.map +1 -1
  78. package/lib/module/components/history/history-list-item.js +15 -13
  79. package/lib/module/components/history/history-list-item.js.map +1 -1
  80. package/lib/module/components/proof-request/share-credential.js +1 -2
  81. package/lib/module/components/proof-request/share-credential.js.map +1 -1
  82. package/lib/module/ui-components/blur/index.js +2 -2
  83. package/lib/module/ui-components/blur/index.js.map +1 -1
  84. package/lib/module/ui-components/buttons/hold-button.js +4 -3
  85. package/lib/module/ui-components/buttons/hold-button.js.map +1 -1
  86. package/lib/module/ui-components/camera/index.js +2 -2
  87. package/lib/module/ui-components/camera/index.js.map +1 -1
  88. package/lib/module/ui-components/control/index.js +3 -3
  89. package/lib/module/ui-components/control/index.js.map +1 -1
  90. package/lib/module/ui-components/credential/card/credential-details-card.js +1 -1
  91. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  92. package/lib/module/ui-components/credential/credential-carousel-images.js +15 -8
  93. package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
  94. package/lib/module/ui-components/entity/entity-cluster.js +51 -3
  95. package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
  96. package/lib/module/ui-components/entity/index.js +4 -4
  97. package/lib/module/ui-components/entity/index.js.map +1 -1
  98. package/lib/module/ui-components/history/history-details.js +1 -1
  99. package/lib/module/ui-components/history/history-details.js.map +1 -1
  100. package/lib/module/ui-components/history/index.js +6 -6
  101. package/lib/module/ui-components/history/index.js.map +1 -1
  102. package/lib/module/ui-components/icons/entity.js +10 -13
  103. package/lib/module/ui-components/icons/entity.js.map +1 -1
  104. package/lib/module/ui-components/input/index.js +6 -6
  105. package/lib/module/ui-components/input/index.js.map +1 -1
  106. package/lib/module/ui-components/list/index.js +4 -4
  107. package/lib/module/ui-components/list/index.js.map +1 -1
  108. package/lib/module/ui-components/loader/index.js +4 -4
  109. package/lib/module/ui-components/loader/index.js.map +1 -1
  110. package/lib/module/ui-components/pin/index.js +3 -3
  111. package/lib/module/ui-components/pin/index.js.map +1 -1
  112. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  113. package/lib/module/ui-components/searchbar/index.js +4 -4
  114. package/lib/module/ui-components/searchbar/index.js.map +1 -1
  115. package/lib/module/ui-components/settings/index.js +10 -10
  116. package/lib/module/ui-components/settings/index.js.map +1 -1
  117. package/lib/module/ui-components/state/index.js +2 -2
  118. package/lib/module/ui-components/state/index.js.map +1 -1
  119. package/lib/module/utils/date.js +1 -1
  120. package/lib/module/utils/date.js.map +1 -1
  121. package/lib/module/utils/hooks/connectivity/connectivity.test.js +4 -0
  122. package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  123. package/lib/module/utils/hooks/core/backup.js +24 -68
  124. package/lib/module/utils/hooks/core/backup.js.map +1 -1
  125. package/lib/module/utils/hooks/core/core-init.js +5 -3
  126. package/lib/module/utils/hooks/core/core-init.js.map +1 -1
  127. package/lib/module/utils/hooks/core/identifiers.js +21 -0
  128. package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
  129. package/lib/module/utils/hooks/core/proofs.js +24 -14
  130. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  131. package/lib/module/utils/hooks/core/trust-entity.js +57 -15
  132. package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
  133. package/lib/module/utils/parsers/credential-sharing.js +6 -15
  134. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  135. package/lib/module/utils/parsers/credential.js +2 -2
  136. package/lib/module/utils/parsers/credential.js.map +1 -1
  137. package/lib/module/utils/parsers/query.js +21 -85
  138. package/lib/module/utils/parsers/query.js.map +1 -1
  139. package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
  140. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +1 -2
  141. package/lib/typescript/components/entity/entity-details.d.ts +3 -2
  142. package/lib/typescript/components/entity/index.d.ts +2 -1
  143. package/lib/typescript/ui-components/blur/index.d.ts +2 -1
  144. package/lib/typescript/ui-components/buttons/hold-button.d.ts +2 -2
  145. package/lib/typescript/ui-components/camera/index.d.ts +2 -1
  146. package/lib/typescript/ui-components/control/index.d.ts +4 -2
  147. package/lib/typescript/ui-components/credential/credential-carousel-images.d.ts +1 -0
  148. package/lib/typescript/ui-components/entity/entity-cluster.d.ts +1 -0
  149. package/lib/typescript/ui-components/entity/index.d.ts +4 -2
  150. package/lib/typescript/ui-components/history/history-details.d.ts +4 -1
  151. package/lib/typescript/ui-components/history/index.d.ts +6 -3
  152. package/lib/typescript/ui-components/input/index.d.ts +6 -3
  153. package/lib/typescript/ui-components/list/index.d.ts +4 -2
  154. package/lib/typescript/ui-components/loader/index.d.ts +4 -2
  155. package/lib/typescript/ui-components/pin/index.d.ts +4 -2
  156. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +1 -1
  157. package/lib/typescript/ui-components/searchbar/index.d.ts +4 -2
  158. package/lib/typescript/ui-components/settings/index.d.ts +10 -5
  159. package/lib/typescript/ui-components/state/index.d.ts +2 -1
  160. package/lib/typescript/utils/hooks/core/backup.d.ts +5 -0
  161. package/lib/typescript/utils/hooks/core/core-init.d.ts +4 -1
  162. package/lib/typescript/utils/hooks/core/identifiers.d.ts +4 -1
  163. package/lib/typescript/utils/hooks/core/proofs.d.ts +1 -0
  164. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +9 -3
  165. package/lib/typescript/utils/parsers/query.d.ts +8 -7
  166. package/package.json +10 -5
  167. package/src/components/entity/entity-attributes.tsx +16 -2
  168. package/src/components/entity/entity-details-with-buttons.tsx +11 -42
  169. package/src/components/entity/entity-details.tsx +96 -33
  170. package/src/components/entity/index.ts +2 -1
  171. package/src/components/history/history-list-item.tsx +17 -13
  172. package/src/components/proof-request/share-credential.tsx +0 -1
  173. package/src/ui-components/blur/index.ts +2 -1
  174. package/src/ui-components/buttons/hold-button.tsx +6 -5
  175. package/src/ui-components/camera/index.tsx +2 -1
  176. package/src/ui-components/control/index.ts +4 -2
  177. package/src/ui-components/credential/card/credential-details-card.tsx +1 -1
  178. package/src/ui-components/credential/credential-carousel-images.tsx +15 -8
  179. package/src/ui-components/entity/entity-cluster.tsx +63 -10
  180. package/src/ui-components/entity/index.ts +4 -2
  181. package/src/ui-components/history/history-details.tsx +5 -2
  182. package/src/ui-components/history/index.ts +6 -3
  183. package/src/ui-components/icons/entity.tsx +8 -12
  184. package/src/ui-components/input/index.ts +6 -3
  185. package/src/ui-components/list/index.ts +4 -2
  186. package/src/ui-components/loader/index.ts +4 -2
  187. package/src/ui-components/pin/index.ts +4 -2
  188. package/src/ui-components/screens/nerd-mode-screen.tsx +1 -1
  189. package/src/ui-components/searchbar/index.ts +4 -2
  190. package/src/ui-components/settings/index.ts +10 -5
  191. package/src/ui-components/state/index.ts +2 -1
  192. package/src/utils/date.ts +1 -1
  193. package/src/utils/hooks/connectivity/connectivity.test.ts +7 -2
  194. package/src/utils/hooks/core/backup.ts +30 -72
  195. package/src/utils/hooks/core/core-init.ts +5 -3
  196. package/src/utils/hooks/core/identifiers.ts +22 -1
  197. package/src/utils/hooks/core/proofs.ts +27 -16
  198. package/src/utils/hooks/core/trust-entity.ts +73 -23
  199. package/src/utils/parsers/credential-sharing.tsx +8 -14
  200. package/src/utils/parsers/credential.ts +2 -1
  201. package/src/utils/parsers/query.ts +149 -0
  202. package/src/utils/parsers/query.tsx +0 -82
@@ -1,7 +1,8 @@
1
- import { CredentialListQuery, CredentialSchemaListQuery, DidListQuery, HistoryListQuery, ProofListQuery, ProofSchemaListQuery } from '@procivis/react-native-one-core';
2
- export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<CredentialListQuery>) => (string | string[] | undefined)[];
3
- export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
4
- export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<CredentialSchemaListQuery>) => (string | string[] | undefined)[];
5
- export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | string[] | undefined)[];
6
- export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | string[] | undefined)[];
7
- export declare const getQueryKeyFromDidListQueryParams: (queryParams?: Partial<DidListQuery>) => (string | boolean | string[] | undefined)[];
1
+ import { CredentialListQuery, CredentialSchemaListQuery, DidListQuery, HistoryListQuery, IdentifierListQuery, ProofListQuery, ProofSchemaListQuery } from '@procivis/react-native-one-core';
2
+ export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<CredentialListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").CredentialListQueryExactColumnEnum[] | import("@procivis/react-native-one-core").CredentialStateEnum[] | import("@procivis/react-native-one-core").CredentialListIncludeEntityType[] | import("@procivis/react-native-one-core").CredentialListSearchType[] | undefined)[];
3
+ export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | number | import("@procivis/react-native-one-core").HistoryActionEnum[] | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
4
+ export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<CredentialSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactCredentialSchemaFilterColumnEnum[] | import("@procivis/react-native-one-core").CredentialSchemaListIncludeEntityType[] | undefined)[];
5
+ export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofSchemaFilterColumnEnum[] | undefined)[];
6
+ export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofFilterColumnEnum[] | import("@procivis/react-native-one-core").ProofStateEnum[] | import("@procivis/react-native-one-core").ProofRoleEnum[] | undefined)[];
7
+ export declare const getQueryKeyFromDidListQueryParams: (queryParams?: Partial<DidListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").ExactDidFilterColumnEnum[] | import("@procivis/react-native-one-core").KeyRoleEnum[] | undefined)[];
8
+ export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<IdentifierListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").KeyRoleEnum[] | import("@procivis/react-native-one-core").ExactIdentifierFilterColumnEnum[] | import("@procivis/react-native-one-core").IdentifierTypeEnum[] | undefined)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procivis/one-react-native-components",
3
- "version": "0.3.27",
3
+ "version": "0.3.50",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Common Procivis ONE UI components for react-native",
@@ -51,7 +51,7 @@
51
51
  "@babel/runtime": "^7.25.0",
52
52
  "@commitlint/config-conventional": "^11.0.0",
53
53
  "@gorhom/bottom-sheet": "^5.1.2",
54
- "@procivis/react-native-one-core": "1.42873.0",
54
+ "@procivis/react-native-one-core": "1.55028.0",
55
55
  "@procivis/react-native-picker": "5.0.3",
56
56
  "@react-native-async-storage/async-storage": "^1.17.3",
57
57
  "@react-native-community/blur": "^4.4.0",
@@ -138,7 +138,7 @@
138
138
  "vite": "^6.2.2"
139
139
  },
140
140
  "peerDependencies": {
141
- "@procivis/react-native-one-core": "^1.42873.0",
141
+ "@procivis/react-native-one-core": "^1.55028.0",
142
142
  "@procivis/react-native-picker": "*",
143
143
  "@react-native-community/blur": "*",
144
144
  "@react-native-community/netinfo": "^11.4.1",
@@ -277,5 +277,10 @@
277
277
  ]
278
278
  ]
279
279
  },
280
- "packageManager": "pnpm@10.5.2"
281
- }
280
+ "packageManager": "pnpm@10.5.2",
281
+ "pnpm": {
282
+ "patchedDependencies": {
283
+ "react-native-web": "patches/react-native-web.patch"
284
+ }
285
+ }
286
+ }
@@ -1,12 +1,13 @@
1
1
  import { TrustEntity } from '@procivis/react-native-one-core';
2
2
  import React, { FC, memo } from 'react';
3
- import { View } from 'react-native';
3
+ import { StyleSheet, View } from 'react-native';
4
4
 
5
5
  import { NerdModeItem } from '../../ui-components/nerd-view';
6
6
  import { AttributesLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
7
7
  import { addElementIf } from '../../utils/array';
8
8
 
9
9
  interface EntityAttributesProps {
10
+ certificate?: string;
10
11
  did?: string;
11
12
  trustEntity?: TrustEntity;
12
13
  trusted: boolean;
@@ -16,6 +17,7 @@ interface EntityAttributesProps {
16
17
  }
17
18
 
18
19
  const EntityAttributes: FC<EntityAttributesProps> = ({
20
+ certificate,
19
21
  did,
20
22
  trustEntity,
21
23
  trusted,
@@ -40,6 +42,12 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
40
42
  highlightedText: didMethod,
41
43
  testID: 'issuerDID',
42
44
  }),
45
+ ...addElementIf(Boolean(certificate), {
46
+ attributeKey: entityType === EntityType.CredentialEntity ? labels.issuerIdentifier : labels.entityIdentifier,
47
+ attributeText: certificate,
48
+ canBeCopied: true,
49
+ testID: 'issuerCertificate',
50
+ }),
43
51
  ...addElementIf(trusted && Boolean(trustEntity?.role), {
44
52
  attributeKey: labels.role,
45
53
  highlightedText: trustEntity?.role,
@@ -47,7 +55,7 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
47
55
  }),
48
56
  ];
49
57
  return (
50
- <View>
58
+ <View style={styles.wrapper}>
51
59
  {attributes.map((attribute) => (
52
60
  <NerdModeItem
53
61
  key={attribute.attributeKey}
@@ -60,4 +68,10 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
60
68
  );
61
69
  };
62
70
 
71
+ const styles = StyleSheet.create({
72
+ wrapper: {
73
+ marginBottom: 20,
74
+ }
75
+ })
76
+
63
77
  export default memo(EntityAttributes);
@@ -1,15 +1,13 @@
1
- import { TrustEntityRoleEnum, TrustEntityStateEnum } from '@procivis/react-native-one-core';
2
- import { IdentifierListItem } from '@procivis/react-native-one-core/dist/src/identifier';
3
- import React, { FC, memo, useMemo } from 'react';
1
+ import { IdentifierListItem, TrustEntityRoleEnum, TrustEntityStateEnum } from '@procivis/react-native-one-core';
2
+ import React, { FC, memo } from 'react';
4
3
  import { StyleProp, View, ViewStyle } from 'react-native';
5
4
 
6
- import EntityCluster from '../../ui-components/entity/entity-cluster';
7
- import { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';
8
5
  import { AttributesLabels, EntityLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
9
6
  import { useAppColorScheme } from '../../ui-components/theme/color-scheme-context';
10
- import { concatTestID, replaceBreakingHyphens, useIdentifierDetails } from '../../utils';
7
+ import { concatTestID, useIdentifierDetails } from '../../utils';
11
8
  import { useTrustEntity } from '../../utils/hooks/core/trust-entity';
12
9
  import EntityAttributes from './entity-attributes';
10
+ import EntityDetails from './entity-details';
13
11
  import EntityButtons from './EntityButtons';
14
12
 
15
13
  export type ContextRole = Exclude<TrustEntityRoleEnum, TrustEntityRoleEnum.BOTH>;
@@ -48,50 +46,21 @@ const EntityDetailsWithButtons: FC<EntityDetailsWithButtonsProps> = ({
48
46
  (trustEntity.role === TrustEntityRoleEnum.BOTH || trustEntity.role === role),
49
47
  );
50
48
 
51
- const trustEntityName = useMemo(() => {
52
- if (!trustEntity || !trusted) {
53
- if (identifierDetail?.did) {
54
- return replaceBreakingHyphens(identifierDetail.did.did);
55
- }
56
-
57
- return role === TrustEntityRoleEnum.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier;
58
- }
59
- return trustEntity.name;
60
- }, [entityLabels, role, trustEntity, trusted, identifierDetail]);
61
-
62
- const trustEntitySubline = useMemo(() => {
63
- if (!trusted) {
64
- return undefined;
65
- }
66
-
67
- return `${entityLabels.trusted} • ${trustEntity?.trustAnchor.name}`;
68
- }, [trustEntity, trusted, entityLabels.trusted]);
69
-
70
- const trustEntityStatusIcon = useMemo(() => {
71
- if (!trusted) {
72
- return <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />;
73
- }
74
- return <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />;
75
- }, [testID, trusted]);
76
-
77
49
  return (
78
50
  <View style={{ backgroundColor: colorScheme.nerdView.background }}>
79
- <EntityCluster
80
- avatar={{
81
- avatar: trusted && trustEntity?.logo ? { imageSource: { uri: trustEntity.logo } } : undefined,
82
- placeholderText: trusted ? trustEntity?.name.substring(0, 1) : "U",
83
- statusIcon: trustEntityStatusIcon,
84
- testID: concatTestID(testID, 'avatar'),
51
+ <EntityDetails
52
+ identifier={identifier}
53
+ labels={{
54
+ unknown: role === TrustEntityRoleEnum.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier,
85
55
  }}
86
- entityName={trustEntityName}
87
- subline={trustEntitySubline}
88
- sublineColor={trusted ? colorScheme.success : colorScheme.white}
56
+ role={role}
89
57
  testID={testID}
90
58
  {...props}
91
59
  />
92
60
  {trusted && <EntityButtons entity={trustEntity} labels={entityLabels} testID={concatTestID(testID, 'links')} />}
93
61
  <EntityAttributes
94
- did={trustEntity?.did?.did}
62
+ certificate={identifierDetail?.certificates?.[0]?.chain}
63
+ did={identifierDetail?.did?.did}
95
64
  trustEntity={trustEntity}
96
65
  trusted={trusted}
97
66
  labels={attributesLabels}
@@ -1,8 +1,15 @@
1
- import { TrustEntity, TrustEntityRoleEnum, TrustEntityStateEnum } from '@procivis/react-native-one-core';
2
- import { IdentifierListItem } from '@procivis/react-native-one-core/dist/src/identifier';
1
+ import {
2
+ IdentifierCertificateDetail,
3
+ IdentifierListItem,
4
+ IdentifierTypeEnum,
5
+ TrustEntity,
6
+ TrustEntityRoleEnum,
7
+ TrustEntityStateEnum,
8
+ } from '@procivis/react-native-one-core';
3
9
  import React, { FC, ReactNode, useMemo } from 'react';
4
10
  import { StyleProp, ViewStyle } from 'react-native';
5
11
 
12
+ import { AvatarProps } from '../../ui-components';
6
13
  import EntityCluster from '../../ui-components/entity/entity-cluster';
7
14
  import { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';
8
15
  import { concatTestID, replaceBreakingHyphens, useIdentifierDetails } from '../../utils';
@@ -17,62 +24,118 @@ export type EntityDetailsProps = {
17
24
  renderMore?: (trustEntity: TrustEntity) => ReactNode;
18
25
  role: Exclude<TrustEntityRoleEnum, TrustEntityRoleEnum.BOTH>;
19
26
  style?: StyleProp<ViewStyle>;
27
+ sublineColor?: string;
28
+ textColor?: string;
20
29
  testID?: string;
21
30
  } & (
22
- | {
31
+ | {
23
32
  identifier?: IdentifierListItem;
24
33
  }
25
- | {
34
+ | {
26
35
  entity: TrustEntity;
27
36
  }
28
- );
37
+ );
38
+
39
+ const getCertificateCommonName = (certificate: IdentifierCertificateDetail): string | undefined => {
40
+ return certificate.x509Attributes.subject
41
+ .split(', ')
42
+ .find((s) => s.startsWith('CN'))
43
+ ?.split('=')
44
+ ?.pop();
45
+ };
29
46
 
30
- const EntityDetails: FC<EntityDetailsProps> = ({ labels, renderMore, role, style, testID, ...props }) => {
31
- const { data } = useTrustEntity('identifier' in props ? props.identifier?.id : undefined);
47
+ const EntityDetails: FC<EntityDetailsProps> = ({
48
+ labels,
49
+ renderMore,
50
+ role,
51
+ style,
52
+ testID,
53
+ sublineColor,
54
+ textColor,
55
+ ...props
56
+ }) => {
57
+ const { data, isLoading: isLoadingTrustEntity } = useTrustEntity(
58
+ 'identifier' in props ? props.identifier?.id : undefined,
59
+ );
32
60
  const trustEntity: TrustEntity | undefined = 'entity' in props ? props.entity : data ?? undefined;
33
- const { data: identifierDetail } = useIdentifierDetails('identifier' in props ? props.identifier?.id : undefined);
61
+ const { data: identifierDetail, isLoading: isLoadingIdentifier } = useIdentifierDetails(
62
+ 'identifier' in props ? props.identifier?.id : undefined,
63
+ );
34
64
 
35
65
  const trusted =
36
66
  trustEntity &&
37
67
  trustEntity.state === TrustEntityStateEnum.ACTIVE &&
38
68
  (trustEntity.role === TrustEntityRoleEnum.BOTH || trustEntity.role === role);
39
69
 
70
+ const isLoading = isLoadingIdentifier || isLoadingTrustEntity;
71
+
72
+ const avatarProps: AvatarProps | undefined = useMemo(() => {
73
+ if (isLoading) {
74
+ return undefined;
75
+ }
76
+
77
+ const avatar =
78
+ trusted && identifierDetail?.type === 'DID' && trustEntity.logo
79
+ ? { imageSource: { uri: trustEntity.logo } }
80
+ : undefined;
81
+
82
+ const placeholderText =
83
+ identifierDetail?.type === IdentifierTypeEnum.CERTIFICATE && identifierDetail.certificates?.[0]
84
+ ? getCertificateCommonName(identifierDetail.certificates[0])?.substring(0, 1)
85
+ : 'D';
86
+
87
+ const statusIcon = trusted ? (
88
+ <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />
89
+ ) : (
90
+ <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />
91
+ );
92
+
93
+ if (trustEntity) {
94
+ return {
95
+ avatar,
96
+ placeholderText:
97
+ trusted && identifierDetail?.type === 'DID' ? trustEntity.name.substring(0, 1) : placeholderText,
98
+ statusIcon,
99
+ testID: concatTestID(testID, 'avatar'),
100
+ };
101
+ }
102
+
103
+ return {
104
+ placeholderText,
105
+ statusIcon,
106
+ };
107
+ }, [trustEntity, trusted, identifierDetail, isLoading, testID]);
108
+
40
109
  const trustEntityName = useMemo(() => {
41
- if (!trusted) {
42
- if (identifierDetail?.did?.did) {
43
- return replaceBreakingHyphens(identifierDetail.did.did);
110
+ if (isLoading) {
111
+ return '';
112
+ }
113
+ if (identifierDetail?.type === IdentifierTypeEnum.CERTIFICATE && identifierDetail.certificates?.[0]) {
114
+ const commonName = getCertificateCommonName(identifierDetail.certificates[0]);
115
+ if (commonName) {
116
+ return commonName;
44
117
  }
45
- return labels.unknown;
46
118
  }
47
- return trustEntity.name;
48
- }, [labels.unknown, trustEntity, trusted, identifierDetail]);
49
-
50
- const trustEntityStatusIcon = useMemo(() => {
51
- if (!trusted) {
52
- return <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />;
119
+ if (trustEntity) {
120
+ return trustEntity.name;
53
121
  }
54
- return <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />;
55
- }, [testID, trusted]);
122
+ if (identifierDetail?.did?.did) {
123
+ return replaceBreakingHyphens(identifierDetail.did.did);
124
+ }
125
+
126
+ return labels.unknown;
127
+ }, [labels.unknown, trustEntity, identifierDetail, isLoading]);
56
128
 
57
129
  return (
58
130
  <>
59
131
  <EntityCluster
60
- avatar={
61
- trustEntity
62
- ? {
63
- avatar: trusted && trustEntity.logo ? { imageSource: { uri: trustEntity.logo } } : undefined,
64
- placeholderText: trusted ? trustEntity.name.substring(0, 1) : "U",
65
- statusIcon: trustEntityStatusIcon,
66
- testID: concatTestID(testID, 'avatar'),
67
- }
68
- : {
69
- statusIcon: trustEntityStatusIcon,
70
- placeholderText: "U",
71
- }
72
- }
132
+ avatar={avatarProps}
73
133
  entityName={trustEntityName}
74
134
  style={style}
75
135
  testID={testID}
136
+ textColor={textColor}
137
+ sublineColor={sublineColor}
138
+ isLoading={isLoading}
76
139
  />
77
140
  {trustEntity && renderMore && renderMore(trustEntity)}
78
141
  </>
@@ -1,3 +1,4 @@
1
- import EntityDetails, { EntityDetailsLabels, EntityDetailsProps } from './entity-details';
1
+ import type { EntityDetailsLabels, EntityDetailsProps } from './entity-details';
2
+ import EntityDetails from './entity-details';
2
3
 
3
4
  export { EntityDetails, EntityDetailsLabels, EntityDetailsProps };
@@ -1,5 +1,5 @@
1
1
  import { HistoryActionEnum, HistoryEntityTypeEnum, HistoryListItem } from '@procivis/react-native-one-core';
2
- import React, { FC, useCallback } from 'react';
2
+ import React, { FC, useCallback, useMemo } from 'react';
3
3
 
4
4
  import { HistoryItemView } from '../../ui-components';
5
5
  import { formatTime, useTrustEntity } from '../../utils';
@@ -29,20 +29,24 @@ export const HistoryListItemView: FC<HistoryListItemViewProps> = ({
29
29
  labels,
30
30
  last,
31
31
  onPress,
32
- testID
32
+ testID,
33
33
  }) => {
34
- const { data: entity } = useTrustEntity(infoLabelMode === 'entity' ? item.target : undefined);
34
+ const identifierId = infoLabelMode === 'entity' ? item.target : undefined;
35
+ const { data: trustEntity } = useTrustEntity(identifierId);
35
36
 
36
37
  const label = `${labels.entityTypes[item.entityType]} ${labels.actions[item.action]}`;
37
- let infoLabel;
38
- switch (infoLabelMode) {
39
- case 'entity':
40
- infoLabel = entity?.name;
41
- break;
42
- case 'associatedLabel':
43
- infoLabel = item.name;
44
- break;
45
- }
38
+
39
+ const info = useMemo(() => {
40
+ switch (infoLabelMode) {
41
+ case 'entity':
42
+ return trustEntity?.name;
43
+ case 'associatedLabel':
44
+ return item.name;
45
+ case 'none':
46
+ return undefined;
47
+ }
48
+ }, [infoLabelMode, item, trustEntity]);
49
+
46
50
  const icon = <HistoryListItemIcon item={item} />;
47
51
 
48
52
  const pressHandler = useCallback(() => {
@@ -53,7 +57,7 @@ export const HistoryListItemView: FC<HistoryListItemViewProps> = ({
53
57
  <HistoryItemView
54
58
  first={first}
55
59
  icon={icon}
56
- info={infoLabel}
60
+ info={info}
57
61
  label={label}
58
62
  last={last}
59
63
  onPress={pressHandler}
@@ -70,7 +70,6 @@ export const ShareCredential: FunctionComponent<{
70
70
  credential
71
71
  ? {
72
72
  ...credential,
73
- issuerDid: credential?.issuerDid?.id,
74
73
  issuer: credential?.issuer?.id,
75
74
  }
76
75
  : undefined,
@@ -1,3 +1,4 @@
1
- import BlurView, { BlurViewProps } from './blur-view';
1
+ import type { BlurViewProps } from './blur-view';
2
+ import BlurView from './blur-view';
2
3
 
3
4
  export { BlurView, BlurViewProps };
@@ -11,7 +11,7 @@ import Animated, {
11
11
  withTiming,
12
12
  } from 'react-native-reanimated';
13
13
 
14
- import { TouchableWithoutFeedback, TouchableWithoutFeedbackRef } from '../accessibility/accessibilityHistoryWrappers';
14
+ import { TouchableOpacity, TouchableOpacityRef } from '../accessibility/accessibilityHistoryWrappers';
15
15
  import { Typography } from '../text';
16
16
  import { useAppColorScheme } from '../theme';
17
17
 
@@ -96,7 +96,7 @@ const Content = ({
96
96
  };
97
97
 
98
98
  interface HoldButtonLayoutedProps extends Omit<HoldButtonProps, 'style'> {
99
- ref: React.ForwardedRef<TouchableWithoutFeedbackRef>;
99
+ ref: React.ForwardedRef<TouchableOpacityRef>;
100
100
  width: number;
101
101
  height: number;
102
102
  }
@@ -182,16 +182,17 @@ const HoldButtonLayouted = ({
182
182
  </Animated.View>
183
183
  )}
184
184
  <View style={styles.pressableLayer}>
185
- <TouchableWithoutFeedback
185
+ <TouchableOpacity
186
186
  accessibilityRole="button"
187
187
  ref={ref}
188
188
  disabled={isFinished || disabled}
189
189
  onLongPress={onLongPress}
190
190
  onPressIn={isFinished ? undefined : onPressIn}
191
191
  onPressOut={isFinished ? undefined : onPressOut}
192
+ activeOpacity={1}
192
193
  {...props}>
193
194
  <View style={{ width, height }} />
194
- </TouchableWithoutFeedback>
195
+ </TouchableOpacity>
195
196
  </View>
196
197
  </>
197
198
  );
@@ -202,7 +203,7 @@ const HoldButtonLayouted = ({
202
203
  *
203
204
  * follows design: https://www.figma.com/design/cCmAyBQrQWCQZuDi85pJfe/Procivis-One-Wallet-Developments-2025?node-id=1-871
204
205
  */
205
- const HoldButton = React.forwardRef<TouchableWithoutFeedbackRef, HoldButtonProps>(
206
+ const HoldButton = React.forwardRef<TouchableOpacityRef, HoldButtonProps>(
206
207
  ({ style, disabled, ...props }, ref) => {
207
208
  const colorScheme = useAppColorScheme();
208
209
 
@@ -1,3 +1,4 @@
1
- import QRCodeScanner, { QRCodeScannerProps } from './qr-code-scanner';
1
+ import type { QRCodeScannerProps } from './qr-code-scanner';
2
+ import QRCodeScanner from './qr-code-scanner';
2
3
 
3
4
  export { QRCodeScanner, QRCodeScannerProps };
@@ -1,4 +1,6 @@
1
- import { Checkbox, CheckboxProps } from './checkbox';
2
- import { Switch, SwitchProps } from './switch';
1
+ import type { CheckboxProps } from './checkbox';
2
+ import { Checkbox } from './checkbox';
3
+ import type { SwitchProps } from './switch';
4
+ import { Switch } from './switch';
3
5
 
4
6
  export { Checkbox, CheckboxProps, Switch, SwitchProps };
@@ -154,7 +154,7 @@ const CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({
154
154
  testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>
155
155
  <CredentialCard
156
156
  {...cardProps}
157
- header={{ ...header, accessory: header.accessory ?? CaretIcon }}
157
+ header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}
158
158
  style={[styles.card, cardProps.style]}
159
159
  />
160
160
  {previewAttributes.length > 0 && (
@@ -64,17 +64,24 @@ type QrCodeProps = {
64
64
  content: string;
65
65
  padding?: number;
66
66
  testID?: string;
67
+ onError?: (err: string) => void;
67
68
  };
68
69
 
69
- export const QrCode: FC<QrCodeProps> = ({ content, padding, testID }) => {
70
+ export const QrCode: FC<QrCodeProps> = ({ content, padding, testID, onError }) => {
70
71
  const qrCodeXml = useMemo(() => {
71
- return new QRCode({
72
- container: 'svg-viewbox',
73
- content,
74
- join: true,
75
- padding: padding ?? 1,
76
- }).svg();
77
- }, [content, padding]);
72
+ try {
73
+ return new QRCode({
74
+ container: 'svg-viewbox',
75
+ content,
76
+ ecl: 'L',
77
+ join: true,
78
+ padding: padding ?? 1,
79
+ }).svg();
80
+ } catch (err) {
81
+ onError && onError(err instanceof Error ? err.message : 'Unknown error occurred.');
82
+ return null;
83
+ }
84
+ }, [content, onError, padding]);
78
85
  return <SvgXml height={'100%'} testID={testID} width={'100%'} xml={qrCodeXml} />;
79
86
  };
80
87
 
@@ -1,6 +1,13 @@
1
- import React, { FunctionComponent, useMemo } from 'react';
1
+ import React, { FunctionComponent, useEffect, useMemo } from 'react';
2
2
  import { Platform, StyleSheet, View, ViewProps } from 'react-native';
3
+ import Animated, {
4
+ useAnimatedStyle,
5
+ useSharedValue,
6
+ withRepeat,
7
+ withTiming,
8
+ } from 'react-native-reanimated';
3
9
 
10
+ import { LoaderView, LoaderViewState } from '../../ui-components/loader';
4
11
  import { concatTestID } from '../../utils';
5
12
  import Typography from '../text/typography';
6
13
  import { useAppColorScheme } from '../theme/color-scheme-context';
@@ -13,6 +20,7 @@ export type EntityClusterProps = ViewProps & {
13
20
  textColor?: string;
14
21
  sublineColor?: string;
15
22
  testID?: string;
23
+ isLoading?: boolean;
16
24
  };
17
25
 
18
26
  // https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25595&mode=design&t=YI1oD2BfBie5HcvJ-0
@@ -24,31 +32,67 @@ const EntityCluster: FunctionComponent<EntityClusterProps> = ({
24
32
  style,
25
33
  sublineColor,
26
34
  testID,
35
+ isLoading,
27
36
  ...viewProps
28
37
  }) => {
29
38
  const colorScheme = useAppColorScheme();
39
+
40
+ const opacity = useSharedValue<number>(1);
41
+
42
+ const animatedStyle = useAnimatedStyle(() => ({
43
+ opacity: opacity.value,
44
+ }));
45
+
46
+ useEffect(() => {
47
+ if (!isLoading) {
48
+ return;
49
+ }
50
+ opacity.value = withRepeat(
51
+ withTiming(0.3, { duration: 1000 }),
52
+ 0,
53
+ true
54
+ );
55
+ }, [opacity, isLoading]);
30
56
 
31
57
  const avatarProps = useMemo<AvatarProps>(() => {
58
+ if (isLoading) {
59
+ return {
60
+ avatar: {
61
+ component:
62
+ <View style={[styles.loaderWrapper, { backgroundColor: colorScheme.grayDark }]}>
63
+ <View style={styles.loader}>
64
+ <LoaderView animate={true} state={LoaderViewState.InProgress} />
65
+ </View>
66
+ </View>
67
+ }
68
+ }
69
+ }
32
70
  const initials = entityName.split(' ', 3).map((word: string) => word[0]);
33
71
  const placeholderText = initials.length > 0 ? initials.join('') : '';
34
72
  return {
35
73
  ...avatar,
36
74
  placeholderText: avatar?.placeholderText ?? placeholderText,
37
75
  };
38
- }, [avatar, entityName]);
76
+ }, [avatar, entityName, colorScheme.grayDark, isLoading]);
39
77
 
40
78
  return (
41
79
  <View style={[styles.entity, style]} testID={testID} {...viewProps}>
42
80
  <Avatar testID={concatTestID(testID, 'avatar')} {...avatarProps} />
43
81
  <View style={styles.labels}>
44
- <Typography
45
- testID={concatTestID(testID, 'entityName')}
46
- color={textColor ?? colorScheme.text}
47
- numberOfLines={1}
48
- preset="m"
49
- style={styles.entityName}>
50
- {entityName}
51
- </Typography>
82
+ {isLoading ? (
83
+ <Animated.View style={[{ backgroundColor: colorScheme.grayDark }, animatedStyle]}>
84
+ <Typography color={colorScheme.grayDark} />
85
+ </Animated.View>
86
+ ) : (
87
+ <Typography
88
+ testID={concatTestID(testID, 'entityName')}
89
+ color={textColor ?? colorScheme.text}
90
+ numberOfLines={1}
91
+ preset="m"
92
+ style={styles.entityName}>
93
+ {!isLoading ? entityName : undefined}
94
+ </Typography>
95
+ )}
52
96
  {subline && (
53
97
  <View>
54
98
  <Typography
@@ -77,6 +121,15 @@ const styles = StyleSheet.create({
77
121
  flex: 1,
78
122
  marginLeft: 12,
79
123
  },
124
+ loader: {
125
+ transform: [{scale: 0.5}],
126
+ },
127
+ loaderWrapper: {
128
+ height: 72,
129
+ paddingLeft: 3,
130
+ paddingTop: 4,
131
+ width: 72,
132
+ }
80
133
  });
81
134
 
82
135
  export default EntityCluster;