@procivis/one-react-native-components 0.3.115 → 0.3.130

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 (262) hide show
  1. package/lib/commonjs/components/credential/credential.js +2 -1
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/history/history-list-item-icon.js +3 -3
  4. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  5. package/lib/commonjs/components/history/history-list-item.js +2 -8
  6. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  7. package/lib/commonjs/components/history/history-list-screen.js +1 -1
  8. package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
  9. package/lib/commonjs/components/index.js +11 -11
  10. package/lib/commonjs/components/index.js.map +1 -1
  11. package/lib/commonjs/components/proof-request/v1/select-credential.js +2 -1
  12. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
  13. package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -1
  14. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
  15. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +2 -1
  16. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
  17. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +3 -1
  18. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  19. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +4 -2
  20. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  21. package/lib/commonjs/components/trust-info/index.js +29 -0
  22. package/lib/commonjs/components/trust-info/index.js.map +1 -0
  23. package/lib/commonjs/components/trust-info/trust-info.js +79 -0
  24. package/lib/commonjs/components/trust-info/trust-info.js.map +1 -0
  25. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +3 -1
  26. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  27. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  28. package/lib/commonjs/ui-components/header/header.js +2 -0
  29. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  30. package/lib/commonjs/ui-components/history/history-details.js +2 -2
  31. package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
  32. package/lib/commonjs/ui-components/icons/contact.js +45 -0
  33. package/lib/commonjs/ui-components/icons/contact.js.map +1 -0
  34. package/lib/commonjs/ui-components/icons/credential.js +3 -3
  35. package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
  36. package/lib/commonjs/ui-components/icons/icons.js +20 -1
  37. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  38. package/lib/commonjs/ui-components/icons/index.js +11 -0
  39. package/lib/commonjs/ui-components/icons/index.js.map +1 -1
  40. package/lib/commonjs/ui-components/loader/loading-result.js +2 -0
  41. package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
  42. package/lib/commonjs/ui-components/screens/index.js +7 -0
  43. package/lib/commonjs/ui-components/screens/index.js.map +1 -1
  44. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +28 -24
  45. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  46. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js +384 -0
  47. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js.map +1 -0
  48. package/lib/commonjs/utils/date.js +4 -5
  49. package/lib/commonjs/utils/date.js.map +1 -1
  50. package/lib/commonjs/utils/hooks/core/cache.js +8 -4
  51. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  52. package/lib/commonjs/utils/hooks/core/core-config.js +1 -6
  53. package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
  54. package/lib/commonjs/utils/hooks/core/core-context.js +0 -15
  55. package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
  56. package/lib/commonjs/utils/hooks/core/credentials.js +40 -1
  57. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  58. package/lib/commonjs/utils/hooks/core/index.js +0 -11
  59. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  60. package/lib/commonjs/utils/hooks/core/proofs.js +12 -1
  61. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  62. package/lib/commonjs/utils/hooks/core/trust-list.js +19 -3
  63. package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
  64. package/lib/commonjs/utils/hooks/core/verifier-instance.js +22 -3
  65. package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -1
  66. package/lib/commonjs/utils/hooks/core/wallet-unit.js +2 -2
  67. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  68. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +14 -14
  69. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  70. package/lib/commonjs/utils/parsers/credential-sharing.js +20 -18
  71. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  72. package/lib/commonjs/utils/parsers/credential.js +36 -22
  73. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  74. package/lib/commonjs/utils/parsers/query.js +1 -1
  75. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  76. package/lib/commonjs/utils/translations.js +15 -0
  77. package/lib/commonjs/utils/translations.js.map +1 -0
  78. package/lib/module/components/credential/credential.js +2 -1
  79. package/lib/module/components/credential/credential.js.map +1 -1
  80. package/lib/module/components/history/history-list-item-icon.js +3 -3
  81. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  82. package/lib/module/components/history/history-list-item.js +3 -9
  83. package/lib/module/components/history/history-list-item.js.map +1 -1
  84. package/lib/module/components/history/history-list-screen.js +1 -1
  85. package/lib/module/components/history/history-list-screen.js.map +1 -1
  86. package/lib/module/components/index.js +1 -1
  87. package/lib/module/components/index.js.map +1 -1
  88. package/lib/module/components/proof-request/v1/select-credential.js +2 -1
  89. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
  90. package/lib/module/components/proof-request/v1/share-credential.js +2 -1
  91. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
  92. package/lib/module/components/proof-request/v2/select-credential-v2.js +2 -1
  93. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
  94. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +3 -1
  95. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  96. package/lib/module/components/proof-request/v2/share-credential-v2.js +4 -2
  97. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  98. package/lib/module/components/trust-info/index.js +4 -0
  99. package/lib/module/components/trust-info/index.js.map +1 -0
  100. package/lib/module/components/trust-info/trust-info.js +70 -0
  101. package/lib/module/components/trust-info/trust-info.js.map +1 -0
  102. package/lib/module/ui-components/credential/card/credential-details-card.js +3 -1
  103. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  104. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  105. package/lib/module/ui-components/header/header.js +2 -0
  106. package/lib/module/ui-components/header/header.js.map +1 -1
  107. package/lib/module/ui-components/history/history-details.js +3 -3
  108. package/lib/module/ui-components/history/history-details.js.map +1 -1
  109. package/lib/module/ui-components/icons/contact.js +34 -0
  110. package/lib/module/ui-components/icons/contact.js.map +1 -0
  111. package/lib/module/ui-components/icons/credential.js +1 -1
  112. package/lib/module/ui-components/icons/credential.js.map +1 -1
  113. package/lib/module/ui-components/icons/icons.js +18 -0
  114. package/lib/module/ui-components/icons/icons.js.map +1 -1
  115. package/lib/module/ui-components/icons/index.js +1 -0
  116. package/lib/module/ui-components/icons/index.js.map +1 -1
  117. package/lib/module/ui-components/loader/loading-result.js +2 -0
  118. package/lib/module/ui-components/loader/loading-result.js.map +1 -1
  119. package/lib/module/ui-components/screens/index.js +2 -0
  120. package/lib/module/ui-components/screens/index.js.map +1 -1
  121. package/lib/module/ui-components/screens/nerd-mode-screen.js +29 -25
  122. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  123. package/lib/module/ui-components/screens/trust-info-details-screen.js +375 -0
  124. package/lib/module/ui-components/screens/trust-info-details-screen.js.map +1 -0
  125. package/lib/module/utils/date.js +4 -5
  126. package/lib/module/utils/date.js.map +1 -1
  127. package/lib/module/utils/hooks/core/cache.js +8 -4
  128. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  129. package/lib/module/utils/hooks/core/core-config.js +0 -4
  130. package/lib/module/utils/hooks/core/core-config.js.map +1 -1
  131. package/lib/module/utils/hooks/core/core-context.js +0 -15
  132. package/lib/module/utils/hooks/core/core-context.js.map +1 -1
  133. package/lib/module/utils/hooks/core/credentials.js +37 -1
  134. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  135. package/lib/module/utils/hooks/core/index.js +0 -1
  136. package/lib/module/utils/hooks/core/index.js.map +1 -1
  137. package/lib/module/utils/hooks/core/proofs.js +10 -0
  138. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  139. package/lib/module/utils/hooks/core/trust-list.js +20 -4
  140. package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
  141. package/lib/module/utils/hooks/core/verifier-instance.js +20 -2
  142. package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -1
  143. package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
  144. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  145. package/lib/module/utils/parsers/credential-sharing-v2.js +15 -15
  146. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  147. package/lib/module/utils/parsers/credential-sharing.js +20 -18
  148. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  149. package/lib/module/utils/parsers/credential.js +37 -23
  150. package/lib/module/utils/parsers/credential.js.map +1 -1
  151. package/lib/module/utils/parsers/query.js +1 -1
  152. package/lib/module/utils/parsers/query.js.map +1 -1
  153. package/lib/module/utils/translations.js +8 -0
  154. package/lib/module/utils/translations.js.map +1 -0
  155. package/lib/typescript/components/credential/credential.d.ts +1 -0
  156. package/lib/typescript/components/history/history-list-item.d.ts +1 -1
  157. package/lib/typescript/components/index.d.ts +1 -1
  158. package/lib/typescript/components/proof-request/v1/select-credential.d.ts +1 -0
  159. package/lib/typescript/components/proof-request/v1/share-credential.d.ts +1 -0
  160. package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +1 -0
  161. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +1 -0
  162. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +1 -0
  163. package/lib/typescript/components/trust-info/index.d.ts +3 -0
  164. package/lib/typescript/components/trust-info/trust-info.d.ts +19 -0
  165. package/lib/typescript/ui-components/header/header.d.ts +2 -0
  166. package/lib/typescript/ui-components/history/history-details.d.ts +2 -2
  167. package/lib/typescript/ui-components/icons/contact.d.ts +4 -0
  168. package/lib/typescript/ui-components/icons/credential.d.ts +1 -1
  169. package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
  170. package/lib/typescript/ui-components/icons/index.d.ts +1 -0
  171. package/lib/typescript/ui-components/screens/index.d.ts +3 -0
  172. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +5 -12
  173. package/lib/typescript/ui-components/screens/trust-info-details-screen.d.ts +32 -0
  174. package/lib/typescript/utils/hooks/core/core-config.d.ts +0 -1
  175. package/lib/typescript/utils/hooks/core/core-context.d.ts +0 -1
  176. package/lib/typescript/utils/hooks/core/credentials.d.ts +5 -1
  177. package/lib/typescript/utils/hooks/core/index.d.ts +0 -1
  178. package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -0
  179. package/lib/typescript/utils/hooks/core/trust-list.d.ts +1 -4
  180. package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +2 -0
  181. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +2 -2
  182. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +3 -3
  183. package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
  184. package/lib/typescript/utils/parsers/credential.d.ts +5 -5
  185. package/lib/typescript/utils/parsers/query.d.ts +1 -1
  186. package/lib/typescript/utils/translations.d.ts +1 -0
  187. package/package.json +8 -8
  188. package/src/components/credential/credential.tsx +3 -0
  189. package/src/components/history/history-list-item-icon.tsx +2 -2
  190. package/src/components/history/history-list-item.tsx +4 -9
  191. package/src/components/history/history-list-screen.tsx +1 -1
  192. package/src/components/index.ts +1 -1
  193. package/src/components/proof-request/v1/select-credential.tsx +3 -1
  194. package/src/components/proof-request/v1/share-credential.tsx +3 -0
  195. package/src/components/proof-request/v2/select-credential-v2.tsx +3 -1
  196. package/src/components/proof-request/v2/share-credential-v2-group.tsx +4 -0
  197. package/src/components/proof-request/v2/share-credential-v2.tsx +5 -0
  198. package/src/components/trust-info/index.ts +4 -0
  199. package/src/components/trust-info/trust-info.tsx +90 -0
  200. package/src/ui-components/credential/card/credential-details-card.tsx +3 -2
  201. package/src/ui-components/header/foldable-header.tsx +10 -9
  202. package/src/ui-components/header/header.tsx +18 -3
  203. package/src/ui-components/history/history-details.tsx +4 -4
  204. package/src/ui-components/icons/contact.tsx +26 -0
  205. package/src/ui-components/icons/credential.tsx +1 -1
  206. package/src/ui-components/icons/icons.tsx +18 -0
  207. package/src/ui-components/icons/index.ts +1 -0
  208. package/src/ui-components/loader/loading-result.tsx +7 -1
  209. package/src/ui-components/screens/index.ts +3 -0
  210. package/src/ui-components/screens/nerd-mode-screen.tsx +49 -41
  211. package/src/ui-components/screens/trust-info-details-screen.tsx +472 -0
  212. package/src/utils/date.ts +7 -14
  213. package/src/utils/hooks/core/cache.ts +12 -4
  214. package/src/utils/hooks/core/core-config.ts +1 -6
  215. package/src/utils/hooks/core/core-context.tsx +0 -24
  216. package/src/utils/hooks/core/credentials.ts +43 -1
  217. package/src/utils/hooks/core/index.ts +0 -1
  218. package/src/utils/hooks/core/proofs.ts +14 -0
  219. package/src/utils/hooks/core/trust-list.ts +22 -11
  220. package/src/utils/hooks/core/verifier-instance.ts +23 -2
  221. package/src/utils/hooks/core/wallet-unit.ts +3 -3
  222. package/src/utils/parsers/credential-sharing-v2.tsx +29 -12
  223. package/src/utils/parsers/credential-sharing.tsx +33 -16
  224. package/src/utils/parsers/credential.ts +45 -14
  225. package/src/utils/parsers/query.ts +3 -0
  226. package/src/utils/translations.ts +10 -0
  227. package/lib/commonjs/components/entity/EntityButtons.js +0 -64
  228. package/lib/commonjs/components/entity/EntityButtons.js.map +0 -1
  229. package/lib/commonjs/components/entity/entity-attributes.js +0 -65
  230. package/lib/commonjs/components/entity/entity-attributes.js.map +0 -1
  231. package/lib/commonjs/components/entity/entity-details-with-buttons.js +0 -67
  232. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +0 -1
  233. package/lib/commonjs/components/entity/entity-details.js +0 -101
  234. package/lib/commonjs/components/entity/entity-details.js.map +0 -1
  235. package/lib/commonjs/components/entity/index.js +0 -14
  236. package/lib/commonjs/components/entity/index.js.map +0 -1
  237. package/lib/commonjs/utils/hooks/core/trust-entity.js +0 -147
  238. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +0 -1
  239. package/lib/module/components/entity/EntityButtons.js +0 -56
  240. package/lib/module/components/entity/EntityButtons.js.map +0 -1
  241. package/lib/module/components/entity/entity-attributes.js +0 -57
  242. package/lib/module/components/entity/entity-attributes.js.map +0 -1
  243. package/lib/module/components/entity/entity-details-with-buttons.js +0 -58
  244. package/lib/module/components/entity/entity-details-with-buttons.js.map +0 -1
  245. package/lib/module/components/entity/entity-details.js +0 -92
  246. package/lib/module/components/entity/entity-details.js.map +0 -1
  247. package/lib/module/components/entity/index.js +0 -3
  248. package/lib/module/components/entity/index.js.map +0 -1
  249. package/lib/module/utils/hooks/core/trust-entity.js +0 -136
  250. package/lib/module/utils/hooks/core/trust-entity.js.map +0 -1
  251. package/lib/typescript/components/entity/EntityButtons.d.ts +0 -14
  252. package/lib/typescript/components/entity/entity-attributes.d.ts +0 -15
  253. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +0 -18
  254. package/lib/typescript/components/entity/entity-details.d.ts +0 -21
  255. package/lib/typescript/components/entity/index.d.ts +0 -3
  256. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +0 -17
  257. package/src/components/entity/EntityButtons.tsx +0 -79
  258. package/src/components/entity/entity-attributes.tsx +0 -80
  259. package/src/components/entity/entity-details-with-buttons.tsx +0 -75
  260. package/src/components/entity/entity-details.tsx +0 -145
  261. package/src/components/entity/index.ts +0 -4
  262. package/src/utils/hooks/core/trust-entity.ts +0 -172
@@ -0,0 +1,375 @@
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
+ import React, { useCallback, useState } from 'react';
3
+ import { Linking, SectionList, StyleSheet, View } from 'react-native';
4
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
5
+ import TrustInfo from '../../components/trust-info/trust-info';
6
+ import { concatTestID, nonEmptyFilter, reportException } from '../../utils';
7
+ import { TouchableOpacity } from '../accessibility';
8
+ import { BackButton } from '../buttons';
9
+ import { NavigationHeader } from '../header';
10
+ import { LinkIcon, MailIcon, PhoneIcon } from '../icons';
11
+ import { Typography } from '../text';
12
+ import { useAppColorScheme } from '../theme';
13
+ const Separator = ({
14
+ dark,
15
+ leadingItem
16
+ }) => {
17
+ const colorScheme = useAppColorScheme();
18
+ if ((leadingItem === null || leadingItem === void 0 ? void 0 : leadingItem.type) === 'subsection' || (leadingItem === null || leadingItem === void 0 ? void 0 : leadingItem.type) === 'item' && !(leadingItem !== null && leadingItem !== void 0 && leadingItem.value)) {
19
+ return /*#__PURE__*/React.createElement(View, {
20
+ style: styles.emptyItem
21
+ });
22
+ }
23
+ return /*#__PURE__*/React.createElement(View, {
24
+ style: {
25
+ backgroundColor: dark ? colorScheme.background : colorScheme.white
26
+ }
27
+ }, /*#__PURE__*/React.createElement(View, {
28
+ style: [styles.separator, {
29
+ backgroundColor: colorScheme.grayDark
30
+ }]
31
+ }));
32
+ };
33
+ const ListButton = ({
34
+ label,
35
+ onPress
36
+ }) => {
37
+ const colorScheme = useAppColorScheme();
38
+ return /*#__PURE__*/React.createElement(TouchableOpacity, {
39
+ onPress: onPress,
40
+ style: [styles.button, styles.lastItem, {
41
+ backgroundColor: colorScheme.white
42
+ }]
43
+ }, /*#__PURE__*/React.createElement(Typography, {
44
+ align: "center",
45
+ color: colorScheme.text
46
+ }, label));
47
+ };
48
+ const ListItem = ({
49
+ action,
50
+ dark,
51
+ title,
52
+ value
53
+ }) => {
54
+ const colorScheme = useAppColorScheme();
55
+ return /*#__PURE__*/React.createElement(View, {
56
+ style: [styles.item, {
57
+ backgroundColor: dark ? undefined : colorScheme.white
58
+ }]
59
+ }, /*#__PURE__*/React.createElement(View, {
60
+ style: styles.itemLabels
61
+ }, /*#__PURE__*/React.createElement(Typography, {
62
+ color: colorScheme.text,
63
+ numberOfLines: 1,
64
+ preset: "s/line-height-capped",
65
+ style: styles.itemTitleLabel
66
+ }, title), /*#__PURE__*/React.createElement(Typography, {
67
+ color: colorScheme.text,
68
+ numberOfLines: 1,
69
+ preset: "s/line-height-capped"
70
+ }, value)), action && /*#__PURE__*/React.createElement(TouchableOpacity, {
71
+ onPress: action.onPress,
72
+ style: [styles.actionButton, {
73
+ backgroundColor: dark ? colorScheme.white : colorScheme.grayDark
74
+ }]
75
+ }, /*#__PURE__*/React.createElement(action.icon, {
76
+ color: colorScheme.black
77
+ })));
78
+ };
79
+ const ContactItem = ({
80
+ email,
81
+ labels,
82
+ onPress,
83
+ phone,
84
+ website
85
+ }) => {
86
+ const colorScheme = useAppColorScheme();
87
+ return /*#__PURE__*/React.createElement(View, {
88
+ style: [styles.contactItemWrapper, {
89
+ backgroundColor: colorScheme.white
90
+ }]
91
+ }, /*#__PURE__*/React.createElement(View, {
92
+ style: [styles.contactItem, {
93
+ backgroundColor: colorScheme.background
94
+ }]
95
+ }, website && /*#__PURE__*/React.createElement(ListItem, {
96
+ action: {
97
+ icon: LinkIcon,
98
+ onPress: onPress(website)
99
+ },
100
+ dark: true,
101
+ title: labels.website,
102
+ value: website
103
+ }), website && (email || phone) && /*#__PURE__*/React.createElement(Separator, {
104
+ dark: true
105
+ }), email && /*#__PURE__*/React.createElement(ListItem, {
106
+ action: {
107
+ icon: MailIcon,
108
+ onPress: onPress(`mailto:${email}`)
109
+ },
110
+ dark: true,
111
+ title: labels.email,
112
+ value: email
113
+ }), email && phone && /*#__PURE__*/React.createElement(Separator, {
114
+ dark: true
115
+ }), phone && /*#__PURE__*/React.createElement(ListItem, {
116
+ action: {
117
+ icon: PhoneIcon,
118
+ onPress: onPress(`tel:${phone}`)
119
+ },
120
+ dark: true,
121
+ title: labels.phone,
122
+ value: phone
123
+ })));
124
+ };
125
+ const TrustInfoDetailsScreen = ({
126
+ countries,
127
+ labels,
128
+ language,
129
+ onClose,
130
+ testID,
131
+ trustInformation
132
+ }) => {
133
+ var _countries$find, _countryDisplay$langu, _trustDetails$service, _trustDetails$interme;
134
+ const insets = useSafeAreaInsets();
135
+ const colorScheme = useAppColorScheme();
136
+ const [expanded, setExpanded] = useState(false);
137
+ const linkHandler = useCallback(url => () => {
138
+ Linking.openURL(url).catch(e => {
139
+ reportException(e, `Error opening contact link ${url}`);
140
+ });
141
+ }, []);
142
+ const trustDetails = trustInformation.eudiEcosystem;
143
+ if (!trustDetails) {
144
+ return null;
145
+ }
146
+ const countryDisplay = (_countries$find = countries.find(c => c.value === trustDetails.country)) === null || _countries$find === void 0 ? void 0 : _countries$find.display;
147
+ const country = (_countryDisplay$langu = countryDisplay === null || countryDisplay === void 0 ? void 0 : countryDisplay[language]) !== null && _countryDisplay$langu !== void 0 ? _countryDisplay$langu : countryDisplay === null || countryDisplay === void 0 ? void 0 : countryDisplay.en;
148
+ const baseInfo = [{
149
+ name: trustDetails.name,
150
+ type: 'trustInfo'
151
+ }, {
152
+ title: labels.isPublicSector,
153
+ type: 'item',
154
+ value: trustDetails.isPublicSector ? labels.true : undefined
155
+ }, {
156
+ title: labels.serviceDescription,
157
+ type: 'item',
158
+ value: (_trustDetails$service = trustDetails.serviceDescription[0]) === null || _trustDetails$service === void 0 ? void 0 : _trustDetails$service[language]
159
+ }];
160
+ const expandItem = !expanded ? [{
161
+ type: 'expand'
162
+ }] : [];
163
+ const supervisoryAuthority = trustDetails.supervisoryAuthority ? [{
164
+ title: labels.supervisoryAuthority,
165
+ type: 'subsection'
166
+ }, {
167
+ ...trustDetails.supervisoryAuthority,
168
+ type: 'contact',
169
+ website: trustDetails.supervisoryAuthority.uri
170
+ }] : [];
171
+ const extraInfo = expanded ? [{
172
+ title: labels.country,
173
+ type: 'item',
174
+ value: country
175
+ }, {
176
+ title: labels.identifier,
177
+ type: 'item',
178
+ value: trustDetails.identifier
179
+ }, {
180
+ title: labels.support,
181
+ type: 'subsection'
182
+ }, {
183
+ type: 'contact',
184
+ ...trustDetails
185
+ }, ...supervisoryAuthority, {
186
+ type: 'collapse'
187
+ }] : [];
188
+ const trustDetailsSection = baseInfo.concat(expandItem).concat(extraInfo);
189
+ const intermediaryName = (_trustDetails$interme = trustDetails.intermediary) !== null && _trustDetails$interme !== void 0 && _trustDetails$interme.name ? [{
190
+ name: trustDetails.intermediary.name,
191
+ type: 'trustInfo'
192
+ }] : [];
193
+ const intermediarySection = trustDetails.intermediary ? [...intermediaryName, {
194
+ title: labels.country,
195
+ type: 'item',
196
+ value: trustDetails.intermediary.country
197
+ }, {
198
+ title: labels.identifier,
199
+ type: 'item',
200
+ value: trustDetails.intermediary.identifier
201
+ }, {
202
+ title: labels.support,
203
+ type: 'subsection'
204
+ }, {
205
+ type: 'contact',
206
+ ...trustDetails.intermediary
207
+ }] : [];
208
+ const sections = [{
209
+ ItemSeparatorComponent: Separator,
210
+ data: trustDetailsSection
211
+ }, intermediarySection.length ? {
212
+ ItemSeparatorComponent: Separator,
213
+ data: intermediarySection,
214
+ title: 'Intermediary'
215
+ } : undefined].filter(nonEmptyFilter);
216
+ return /*#__PURE__*/React.createElement(View, {
217
+ style: styles.container
218
+ }, /*#__PURE__*/React.createElement(NavigationHeader, {
219
+ leftItem: /*#__PURE__*/React.createElement(BackButton, {
220
+ onPress: onClose
221
+ }),
222
+ style: {
223
+ paddingTop: insets.top
224
+ },
225
+ title: labels.title
226
+ }), /*#__PURE__*/React.createElement(SectionList, {
227
+ contentInset: insets,
228
+ renderItem: ({
229
+ item,
230
+ section
231
+ }) => {
232
+ switch (item.type) {
233
+ case 'subsection':
234
+ return /*#__PURE__*/React.createElement(View, {
235
+ style: [styles.subsection, {
236
+ backgroundColor: colorScheme.white
237
+ }],
238
+ testID: concatTestID(testID, section.title)
239
+ }, /*#__PURE__*/React.createElement(Typography, {
240
+ color: colorScheme.text,
241
+ preset: "m/heading"
242
+ }, item.title));
243
+ case 'trustInfo':
244
+ return /*#__PURE__*/React.createElement(TrustInfo, {
245
+ labels: labels,
246
+ style: [styles.trustInfoItem, styles.firstItem, {
247
+ backgroundColor: colorScheme.white
248
+ }],
249
+ trustInformation: item
250
+ });
251
+ case 'item':
252
+ if (!item.value) {
253
+ return /*#__PURE__*/React.createElement(View, {
254
+ style: styles.emptyItem
255
+ });
256
+ }
257
+ return /*#__PURE__*/React.createElement(ListItem, _extends({}, item, {
258
+ value: item.value
259
+ }));
260
+ case 'contact':
261
+ if (!item.website && !item.phone && !item.email) {
262
+ return /*#__PURE__*/React.createElement(View, {
263
+ style: styles.emptyItem
264
+ });
265
+ }
266
+ return /*#__PURE__*/React.createElement(ContactItem, _extends({
267
+ labels: labels,
268
+ onPress: linkHandler
269
+ }, item));
270
+ case 'expand':
271
+ return /*#__PURE__*/React.createElement(ListButton, {
272
+ label: labels.expand,
273
+ onPress: () => setExpanded(true)
274
+ });
275
+ case 'collapse':
276
+ return /*#__PURE__*/React.createElement(ListButton, {
277
+ label: labels.collapse,
278
+ onPress: () => setExpanded(false)
279
+ });
280
+ }
281
+ },
282
+ renderSectionHeader: ({
283
+ section
284
+ }) => {
285
+ return section.title ? /*#__PURE__*/React.createElement(View, {
286
+ style: styles.sectionHeaderContainer,
287
+ testID: concatTestID(testID, section.title)
288
+ }, /*#__PURE__*/React.createElement(Typography, {
289
+ color: colorScheme.text,
290
+ preset: "m/heading",
291
+ style: styles.sectionHeaderText
292
+ }, section.title)) : null;
293
+ },
294
+ scrollEventThrottle: 16,
295
+ sections: sections,
296
+ showsVerticalScrollIndicator: false,
297
+ stickySectionHeadersEnabled: false,
298
+ style: styles.list,
299
+ testID: testID
300
+ }));
301
+ };
302
+ const styles = StyleSheet.create({
303
+ actionButton: {
304
+ alignItems: 'center',
305
+ borderRadius: 19,
306
+ height: 38,
307
+ justifyContent: 'center',
308
+ width: 38
309
+ },
310
+ button: {
311
+ height: 64,
312
+ justifyContent: 'center',
313
+ paddingBottom: 8,
314
+ width: '100%'
315
+ },
316
+ contactItem: {
317
+ borderRadius: 8
318
+ },
319
+ contactItemWrapper: {
320
+ padding: 12
321
+ },
322
+ container: {
323
+ flex: 1
324
+ },
325
+ emptyItem: {
326
+ height: 0
327
+ },
328
+ firstItem: {
329
+ borderTopLeftRadius: 8,
330
+ borderTopRightRadius: 8
331
+ },
332
+ item: {
333
+ alignItems: 'center',
334
+ flexDirection: 'row',
335
+ justifyContent: 'space-between',
336
+ padding: 12
337
+ },
338
+ itemLabels: {
339
+ flexDirection: 'column'
340
+ },
341
+ itemTitleLabel: {
342
+ opacity: 0.5
343
+ },
344
+ lastItem: {
345
+ borderBottomLeftRadius: 8,
346
+ borderBottomRightRadius: 8
347
+ },
348
+ list: {
349
+ marginHorizontal: 16
350
+ },
351
+ sectionHeaderContainer: {
352
+ justifyContent: 'center',
353
+ marginTop: 20,
354
+ paddingVertical: 16
355
+ },
356
+ sectionHeaderText: {
357
+ opacity: 0.7,
358
+ paddingHorizontal: 20
359
+ },
360
+ separator: {
361
+ height: 1,
362
+ marginHorizontal: 12,
363
+ opacity: 0.4
364
+ },
365
+ subsection: {
366
+ paddingBottom: 8,
367
+ paddingHorizontal: 12,
368
+ paddingTop: 22
369
+ },
370
+ trustInfoItem: {
371
+ padding: 8
372
+ }
373
+ });
374
+ export default TrustInfoDetailsScreen;
375
+ //# sourceMappingURL=trust-info-details-screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useCallback","useState","Linking","SectionList","StyleSheet","View","useSafeAreaInsets","TrustInfo","concatTestID","nonEmptyFilter","reportException","TouchableOpacity","BackButton","NavigationHeader","LinkIcon","MailIcon","PhoneIcon","Typography","useAppColorScheme","Separator","dark","leadingItem","colorScheme","type","value","createElement","style","styles","emptyItem","backgroundColor","background","white","separator","grayDark","ListButton","label","onPress","button","lastItem","align","color","text","ListItem","action","title","item","undefined","itemLabels","numberOfLines","preset","itemTitleLabel","actionButton","icon","black","ContactItem","email","labels","phone","website","contactItemWrapper","contactItem","TrustInfoDetailsScreen","countries","language","onClose","testID","trustInformation","_countries$find","_countryDisplay$langu","_trustDetails$service","_trustDetails$interme","insets","expanded","setExpanded","linkHandler","url","openURL","catch","e","trustDetails","eudiEcosystem","countryDisplay","find","c","country","display","en","baseInfo","name","isPublicSector","true","serviceDescription","expandItem","supervisoryAuthority","uri","extraInfo","identifier","support","trustDetailsSection","concat","intermediaryName","intermediary","intermediarySection","sections","ItemSeparatorComponent","data","length","filter","container","leftItem","paddingTop","top","contentInset","renderItem","section","subsection","trustInfoItem","firstItem","_extends","expand","collapse","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","showsVerticalScrollIndicator","stickySectionHeadersEnabled","list","create","alignItems","borderRadius","height","justifyContent","width","paddingBottom","padding","flex","borderTopLeftRadius","borderTopRightRadius","flexDirection","opacity","borderBottomLeftRadius","borderBottomRightRadius","marginHorizontal","marginTop","paddingVertical","paddingHorizontal"],"sources":["trust-info-details-screen.tsx"],"sourcesContent":["import { TrustInformationDetail } from '@procivis/react-native-one-core';\nimport React, { FC, useCallback, useState } from 'react';\nimport { Linking, SectionList, SectionListData, StyleSheet, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { SvgProps } from 'react-native-svg';\n\nimport TrustInfo, { TrustInfoLabels } from '../../components/trust-info/trust-info';\nimport { concatTestID, nonEmptyFilter, reportException } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport { NavigationHeader } from '../header';\nimport { LinkIcon, MailIcon, PhoneIcon } from '../icons';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\ntype TrustInfoDetailItem =\n | {\n name: string;\n type: 'trustInfo';\n }\n | {\n title: string;\n type: 'subsection';\n }\n | {\n action?: {\n icon: FC<SvgProps>;\n onPress: () => void;\n };\n title: string;\n type: 'item';\n value?: string;\n }\n | {\n email?: string;\n phone?: string;\n type: 'contact';\n website?: string;\n }\n | {\n type: 'expand';\n }\n | {\n type: 'collapse';\n };\n\ntype TrustInfoDetailSection = {\n title?: string;\n};\n\nexport type TrustInfoDetailsScreenLabels = TrustInfoLabels & {\n collapse: string;\n country: string;\n email: string;\n expand: string;\n identifier: string;\n isPublicSector: string;\n phone: string;\n privacyPolicy: string;\n serviceDescription: string;\n supervisoryAuthority: string;\n support: string;\n title: string;\n true: string;\n website: string;\n};\n\ntype SeparatorProps = {\n dark?: boolean;\n leadingItem?: TrustInfoDetailItem;\n};\n\nconst Separator: FC<SeparatorProps> = ({ dark, leadingItem }) => {\n const colorScheme = useAppColorScheme();\n if (leadingItem?.type === 'subsection' || (leadingItem?.type === 'item' && !leadingItem?.value)) {\n return <View style={styles.emptyItem} />;\n }\n return (\n <View style={{ backgroundColor: dark ? colorScheme.background : colorScheme.white }}>\n <View style={[styles.separator, { backgroundColor: colorScheme.grayDark }]} />\n </View>\n );\n};\n\ntype ListButtonProps = {\n label: string;\n onPress: () => void;\n};\n\nconst ListButton: FC<ListButtonProps> = ({ label, onPress }) => {\n const colorScheme = useAppColorScheme();\n return (\n <TouchableOpacity\n onPress={onPress}\n style={[styles.button, styles.lastItem, { backgroundColor: colorScheme.white }]}>\n <Typography align=\"center\" color={colorScheme.text}>\n {label}\n </Typography>\n </TouchableOpacity>\n );\n};\n\ntype ListItemProps = {\n action?: {\n icon: FC<SvgProps>;\n onPress: () => void;\n };\n dark?: boolean;\n title: string;\n value: string;\n};\n\nconst ListItem: FC<ListItemProps> = ({ action, dark, title, value }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.item, { backgroundColor: dark ? undefined : colorScheme.white }]}>\n <View style={styles.itemLabels}>\n <Typography\n color={colorScheme.text}\n numberOfLines={1}\n preset=\"s/line-height-capped\"\n style={styles.itemTitleLabel}>\n {title}\n </Typography>\n <Typography color={colorScheme.text} numberOfLines={1} preset=\"s/line-height-capped\">\n {value}\n </Typography>\n </View>\n {action && (\n <TouchableOpacity\n onPress={action.onPress}\n style={[styles.actionButton, { backgroundColor: dark ? colorScheme.white : colorScheme.grayDark }]}>\n <action.icon color={colorScheme.black} />\n </TouchableOpacity>\n )}\n </View>\n );\n};\n\ntype ContactItemProps = {\n email?: string;\n labels: TrustInfoDetailsScreenLabels;\n onPress: (url: string) => () => void;\n phone?: string;\n website?: string;\n};\n\nconst ContactItem: FC<ContactItemProps> = ({ email, labels, onPress, phone, website }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.contactItemWrapper, { backgroundColor: colorScheme.white }]}>\n <View style={[styles.contactItem, { backgroundColor: colorScheme.background }]}>\n {website && (\n <ListItem\n action={{ icon: LinkIcon, onPress: onPress(website) }}\n dark\n title={labels.website}\n value={website}\n />\n )}\n {website && (email || phone) && <Separator dark />}\n {email && (\n <ListItem\n action={{ icon: MailIcon, onPress: onPress(`mailto:${email}`) }}\n dark\n title={labels.email}\n value={email}\n />\n )}\n {email && phone && <Separator dark />}\n {phone && (\n <ListItem\n action={{ icon: PhoneIcon, onPress: onPress(`tel:${phone}`) }}\n dark\n title={labels.phone}\n value={phone}\n />\n )}\n </View>\n </View>\n );\n};\n\nexport type TrustInfoDetailsScreenProps = {\n countries: {\n display: Record<string, string>;\n value: string;\n }[];\n labels: TrustInfoDetailsScreenLabels;\n language: string;\n onClose: () => void;\n testID: string;\n trustInformation: TrustInformationDetail;\n};\n\nconst TrustInfoDetailsScreen: FC<TrustInfoDetailsScreenProps> = ({\n countries,\n labels,\n language,\n onClose,\n testID,\n trustInformation,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [expanded, setExpanded] = useState(false);\n\n const linkHandler = useCallback(\n (url: string) => () => {\n Linking.openURL(url).catch((e) => {\n reportException(e, `Error opening contact link ${url}`);\n });\n },\n [],\n );\n\n const trustDetails = trustInformation.eudiEcosystem;\n if (!trustDetails) {\n return null;\n }\n\n const countryDisplay = countries.find((c) => c.value === trustDetails.country)?.display;\n const country = countryDisplay?.[language] ?? countryDisplay?.en;\n\n const baseInfo: TrustInfoDetailItem[] = [\n {\n name: trustDetails.name,\n type: 'trustInfo',\n },\n {\n title: labels.isPublicSector,\n type: 'item',\n value: trustDetails.isPublicSector ? labels.true : undefined,\n },\n {\n title: labels.serviceDescription,\n type: 'item',\n value: trustDetails.serviceDescription[0]?.[language],\n },\n ];\n\n const expandItem: TrustInfoDetailItem[] = !expanded ? [{ type: 'expand' }] : [];\n\n const supervisoryAuthority: TrustInfoDetailItem[] = trustDetails.supervisoryAuthority\n ? [\n {\n title: labels.supervisoryAuthority,\n type: 'subsection',\n },\n {\n ...trustDetails.supervisoryAuthority,\n type: 'contact',\n website: trustDetails.supervisoryAuthority.uri,\n },\n ]\n : [];\n\n const extraInfo: TrustInfoDetailItem[] = expanded\n ? [\n {\n title: labels.country,\n type: 'item',\n value: country,\n },\n {\n title: labels.identifier,\n type: 'item',\n value: trustDetails.identifier,\n },\n {\n title: labels.support,\n type: 'subsection',\n },\n {\n type: 'contact',\n ...trustDetails,\n },\n ...supervisoryAuthority,\n { type: 'collapse' },\n ]\n : [];\n\n const trustDetailsSection = baseInfo.concat(expandItem).concat(extraInfo);\n\n const intermediaryName: TrustInfoDetailItem[] = trustDetails.intermediary?.name\n ? [\n {\n name: trustDetails.intermediary.name,\n type: 'trustInfo',\n },\n ]\n : [];\n\n const intermediarySection: TrustInfoDetailItem[] = trustDetails.intermediary\n ? [\n ...intermediaryName,\n {\n title: labels.country,\n type: 'item',\n value: trustDetails.intermediary.country,\n },\n {\n title: labels.identifier,\n type: 'item',\n value: trustDetails.intermediary.identifier,\n },\n {\n title: labels.support,\n type: 'subsection',\n },\n {\n type: 'contact',\n ...trustDetails.intermediary,\n },\n ]\n : [];\n\n const sections: SectionListData<TrustInfoDetailItem, TrustInfoDetailSection>[] = [\n {\n ItemSeparatorComponent: Separator,\n data: trustDetailsSection,\n },\n intermediarySection.length\n ? {\n ItemSeparatorComponent: Separator,\n data: intermediarySection,\n title: 'Intermediary',\n }\n : undefined,\n ].filter(nonEmptyFilter);\n\n return (\n <View style={styles.container}>\n <NavigationHeader\n leftItem={<BackButton onPress={onClose} />}\n style={{\n paddingTop: insets.top,\n }}\n title={labels.title}\n />\n <SectionList<TrustInfoDetailItem, TrustInfoDetailSection>\n contentInset={insets}\n renderItem={({ item, section }) => {\n switch (item.type) {\n case 'subsection':\n return (\n <View\n style={[styles.subsection, { backgroundColor: colorScheme.white }]}\n testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.text} preset=\"m/heading\">\n {item.title}\n </Typography>\n </View>\n );\n case 'trustInfo':\n return (\n <TrustInfo\n labels={labels}\n style={[styles.trustInfoItem, styles.firstItem, { backgroundColor: colorScheme.white }]}\n trustInformation={item}\n />\n );\n case 'item':\n if (!item.value) {\n return <View style={styles.emptyItem} />;\n }\n return <ListItem {...item} value={item.value} />;\n case 'contact':\n if (!item.website && !item.phone && !item.email) {\n return <View style={styles.emptyItem} />;\n }\n return <ContactItem labels={labels} onPress={linkHandler} {...item} />;\n case 'expand':\n return <ListButton label={labels.expand} onPress={() => setExpanded(true)} />;\n case 'collapse':\n return <ListButton label={labels.collapse} onPress={() => setExpanded(false)} />;\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.text} preset=\"m/heading\" style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n showsVerticalScrollIndicator={false}\n stickySectionHeadersEnabled={false}\n style={styles.list}\n testID={testID}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n actionButton: {\n alignItems: 'center',\n borderRadius: 19,\n height: 38,\n justifyContent: 'center',\n width: 38,\n },\n button: {\n height: 64,\n justifyContent: 'center',\n paddingBottom: 8,\n width: '100%',\n },\n contactItem: {\n borderRadius: 8,\n },\n contactItemWrapper: {\n padding: 12,\n },\n container: {\n flex: 1,\n },\n emptyItem: {\n height: 0,\n },\n firstItem: {\n borderTopLeftRadius: 8,\n borderTopRightRadius: 8,\n },\n item: {\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 12,\n },\n itemLabels: {\n flexDirection: 'column',\n },\n itemTitleLabel: {\n opacity: 0.5,\n },\n lastItem: {\n borderBottomLeftRadius: 8,\n borderBottomRightRadius: 8,\n },\n list: {\n marginHorizontal: 16,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n separator: {\n height: 1,\n marginHorizontal: 12,\n opacity: 0.4,\n },\n subsection: {\n paddingBottom: 8,\n paddingHorizontal: 12,\n paddingTop: 22,\n },\n trustInfoItem: {\n padding: 8,\n },\n});\n\nexport default TrustInfoDetailsScreen;\n"],"mappings":";AACA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAASC,OAAO,EAAEC,WAAW,EAAmBC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACtF,SAASC,iBAAiB,QAAQ,gCAAgC;AAGlE,OAAOC,SAAS,MAA2B,wCAAwC;AACnF,SAASC,YAAY,EAAEC,cAAc,EAAEC,eAAe,QAAQ,aAAa;AAC3E,SAASC,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Aa,EAAE,KAAK;IACpBP,cAAc,EAAE,eAAe;IAC/BG,OAAO,EAAE;EACX,CAAC;EACDxF,UAAU,EAAE;IACV4F,aAAa,EAAE;EACjB,CAAC;EACDzF,cAAc,EAAE;IACd0F,OAAO,EAAE;EACX,CAAC;EACDtG,QAAQ,EAAE;IACRuG,sBAAsB,EAAE,CAAC;IACzBC,uBAAuB,EAAE;EAC3B,CAAC;EACDf,IAAI,EAAE;IACJgB,gBAAgB,EAAE;EACpB,CAAC;EACDrB,sBAAsB,EAAE;IACtBU,cAAc,EAAE,QAAQ;IACxBY,SAAS,EAAE,EAAE;IACbC,eAAe,EAAE;EACnB,CAAC;EACDtB,iBAAiB,EAAE;IACjBiB,OAAO,EAAE,GAAG;IACZM,iBAAiB,EAAE;EACrB,CAAC;EACDlH,SAAS,EAAE;IACTmG,MAAM,EAAE,CAAC;IACTY,gBAAgB,EAAE,EAAE;IACpBH,OAAO,EAAE;EACX,CAAC;EACDzB,UAAU,EAAE;IACVmB,aAAa,EAAE,CAAC;IAChBY,iBAAiB,EAAE,EAAE;IACrBpC,UAAU,EAAE;EACd,CAAC;EACDM,aAAa,EAAE;IACbmB,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAe1E,sBAAsB","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- var _I18nManager$getConst, _ref;
1
+ var _ref;
2
2
  // Date & Time formatted as specified in SW-610
3
3
 
4
4
  import { I18nManager, Platform, Settings } from 'react-native';
@@ -7,7 +7,7 @@ const MINUTE = 60 * 1000;
7
7
  const DAY = 24 * 60 * MINUTE;
8
8
 
9
9
  // OS locale
10
- const systemLocale = (_I18nManager$getConst = I18nManager.getConstants().localeIdentifier) === null || _I18nManager$getConst === void 0 ? void 0 : _I18nManager$getConst.replace(/_/g, '-').split(/[#@]/)[0].replace(/-$/, '');
10
+ const systemLocale = (_ref = Platform.OS === 'ios' ? Settings.get('AppleLocale') : I18nManager.getConstants().localeIdentifier) === null || _ref === void 0 || (_ref = _ref.match(/[a-zA-Z]+_[a-zA-Z]+/)[0]) === null || _ref === void 0 ? void 0 : _ref.replaceAll('_', '-');
11
11
 
12
12
  /**
13
13
  * Date only format
@@ -129,11 +129,10 @@ export const formatDateOnlyFromUTCTimestamp = utcTimestamp => {
129
129
  const utcDate = new Date(utcTimestamp);
130
130
  return (_formatDate = formatDate(convertDateStrToLocalDate(`${utcDate.getUTCFullYear()}-${pad(utcDate.getUTCMonth() + 1)}-${pad(utcDate.getUTCDate())}`))) !== null && _formatDate !== void 0 ? _formatDate : '';
131
131
  };
132
- const locale = (_ref = Platform.OS === 'ios' ? Settings.get('AppleLocale') : I18nManager.getConstants().localeIdentifier) === null || _ref === void 0 ? void 0 : _ref.split('@')[0].replace('_', '-');
133
132
  export const formatDateTimeLocalized = date => {
134
- return formatDateTime(date, locale);
133
+ return formatDateTime(date, systemLocale);
135
134
  };
136
135
  export const formatDateLocalized = date => {
137
- return formatDate(date, locale);
136
+ return formatDate(date, systemLocale);
138
137
  };
139
138
  //# sourceMappingURL=date.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["I18nManager","Platform","Settings","format","MINUTE","DAY","systemLocale","_I18nManager$getConst","getConstants","localeIdentifier","replace","split","formatDate","date","locale","options","toLocaleDateString","undefined","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","formatTimestamp","nowLabel","_formatDateTime2","now","Date","timestamp","getTime","_formatDateTime","pad","x","String","convertDateToUTCTimestamp","parse","getMonth","getDate","convertDateStrToLocalDate","select","android","timezoneOffset","getTimezoneOffset","default","formatDateOnlyFromUTCTimestamp","utcTimestamp","_formatDate","utcDate","getUTCFullYear","getUTCMonth","getUTCDate","_ref","OS","get","formatDateTimeLocalized","formatDateLocalized"],"sources":["date.ts"],"sourcesContent":["// Date & Time formatted as specified in SW-610\n\nimport { I18nManager, Platform, Settings } from 'react-native';\nimport { format } from 'timeago.js';\n\nconst MINUTE = 60 * 1000;\nconst DAY = 24 * 60 * MINUTE;\n\n// OS locale\nconst systemLocale: string | undefined = I18nManager.getConstants()\n .localeIdentifier?.replace(/_/g, '-')\n .split(/[#@]/)[0]\n .replace(/-$/, '');\n\n/**\n * Date only format\n */\nexport const formatDate = (date: Date, locale?: string, options?: Intl.DateTimeFormatOptions) => {\n try {\n return date.toLocaleDateString(locale || systemLocale, options);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Time only format\n */\nexport const formatTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleTimeString(locale || systemLocale, { hour: '2-digit', minute: '2-digit' });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Date and time format\n */\nexport const formatDateTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleString(locale || systemLocale, {\n hour: '2-digit',\n minute: '2-digit',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour12: locale === 'en-US',\n });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Month format\n */\nexport const formatMonth = (date: Date, locale: string): string => {\n return `${date.toLocaleString(locale, {\n month: 'long',\n })} ${date.getFullYear()}`;\n};\n\n/**\n * Time-ago format\n */\nexport const formatTimeAgo = (date: Date, locale: string): string => {\n return format(date, locale);\n};\n\n/**\n * Timestamp formatted for general use\n */\nexport const formatTimestamp = (date: Date, locale: string, nowLabel: string): string => {\n const now = Date.now();\n const timestamp = date.getTime();\n if (now < timestamp) {\n // in the future\n return formatDateTime(date, locale) ?? '';\n }\n\n // in the past\n if (now - timestamp < MINUTE) {\n // less than a minute ago\n return nowLabel;\n }\n\n // less than a day ago\n if (now - timestamp < DAY) {\n return formatTimeAgo(date, locale);\n }\n\n // longer ago\n return formatDateTime(date, locale) ?? '';\n};\n\nconst pad = (x: number) => (x >= 0 && x < 10 ? `0${x}` : String(x));\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {Date} date local timezone representation\n * @returns {number} the same day, but UTC timezone with midnight time\n */\nexport const convertDateToUTCTimestamp = (date: Date): number =>\n Date.parse(`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`);\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {string} date in YYYY-MM-DD representation\n * @returns {Date} the same day, but local timezone with midnight time\n */\nexport const convertDateStrToLocalDate = (date: string): Date =>\n Platform.select({\n // android conversion using the standard date parsing doesn't work, computing the timestamp manually\n android: (() => {\n const timestamp = Date.parse(date);\n const timezoneOffset = new Date(date).getTimezoneOffset();\n return new Date(timestamp + timezoneOffset * MINUTE);\n })(),\n default: new Date(`${date}T00:00:00`),\n });\n\n/**\n * Inverted function to {@link convertDateToUTCTimestamp}\n * @param {number} utcTimestamp date timestamp represented as midnight UTC time\n * @returns {string} formatted date (based on locale settings, e.g. `21/02/2021`)\n */\nexport const formatDateOnlyFromUTCTimestamp = (utcTimestamp: number): string => {\n const utcDate = new Date(utcTimestamp);\n return (\n formatDate(\n convertDateStrToLocalDate(\n `${utcDate.getUTCFullYear()}-${pad(utcDate.getUTCMonth() + 1)}-${pad(utcDate.getUTCDate())}`,\n ),\n ) ?? ''\n );\n};\n\nconst locale = (\n Platform.OS === 'ios'\n ? Settings.get('AppleLocale')\n : I18nManager.getConstants().localeIdentifier\n)\n ?.split('@')[0]\n .replace('_', '-');\n\nexport const formatDateTimeLocalized = (date: Date) => {\n return formatDateTime(date, locale);\n};\n\nexport const formatDateLocalized = (date: Date) => {\n return formatDate(date, locale);\n};\n"],"mappings":";AAAA;;AAEA,SAASA,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAC9D,SAASC,MAAM,QAAQ,YAAY;AAEnC,MAAMC,MAAM,GAAG,EAAE,GAAG,IAAI;AACxB,MAAMC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAGD,MAAM;;AAE5B;AACA,MAAME,YAAgC,IAAAC,qBAAA,GAAGP,WAAW,CAACQ,YAAY,CAAC,CAAC,CAChEC,gBAAgB,cAAAF,qBAAA,uBADsBA,qBAAA,CACpBG,OAAO,CAAC,IAAI,E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CAAC,CAAC,CAAC,CAAC,CACdD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AAEpB,OAAO,MAAMoD,uBAAuB,GAAIjD,IAAU,IAAK;EACrD,OAAOS,cAAc,CAACT,IAAI,EAAEC,MAAM,CAAC;AACrC,CAAC;AAED,OAAO,MAAMiD,mBAAmB,GAAIlD,IAAU,IAAK;EACjD,OAAOD,UAAU,CAACC,IAAI,EAAEC,MAAM,CAAC;AACjC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["I18nManager","Platform","Settings","format","MINUTE","DAY","systemLocale","_ref","OS","get","getConstants","localeIdentifier","match","replaceAll","formatDate","date","locale","options","toLocaleDateString","undefined","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","formatTimestamp","nowLabel","_formatDateTime2","now","Date","timestamp","getTime","_formatDateTime","pad","x","String","convertDateToUTCTimestamp","parse","getMonth","getDate","convertDateStrToLocalDate","select","android","timezoneOffset","getTimezoneOffset","default","formatDateOnlyFromUTCTimestamp","utcTimestamp","_formatDate","utcDate","getUTCFullYear","getUTCMonth","getUTCDate","formatDateTimeLocalized","formatDateLocalized"],"sources":["date.ts"],"sourcesContent":["// Date & Time formatted as specified in SW-610\n\nimport { I18nManager, Platform, Settings } from 'react-native';\nimport { format } from 'timeago.js';\n\nconst MINUTE = 60 * 1000;\nconst DAY = 24 * 60 * MINUTE;\n\n// OS locale\nconst systemLocale: string | undefined = (\n Platform.OS === 'ios' ? Settings.get('AppleLocale') : I18nManager.getConstants().localeIdentifier\n)\n ?.match(/[a-zA-Z]+_[a-zA-Z]+/)[0]\n ?.replaceAll('_', '-');\n\n/**\n * Date only format\n */\nexport const formatDate = (date: Date, locale?: string, options?: Intl.DateTimeFormatOptions) => {\n try {\n return date.toLocaleDateString(locale || systemLocale, options);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Time only format\n */\nexport const formatTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleTimeString(locale || systemLocale, { hour: '2-digit', minute: '2-digit' });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Date and time format\n */\nexport const formatDateTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleString(locale || systemLocale, {\n hour: '2-digit',\n minute: '2-digit',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour12: locale === 'en-US',\n });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Month format\n */\nexport const formatMonth = (date: Date, locale: string): string => {\n return `${date.toLocaleString(locale, {\n month: 'long',\n })} ${date.getFullYear()}`;\n};\n\n/**\n * Time-ago format\n */\nexport const formatTimeAgo = (date: Date, locale: string): string => {\n return format(date, locale);\n};\n\n/**\n * Timestamp formatted for general use\n */\nexport const formatTimestamp = (date: Date, locale: string, nowLabel: string): string => {\n const now = Date.now();\n const timestamp = date.getTime();\n if (now < timestamp) {\n // in the future\n return formatDateTime(date, locale) ?? '';\n }\n\n // in the past\n if (now - timestamp < MINUTE) {\n // less than a minute ago\n return nowLabel;\n }\n\n // less than a day ago\n if (now - timestamp < DAY) {\n return formatTimeAgo(date, locale);\n }\n\n // longer ago\n return formatDateTime(date, locale) ?? '';\n};\n\nconst pad = (x: number) => (x >= 0 && x < 10 ? `0${x}` : String(x));\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {Date} date local timezone representation\n * @returns {number} the same day, but UTC timezone with midnight time\n */\nexport const convertDateToUTCTimestamp = (date: Date): number =>\n Date.parse(`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`);\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {string} date in YYYY-MM-DD representation\n * @returns {Date} the same day, but local timezone with midnight time\n */\nexport const convertDateStrToLocalDate = (date: string): Date =>\n Platform.select({\n // android conversion using the standard date parsing doesn't work, computing the timestamp manually\n android: (() => {\n const timestamp = Date.parse(date);\n const timezoneOffset = new Date(date).getTimezoneOffset();\n return new Date(timestamp + timezoneOffset * MINUTE);\n })(),\n default: new Date(`${date}T00:00:00`),\n });\n\n/**\n * Inverted function to {@link convertDateToUTCTimestamp}\n * @param {number} utcTimestamp date timestamp represented as midnight UTC time\n * @returns {string} formatted date (based on locale settings, e.g. `21/02/2021`)\n */\nexport const formatDateOnlyFromUTCTimestamp = (utcTimestamp: number): string => {\n const utcDate = new Date(utcTimestamp);\n return (\n formatDate(\n convertDateStrToLocalDate(\n `${utcDate.getUTCFullYear()}-${pad(utcDate.getUTCMonth() + 1)}-${pad(utcDate.getUTCDate())}`,\n ),\n ) ?? ''\n );\n};\n\nexport const formatDateTimeLocalized = (date: Date) => {\n return formatDateTime(date, systemLocale);\n};\n\nexport const formatDateLocalized = (date: Date) => {\n return formatDate(date, systemLocale);\n};\n"],"mappings":";AAAA;;AAEA,SAASA,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAC9D,SAASC,MAAM,QAAQ,YAAY;AAEnC,MAAMC,MAAM,GAAG,EAAE,GAAG,IAAI;AACxB,MAAMC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAGD,MAAM;;AAE5B;AACA,MAAME,YAAgC,IAAAC,IAAA,GACpCN,QAAQ,CAACO,EAAE,KAAK,KAAK,GAAGN,QAAQ,CAACO,GAAG,CAAC,aAAa,CAAC,GAAGT,WAAW,CAACU,YAAY,CAAC,CAAC,CAACC,gBAAgB,cAAAJ,IAAA,gBAAAA,IAAA,GAD1DA,IAAA,CAGrCK,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,cAAAL,IAAA,uBAHMA,IAAA,CAIrCM,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;;AAExB;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAACC,IAAU,EAAEC,MAAe,EAAEC,OAAoC,KAAK;EAC/F,IAAI;IACF,OAAOF,IAAI,CAACG,kBAAkB,CAACF,MAAM,IAAIV,YAAY,EAAEW,OAAO,CAAC;EACjE,CAAC,CAAC,MAAM;IACN,OAAOE,SAAS;E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tB,IAAI,CAAC,CAACqC,iBAAiB,CAAC,CAAC;IACzD,OAAO,IAAIf,IAAI,CAACC,SAAS,GAAGa,cAAc,GAAG/C,MAAM,CAAC;EACtD,CAAC,EAAE,CAAC;EACJiD,OAAO,EAAE,IAAIhB,IAAI,CAAC,GAAGtB,IAAI,WAAW;AACtC,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMuC,8BAA8B,GAAIC,YAAoB,IAAa;EAAA,IAAAC,WAAA;EAC9E,MAAMC,OAAO,GAAG,IAAIpB,IAAI,CAACkB,YAAY,CAAC;EACtC,QAAAC,WAAA,GACE1C,UAAU,CACRkC,yBAAyB,CACvB,GAAGS,OAAO,CAACC,cAAc,CAAC,CAAC,IAAIjB,GAAG,CAACgB,OAAO,CAACE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAIlB,GAAG,CAACgB,OAAO,CAACG,UAAU,CAAC,CAAC,CAAC,EAC5F,CACF,CAAC,cAAAJ,WAAA,cAAAA,WAAA,GAAI,EAAE;AAEX,CAAC;AAED,OAAO,MAAMK,uBAAuB,GAAI9C,IAAU,IAAK;EACrD,OAAOS,cAAc,CAACT,IAAI,EAAET,YAAY,CAAC;AAC3C,CAAC;AAED,OAAO,MAAMwD,mBAAmB,GAAI/C,IAAU,IAAK;EACjD,OAAOD,UAAU,CAACC,IAAI,EAAET,YAAY,CAAC;AACvC,CAAC","ignoreList":[]}
@@ -2,9 +2,10 @@ import { CacheType } from '@procivis/react-native-one-core';
2
2
  import { useMutation, useQueryClient } from 'react-query';
3
3
  import { useONECore } from './core-context';
4
4
  import { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';
5
- import { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';
5
+ import { VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY } from './verifier-instance';
6
+ import { WALLET_UNIT_QUERY_KEY, WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY } from './wallet-unit';
6
7
  const CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];
7
- const TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];
8
+ const WALLET_VERIFIER_INSTANCE_QUERY_KEYS = [WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY, WALLET_UNIT_QUERY_KEY, VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY];
8
9
 
9
10
  // Map each CacheType to the query keys that should be invalidated when that cache is cleared.
10
11
  const cacheTypeToQueryKeys = {
@@ -13,10 +14,13 @@ const cacheTypeToQueryKeys = {
13
14
  [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
14
15
  [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
15
16
  [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
16
- [CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
17
+ [CacheType.TRUST_LIST]: CREDENTIAL_QUERY_KEYS,
17
18
  [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
18
19
  [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
19
- [CacheType.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS
20
+ [CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,
21
+ [CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS,
22
+ [CacheType.WALLET_PROVIDER_METADATA]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,
23
+ [CacheType.REMOTE_TRUST_COLLECTION]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS
20
24
  };
21
25
  export const useCacheClear = () => {
22
26
  const queryClient = useQueryClient();
@@ -1 +1 @@
1
- {"version":3,"names":["CacheType","useMutation","useQueryClient","useONECore","CREDENTIAL_DETAIL_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_LIST_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","TRUST_ENTITY_DETAIL_QUERY_KEY","CREDENTIAL_QUERY_KEYS","TRUST_ENTITY_QUERY_KEYS","cacheTypeToQueryKeys","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","OPEN_ID_METADATA","useCacheClear","queryClient","core","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries"],"sources":["cache.ts"],"sourcesContent":["import { CacheType } from '@procivis/react-native-one-core';\nimport { useMutation, useQueryClient } from 'react-query';\n\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';\nimport { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];\n\n// Map each CacheType to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheType, string[]> = {\n [CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],\n [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS,\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheType[]) => {\n await core.deleteCache(cacheTypes);\n return cacheTypes;\n },\n {\n onSuccess: async (_, cacheTypes) => {\n const queryKeysToInvalidate = new Set<string>();\n\n cacheTypes.forEach((cacheType) => {\n const keys = cacheTypeToQueryKeys[cacheType] || [];\n keys.forEach((key) => queryKeysToInvalidate.add(key));\n });\n\n await Promise.all([...queryKeysToInvalidate].map((queryKey) => queryClient.invalidateQueries(queryKey)));\n },\n },\n );\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,iCAAiC;AAC3D,SAASC,WAAW,EAAEC,cAAc,QAAQ,aAAa;AAEzD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,2BAA2B,EAAEC,+BAA+B,EAAEC,yBAAyB,QAAQ,eAAe;AACvH,SAASC,oCAAoC,EAAEC,6BAA6B,QAAQ,gBAAgB;AAEpG,MAAMC,qBAAqB,GAAG,CAACH,yBAAyB,EAAED,+BAA+B,EAAED,2BAA2B,CAAC;AACvH,MAAMM,uBAAuB,GAAG,CAACF,6BAA6B,EAAED,oCAAoC,CAAC;;AAErG;AACA,MAAMI,oBAAiD,GAAG;EACxD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CAAC;IAC1G;EACF,CACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["CacheType","useMutation","useQueryClient","useONECore","CREDENTIAL_DETAIL_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_LIST_QUERY_KEY","VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY","WALLET_UNIT_QUERY_KEY","WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY","CREDENTIAL_QUERY_KEYS","WALLET_VERIFIER_INSTANCE_QUERY_KEYS","cacheTypeToQueryKeys","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","OPEN_ID_METADATA_HOLDER","OPEN_ID_METADATA_ISSUER","WALLET_PROVIDER_METADATA","REMOTE_TRUST_COLLECTION","useCacheClear","queryClient","core","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries"],"sources":["cache.ts"],"sourcesContent":["import { CacheType } from '@procivis/react-native-one-core';\nimport { useMutation, useQueryClient } from 'react-query';\n\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';\nimport { VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY } from './verifier-instance';\nimport { WALLET_UNIT_QUERY_KEY, WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY } from './wallet-unit';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst WALLET_VERIFIER_INSTANCE_QUERY_KEYS = [\n WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY,\n WALLET_UNIT_QUERY_KEY,\n VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY,\n];\n\n// Map each CacheType to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheType, string[]> = {\n [CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.TRUST_LIST]: CREDENTIAL_QUERY_KEYS,\n [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS,\n [CacheType.WALLET_PROVIDER_METADATA]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,\n [CacheType.REMOTE_TRUST_COLLECTION]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheType[]) => {\n await core.deleteCache(cacheTypes);\n return cacheTypes;\n },\n {\n onSuccess: async (_, cacheTypes) => {\n const queryKeysToInvalidate = new Set<string>();\n\n cacheTypes.forEach((cacheType) => {\n const keys = cacheTypeToQueryKeys[cacheType] || [];\n keys.forEach((key) => queryKeysToInvalidate.add(key));\n });\n\n await Promise.all([...queryKeysToInvalidate].map((queryKey) => queryClient.invalidateQueries(queryKey)));\n },\n },\n );\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,iCAAiC;AAC3D,SAASC,WAAW,EAAEC,cAAc,QAAQ,aAAa;AAEzD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;EACnB,CAAC,EACD;IACEE,SAAS,EAAE,MAAAA,CAAOC,CAAC,EAAEH,UAAU,KAAK;MAClC,MAAMI,qBAAqB,GAAG,IAAIC,GAAG,CAAS,CAAC;MAE/CL,UAAU,CAACM,OAAO,CAAEC,SAAS,IAAK;QAChC,MAAMC,IAAI,GAAGxB,oBAAoB,CAACuB,SAAS,CAAC,IAAI,EAAE;QAClDC,IAAI,CAACF,OAAO,CAAEG,GAAG,IAAKL,qBAAqB,CAACM,GAAG,CAACD,GAAG,CAAC,CAAC;MACvD,CAAC,CAAC;MAEF,MAAME,OAAO,CAACC,GAAG,CAAC,CAAC,GAAGR,qBAAqB,CAAC,CAACS,GAAG,CAAEC,QAAQ,IAAKhB,WAAW,CAACiB,iBAAiB,CAACD,QAAQ,CAAC,CAAC,CAAC;IAC1G;EACF,CACF,CAAC;AACH,CAAC","ignoreList":[]}
@@ -16,8 +16,4 @@ export const getEnabledTransports = config => {
16
16
  export const getEnabledExchangeProtocols = exchangeProtocol => {
17
17
  return Object.values(exchangeProtocol !== null && exchangeProtocol !== void 0 ? exchangeProtocol : {}).filter(t => t.enabled !== false).map(exchange => exchange.type);
18
18
  };
19
- export const getEnabledTrustManagement = config => {
20
- var _config$trustManageme;
21
- return Object.values((_config$trustManageme = config === null || config === void 0 ? void 0 : config.trustManagement) !== null && _config$trustManageme !== void 0 ? _config$trustManageme : {}).filter(t => t.enabled !== false).map(trustManagement => trustManagement.type);
22
- };
23
19
  //# sourceMappingURL=core-config.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useQuery","useONECore","CONFIG_QUERY_KEY","useCoreConfig","core","getConfig","keepPreviousData","getEnabledTransports","config","_config$transport","Object","values","transport","filter","t","enabled","map","type","getEnabledExchangeProtocols","exchangeProtocol","exchange","getEnabledTrustManagement","_config$trustManageme","trustManagement"],"sources":["core-config.ts"],"sourcesContent":["import { ConfigEntities,CoreConfig } from '@procivis/react-native-one-core';\nimport { useQuery } from 'react-query';\n\nimport { useONECore } from './core-context';\n\nconst CONFIG_QUERY_KEY = 'config';\n\nexport const useCoreConfig = () => {\n const { core } = useONECore();\n\n return useQuery([CONFIG_QUERY_KEY], () => core?.getConfig(), {\n keepPreviousData: true,\n });\n};\n\nexport const getEnabledTransports = (config: CoreConfig): string[] => {\n return Object.values(config?.transport ?? {})\n .filter((t) => t.enabled !== false)\n .map((transport) => transport.type);\n};\n\nexport const getEnabledExchangeProtocols = (exchangeProtocol: ConfigEntities<any>): string[] => {\n return Object.values(exchangeProtocol ?? {})\n .filter((t) => t.enabled !== false)\n .map((exchange) => exchange.type);\n};\n\nexport const getEnabledTrustManagement = (config: CoreConfig): string[] => {\n return Object.values(config?.trustManagement ?? {})\n .filter((t) => t.enabled !== false)\n .map((trustManagement) => trustManagement.type);\n};\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,aAAa;AAEtC,SAASC,UAAU,QAAQ,gBAAgB;AAE3C,MAAMC,gBAAgB,GAAG,QAAQ;AAEjC,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAGH,UAAU,CAAC,CAAC;EAE7B,OAAOD,QAAQ,CAAC,CAACE,gBAAgB,CAAC,EAAE,MAAME,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEC,SAAS,CAAC,CAAC,EAAE;IAC3DC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMC,oBAAoB,GAAIC,MAAkB,IAAe;EAAA,IAAAC,iBAAA;EACpE,OAAOC,MAAM,CAACC,MAAM,EAAAF,iBAAA,GAACD,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEI,SAAS,cAAAH,iBAAA,cAAAA,iBAAA,GAAI,CAAC,CAAC,CAAC,CAC1CI,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEJ,SAAS,IAAKA,SAAS,CAACK,IAAI,CAAC;AACvC,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAIC,gBAAqC,IAAe;EAC9F,OAAOT,MAAM,CAACC,MAAM,CAACQ,gBAAgB,aAAhBA,gBAAgB,cAAhBA,gBAAgB,GAAI,CAAC,CAAC,CAAC,CACzCN,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEI,QAAQ,IAAKA,QAAQ,CAACH,IAAI,CAAC;AACrC,CAAC;AAED,OAAO,MAAMI,yBAAyB,GAAIb,MAAkB,IAAe;EAAA,IAAAc,qBAAA;EACzE,OAAOZ,MAAM,CAACC,MAAM,EAAAW,qBAAA,GAACd,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEe,eAAe,cAAAD,qBAAA,cAAAA,qBAAA,GAAI,CAAC,CAAC,CAAC,CAChDT,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEO,eAAe,IAAKA,eAAe,CAACN,IAAI,CAAC;AACnD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useQuery","useONECore","CONFIG_QUERY_KEY","useCoreConfig","core","getConfig","keepPreviousData","getEnabledTransports","config","_config$transport","Object","values","transport","filter","t","enabled","map","type","getEnabledExchangeProtocols","exchangeProtocol","exchange"],"sources":["core-config.ts"],"sourcesContent":["import { ConfigEntities, CoreConfig } from '@procivis/react-native-one-core';\nimport { useQuery } from 'react-query';\n\nimport { useONECore } from './core-context';\n\nconst CONFIG_QUERY_KEY = 'config';\n\nexport const useCoreConfig = () => {\n const { core } = useONECore();\n\n return useQuery([CONFIG_QUERY_KEY], () => core?.getConfig(), {\n keepPreviousData: true,\n });\n};\n\nexport const getEnabledTransports = (config: CoreConfig): string[] => {\n return Object.values(config?.transport ?? {})\n .filter((t) => t.enabled !== false)\n .map((transport) => transport.type);\n};\n\nexport const getEnabledExchangeProtocols = (exchangeProtocol: ConfigEntities<any>): string[] => {\n return Object.values(exchangeProtocol ?? {})\n .filter((t) => t.enabled !== false)\n .map((exchange) => exchange.type);\n};\n\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,aAAa;AAEtC,SAASC,UAAU,QAAQ,gBAAgB;AAE3C,MAAMC,gBAAgB,GAAG,QAAQ;AAEjC,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAGH,UAAU,CAAC,CAAC;EAE7B,OAAOD,QAAQ,CAAC,CAACE,gBAAgB,CAAC,EAAE,MAAME,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEC,SAAS,CAAC,CAAC,EAAE;IAC3DC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMC,oBAAoB,GAAIC,MAAkB,IAAe;EAAA,IAAAC,iBAAA;EACpE,OAAOC,MAAM,CAACC,MAAM,EAAAF,iBAAA,GAACD,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEI,SAAS,cAAAH,iBAAA,cAAAA,iBAAA,GAAI,CAAC,CAAC,CAAC,CAC1CI,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEJ,SAAS,IAAKA,SAAS,CAACK,IAAI,CAAC;AACvC,CAAC;AAED,OAAO,MAAMC,2BAA2B,GAAIC,gBAAqC,IAAe;EAC9F,OAAOT,MAAM,CAACC,MAAM,CAACQ,gBAAgB,aAAhBA,gBAAgB,cAAhBA,gBAAgB,GAAI,CAAC,CAAC,CAAC,CACzCN,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEI,QAAQ,IAAKA,QAAQ,CAACH,IAAI,CAAC;AACrC,CAAC","ignoreList":[]}
@@ -1,8 +1,6 @@
1
1
  import { initializeCore } from '@procivis/react-native-one-core';
2
2
  import React, { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';
3
3
  import { reportException } from '../../reporting';
4
- import { getEnabledTrustManagement } from './core-config';
5
- import { TrustManagementEnum, useCreateTrustAnchor } from './trust-entity';
6
4
  const defaultContextValue = {
7
5
  core: {},
8
6
  organisationId: '11111111-2222-3333-a444-ffffffffffff',
@@ -12,11 +10,9 @@ const ONECoreContext = /*#__PURE__*/createContext(defaultContextValue);
12
10
  export const ONECoreContextProvider = ({
13
11
  children,
14
12
  organisationId = defaultContextValue.organisationId,
15
- publisherReference,
16
13
  config
17
14
  }) => {
18
15
  const [core, setCore] = useState();
19
- const createTrustAnchor = useCreateTrustAnchor();
20
16
  const initialize = useCallback(async force => {
21
17
  if (core && !force) {
22
18
  return core;
@@ -40,17 +36,6 @@ export const ONECoreContextProvider = ({
40
36
  },
41
37
  // eslint-disable-next-line react-hooks/exhaustive-deps
42
38
  []);
43
- useEffect(() => {
44
- if (!core || !publisherReference) {
45
- return;
46
- }
47
- core.getConfig().then(coreConfig => {
48
- const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(TrustManagementEnum.SimpleTrustList);
49
- if (trustManagementEnabled) {
50
- createTrustAnchor(core, publisherReference).catch(() => {});
51
- }
52
- }).catch(() => {});
53
- }, [core, createTrustAnchor, publisherReference]);
54
39
  const contextValue = useMemo(() => ({
55
40
  core: core !== null && core !== void 0 ? core : defaultContextValue.core,
56
41
  organisationId,