@procivis/one-react-native-components 0.3.95 → 0.3.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
  4. package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
  5. package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -2
  6. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
  7. package/lib/commonjs/components/entity/entity-details.js +3 -3
  8. package/lib/commonjs/components/entity/entity-details.js.map +1 -1
  9. package/lib/commonjs/components/history/history-details-screen.js +10 -10
  10. package/lib/commonjs/components/history/history-details-screen.js.map +1 -1
  11. package/lib/commonjs/components/history/history-list-item-icon.js +10 -8
  12. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  13. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  14. package/lib/commonjs/components/history/history-list-screen.js +1 -0
  15. package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
  16. package/lib/commonjs/components/history/history-list-section-header.js +1 -1
  17. package/lib/commonjs/components/history/history-list-section-header.js.map +1 -1
  18. package/lib/commonjs/components/history/history-list.js.map +1 -1
  19. package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -1
  20. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
  21. package/lib/commonjs/components/proof-request/v1/share-credential.js +1 -1
  22. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
  23. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
  24. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +3 -2
  25. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  26. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +3 -2
  27. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  28. package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  29. package/lib/commonjs/ui-components/accessibility/locale/fi.json +1 -1
  30. package/lib/commonjs/ui-components/buttons/connectivity-button.js +1 -0
  31. package/lib/commonjs/ui-components/buttons/connectivity-button.js.map +1 -1
  32. package/lib/commonjs/ui-components/buttons/filter-button.js +1 -0
  33. package/lib/commonjs/ui-components/buttons/filter-button.js.map +1 -1
  34. package/lib/commonjs/ui-components/buttons/ghost-button.js +1 -0
  35. package/lib/commonjs/ui-components/buttons/ghost-button.js.map +1 -1
  36. package/lib/commonjs/ui-components/buttons/hold-button.js +1 -0
  37. package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -1
  38. package/lib/commonjs/ui-components/buttons/scan-button.js +3 -0
  39. package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
  40. package/lib/commonjs/ui-components/buttons/share-button.js +1 -0
  41. package/lib/commonjs/ui-components/buttons/share-button.js.map +1 -1
  42. package/lib/commonjs/ui-components/control/checkbox.js +1 -0
  43. package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
  44. package/lib/commonjs/ui-components/credential/card/credential-card.js +1 -0
  45. package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
  46. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +3 -1
  47. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  48. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +1 -0
  49. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  50. package/lib/commonjs/ui-components/credential/card/credential-header.js +1 -0
  51. package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
  52. package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js +2 -0
  53. package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js.map +1 -1
  54. package/lib/commonjs/ui-components/credential/credential-attribute-item.js +1 -0
  55. package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
  56. package/lib/commonjs/ui-components/credential/credential-carousel-images.js +2 -1
  57. package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
  58. package/lib/commonjs/ui-components/credential/selector.js +1 -0
  59. package/lib/commonjs/ui-components/credential/selector.js.map +1 -1
  60. package/lib/commonjs/ui-components/entity/avatar.js +1 -0
  61. package/lib/commonjs/ui-components/entity/avatar.js.map +1 -1
  62. package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
  63. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  64. package/lib/commonjs/ui-components/header/navigation-header.js +1 -0
  65. package/lib/commonjs/ui-components/header/navigation-header.js.map +1 -1
  66. package/lib/commonjs/ui-components/history/history-details.js +3 -1
  67. package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
  68. package/lib/commonjs/ui-components/history/history-section-header.js +1 -1
  69. package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
  70. package/lib/commonjs/ui-components/history/history-section-list-item.js +1 -1
  71. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  72. package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
  73. package/lib/commonjs/ui-components/icons/history.js +1 -0
  74. package/lib/commonjs/ui-components/icons/history.js.map +1 -1
  75. package/lib/commonjs/ui-components/pin/keypad.js +1 -0
  76. package/lib/commonjs/ui-components/pin/keypad.js.map +1 -1
  77. package/lib/commonjs/ui-components/pin/pins.js +1 -0
  78. package/lib/commonjs/ui-components/pin/pins.js.map +1 -1
  79. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  80. package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
  81. package/lib/commonjs/ui-components/settings/button-setting.js +3 -1
  82. package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
  83. package/lib/commonjs/ui-components/settings/setting-item.js +5 -2
  84. package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
  85. package/lib/commonjs/ui-components/settings/settings-button.js +1 -0
  86. package/lib/commonjs/ui-components/settings/settings-button.js.map +1 -1
  87. package/lib/commonjs/ui-components/settings/switch-setting.js +4 -2
  88. package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
  89. package/lib/commonjs/utils/date.js.map +1 -1
  90. package/lib/commonjs/utils/history.js.map +1 -1
  91. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  92. package/lib/commonjs/utils/hooks/core/backup.js +3 -3
  93. package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
  94. package/lib/commonjs/utils/hooks/core/cache.js +10 -10
  95. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  96. package/lib/commonjs/utils/hooks/core/core-context.js +5 -5
  97. package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
  98. package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
  99. package/lib/commonjs/utils/hooks/core/credentials.js +3 -3
  100. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  101. package/lib/commonjs/utils/hooks/core/dids.js +1 -1
  102. package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
  103. package/lib/commonjs/utils/hooks/core/history.js +1 -1
  104. package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
  105. package/lib/commonjs/utils/hooks/core/identifiers.js +3 -3
  106. package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
  107. package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
  108. package/lib/commonjs/utils/hooks/core/proofs.js +9 -9
  109. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  110. package/lib/commonjs/utils/hooks/core/trust-entity.js +5 -5
  111. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
  112. package/lib/commonjs/utils/hooks/core/wallet-unit.js +1 -1
  113. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  114. package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
  115. package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
  116. package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
  117. package/lib/commonjs/utils/parsers/credential-images.js +11 -10
  118. package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
  119. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +11 -8
  120. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  121. package/lib/commonjs/utils/parsers/credential-sharing.js +2 -2
  122. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  123. package/lib/commonjs/utils/parsers/credential.js +29 -16
  124. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  125. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  126. package/lib/commonjs/utils/url.js.map +1 -1
  127. package/lib/module/components/backup/preview-credentials.js.map +1 -1
  128. package/lib/module/components/credential/credential.js.map +1 -1
  129. package/lib/module/components/entity/EntityButtons.js.map +1 -1
  130. package/lib/module/components/entity/entity-attributes.js.map +1 -1
  131. package/lib/module/components/entity/entity-details-with-buttons.js +3 -3
  132. package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
  133. package/lib/module/components/entity/entity-details.js +4 -4
  134. package/lib/module/components/entity/entity-details.js.map +1 -1
  135. package/lib/module/components/history/history-details-screen.js +11 -11
  136. package/lib/module/components/history/history-details-screen.js.map +1 -1
  137. package/lib/module/components/history/history-list-item-icon.js +11 -9
  138. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  139. package/lib/module/components/history/history-list-item.js.map +1 -1
  140. package/lib/module/components/history/history-list-screen.js +1 -0
  141. package/lib/module/components/history/history-list-screen.js.map +1 -1
  142. package/lib/module/components/history/history-list-section-header.js +1 -1
  143. package/lib/module/components/history/history-list-section-header.js.map +1 -1
  144. package/lib/module/components/history/history-list.js.map +1 -1
  145. package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -1
  146. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
  147. package/lib/module/components/proof-request/v1/share-credential.js +2 -2
  148. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
  149. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
  150. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +3 -2
  151. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  152. package/lib/module/components/proof-request/v2/share-credential-v2.js +3 -2
  153. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  154. package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  155. package/lib/module/ui-components/accessibility/locale/fi.json +1 -1
  156. package/lib/module/ui-components/buttons/connectivity-button.js +1 -0
  157. package/lib/module/ui-components/buttons/connectivity-button.js.map +1 -1
  158. package/lib/module/ui-components/buttons/filter-button.js +1 -0
  159. package/lib/module/ui-components/buttons/filter-button.js.map +1 -1
  160. package/lib/module/ui-components/buttons/ghost-button.js +1 -0
  161. package/lib/module/ui-components/buttons/ghost-button.js.map +1 -1
  162. package/lib/module/ui-components/buttons/hold-button.js +1 -0
  163. package/lib/module/ui-components/buttons/hold-button.js.map +1 -1
  164. package/lib/module/ui-components/buttons/scan-button.js +3 -0
  165. package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
  166. package/lib/module/ui-components/buttons/share-button.js +1 -0
  167. package/lib/module/ui-components/buttons/share-button.js.map +1 -1
  168. package/lib/module/ui-components/control/checkbox.js +1 -0
  169. package/lib/module/ui-components/control/checkbox.js.map +1 -1
  170. package/lib/module/ui-components/credential/card/credential-card.js +1 -0
  171. package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
  172. package/lib/module/ui-components/credential/card/credential-details-card.js +3 -1
  173. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  174. package/lib/module/ui-components/credential/card/credential-details-list-item.js +1 -0
  175. package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  176. package/lib/module/ui-components/credential/card/credential-header.js +1 -0
  177. package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
  178. package/lib/module/ui-components/credential/card/credential-image-carousel.js +2 -0
  179. package/lib/module/ui-components/credential/card/credential-image-carousel.js.map +1 -1
  180. package/lib/module/ui-components/credential/credential-attribute-item.js +1 -0
  181. package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
  182. package/lib/module/ui-components/credential/credential-carousel-images.js +2 -1
  183. package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
  184. package/lib/module/ui-components/credential/selector.js +1 -0
  185. package/lib/module/ui-components/credential/selector.js.map +1 -1
  186. package/lib/module/ui-components/entity/avatar.js +1 -0
  187. package/lib/module/ui-components/entity/avatar.js.map +1 -1
  188. package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
  189. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  190. package/lib/module/ui-components/header/navigation-header.js +1 -0
  191. package/lib/module/ui-components/header/navigation-header.js.map +1 -1
  192. package/lib/module/ui-components/history/history-details.js +3 -1
  193. package/lib/module/ui-components/history/history-details.js.map +1 -1
  194. package/lib/module/ui-components/history/history-section-header.js +1 -1
  195. package/lib/module/ui-components/history/history-section-header.js.map +1 -1
  196. package/lib/module/ui-components/history/history-section-list-item.js +1 -1
  197. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  198. package/lib/module/ui-components/icons/entity.js.map +1 -1
  199. package/lib/module/ui-components/icons/history.js +1 -0
  200. package/lib/module/ui-components/icons/history.js.map +1 -1
  201. package/lib/module/ui-components/pin/keypad.js +1 -0
  202. package/lib/module/ui-components/pin/keypad.js.map +1 -1
  203. package/lib/module/ui-components/pin/pins.js +1 -0
  204. package/lib/module/ui-components/pin/pins.js.map +1 -1
  205. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  206. package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
  207. package/lib/module/ui-components/settings/button-setting.js +3 -1
  208. package/lib/module/ui-components/settings/button-setting.js.map +1 -1
  209. package/lib/module/ui-components/settings/setting-item.js +5 -2
  210. package/lib/module/ui-components/settings/setting-item.js.map +1 -1
  211. package/lib/module/ui-components/settings/settings-button.js +1 -0
  212. package/lib/module/ui-components/settings/settings-button.js.map +1 -1
  213. package/lib/module/ui-components/settings/switch-setting.js +4 -2
  214. package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
  215. package/lib/module/utils/date.js.map +1 -1
  216. package/lib/module/utils/history.js.map +1 -1
  217. package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  218. package/lib/module/utils/hooks/core/backup.js +4 -4
  219. package/lib/module/utils/hooks/core/backup.js.map +1 -1
  220. package/lib/module/utils/hooks/core/cache.js +11 -11
  221. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  222. package/lib/module/utils/hooks/core/core-context.js +5 -5
  223. package/lib/module/utils/hooks/core/core-context.js.map +1 -1
  224. package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
  225. package/lib/module/utils/hooks/core/credentials.js +4 -4
  226. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  227. package/lib/module/utils/hooks/core/dids.js +2 -2
  228. package/lib/module/utils/hooks/core/dids.js.map +1 -1
  229. package/lib/module/utils/hooks/core/history.js +1 -1
  230. package/lib/module/utils/hooks/core/history.js.map +1 -1
  231. package/lib/module/utils/hooks/core/identifiers.js +4 -4
  232. package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
  233. package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
  234. package/lib/module/utils/hooks/core/proofs.js +10 -10
  235. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  236. package/lib/module/utils/hooks/core/trust-entity.js +6 -6
  237. package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
  238. package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
  239. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  240. package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
  241. package/lib/module/utils/hooks/revocation/credential-status.js +2 -2
  242. package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
  243. package/lib/module/utils/parsers/credential-images.js +12 -11
  244. package/lib/module/utils/parsers/credential-images.js.map +1 -1
  245. package/lib/module/utils/parsers/credential-sharing-v2.js +11 -8
  246. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  247. package/lib/module/utils/parsers/credential-sharing.js +2 -2
  248. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  249. package/lib/module/utils/parsers/credential.js +30 -17
  250. package/lib/module/utils/parsers/credential.js.map +1 -1
  251. package/lib/module/utils/parsers/query.js.map +1 -1
  252. package/lib/module/utils/url.js.map +1 -1
  253. package/lib/typescript/components/backup/preview-credentials.d.ts +2 -2
  254. package/lib/typescript/components/credential/credential.d.ts +2 -2
  255. package/lib/typescript/components/entity/EntityButtons.d.ts +2 -2
  256. package/lib/typescript/components/entity/entity-attributes.d.ts +2 -2
  257. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -3
  258. package/lib/typescript/components/entity/entity-details.d.ts +5 -5
  259. package/lib/typescript/components/history/history-details-screen.d.ts +2 -2
  260. package/lib/typescript/components/history/history-list-item-icon.d.ts +3 -3
  261. package/lib/typescript/components/history/history-list-item.d.ts +5 -5
  262. package/lib/typescript/components/history/history-list-screen.d.ts +4 -4
  263. package/lib/typescript/components/history/history-list.d.ts +5 -5
  264. package/lib/typescript/components/proof-request/v1/select-credential.d.ts +2 -2
  265. package/lib/typescript/components/proof-request/v1/share-credential.d.ts +6 -6
  266. package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +3 -3
  267. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +4 -4
  268. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +5 -5
  269. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
  270. package/lib/typescript/ui-components/settings/setting-item.d.ts +1 -0
  271. package/lib/typescript/utils/history.d.ts +3 -3
  272. package/lib/typescript/utils/hooks/core/backup.d.ts +3 -3
  273. package/lib/typescript/utils/hooks/core/cache.d.ts +2 -2
  274. package/lib/typescript/utils/hooks/core/core-context.d.ts +1 -1
  275. package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +6 -6
  276. package/lib/typescript/utils/hooks/core/credentials.d.ts +8 -8
  277. package/lib/typescript/utils/hooks/core/dids.d.ts +2 -2
  278. package/lib/typescript/utils/hooks/core/history.d.ts +2 -2
  279. package/lib/typescript/utils/hooks/core/identifiers.d.ts +3 -3
  280. package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
  281. package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -9
  282. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -6
  283. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -5
  284. package/lib/typescript/utils/parsers/credential-images.d.ts +2 -2
  285. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +7 -7
  286. package/lib/typescript/utils/parsers/credential-sharing.d.ts +8 -8
  287. package/lib/typescript/utils/parsers/credential.d.ts +11 -37
  288. package/lib/typescript/utils/parsers/query.d.ts +8 -8
  289. package/package.json +6 -4
  290. package/src/components/backup/preview-credentials.tsx +2 -2
  291. package/src/components/credential/credential.tsx +2 -2
  292. package/src/components/entity/EntityButtons.tsx +2 -2
  293. package/src/components/entity/entity-attributes.tsx +4 -4
  294. package/src/components/entity/entity-details-with-buttons.tsx +11 -6
  295. package/src/components/entity/entity-details.tsx +17 -16
  296. package/src/components/history/history-details-screen.tsx +13 -16
  297. package/src/components/history/history-list-item-icon.tsx +17 -11
  298. package/src/components/history/history-list-item.tsx +9 -5
  299. package/src/components/history/history-list-screen.tsx +5 -4
  300. package/src/components/history/history-list-section-header.tsx +1 -1
  301. package/src/components/history/history-list.tsx +6 -6
  302. package/src/components/proof-request/share-credential-card-notice.tsx +1 -1
  303. package/src/components/proof-request/v1/select-credential.tsx +2 -2
  304. package/src/components/proof-request/v1/share-credential.tsx +13 -11
  305. package/src/components/proof-request/v2/select-credential-v2.tsx +6 -3
  306. package/src/components/proof-request/v2/share-credential-v2-group.tsx +13 -12
  307. package/src/components/proof-request/v2/share-credential-v2.tsx +12 -11
  308. package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +4 -1
  309. package/src/ui-components/accessibility/locale/fi.json +1 -1
  310. package/src/ui-components/buttons/connectivity-button.tsx +1 -0
  311. package/src/ui-components/buttons/filter-button.tsx +1 -0
  312. package/src/ui-components/buttons/ghost-button.stories.tsx +0 -1
  313. package/src/ui-components/buttons/ghost-button.tsx +1 -0
  314. package/src/ui-components/buttons/hold-button.tsx +1 -0
  315. package/src/ui-components/buttons/scan-button.tsx +3 -0
  316. package/src/ui-components/buttons/share-button.tsx +1 -0
  317. package/src/ui-components/control/checkbox.stories.tsx +1 -1
  318. package/src/ui-components/control/checkbox.tsx +1 -0
  319. package/src/ui-components/control/switch.stories.tsx +1 -1
  320. package/src/ui-components/credential/card/credential-card.tsx +1 -0
  321. package/src/ui-components/credential/card/credential-details-card.tsx +2 -0
  322. package/src/ui-components/credential/card/credential-details-list-item.tsx +1 -0
  323. package/src/ui-components/credential/card/credential-header.stories.tsx +0 -1
  324. package/src/ui-components/credential/card/credential-header.tsx +1 -0
  325. package/src/ui-components/credential/card/credential-image-carousel.tsx +2 -2
  326. package/src/ui-components/credential/credential-attribute-item.tsx +1 -0
  327. package/src/ui-components/credential/credential-carousel-images.tsx +1 -0
  328. package/src/ui-components/credential/selector.tsx +1 -0
  329. package/src/ui-components/entity/avatar.tsx +1 -0
  330. package/src/ui-components/entity/entity-cluster.tsx +7 -6
  331. package/src/ui-components/header/foldable-header.tsx +8 -11
  332. package/src/ui-components/header/navigation-header.tsx +1 -0
  333. package/src/ui-components/history/history-details.tsx +2 -0
  334. package/src/ui-components/history/history-section-header.tsx +1 -1
  335. package/src/ui-components/history/history-section-list-item.tsx +1 -1
  336. package/src/ui-components/icons/entity.tsx +2 -2
  337. package/src/ui-components/icons/history.tsx +1 -0
  338. package/src/ui-components/pin/keypad.tsx +1 -0
  339. package/src/ui-components/pin/pin-code-screen.stories.tsx +1 -1
  340. package/src/ui-components/pin/pins.tsx +1 -0
  341. package/src/ui-components/screens/image-preview-screen.stories.tsx +1 -1
  342. package/src/ui-components/screens/nerd-mode-screen.tsx +2 -2
  343. package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +1 -1
  344. package/src/ui-components/screens/section-list-screen.tsx +10 -1
  345. package/src/ui-components/searchbar/search-bar.stories.tsx +0 -1
  346. package/src/ui-components/settings/button-setting.tsx +2 -1
  347. package/src/ui-components/settings/setting-item.tsx +10 -2
  348. package/src/ui-components/settings/settings-button.tsx +1 -0
  349. package/src/ui-components/settings/switch-setting.tsx +9 -2
  350. package/src/ui-components/text/typography.stories.tsx +2 -2
  351. package/src/utils/date.ts +2 -2
  352. package/src/utils/history.ts +4 -4
  353. package/src/utils/hooks/connectivity/connectivity.test.ts +2 -2
  354. package/src/utils/hooks/core/backup.ts +4 -4
  355. package/src/utils/hooks/core/cache.ts +13 -13
  356. package/src/utils/hooks/core/core-context.tsx +6 -6
  357. package/src/utils/hooks/core/credential-schemas.ts +7 -4
  358. package/src/utils/hooks/core/credentials.ts +21 -13
  359. package/src/utils/hooks/core/dids.ts +3 -3
  360. package/src/utils/hooks/core/history.ts +3 -3
  361. package/src/utils/hooks/core/identifiers.ts +9 -5
  362. package/src/utils/hooks/core/proof-schemas.ts +21 -16
  363. package/src/utils/hooks/core/proofs.ts +31 -27
  364. package/src/utils/hooks/core/trust-entity.ts +19 -12
  365. package/src/utils/hooks/core/wallet-unit.ts +21 -11
  366. package/src/utils/hooks/navigation/open-settings.ts +1 -1
  367. package/src/utils/hooks/revocation/credential-status.ts +2 -2
  368. package/src/utils/parsers/credential-images.tsx +19 -13
  369. package/src/utils/parsers/credential-sharing-v2.tsx +29 -24
  370. package/src/utils/parsers/credential-sharing.tsx +24 -24
  371. package/src/utils/parsers/credential.ts +63 -40
  372. package/src/utils/parsers/query.ts +16 -14
  373. package/src/utils/url.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","SectionList","StyleSheet","View","Animated","useAnimatedScrollHandler","useSharedValue","useSafeAreaInsets","EntityDetailsWithButtons","ContrastingStatusBar","concatTestID","TouchableOpacity","SectionEntityCluster","NavigationHeader","CloseIcon","NerdModeItem","Typography","useAppColorScheme","EntityType","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","createAnimatedComponent","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","colorScheme","scrollOffset","expandedAttributes","setExpandedAttributes","onExpand","expanded","prev","onScroll","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","length","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","onPress","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","_extends","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { IdentifierListItem } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: IdentifierListItem;\n subline?: string;\n entityLabels: EntityLabels;\n role: ContextRole;\n testID?: string;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={\n entityCluster ? (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n ) : null\n }\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n});\n\nexport default NerdModeScreen;\n"],"mappings":";AACA,OAAOA,KAAK,IAAuBC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,WAAW,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC5D,OAAOC,QAAQ,IAAIC,wBAAwB,EAAEC,cAAc,QAAQ,yBAAyB;AAC5F,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,wBAAwB,MAAuB,qDAAqD;AAC3G,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,YAAY,MAA6B,6BAA6B;AAC7E,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AA+CjE,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAKtB,SAASC,sBAAsBA,CAACC,IAAyB,EAAgC;EACvF,OAAQA,IAAI,CAA0BC,UAAU,KAAKC,SAAS;AAChE;AAEA,MAAMC,mBAAmB,GAAGnB,QAAQ,CAACoB,uBAAuB,CAACvB,WAAgC,CAAC;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,aAAA,CAACnD,IAAI;QAAC4D,KAAK,EAAEU,MAAM,CAACU,sBAAuB;QAACpD,MAAM,EAAErB,YAAY,CAACqB,MAAM,EAAE6C,OAAO,CAAC5C,KAAK;MAAE,gBACtFjC,KAAA,CAAAuD,aAAA,CAACtC,UAAU;QAAC6C,KAAK,EAAE1B,WAAW,CAAC2B,KAAM;QAACC,KAAK,EAAEU,MAAM,CAACW;MAAkB,GACnER,OAAO,CAAC5C,KACC,CACR,CAAC,GACL,IAAI;IACV,CAAE;IACFqD,mBAAmB,EAAE,EAAG;IACxB3D,QAAQ,EAAEA,QAAS;IACnB4D,2BAA2B,EAAE,KAAM;IACnCvB,KAAK,EAAE;MAAEP,eAAe,EAAErB,WAAW,CAACsB,QAAQ,CAACC;IAAW,CAAE;IAC5D3B,MAAM,EAAEA;EAAO,CAChB,CACD,CAAC;AAEP,CAAC;AAED,MAAM0C,MAAM,GAAGvE,UAAU,CAACqF,MAAM,CAAC;EAC/BzD,aAAa,EAAE;IACb0D,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDN,sBAAsB,EAAE;IACtBO,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDL,iBAAiB,EAAE;IACjBQ,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAe/D,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["React","useState","SectionList","StyleSheet","View","Animated","useAnimatedScrollHandler","useSharedValue","useSafeAreaInsets","EntityDetailsWithButtons","ContrastingStatusBar","concatTestID","TouchableOpacity","SectionEntityCluster","NavigationHeader","CloseIcon","NerdModeItem","Typography","useAppColorScheme","EntityType","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","createAnimatedComponent","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","colorScheme","scrollOffset","expandedAttributes","setExpandedAttributes","onExpand","expanded","prev","onScroll","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","length","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","onPress","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","_extends","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { GetIdentifierListItemBindingDto } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: GetIdentifierListItemBindingDto;\n subline?: string;\n entityLabels: EntityLabels;\n role: ContextRole;\n testID?: string;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={\n entityCluster ? (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n ) : null\n }\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,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FqD,mBAAmB,EAAE,EAAG;IACxB3D,QAAQ,EAAEA,QAAS;IACnB4D,2BAA2B,EAAE,KAAM;IACnCvB,KAAK,EAAE;MAAEP,eAAe,EAAErB,WAAW,CAACsB,QAAQ,CAACC;IAAW,CAAE;IAC5D3B,MAAM,EAAEA;EAAO,CAChB,CACD,CAAC;AAEP,CAAC;AAED,MAAM0C,MAAM,GAAGvE,UAAU,CAACqF,MAAM,CAAC;EAC/BzD,aAAa,EAAE;IACb0D,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDN,sBAAsB,EAAE;IACtBO,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDL,iBAAiB,EAAE;IACjBQ,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAe/D,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","Platform","SectionList","StyleSheet","View","useSafeAreaInsets","useOnScrollHeaderState","useListContentInset","NavigationHeader","ListTitleHeader","useAppColorScheme","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","top","contentInsetsStyle","headerHeight","OS","titleVisible","onScroll","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","undefined","isValidElement","HeaderComponent","createElement","_extends","container","backgroundColor","background","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","create","flex","position","width"],"sources":["section-list-screen.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Platform, SectionList, SectionListProps, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { useOnScrollHeaderState } from '../../utils/hooks/header/on-scroll-header-state';\nimport { useListContentInset } from '../../utils/hooks/list/list-content-inset';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport ListTitleHeader from '../list/list-title-header';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type SectionListScreenProps<ItemT, SectionT> = ViewProps & {\n header: Omit<NavigationHeaderProps, 'animate' | 'blurred' | 'style' | 'title' | 'titleVisible'> & {\n static?: boolean;\n title: string;\n };\n list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'> & {\n header?: React.ComponentType<any> | React.ReactElement;\n };\n modalPresentation?: boolean;\n};\n\nconst SectionListScreen = <ItemT, SectionT>({\n header,\n list: { contentContainerStyle, header: listHeader, stickySectionHeadersEnabled, ...listProps },\n modalPresentation,\n style,\n ...viewProps\n}: SectionListScreenProps<ItemT, SectionT>) => {\n const colorScheme = useAppColorScheme();\n const { top } = useSafeAreaInsets();\n const contentInsetsStyle = useListContentInset({\n headerHeight: modalPresentation && Platform.OS === 'ios' ? 63 : 48,\n modalPresentation,\n });\n const { titleVisible, onScroll } = useOnScrollHeaderState();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (!modalPresentation || Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (modalPresentation && !header.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n const headerView: React.ReactElement | undefined = useMemo(() => {\n if (!listHeader) {\n return undefined;\n }\n if (React.isValidElement(listHeader)) {\n return listHeader;\n } else {\n const HeaderComponent = listHeader as React.ComponentType<any>;\n return <HeaderComponent />;\n }\n }, [listHeader]);\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <SectionList<ItemT, SectionT>\n ListHeaderComponent={!header.static ? <View><ListTitleHeader title={header.title} />{headerView}</View> : headerView}\n contentContainerStyle={[contentInsetsStyle, contentContainerStyle]}\n onScroll={onScroll}\n scrollEventThrottle={100}\n stickySectionHeadersEnabled={stickySectionHeadersEnabled ?? false}\n {...listProps}\n />\n <NavigationHeader\n animate\n blurred\n style={[styles.header, headerPaddingStyle]}\n titleVisible={header.static || titleVisible}\n {...header}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n header: {\n position: 'absolute',\n width: '100%',\n },\n modalHeaderWithoutHandle: {\n paddingTop: 15,\n },\n});\n\nexport default SectionListScreen;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,WAAW,EAAoBC,UAAU,EAAEC,IAAI,QAA8B,cAAc;AAC9G,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,OAAOC,gBAAgB,MAAiC,6BAA6B;AACrF,OAAOC,eAAe,MAAM,2BAA2B;AACvD,SAASC,iBAAiB,QAAQ,+BAA+B;AAajE,MAAMC,iBAAiB,GAAGA,CAAkB;EAC1CC,MAAM;EACNC,IAAI,EAAE;IAAEC,qBAAqB;IAAEF,MAAM,EAAEG,UAAU;IAAEC,2BAA2B;IAAE,GAAGC;EAAU,CAAC;EAC9FC,iBAAiB;EACjBC,KAAK;EACL,GAAGC;AACoC,CAAC,KAAK;EAC7C,MAAMC,WAAW,GAAGX,iBAAiB,CAAC,CAAC;EACvC,MAAM;IAAEY;EAAI,CAAC,GAAGjB,iBAAiB,CAAC,CAAC;EACnC,MAAMkB,kBAAkB,GAAGhB,mBAAmB,CAAC;IAC7CiB,YAAY,EAAEN,iBAAiB,IAAIjB,QAAQ,CAACwB,EAAE,KAAK,KAAK,GAAG,EAAE,GAAG,EAAE;IAClEP;EACF,CAAC,CAAC;EACF,MAAM;IAAEQ,YAAY;IAAEC;EAAS,CAAC,GAAGrB,sBAAsB,CAAC,CAAC;EAE3D,IAAIsB,kBAAyC;EAC7C,IAAI,CAACV,iBAAiB,IAAIjB,QAAQ,CAACwB,EAAE,KAAK,SAAS,EAAE;IACnDG,kBAAkB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AAC,eACFlB,KAAA,CAAAsC,aAAA,CAAC7B,gBAAgB,EAAA8B,QAAA;IACfQ,OAAO;IACPC,OAAO;IACP5B,KAAK,EAAE,CAACY,MAAM,CAACnB,MAAM,EAAEgB,kBAAkB,CAAE;IAC3CF,YAAY,EAAEd,MAAM,CAAC+B,MAAM,IAAIjB;EAAa,GACxCd,MAAM,CACX,CACG,CAAC;AAEX,CAAC;AAED,MAAMmB,MAAM,GAAG5B,UAAU,CAAC6C,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE;EACR,CAAC;EACDrC,MAAM,EAAE;IACNsC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDnB,wBAAwB,EAAE;IACxBH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAelB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","Platform","SectionList","StyleSheet","View","useSafeAreaInsets","useOnScrollHeaderState","useListContentInset","NavigationHeader","ListTitleHeader","useAppColorScheme","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","top","contentInsetsStyle","headerHeight","OS","titleVisible","onScroll","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","undefined","isValidElement","HeaderComponent","createElement","_extends","container","backgroundColor","background","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","create","flex","position","width"],"sources":["section-list-screen.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Platform, SectionList, SectionListProps, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { useOnScrollHeaderState } from '../../utils/hooks/header/on-scroll-header-state';\nimport { useListContentInset } from '../../utils/hooks/list/list-content-inset';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport ListTitleHeader from '../list/list-title-header';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type SectionListScreenProps<ItemT, SectionT> = ViewProps & {\n header: Omit<NavigationHeaderProps, 'animate' | 'blurred' | 'style' | 'title' | 'titleVisible'> & {\n static?: boolean;\n title: string;\n };\n list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'> & {\n header?: React.ComponentType<any> | React.ReactElement;\n };\n modalPresentation?: boolean;\n};\n\nconst SectionListScreen = <ItemT, SectionT>({\n header,\n list: { contentContainerStyle, header: listHeader, stickySectionHeadersEnabled, ...listProps },\n modalPresentation,\n style,\n ...viewProps\n}: SectionListScreenProps<ItemT, SectionT>) => {\n const colorScheme = useAppColorScheme();\n const { top } = useSafeAreaInsets();\n const contentInsetsStyle = useListContentInset({\n headerHeight: modalPresentation && Platform.OS === 'ios' ? 63 : 48,\n modalPresentation,\n });\n const { titleVisible, onScroll } = useOnScrollHeaderState();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (!modalPresentation || Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (modalPresentation && !header.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n const headerView: React.ReactElement | undefined = useMemo(() => {\n if (!listHeader) {\n return undefined;\n }\n if (React.isValidElement(listHeader)) {\n return listHeader;\n } else {\n const HeaderComponent = listHeader as React.ComponentType<any>;\n return <HeaderComponent />;\n }\n }, [listHeader]);\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <SectionList<ItemT, SectionT>\n ListHeaderComponent={\n !header.static ? (\n <View>\n <ListTitleHeader title={header.title} />\n {headerView}\n </View>\n ) : (\n headerView\n )\n }\n contentContainerStyle={[contentInsetsStyle, contentContainerStyle]}\n onScroll={onScroll}\n scrollEventThrottle={100}\n stickySectionHeadersEnabled={stickySectionHeadersEnabled ?? false}\n {...listProps}\n />\n <NavigationHeader\n animate\n blurred\n style={[styles.header, headerPaddingStyle]}\n titleVisible={header.static || titleVisible}\n {...header}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n header: {\n position: 'absolute',\n width: '100%',\n },\n modalHeaderWithoutHandle: {\n paddingTop: 15,\n },\n});\n\nexport default SectionListScreen;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,WAAW,EAAoBC,UAAU,EAAEC,IAAI,QAA8B,cAAc;AAC9G,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,OAAOC,gBAAgB,MAAiC,6BAA6B;AACrF,OAAOC,eAAe,MAAM,2BAA2B;AACvD,SAASC,iBAAiB,QAAQ,+BAA+B;AAajE,MAAMC,iBAAiB,GAAGA,CAAkB;EAC1CC,MAAM;EACNC,IAAI,EAAE;IAAEC,qBAAqB;IAAEF,MAAM,EAAEG,UAAU;IAAEC,2BAA2B;IAAE,GAAGC;EAAU,CAAC;EAC9FC,iBAAiB;EACjBC,KAAK;EACL,GAAGC;AACoC,CAAC,KAAK;EAC7C,MAAMC,WAAW,GAAGX,iBAAiB,CAAC,CAAC;EACvC,MAAM;IAAEY;EAAI,CAAC,GAAGjB,iBAAiB,CAAC,CAAC;EACnC,MAAMkB,kBAAkB,GAAGhB,mBAAmB,CAAC;IAC7CiB,YAAY,EAAEN,iBAAiB,IAAIjB,QAAQ,CAACwB,EAAE,KAAK,KAAK,GAAG,EAAE,GAAG,EAAE;IAClEP;EACF,CAAC,CAAC;EACF,MAAM;IAAEQ,YAAY;IAAEC;EAAS,CAAC,GAAGrB,sBAAsB,CAAC,CAAC;EAE3D,IAAIsB,kBAAyC;EAC7C,IAAI,CAACV,iBAAiB,IAAIjB,QAAQ,CAACwB,EAAE,KAAK,SAAS,EAAE;IACnDG,kBAAkB,GAAG;MACnBC,UAAU,EAAEP;IACd,CA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7B,gBAAgB,EAAA8B,QAAA;IACfQ,OAAO;IACPC,OAAO;IACP5B,KAAK,EAAE,CAACY,MAAM,CAACnB,MAAM,EAAEgB,kBAAkB,CAAE;IAC3CF,YAAY,EAAEd,MAAM,CAAC+B,MAAM,IAAIjB;EAAa,GACxCd,MAAM,CACX,CACG,CAAC;AAEX,CAAC;AAED,MAAMmB,MAAM,GAAG5B,UAAU,CAAC6C,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE;EACR,CAAC;EACDrC,MAAM,EAAE;IACNsC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDnB,wBAAwB,EAAE;IACxBH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAelB,iBAAiB","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
+ import { concatTestID } from '../../utils';
3
4
  import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
4
5
  import { NextIcon } from '../icons/wallet';
5
6
  import { useAppColorScheme } from '../theme/color-scheme-context';
@@ -38,7 +39,8 @@ const ButtonSetting = ({
38
39
  }, /*#__PURE__*/React.createElement(SettingItem, {
39
40
  icon: icon,
40
41
  style: style,
41
- title: title
42
+ title: title,
43
+ testID: concatTestID(testID, 'text')
42
44
  }, accessoryView));
43
45
  };
44
46
  const styles = StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","StyleSheet","View","TouchableOpacity","NextIcon","useAppColorScheme","SettingItem","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","accessoryView","createElement","styles","arrow","color","text","isValidElement","AccessoryComponent","accessibilityRole","container","create","alignItems","height","justifyContent","width"],"sources":["button-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport { NextIcon } from '../icons/wallet';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport SettingItem from './setting-item';\n\nexport type ButtonSettingProps = {\n accessory?: ComponentType<any> | ReactElement;\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onPress: () => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n};\n\nconst ButtonSetting: FunctionComponent<ButtonSettingProps> = ({\n accessory,\n disabled,\n title,\n onPress,\n icon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return (\n <View style={styles.arrow}>\n <NextIcon color={colorScheme.text} />\n </View>\n );\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory, colorScheme.text]);\n\n return (\n <TouchableOpacity\n disabled={disabled}\n accessibilityRole=\"button\"\n onPress={onPress}\n style={styles.container}\n testID={testID}>\n <SettingItem icon={icon} style={style} title={title}>\n {accessoryView}\n </SettingItem>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n arrow: {\n alignItems: 'center',\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n container: {\n width: '100%',\n },\n});\n\nexport default ButtonSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAoDC,OAAO,QAAQ,OAAO;AACtF,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,KAAK;EACLC;AACF,CAAC,KAAK;EAC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estID","TouchableOpacity","NextIcon","useAppColorScheme","SettingItem","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","accessoryView","createElement","styles","arrow","color","text","isValidElement","AccessoryComponent","accessibilityRole","container","create","alignItems","height","justifyContent","width"],"sources":["button-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport { NextIcon } from '../icons/wallet';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport SettingItem from './setting-item';\n\nexport type ButtonSettingProps = {\n accessory?: ComponentType<any> | ReactElement;\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onPress: () => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n};\n\nconst ButtonSetting: FunctionComponent<ButtonSettingProps> = ({\n accessory,\n disabled,\n title,\n onPress,\n icon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return (\n <View style={styles.arrow}>\n <NextIcon color={colorScheme.text} />\n </View>\n );\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory, colorScheme.text]);\n\n return (\n <TouchableOpacity\n disabled={disabled}\n accessibilityRole=\"button\"\n onPress={onPress}\n style={styles.container}\n testID={testID}>\n <SettingItem icon={icon} style={style} title={title} testID={concatTestID(testID, 'text')}>\n {accessoryView}\n </SettingItem>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n arrow: {\n alignItems: 'center',\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n container: {\n width: '100%',\n },\n});\n\nexport default ButtonSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAoDC,OAAO,Q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KAAM;IAACH,KAAK,EAAEA,KAAM;IAACI,MAAM,EAAEZ,YAAY,CAACY,MAAM,EAAE,MAAM;EAAE,GACvFE,aACU,CACG,CAAC;AAEvB,CAAC;AAED,MAAME,MAAM,GAAGlB,UAAU,CAAC0B,MAAM,CAAC;EAC/BP,KAAK,EAAE;IACLQ,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDL,SAAS,EAAE;IACTK,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAevB,aAAa","ignoreList":[]}
@@ -13,6 +13,7 @@ const styles = StyleSheet.create({
13
13
  icon: {
14
14
  alignItems: 'center',
15
15
  borderRadius: 18,
16
+ borderWidth: 0,
16
17
  height: 36,
17
18
  justifyContent: 'center',
18
19
  marginRight: 12,
@@ -33,7 +34,8 @@ const SettingItem = ({
33
34
  title,
34
35
  icon,
35
36
  style,
36
- children
37
+ children,
38
+ testID
37
39
  }) => {
38
40
  const colorScheme = useAppColorScheme();
39
41
  const iconView = useMemo(() => {
@@ -61,7 +63,8 @@ const SettingItem = ({
61
63
  accessible: false,
62
64
  color: colorScheme.text,
63
65
  preset: "s",
64
- style: styles.label
66
+ style: styles.label,
67
+ testID: testID
65
68
  }, title), children));
66
69
  };
67
70
  export default SettingItem;
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","StyleSheet","View","Typography","useAppColorScheme","styles","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","colorScheme","iconView","undefined","isValidElement","IconComponent","createElement","backgroundColor","white","background","accessible","color","text","preset"],"sources":["setting-item.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n justifyContent: 'center',\n width: '100%',\n },\n icon: {\n alignItems: 'center',\n borderRadius: 18,\n height: 36,\n justifyContent: 'center',\n marginRight: 12,\n width: 36,\n },\n label: {\n flex: 1,\n marginBottom: 0,\n marginTop: 0,\n },\n wrapper: {\n justifyContent: 'center',\n marginHorizontal: 16,\n paddingHorizontal: 12,\n },\n});\n\nexport type SettingItemProps = {\n icon?: ComponentType<any> | ReactElement;\n style?: StyleProp<ViewStyle>;\n title: string;\n};\n\nconst SettingItem: FunctionComponent<PropsWithChildren<SettingItemProps>> = ({ title, icon, style, children }) => {\n const colorScheme = useAppColorScheme();\n const iconView: React.ReactElement | undefined = useMemo(() => {\n if (!icon) {\n return undefined;\n }\n if (React.isValidElement(icon)) {\n return icon;\n } else {\n const IconComponent = icon as React.ComponentType<any>;\n return <IconComponent />;\n }\n }, [icon]);\n\n return (\n <View style={[styles.wrapper, { backgroundColor: colorScheme.white }, style]}>\n <View style={styles.container}>\n {iconView && <View style={[styles.icon, { backgroundColor: colorScheme.background }]}>{iconView}</View>}\n <Typography accessible={false} color={colorScheme.text} preset=\"s\" style={styles.label}>\n {title}\n </Typography>\n {children}\n </View>\n </View>\n );\n};\n\nexport default SettingItem;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAuEC,OAAO,QAAQ,OAAO;AACzG,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,IAAI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B,eAAe,EAAEN,WAAW,CAACQ;IAAW,CAAC;EAAE,GAAEP,QAAe,CAAC,eACvG7B,KAAA,CAAAiC,aAAA,CAAC7B,UAAU;IAACiC,UAAU,EAAE,KAAM;IAACC,KAAK,EAAEV,WAAW,CAACW,IAAK;IAACC,MAAM,EAAC,GAAG;IAACd,KAAK,EAAEpB,MAAM,CAACW;EAAM,GACpFQ,KACS,CAAC,EACZE,QACG,CACF,CAAC;AAEX,CAAC;AAED,eAAeH,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","StyleSheet","View","Typography","useAppColorScheme","styles","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","borderWidth","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","testID","colorScheme","iconView","undefined","isValidElement","IconComponent","createElement","backgroundColor","white","background","accessible","color","text","preset"],"sources":["setting-item.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n justifyContent: 'center',\n width: '100%',\n },\n icon: {\n alignItems: 'center',\n borderRadius: 18,\n borderWidth: 0,\n height: 36,\n justifyContent: 'center',\n marginRight: 12,\n width: 36,\n },\n label: {\n flex: 1,\n marginBottom: 0,\n marginTop: 0,\n },\n wrapper: {\n justifyContent: 'center',\n marginHorizontal: 16,\n paddingHorizontal: 12,\n },\n});\n\nexport type SettingItemProps = {\n icon?: ComponentType<any> | ReactElement;\n style?: StyleProp<ViewStyle>;\n title: string;\n testID?: string;\n};\n\nconst SettingItem: FunctionComponent<PropsWithChildren<SettingItemProps>> = ({\n title,\n icon,\n style,\n children,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const iconView: React.ReactElement | undefined = useMemo(() => {\n if (!icon) {\n return undefined;\n }\n if (React.isValidElement(icon)) {\n return icon;\n } else {\n const IconComponent = icon as React.ComponentType<any>;\n return <IconComponent />;\n }\n }, [icon]);\n\n return (\n <View style={[styles.wrapper, { backgroundColor: colorScheme.white }, style]}>\n <View style={styles.container}>\n {iconView && <View style={[styles.icon, { backgroundColor: colorScheme.background }]}>{iconView}</View>}\n <Typography accessible={false} color={colorScheme.text} preset=\"s\" style={styles.label} testID={testID}>\n {title}\n </Typography>\n {children}\n </View>\n </View>\n );\n};\n\nexport default SettingItem;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAuEC,OAAO,QAAQ,OAAO;AACzG,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,IAAI,EAAE;IACJL,UAAU,EAAE,QAAQ;IACpBM,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdL,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBK,WAAW,EAAE,EAAE;IACfJ,KAAK,EAAE;EACT,CAAC;EACDK,KAAK,EAAE;IACLC,IAAI,EAAE,CAAC;IACPC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb,CAAC;EACDC,OAAO,EAAE;IACPV,cAAc,EAAE,QAAQ;IACxBW,gBAAgB,EAAE,EAAE;IACpBC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AASF,MAAMC,WAAmE,GAAGA,CAAC;EAC3EC,KAAK;EACLZ,IAAI;EACJa,KAAK;EACLC,QAAQ;EACRC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGzB,iBAAiB,CAAC,CAAC;EACvC,MAAM0B,QAAwC,GAAG9B,OAAO,CAAC,MAAM;IAC7D,IAAI,CAACa,IAAI,EAAE;MACT,OAAOkB,SAAS;IAClB;IACA,iBAAIhC,KAAK,CAACiC,cAAc,CAACnB,IAAI,CAAC,EAAE;MAC9B,OAAOA,IAAI;IACb,CAAC,MAAM;MACL,MAAMoB,aAAa,GAAGpB,IAAgC;MACtD,oBAAOd,KAAA,CAAAmC,aAAA,CAACD,aAAa,MAAE,CAAC;IAC1B;EACF,CAAC,EAAE,CAACpB,IAAI,CAAC,CAAC;EAEV,oBACEd,KAAA,CAAAmC,aAAA,CAAChC,IAAI;IAACwB,KAAK,EAAE,CAACrB,MAAM,CAACgB,OAAO,EAAE;MAAEc,eAAe,EAAEN,WAAW,CAACO;IAAM,CAAC,EAAEV,KAAK;EAAE,gBAC3E3B,KAAA,CAAAmC,aAAA,CAAChC,IAAI;IAACwB,KAAK,EAAErB,MAAM,CAACE;EAAU,GAC3BuB,QAAQ,iBAAI/B,KAAA,CAAAmC,aAAA,CAAChC,IAAI;IAACwB,KAAK,EAAE,CAACrB,MAAM,CAACQ,IAAI,EAAE;MAAEsB,eAAe,EAAEN,WAAW,CAACQ;IAAW,CAAC;EAAE,GAAEP,QAAe,CAAC,eACvG/B,KAAA,CAAAmC,aAAA,CAAC/B,UAAU;IAACmC,UAAU,EAAE,KAAM;IAACC,KAAK,EAAEV,WAAW,CAACW,IAAK;IAACC,MAAM,EAAC,GAAG;IAACf,KAAK,EAAErB,MAAM,CAACY,KAAM;IAACW,MAAM,EAAEA;EAAO,GACpGH,KACS,CAAC,EACZE,QACG,CACF,CAAC;AAEX,CAAC;AAED,eAAeH,WAAW","ignoreList":[]}
@@ -17,6 +17,7 @@ const SettingsButton = ({
17
17
  const styles = StyleSheet.create({
18
18
  button: {
19
19
  borderRadius: 12,
20
+ borderWidth: 0,
20
21
  height: 68,
21
22
  marginHorizontal: 0,
22
23
  paddingHorizontal: 12
@@ -1 +1 @@
1
- {"version":3,"names":["React","StyleSheet","useAppColorScheme","ButtonSetting","SettingsButton","style","props","colorScheme","createElement","_extends","styles","button","backgroundColor","background","create","borderRadius","height","marginHorizontal","paddingHorizontal"],"sources":["settings-button.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport ButtonSetting, { ButtonSettingProps } from './button-setting';\n\nexport type SettingsButtonProps = ButtonSettingProps;\n\nconst SettingsButton: FC<SettingsButtonProps> = ({ style, ...props }) => {\n const colorScheme = useAppColorScheme();\n return <ButtonSetting style={[styles.button, { backgroundColor: colorScheme.background }, style]} {...props} />;\n};\n\nconst styles = StyleSheet.create({\n button: {\n borderRadius: 12,\n height: 68,\n marginHorizontal: 0,\n paddingHorizontal: 12,\n },\n});\n\nexport default SettingsButton;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,aAAa,MAA8B,kBAAkB;AAIpE,MAAMC,cAAuC,GAAGA,CAAC;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,KAAK;EACvE,MAAMC,WAAW,GAAGL,iBAAiB,CAAC,CAAC;EACvC,oBAAOF,KAAA,CAAAQ,aAAA,CAACL,aAAa,EAAAM,QAAA;IAACJ,KAAK,EAAE,CAACK,MAAM,CAACC,MAAM,EAAE;MAAEC,eAAe,EAAEL,WAAW,CAACM;IAAW,CAAC,EAAER,KAAK;EAAE,GAAKC,KAAK,CAAG,CAAC;AACjH,CAAC;AAED,MAAMI,MAAM,GAAGT,UAAU,CAACa,MAAM,CAAC;EAC/BH,MAAM,EAAE;IACNI,YAAY,EAAE,EAAE;IAChBC,MAAM,EAAE,EAAE;IACVC,gBAAgB,EAAE,CAAC;IACnBC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAed,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["React","StyleSheet","useAppColorScheme","ButtonSetting","SettingsButton","style","props","colorScheme","createElement","_extends","styles","button","backgroundColor","background","create","borderRadius","borderWidth","height","marginHorizontal","paddingHorizontal"],"sources":["settings-button.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport ButtonSetting, { ButtonSettingProps } from './button-setting';\n\nexport type SettingsButtonProps = ButtonSettingProps;\n\nconst SettingsButton: FC<SettingsButtonProps> = ({ style, ...props }) => {\n const colorScheme = useAppColorScheme();\n return <ButtonSetting style={[styles.button, { backgroundColor: colorScheme.background }, style]} {...props} />;\n};\n\nconst styles = StyleSheet.create({\n button: {\n borderRadius: 12,\n borderWidth: 0,\n height: 68,\n marginHorizontal: 0,\n paddingHorizontal: 12,\n },\n});\n\nexport default SettingsButton;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,QAAQ,cAAc;AAEzC,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,aAAa,MAA8B,kBAAkB;AAIpE,MAAMC,cAAuC,GAAGA,CAAC;EAAEC,KAAK;EAAE,GAAGC;AAAM,CAAC,KAAK;EACvE,MAAMC,WAAW,GAAGL,iBAAiB,CAAC,CAAC;EACvC,oBAAOF,KAAA,CAAAQ,aAAA,CAACL,aAAa,EAAAM,QAAA;IAACJ,KAAK,EAAE,CAACK,MAAM,CAACC,MAAM,EAAE;MAAEC,eAAe,EAAEL,WAAW,CAACM;IAAW,CAAC,EAAER,KAAK;EAAE,GAAKC,KAAK,CAAG,CAAC;AACjH,CAAC;AAED,MAAMI,MAAM,GAAGT,UAAU,CAACa,MAAM,CAAC;EAC/BH,MAAM,EAAE;IACNI,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,MAAM,EAAE,EAAE;IACVC,gBAAgB,EAAE,CAAC;IACnBC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAef,cAAc","ignoreList":[]}
@@ -1,4 +1,5 @@
1
1
  import React from 'react';
2
+ import { concatTestID } from '../../utils';
2
3
  import { Switch } from '../control/switch';
3
4
  import SettingItem from './setting-item';
4
5
  const SwitchSetting = ({
@@ -13,12 +14,13 @@ const SwitchSetting = ({
13
14
  return /*#__PURE__*/React.createElement(SettingItem, {
14
15
  icon: icon,
15
16
  style: style,
16
- title: title
17
+ title: title,
18
+ testID: concatTestID(testID, 'text')
17
19
  }, /*#__PURE__*/React.createElement(Switch, {
18
20
  accessibilityLabel: title,
19
21
  disabled: disabled,
20
22
  onChange: onChange,
21
- testID: testID,
23
+ testID: concatTestID(testID, 'switch'),
22
24
  value: value
23
25
  }));
24
26
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","Switch","SettingItem","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","accessibilityLabel"],"sources":["switch-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Switch } from '../control/switch';\nimport SettingItem from './setting-item';\n\nexport type SwitchSettingProps = {\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onChange: (newValue: boolean) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n value: boolean;\n};\n\nconst SwitchSetting: FunctionComponent<SwitchSettingProps> = ({\n title,\n value,\n onChange,\n icon,\n style,\n disabled = false,\n testID,\n}) => {\n return (\n <SettingItem icon={icon} style={style} title={title}>\n <Switch accessibilityLabel={title} disabled={disabled} onChange={onChange} testID={testID} value={value} />\n </SettingItem>\n );\n};\n\nexport default SwitchSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0D,OAAO;AAG7E,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC;AACF,CAAC,KAAK;EACJ,oBACEV,KAAA,CAAAW,aAAA,CAACT,WAAW;IAACK,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACJ,KAAK,EAAEA;EAAM,gBAClDJ,KAAA,CAAAW,aAAA,CAACV,MAAM;IAACW,kBAAkB,EAAER,KAAM;IAACK,QAAQ,EAAEA,QAAS;IAACH,QAAQ,EAAEA,QAAS;IAACI,MAAM,EAAEA,MAAO;IAACL,KAAK,EAAEA;EAAM,CAAE,CAC/F,CAAC;AAElB,CAAC;AAED,eAAeF,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["React","concatTestID","Switch","SettingItem","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","accessibilityLabel"],"sources":["switch-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { Switch } from '../control/switch';\nimport SettingItem from './setting-item';\n\nexport type SwitchSettingProps = {\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onChange: (newValue: boolean) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n value: boolean;\n};\n\nconst SwitchSetting: FunctionComponent<SwitchSettingProps> = ({\n title,\n value,\n onChange,\n icon,\n style,\n disabled = false,\n testID,\n}) => {\n return (\n <SettingItem icon={icon} style={style} title={title} testID={concatTestID(testID, 'text')}>\n <Switch\n accessibilityLabel={title}\n disabled={disabled}\n onChange={onChange}\n testID={concatTestID(testID, 'switch')}\n value={value}\n />\n </SettingItem>\n );\n};\n\nexport default SwitchSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0D,OAAO;AAG7E,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC;AACF,CAAC,KAAK;EACJ,oBACEX,KAAA,CAAAY,aAAA,CAACT,WAAW;IAACK,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACJ,KAAK,EAAEA,KAAM;IAACM,MAAM,EAAEV,YAAY,CAACU,MAAM,EAAE,MAAM;EAAE,gBACxFX,KAAA,CAAAY,aAAA,CAACV,MAAM;IACLW,kBAAkB,EAAER,KAAM;IAC1BK,QAAQ,EAAEA,QAAS;IACnBH,QAAQ,EAAEA,QAAS;IACnBI,MAAM,EAAEV,YAAY,CAACU,MAAM,EAAE,QAAQ,CAAE;IACvCL,KAAK,EAAEA;EAAM,CACd,CACU,CAAC;AAElB,CAAC;AAED,eAAeF,aAAa","ignoreList":[]}
@@ -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().localeIdentifier\n ?.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,CAACC,gBAAgB,cAAAF,qBAAA,uBAA3CA,qBAAA,CACrCG,OAAO,CAAC,IAAI,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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","_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,EAAE,GAAG,CAAC,CACpCC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAChBD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;;AAEpB;AACA;AACA;AACA,OAAO,MAAME,UAAU,GAAGA,CAACC,IAAU,EAAEC,MAAe,EAAEC,OAAoC,KAAK;EAC/F,IAAI;IACF,OAAOF,IAAI,CAACG,kBAAkB,CAACF,MAAM,IAAIR,YAAY,EAAES,OAAO,CAAC;EACjE,CAAC,CAAC,MAAM;IACN,OAAOE,SAAS;EAClB;AACF,CAAC;;AAED;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ries","reduce","result","entry","entryDate","createdDate","matchingEntry","find","date","isSame","data","push","firstYearEntry","sort","a","b","valueOf","map","item","index","list"],"sources":["history.ts"],"sourcesContent":["import { HistoryListItem } from '@procivis/react-native-one-core';\nimport moment, { Moment } from 'moment';\n\nexport interface HistoryGroupByDaySection {\n data: HistoryListItem[];\n date: Moment;\n firstYearEntry: boolean;\n}\n\nexport const groupEntriesByDay = (entries: HistoryListItem[]) => {\n const groupedEntries = entries.reduce((result: HistoryGroupByDaySection[], entry: HistoryListItem) => {\n const entryDate = moment(entry.createdDate);\n\n const matchingEntry = result.find(({ date }) => date.isSame(entryDate, 'day'));\n if (matchingEntry) {\n matchingEntry.data.push(entry);\n } else {\n result.push({ data: [entry], date: entryDate, firstYearEntry: false });\n }\n\n return result;\n }, []);\n\n return groupedEntries\n .sort(({ date: a }, { date: b }) => b.valueOf() - a.valueOf())\n .map((item, index, list) => {\n item.firstYearEntry = !index || !list[index - 1].date.isSame(item.date, 'year');\n return item;\n });\n};\n"],"mappings":"AACA,OAAOA,MAAM,MAAkB,QAAQ;AAQvC,OAAO,MAAMC,iBAAiB,GAAIC,OAA0B,IAAK;EAC/D,MAAMC,cAAc,GAAGD,OAAO,CAACE,MAAM,CAAC,CAACC,MAAkC,EAAEC,KAAsB,KAAK;IACpG,MAAMC,SAAS,GAAGP,MAAM,CAACM,KAAK,CAACE,WAAW,CAAC;IAE3C,MAAMC,aAAa,GAAGJ,MAAM,CAACK,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAACC,MAAM,CAACL,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9E,IAAIE,aAAa,EAAE;MACjBA,aAAa,CAACI,IAAI,CAACC,IAAI,CAACR,KAAK,CAAC;IAChC,CAAC,MAAM;MACLD,MAAM,CAACS,IAAI,CAAC;QAAED,IAAI,EAAE,CAACP,KAAK,CAAC;QAAEK,IAAI,EAAEJ,SAAS;QAAEQ,cAAc,EAAE;MAAM,CAAC,CAAC;IACxE;IAEA,OAAOV,MAAM;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,cAAc,CAClBa,IAAI,CAAC,CAAC;IAAEL,IAAI,EAAEM;EAAE,CAAC,EAAE;IAAEN,IAAI,EAAEO;EAAE,CAAC,KAAKA,CAAC,CAACC,OAAO,CAAC,CAAC,GAAGF,CAAC,CAACE,OAAO,CAAC,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,EAAEC,IAAI,KAAK;IAC1BF,IAAI,CAACN,cAAc,GAAG,CAACO,KAAK,IAAI,CAACC,IAAI,CAACD,KAAK,GAAG,CAAC,CAAC,CAACX,IAAI,CAACC,MAAM,CAACS,IAAI,CAACV,IAAI,EAAE,MAAM,CAAC;IAC/E,OAAOU,IAAI;EACb,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["moment","groupEntriesByDay","entries","groupedEntries","reduce","result","entry","entryDate","createdDate","matchingEntry","find","date","isSame","data","push","firstYearEntry","sort","a","b","valueOf","map","item","index","list"],"sources":["history.ts"],"sourcesContent":["import { HistoryListItemBindingDto } from '@procivis/react-native-one-core';\nimport moment, { Moment } from 'moment';\n\nexport interface HistoryGroupByDaySection {\n data: HistoryListItemBindingDto[];\n date: Moment;\n firstYearEntry: boolean;\n}\n\nexport const groupEntriesByDay = (entries: HistoryListItemBindingDto[]) => {\n const groupedEntries = entries.reduce((result: HistoryGroupByDaySection[], entry: HistoryListItemBindingDto) => {\n const entryDate = moment(entry.createdDate);\n\n const matchingEntry = result.find(({ date }) => date.isSame(entryDate, 'day'));\n if (matchingEntry) {\n matchingEntry.data.push(entry);\n } else {\n result.push({ data: [entry], date: entryDate, firstYearEntry: false });\n }\n\n return result;\n }, []);\n\n return groupedEntries\n .sort(({ date: a }, { date: b }) => b.valueOf() - a.valueOf())\n .map((item, index, list) => {\n item.firstYearEntry = !index || !list[index - 1].date.isSame(item.date, 'year');\n return item;\n });\n};\n"],"mappings":"AACA,OAAOA,MAAM,MAAkB,QAAQ;AAQvC,OAAO,MAAMC,iBAAiB,GAAIC,OAAoC,IAAK;EACzE,MAAMC,cAAc,GAAGD,OAAO,CAACE,MAAM,CAAC,CAACC,MAAkC,EAAEC,KAAgC,KAAK;IAC9G,MAAMC,SAAS,GAAGP,MAAM,CAACM,KAAK,CAACE,WAAW,CAAC;IAE3C,MAAMC,aAAa,GAAGJ,MAAM,CAACK,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAACC,MAAM,CAACL,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9E,IAAIE,aAAa,EAAE;MACjBA,aAAa,CAACI,IAAI,CAACC,IAAI,CAACR,KAAK,CAAC;IAChC,CAAC,MAAM;MACLD,MAAM,CAACS,IAAI,CAAC;QAAED,IAAI,EAAE,CAACP,KAAK,CAAC;QAAEK,IAAI,EAAEJ,SAAS;QAAEQ,cAAc,EAAE;MAAM,CAAC,CAAC;IACxE;IAEA,OAAOV,MAAM;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,cAAc,CAClBa,IAAI,CAAC,CAAC;IAAEL,IAAI,EAAEM;EAAE,CAAC,EAAE;IAAEN,IAAI,EAAEO;EAAE,CAAC,KAAKA,CAAC,CAACC,OAAO,CAAC,CAAC,GAAGF,CAAC,CAACE,OAAO,CAAC,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,EAAEC,IAAI,KAAK;IAC1BF,IAAI,CAACN,cAAc,GAAG,CAACO,KAAK,IAAI,CAACC,IAAI,CAACD,KAAK,GAAG,CAAC,CAAC,CAACX,IAAI,CAACC,MAAM,CAACS,IAAI,CAACV,IAAI,EAAE,MAAM,CAAC;IAC/E,OAAOU,IAAI;EACb,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["getInvitationUrlTransports","Transport","jest","mock","initializeCore","Promise","resolve","captureException","getEnabledTransports","useCoreConfig","addEventListener","onStateChange","describe","test","transports","expect","toStrictEqual","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@procivis/react-native-one-core', () => ({\n initializeCore: () => Promise.resolve({} as any),\n}));\n\njest.mock('@sentry/react-native', () => ({\n captureException: () => {},\n}));\n\njest.mock('../core/core-config', () => ({\n getEnabledTransports: () => [],\n useCoreConfig: () => ({}),\n}));\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => { },\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => { },\n}));\n\ndescribe('getInvitationUrlTransports', () => {\n test('BLE OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('BLE OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('HTTP OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with requestUri', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID credential offer url', () => {\n const transports = getInvitationUrlTransports(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n\n test('Invalid link', () => {\n const transports = getInvitationUrlTransports('invalid');\n expect(trans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U,CAAC,CAACE,aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFN,IAAI,CAAC,oCAAoC,EAAE,MAAM;IAC/C,MAAMC,UAAU,GAAGd,0BAA0B,CAC3C,6OAA6O,EAC7O,gBACF,CAAC;IACDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFN,IAAI,CAAC,kCAAkC,EAAE,MAAM;IAC7C,MAAMC,UAAU,GAAGd,0BAA0B,CAC3C,wMAAwM,EACxM,gBACF,CAAC;IACDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EAEFN,IAAI,CAAC,cAAc,EAAE,MAAM;IACzB,MAAMC,UAAU,GAAGd,0BAA0B,CAAC,SAAS,CAAC;IACxDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,EAAE,CAAC;EACtC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["getInvitationUrlTransports","Transport","jest","mock","initializeCore","Promise","resolve","captureException","getEnabledTransports","useCoreConfig","addEventListener","onStateChange","describe","test","transports","expect","toStrictEqual","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@procivis/react-native-one-core', () => ({\n initializeCore: () => Promise.resolve({} as any),\n}));\n\njest.mock('@sentry/react-native', () => ({\n captureException: () => {},\n}));\n\njest.mock('../core/core-config', () => ({\n getEnabledTransports: () => [],\n useCoreConfig: () => ({}),\n}));\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {},\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => {},\n}));\n\ndescribe('getInvitationUrlTransports', () => {\n test('BLE OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('BLE OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('HTTP OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with requestUri', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID credential offer url', () => {\n const transports = getInvitationUrlTransports(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n\n test('Invalid link', () => {\n const transports = getInvitationUrlTransports('invalid');\n expect(transports).toStrictEqual([]);\n });\n});\n"],"mappings":"AAAA,SAASA,0BAA0B,EAAEC,SAAS,QAAQ,gBAAgB;AAEtEC,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDC,cAAc,EAAEA,CAAA,KAAMC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAQ;AACjD,CAAC,CAAC,CAAC;AAEHJ,IAAI,CAACC,IAAI,CAAC,sBAAsB,EAAE,OAAO;EACvCI,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHL,IAAI,CAACC,IAAI,CAAC,qBAAqB,EAAE,OAAO;EACtCK,oBAAoB,EAAEA,CAAA,KAAM,EA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aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EAEFN,IAAI,CAAC,cAAc,EAAE,MAAM;IACzB,MAAMC,UAAU,GAAGd,0BAA0B,CAAC,SAAS,CAAC;IACxDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,EAAE,CAAC;EACtC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { IdentifierStateEnum, IdentifierTypeEnum } from '@procivis/react-native-one-core';
1
+ import { IdentifierStateBindingEnum, IdentifierTypeBindingEnum } from '@procivis/react-native-one-core';
2
2
  import { useCallback } from 'react';
3
3
  import { useMutation, useQuery, useQueryClient } from 'react-query';
4
4
  import { reportException } from '../../reporting';
@@ -80,12 +80,12 @@ export const useBackupFinalizeImportProcedure = ({
80
80
  let swIdentifierId;
81
81
  if (generateSwKey) {
82
82
  var _identifiers$values$f;
83
- const identifiers = await core.getIdentifiers({
84
- states: [IdentifierStateEnum.ACTIVE],
83
+ const identifiers = await core.listIdentifiers({
84
+ states: [IdentifierStateBindingEnum.ACTIVE],
85
85
  organisationId,
86
86
  page: 0,
87
87
  pageSize: 1,
88
- types: [IdentifierTypeEnum.DID],
88
+ types: [IdentifierTypeBindingEnum.DID],
89
89
  isRemote: false
90
90
  });
91
91
  swIdentifierId = (_identifiers$values$f = identifiers.values.find(identifier => identifier.name.startsWith(SW_DID_NAME_PREFIX))) === null || _identifiers$values$f === void 0 ? void 0 : _identifiers$values$f.id;
@@ -1 +1 @@
1
- {"version":3,"names":["IdentifierStateEnum","IdentifierTypeEnum","useCallback","useMutation","useQuery","useQueryClient","reportException","useONECore","generateHwIdentifier","generateSwIdentifier","SW_DID_NAME_PREFIX","HISTORY_LIST_QUERY_KEY","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","backupInfo","keepPreviousData","useCreateBackup","queryClient","password","outputPath","createBackup","onSuccess","invalidateQueries","useUnpackBackup","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","generateHwKey","generateSwKey","mutateAsync","organisationId","swIdentifierId","_identifiers$values$f","identifiers","getIdentifiers","states","ACTIVE","page","pageSize","types","DID","isRemote","values","find","identifier","name","startsWith","id","Promise","all","catch","err"],"sources":["backup.ts"],"sourcesContent":["import { IdentifierStateEnum, IdentifierTypeEnum } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport {\n generateHwIdentifier,\n generateSwIdentifier,\n IdentifiersInitializationConfig,\n SW_DID_NAME_PREFIX,\n} from './core-init';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst BACKUP_INFO_QUERY_KEY = 'backup-info';\n\nexport const useBackupInfo = () => {\n const { core } = useONECore();\n\n return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {\n keepPreviousData: true,\n });\n};\n\nexport const useCreateBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, outputPath }: { outputPath: string; password: string }) =>\n core.createBackup(password, outputPath),\n {\n onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY),\n },\n );\n};\n\nexport const useUnpackBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, inputPath }: { inputPath: string; password: string }) => core.unpackBackup(password, inputPath),\n {\n onSuccess: () => queryClient.resetQueries(),\n },\n );\n};\n\nexport const useFinalizeImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.finalizeImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useRollbackImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.rollbackImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\n/**\n * Finalize backup import and extract/prepare identifiers\n * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be restored/created\n * @returns [hwIdentifierId, swIdentifierId]\n */\nexport const useBackupFinalizeImportProcedure = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {\n const { mutateAsync: finalizeImport } = useFinalizeImport();\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n await finalizeImport();\n\n // update wallet identifier references\n let swIdentifierId: string | undefined;\n if (generateSwKey) {\n const identifiers = await core.getIdentifiers({\n states: [IdentifierStateEnum.ACTIVE],\n organisationId,\n page: 0,\n pageSize: 1,\n types: [IdentifierTypeEnum.DID],\n isRemote: false,\n });\n swIdentifierId = identifiers.values.find((identifier) => identifier.name.startsWith(SW_DID_NAME_PREFIX))?.id;\n }\n\n return Promise.all([\n generateHwKey ? generateHwIdentifier(core, organisationId) : null,\n !swIdentifierId && generateSwKey ? generateSwIdentifier(core, organisationId) : swIdentifierId,\n ]).catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [finalizeImport, generateSwKey, generateHwKey, core, organisationId]);\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,EAAEC,kBAAkB,QAAQ,iCAAiC;AACzF,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAEnE,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SACEC,oBAAoB,EACpBC,oBAAoB,EAEpBC,kBAAkB,QACb,aAAa;AACpB,SAASC,sBAAsB,QAAQ,WAAW;AAElD,MAAMC,qBAAqB,GAAG,aAAa;AAE3C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAGP,UAAU,CAAC,CAAC;EAE7B,OAAOH,QAAQ,CAAC,CAACQ,qBAAqB,CAAC,EAAE,MAAME,IAAI,CAACC,UAAU,CAAC,CAAC,EAA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GAAGC,cAAc,CAC/F,CAAC,CAACmB,KAAK,CAAEC,GAAG,IAAK;MAChBnD,eAAe,CAACmD,GAAG,EAAE,mCAAmC,CAAC;MACzD,MAAMA,GAAG;IACX,CAAC,CAAC;EACJ,CAAC,EAAE,CAAC5B,cAAc,EAAEK,aAAa,EAAED,aAAa,EAAEnB,IAAI,EAAEsB,cAAc,CAAC,CAAC;AAC1E,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["IdentifierStateBindingEnum","IdentifierTypeBindingEnum","useCallback","useMutation","useQuery","useQueryClient","reportException","useONECore","generateHwIdentifier","generateSwIdentifier","SW_DID_NAME_PREFIX","HISTORY_LIST_QUERY_KEY","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","backupInfo","keepPreviousData","useCreateBackup","queryClient","password","outputPath","createBackup","onSuccess","invalidateQueries","useUnpackBackup","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","generateHwKey","generateSwKey","mutateAsync","organisationId","swIdentifierId","_identifiers$values$f","identifiers","listIdentifiers","states","ACTIVE","page","pageSize","types","DID","isRemote","values","find","identifier","name","startsWith","id","Promise","all","catch","err"],"sources":["backup.ts"],"sourcesContent":["import { IdentifierStateBindingEnum, IdentifierTypeBindingEnum } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport {\n generateHwIdentifier,\n generateSwIdentifier,\n IdentifiersInitializationConfig,\n SW_DID_NAME_PREFIX,\n} from './core-init';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst BACKUP_INFO_QUERY_KEY = 'backup-info';\n\nexport const useBackupInfo = () => {\n const { core } = useONECore();\n\n return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {\n keepPreviousData: true,\n });\n};\n\nexport const useCreateBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, outputPath }: { outputPath: string; password: string }) =>\n core.createBackup(password, outputPath),\n {\n onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY),\n },\n );\n};\n\nexport const useUnpackBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, inputPath }: { inputPath: string; password: string }) => core.unpackBackup(password, inputPath),\n {\n onSuccess: () => queryClient.resetQueries(),\n },\n );\n};\n\nexport const useFinalizeImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.finalizeImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useRollbackImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.rollbackImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\n/**\n * Finalize backup import and extract/prepare identifiers\n * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be restored/created\n * @returns [hwIdentifierId, swIdentifierId]\n */\nexport const useBackupFinalizeImportProcedure = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {\n const { mutateAsync: finalizeImport } = useFinalizeImport();\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n await finalizeImport();\n\n // update wallet identifier references\n let swIdentifierId: string | undefined;\n if (generateSwKey) {\n const identifiers = await core.listIdentifiers({\n states: [IdentifierStateBindingEnum.ACTIVE],\n organisationId,\n page: 0,\n pageSize: 1,\n types: [IdentifierTypeBindingEnum.DID],\n isRemote: false,\n });\n swIdentifierId = identifiers.values.find((identifier) => identifier.name.startsWith(SW_DID_NAME_PREFIX))?.id;\n }\n\n return Promise.all([\n generateHwKey ? generateHwIdentifier(core, organisationId) : null,\n !swIdentifierId && generateSwKey ? generateSwIdentifier(core, organisationId) : swIdentifierId,\n ]).catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [finalizeImport, generateSwKey, generateHwKey, core, organisationId]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M,CAAC;QAC3CN,cAAc;QACdO,IAAI,EAAE,CAAC;QACPC,QAAQ,EAAE,CAAC;QACXC,KAAK,EAAE,CAAC5C,yBAAyB,CAAC6C,GAAG,CAAC;QACtCC,QAAQ,EAAE;MACZ,CAAC,CAAC;MACFV,cAAc,IAAAC,qBAAA,GAAGC,WAAW,CAACS,MAAM,CAACC,IAAI,CAAEC,UAAU,IAAKA,UAAU,CAACC,IAAI,CAACC,UAAU,CAAC1C,kBAAkB,CAAC,CAAC,cAAA4B,qBAAA,uBAAvFA,qBAAA,CAAyFe,EAAE;IAC9G;IAEA,OAAOC,OAAO,CAACC,GAAG,CAAC,CACjBtB,aAAa,GAAGzB,oBAAoB,CAACM,IAAI,EAAEsB,cAAc,CAAC,GAAG,IAAI,EACjE,CAACC,cAAc,IAAIH,aAAa,GAAGzB,oBAAoB,CAACK,IAAI,EAAEsB,cAAc,CAAC,GAAGC,cAAc,CAC/F,CAAC,CAACmB,KAAK,CAAEC,GAAG,IAAK;MAChBnD,eAAe,CAACmD,GAAG,EAAE,mCAAmC,CAAC;MACzD,MAAMA,GAAG;IACX,CAAC,CAAC;EACJ,CAAC,EAAE,CAAC5B,cAAc,EAAEK,aAAa,EAAED,aAAa,EAAEnB,IAAI,EAAEsB,cAAc,CAAC,CAAC;AAC1E,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { CacheType } from '@procivis/react-native-one-core';
1
+ import { CacheTypeBindingDto } 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';
@@ -6,17 +6,17 @@ import { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } f
6
6
  const CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];
7
7
  const TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];
8
8
 
9
- // Map each CacheType to the query keys that should be invalidated when that cache is cleared.
9
+ // Map each CacheTypeBindingDto to the query keys that should be invalidated when that cache is cleared.
10
10
  const cacheTypeToQueryKeys = {
11
- [CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,
12
- [CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,
13
- [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
14
- [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
15
- [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
16
- [CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
17
- [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
18
- [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
19
- [CacheType.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS
11
+ [CacheTypeBindingDto.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,
12
+ [CacheTypeBindingDto.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,
13
+ [CacheTypeBindingDto.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
14
+ [CacheTypeBindingDto.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
15
+ [CacheTypeBindingDto.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
16
+ [CacheTypeBindingDto.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
17
+ [CacheTypeBindingDto.X509_CRL]: CREDENTIAL_QUERY_KEYS,
18
+ [CacheTypeBindingDto.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
19
+ [CacheTypeBindingDto.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS
20
20
  };
21
21
  export const useCacheClear = () => {
22
22
  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,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AKhB,WAAW,CAACiB,iBAAiB,CAACD,QAAQ,CAAC,CAAC,CAAC;IAC1G;EACF,CACF,CAAC;AACH,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["CacheTypeBindingDto","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 { CacheTypeBindingDto } 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 CacheTypeBindingDto to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheTypeBindingDto, string[]> = {\n [CacheTypeBindingDto.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],\n [CacheTypeBindingDto.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.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: CacheTypeBindingDto[]) => {\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,mBAAmB,QAAQ,iCAAiC;AACrE,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;AAC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,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":[]}
@@ -11,12 +11,12 @@ const defaultContextValue = {
11
11
  const ONECoreContext = /*#__PURE__*/createContext(defaultContextValue);
12
12
  export const ONECoreContextProvider = ({
13
13
  children,
14
- organisationId = '11111111-2222-3333-a444-ffffffffffff',
14
+ organisationId = defaultContextValue.organisationId,
15
15
  publisherReference,
16
16
  config
17
17
  }) => {
18
18
  const [core, setCore] = useState();
19
- const createTrustAnchor = useCreateTrustAnchor(publisherReference);
19
+ const createTrustAnchor = useCreateTrustAnchor();
20
20
  const initialize = useCallback(async force => {
21
21
  if (core && !force) {
22
22
  return core;
@@ -41,16 +41,16 @@ export const ONECoreContextProvider = ({
41
41
  // eslint-disable-next-line react-hooks/exhaustive-deps
42
42
  []);
43
43
  useEffect(() => {
44
- if (!core) {
44
+ if (!core || !publisherReference) {
45
45
  return;
46
46
  }
47
47
  core.getConfig().then(coreConfig => {
48
48
  const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(TrustManagementEnum.SimpleTrustList);
49
49
  if (trustManagementEnabled) {
50
- createTrustAnchor(core).catch(() => {});
50
+ createTrustAnchor(core, publisherReference).catch(() => {});
51
51
  }
52
52
  }).catch(() => {});
53
- }, [core, createTrustAnchor]);
53
+ }, [core, createTrustAnchor, publisherReference]);
54
54
  const contextValue = useMemo(() => ({
55
55
  core: core !== null && core !== void 0 ? core : defaultContextValue.core,
56
56
  organisationId,
@@ -1 +1 @@
1
- {"version":3,"names":["initializeCore","React","createContext","useCallback","useContext","useEffect","useMemo","useState","reportException","getEnabledTrustManagement","TrustManagementEnum","useCreateTrustAnchor","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","ONECoreContextProvider","children","publisherReference","config","setCore","createTrustAnchor","force","coreInstance","e","corePromise","then","c","uninitialize","catch","getConfig","coreConfig","trustManagementEnabled","includes","SimpleTrustList","contextValue","createElement","Provider","value","useONECore"],"sources":["core-context.tsx"],"sourcesContent":["import { initializeCore, ONECore } from '@procivis/react-native-one-core';\nimport React, {\n createContext,\n FC,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { reportException } from '../../reporting';\nimport { getEnabledTrustManagement } from './core-config';\nimport { TrustManagementEnum, useCreateTrustAnchor } from './trust-entity';\n\ninterface ContextValue {\n core: ONECore;\n organisationId: string;\n initialize: (force?: boolean) => Promise<ONECore>;\n}\n\nconst defaultContextValue: ContextValue = {\n core: {} as ONECore,\n organisationId: '11111111-2222-3333-a444-ffffffffffff',\n initialize: () => Promise.reject(),\n};\n\nexport type ONECoreContextProviderProps = {\n config?: Record<string, unknown>;\n organisationId?: string;\n publisherReference: string;\n};\n\nconst ONECoreContext = createContext<ContextValue>(defaultContextValue);\n\nexport const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({\n children,\n organisationId = '11111111-2222-3333-a444-ffffffffffff',\n publisherReference,\n config,\n}) => {\n const [core, setCore] = useState<ONECore>();\n const createTrustAnchor = useCreateTrustAnchor(publisherReference);\n\n const initialize = useCallback(\n async (force?: boolean) => {\n if (core && !force) {\n return core;\n }\n\n try {\n const coreInstance = await initializeCore(config);\n setCore(coreInstance);\n return coreInstance;\n } catch (e) {\n reportException(e, 'Failed to initialize core');\n throw e;\n }\n },\n [core, config],\n );\n\n useEffect(\n () => {\n const corePromise = initialize();\n return () => {\n corePromise\n .then((c) => c?.uninitialize(false))\n .catch((e) => {\n reportException(e, 'Core uninitialization error');\n });\n };\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n useEffect(() => {\n if (!core) {\n return;\n }\n\n core\n .getConfig()\n .then((coreConfig) => {\n const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(\n TrustManagementEnum.SimpleTrustList,\n );\n\n if (trustManagementEnabled) {\n createTrustAnchor(core).catch(() => {});\n }\n })\n .catch(() => {});\n }, [core, createTrustAnchor]);\n\n const contextValue = useMemo(\n () => ({\n core: core ?? defaultContextValue.core,\n organisationId,\n initialize,\n }),\n [core, initialize, organisationId],\n );\n\n if (!core) {\n return null;\n }\n\n return <ONECoreContext.Provider value={contextValue}>{children}</ONECoreContext.Provider>;\n};\n\nexport const useONECore = () => useContext(ONECoreContext);\n"],"mappings":"AAAA,SAASA,cAAc,QAAiB,iCAAiC;AACzE,OAAOC,KAAK,IACVC,aAAa,EAGbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AAEd,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,yBAAyB,QAAQ,eAAe;AACzD,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,gBAAgB;AAQ1E,MAAMC,mBAAiC,GAAG;EACxCC,IAAI,EAAE,CAAC,CAAY;EACnBC,cAAc,EAAE,sCAAsC;EACtDC,UAAU,EAAEA,CAAA,KAAMC,OAAO,CAACC,MAAM,CAAC;AACnC,CAAC;AAQD,MAAMC,cAAc,gBAAGhB,aAAa,CAAeU,mBAAmB,CAAC;AAEvE,OAAO,MAAMO,sBAA0E,GAAGA,CAAC;EACzFC,QAAQ;EACRN,cAAc,GAAG,sCAAsC;EACvDO,kBAAkB;EAClBC;AACF,CAAC,KAAK;EACJ,MAAM,CAACT,IAAI,EAAEU,OAAO,CAAC,GAAGhB,QAAQ,CAAU,CAAC;EAC3C,MAAMiB,iBAAiB,GAAGb,oBAAoB,CAACU,kBAAkB,CAAC;EAElE,MAAMN,UAAU,GAAGZ,WAAW,CAC5B,MAAOsB,KAAe,IAAK;IACzB,IAAIZ,IAAI,IAAI,CAACY,KAAK,EAAE;MAClB,OAAOZ,IAAI;IACb;IAEA,IAAI;MACF,MAAMa,YAAY,GAAG,MAAM1B,cAAc,CAACsB,MAAM,CAAC;MACjDC,OAA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;EAED,IAAI,CAACD,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,oBAAOZ,KAAA,CAAAsC,aAAA,CAACrB,cAAc,CAACsB,QAAQ;IAACC,KAAK,EAAEH;EAAa,GAAElB,QAAkC,CAAC;AAC3F,CAAC;AAED,OAAO,MAAMsB,UAAU,GAAGA,CAAA,KAAMtC,UAAU,CAACc,cAAc,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["initializeCore","React","createContext","useCallback","useContext","useEffect","useMemo","useState","reportException","getEnabledTrustManagement","TrustManagementEnum","useCreateTrustAnchor","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","ONECoreContextProvider","children","publisherReference","config","setCore","createTrustAnchor","force","coreInstance","e","corePromise","then","c","uninitialize","catch","getConfig","coreConfig","trustManagementEnabled","includes","SimpleTrustList","contextValue","createElement","Provider","value","useONECore"],"sources":["core-context.tsx"],"sourcesContent":["import { initializeCore, ONECore } from '@procivis/react-native-one-core';\nimport React, {\n createContext,\n FC,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { reportException } from '../../reporting';\nimport { getEnabledTrustManagement } from './core-config';\nimport { TrustManagementEnum, useCreateTrustAnchor } from './trust-entity';\n\ninterface ContextValue {\n core: ONECore;\n organisationId: string;\n initialize: (force?: boolean) => Promise<ONECore>;\n}\n\nconst defaultContextValue: ContextValue = {\n core: {} as ONECore,\n organisationId: '11111111-2222-3333-a444-ffffffffffff',\n initialize: () => Promise.reject(),\n};\n\nexport type ONECoreContextProviderProps = {\n config?: Record<string, unknown>;\n organisationId?: string;\n publisherReference?: string;\n};\n\nconst ONECoreContext = createContext<ContextValue>(defaultContextValue);\n\nexport const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({\n children,\n organisationId = defaultContextValue.organisationId,\n publisherReference,\n config,\n}) => {\n const [core, setCore] = useState<ONECore>();\n const createTrustAnchor = useCreateTrustAnchor();\n\n const initialize = useCallback(\n async (force?: boolean) => {\n if (core && !force) {\n return core;\n }\n\n try {\n const coreInstance = await initializeCore(config);\n setCore(coreInstance);\n return coreInstance;\n } catch (e) {\n reportException(e, 'Failed to initialize core');\n throw e;\n }\n },\n [core, config],\n );\n\n useEffect(\n () => {\n const corePromise = initialize();\n return () => {\n corePromise\n .then((c) => c?.uninitialize(false))\n .catch((e) => {\n reportException(e, 'Core uninitialization error');\n });\n };\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n useEffect(() => {\n if (!core || !publisherReference) {\n return;\n }\n\n core\n .getConfig()\n .then((coreConfig) => {\n const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(\n TrustManagementEnum.SimpleTrustList,\n );\n\n if (trustManagementEnabled) {\n createTrustAnchor(core, publisherReference).catch(() => {});\n }\n })\n .catch(() => {});\n }, [core, createTrustAnchor, publisherReference]);\n\n const contextValue = useMemo(\n () => ({\n core: core ?? defaultContextValue.core,\n organisationId,\n initialize,\n }),\n [core, initialize, organisationId],\n );\n\n if (!core) {\n return null;\n }\n\n return <ONECoreContext.Provider value={contextValue}>{children}</ONECoreContext.Provider>;\n};\n\nexport const useONECore = () => useContext(ONECoreContext);\n"],"mappings":"AAAA,SAASA,cAAc,QAAiB,iCAAiC;AACzE,OAAOC,KAAK,IACVC,aAAa,EAGbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AAEd,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,yBAAyB,QAAQ,eAAe;AACzD,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,gBAAgB;AAQ1E,MAAMC,mBAAiC,GAAG;EACxCC,IAAI,EAAE,CAAC,CAAY;EACnBC,cAAc,EAAE,sCAAsC;EACtDC,UAAU,EAAEA,CAAA,KAAMC,OAAO,CAACC,MAAM,CAAC;AACnC,CAAC;AAQD,MAAMC,cAAc,gBAAGhB,aAAa,CAAeU,mBAAmB,CAAC;A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