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

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 (889) hide show
  1. package/README.md +3 -8
  2. package/lib/commonjs/components/backup/index.js.map +1 -1
  3. package/lib/commonjs/components/backup/preview-credentials.js +18 -22
  4. package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
  5. package/lib/commonjs/components/credential/credential.js +11 -12
  6. package/lib/commonjs/components/credential/credential.js.map +1 -1
  7. package/lib/commonjs/components/credential/index.js.map +1 -1
  8. package/lib/commonjs/components/entity/EntityButtons.js +20 -25
  9. package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
  10. package/lib/commonjs/components/entity/entity-attributes.js +16 -18
  11. package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
  12. package/lib/commonjs/components/entity/entity-details-with-buttons.js +31 -23
  13. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
  14. package/lib/commonjs/components/entity/entity-details.js +30 -31
  15. package/lib/commonjs/components/entity/entity-details.js.map +1 -1
  16. package/lib/commonjs/components/entity/index.js +2 -2
  17. package/lib/commonjs/components/entity/index.js.map +1 -1
  18. package/lib/commonjs/components/history/history-details-screen.js +67 -0
  19. package/lib/commonjs/components/history/history-details-screen.js.map +1 -0
  20. package/lib/commonjs/components/history/history-list-item-icon.js +97 -0
  21. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -0
  22. package/lib/commonjs/components/history/history-list-item.js +55 -0
  23. package/lib/commonjs/components/history/history-list-item.js.map +1 -0
  24. package/lib/commonjs/components/history/history-list-screen.js +123 -0
  25. package/lib/commonjs/components/history/history-list-screen.js.map +1 -0
  26. package/lib/commonjs/components/history/history-list-section-header.js +39 -0
  27. package/lib/commonjs/components/history/history-list-section-header.js.map +1 -0
  28. package/lib/commonjs/components/history/history-list.js +100 -0
  29. package/lib/commonjs/components/history/history-list.js.map +1 -0
  30. package/lib/commonjs/components/history/index.js +72 -0
  31. package/lib/commonjs/components/history/index.js.map +1 -0
  32. package/lib/commonjs/components/index.js +11 -0
  33. package/lib/commonjs/components/index.js.map +1 -1
  34. package/lib/commonjs/components/navigation/header-buttons.js +21 -25
  35. package/lib/commonjs/components/navigation/header-buttons.js.map +1 -1
  36. package/lib/commonjs/components/navigation/index.js.map +1 -1
  37. package/lib/commonjs/components/proof-request/group.js +4 -5
  38. package/lib/commonjs/components/proof-request/group.js.map +1 -1
  39. package/lib/commonjs/components/proof-request/index.js.map +1 -1
  40. package/lib/commonjs/components/proof-request/select-credential.js +11 -12
  41. package/lib/commonjs/components/proof-request/select-credential.js.map +1 -1
  42. package/lib/commonjs/components/proof-request/share-credential.js +25 -28
  43. package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
  44. package/lib/commonjs/index.js.map +1 -1
  45. package/lib/commonjs/normalize-color.d.js.map +1 -1
  46. package/lib/commonjs/ui-components/accessibility/accessibility.js +11 -7
  47. package/lib/commonjs/ui-components/accessibility/accessibility.js.map +1 -1
  48. package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js +8 -12
  49. package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js.map +1 -1
  50. package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js +15 -17
  51. package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  52. package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js +8 -10
  53. package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
  54. package/lib/commonjs/ui-components/accessibility/index.js +1 -30
  55. package/lib/commonjs/ui-components/accessibility/index.js.map +1 -1
  56. package/lib/commonjs/ui-components/accessibility/locale/index.js +2 -3
  57. package/lib/commonjs/ui-components/accessibility/locale/index.js.map +1 -1
  58. package/lib/commonjs/ui-components/accessibility/locale.test.js.map +1 -1
  59. package/lib/commonjs/ui-components/action-modal/ActionModal.js +9 -11
  60. package/lib/commonjs/ui-components/action-modal/ActionModal.js.map +1 -1
  61. package/lib/commonjs/ui-components/action-modal/index.js +1 -1
  62. package/lib/commonjs/ui-components/action-modal/index.js.map +1 -1
  63. package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js +10 -12
  64. package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js.map +1 -1
  65. package/lib/commonjs/ui-components/activity-indicator/index.js +1 -1
  66. package/lib/commonjs/ui-components/activity-indicator/index.js.map +1 -1
  67. package/lib/commonjs/ui-components/blur/blur-view.js +13 -15
  68. package/lib/commonjs/ui-components/blur/blur-view.js.map +1 -1
  69. package/lib/commonjs/ui-components/blur/index.js +2 -2
  70. package/lib/commonjs/ui-components/blur/index.js.map +1 -1
  71. package/lib/commonjs/ui-components/buttons/back-button.js +12 -15
  72. package/lib/commonjs/ui-components/buttons/back-button.js.map +1 -1
  73. package/lib/commonjs/ui-components/buttons/button.js +19 -22
  74. package/lib/commonjs/ui-components/buttons/button.js.map +1 -1
  75. package/lib/commonjs/ui-components/buttons/connectivity-button.js +16 -18
  76. package/lib/commonjs/ui-components/buttons/connectivity-button.js.map +1 -1
  77. package/lib/commonjs/ui-components/buttons/filter-button.js +8 -10
  78. package/lib/commonjs/ui-components/buttons/filter-button.js.map +1 -1
  79. package/lib/commonjs/ui-components/buttons/ghost-button.js +12 -14
  80. package/lib/commonjs/ui-components/buttons/ghost-button.js.map +1 -1
  81. package/lib/commonjs/ui-components/buttons/hold-button.js +244 -0
  82. package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -0
  83. package/lib/commonjs/ui-components/buttons/index.js +9 -37
  84. package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
  85. package/lib/commonjs/ui-components/buttons/scan-button.js +7 -9
  86. package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
  87. package/lib/commonjs/ui-components/camera/camera-overlay.js +11 -14
  88. package/lib/commonjs/ui-components/camera/camera-overlay.js.map +1 -1
  89. package/lib/commonjs/ui-components/camera/index.js +2 -2
  90. package/lib/commonjs/ui-components/camera/index.js.map +1 -1
  91. package/lib/commonjs/ui-components/camera/qr-code-scanner.js +12 -14
  92. package/lib/commonjs/ui-components/camera/qr-code-scanner.js.map +1 -1
  93. package/lib/commonjs/ui-components/control/checkbox.js +11 -12
  94. package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
  95. package/lib/commonjs/ui-components/control/index.js.map +1 -1
  96. package/lib/commonjs/ui-components/control/switch.js +10 -12
  97. package/lib/commonjs/ui-components/control/switch.js.map +1 -1
  98. package/lib/commonjs/ui-components/credential/card/credential-card.js +22 -26
  99. package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
  100. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +30 -35
  101. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  102. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +27 -20
  103. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  104. package/lib/commonjs/ui-components/credential/card/credential-header.js +25 -24
  105. package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
  106. package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js +27 -29
  107. package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js.map +1 -1
  108. package/lib/commonjs/ui-components/credential/card/index.js +6 -41
  109. package/lib/commonjs/ui-components/credential/card/index.js.map +1 -1
  110. package/lib/commonjs/ui-components/credential/credential-attribute-item.js +51 -60
  111. package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
  112. package/lib/commonjs/ui-components/credential/credential-carousel-images.js +18 -21
  113. package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
  114. package/lib/commonjs/ui-components/credential/index.js +2 -25
  115. package/lib/commonjs/ui-components/credential/index.js.map +1 -1
  116. package/lib/commonjs/ui-components/credential/selector-status.js +3 -4
  117. package/lib/commonjs/ui-components/credential/selector-status.js.map +1 -1
  118. package/lib/commonjs/ui-components/credential/selector.js +8 -10
  119. package/lib/commonjs/ui-components/credential/selector.js.map +1 -1
  120. package/lib/commonjs/ui-components/detail/detail.js +12 -14
  121. package/lib/commonjs/ui-components/detail/detail.js.map +1 -1
  122. package/lib/commonjs/ui-components/detail/index.js +1 -1
  123. package/lib/commonjs/ui-components/detail/index.js.map +1 -1
  124. package/lib/commonjs/ui-components/entity/avatar.js +14 -16
  125. package/lib/commonjs/ui-components/entity/avatar.js.map +1 -1
  126. package/lib/commonjs/ui-components/entity/entity-cluster.js +16 -19
  127. package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
  128. package/lib/commonjs/ui-components/entity/index.js +2 -2
  129. package/lib/commonjs/ui-components/entity/index.js.map +1 -1
  130. package/lib/commonjs/ui-components/header/focus-aware-status-bar.js +3 -4
  131. package/lib/commonjs/ui-components/header/focus-aware-status-bar.js.map +1 -1
  132. package/lib/commonjs/ui-components/header/foldable-header.js +14 -17
  133. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  134. package/lib/commonjs/ui-components/header/header.js +12 -14
  135. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  136. package/lib/commonjs/ui-components/header/index.js +4 -24
  137. package/lib/commonjs/ui-components/header/index.js.map +1 -1
  138. package/lib/commonjs/ui-components/header/navigation-header.js +27 -33
  139. package/lib/commonjs/ui-components/header/navigation-header.js.map +1 -1
  140. package/lib/commonjs/ui-components/history/data-item.js +30 -23
  141. package/lib/commonjs/ui-components/history/data-item.js.map +1 -1
  142. package/lib/commonjs/ui-components/history/history-details.js +181 -0
  143. package/lib/commonjs/ui-components/history/history-details.js.map +1 -0
  144. package/lib/commonjs/ui-components/history/{history-list-item.js → history-item.js} +47 -26
  145. package/lib/commonjs/ui-components/history/history-item.js.map +1 -0
  146. package/lib/commonjs/ui-components/history/history-section-header.js +7 -9
  147. package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
  148. package/lib/commonjs/ui-components/history/history-section-list-item.js +13 -12
  149. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  150. package/lib/commonjs/ui-components/history/index.js +30 -9
  151. package/lib/commonjs/ui-components/history/index.js.map +1 -1
  152. package/lib/commonjs/ui-components/icons/connectivity.js +19 -24
  153. package/lib/commonjs/ui-components/icons/connectivity.js.map +1 -1
  154. package/lib/commonjs/ui-components/icons/credential.js +60 -71
  155. package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
  156. package/lib/commonjs/ui-components/icons/entity.js +36 -9
  157. package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
  158. package/lib/commonjs/ui-components/icons/history.js +115 -133
  159. package/lib/commonjs/ui-components/icons/history.js.map +1 -1
  160. package/lib/commonjs/ui-components/icons/icons.js +73 -90
  161. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  162. package/lib/commonjs/ui-components/icons/index.js.map +1 -1
  163. package/lib/commonjs/ui-components/icons/input.js +3 -3
  164. package/lib/commonjs/ui-components/icons/input.js.map +1 -1
  165. package/lib/commonjs/ui-components/icons/keypad.js +69 -81
  166. package/lib/commonjs/ui-components/icons/keypad.js.map +1 -1
  167. package/lib/commonjs/ui-components/icons/loader.js +4 -4
  168. package/lib/commonjs/ui-components/icons/loader.js.map +1 -1
  169. package/lib/commonjs/ui-components/icons/nerd-view.js +6 -9
  170. package/lib/commonjs/ui-components/icons/nerd-view.js.map +1 -1
  171. package/lib/commonjs/ui-components/icons/selector.js +8 -9
  172. package/lib/commonjs/ui-components/icons/selector.js.map +1 -1
  173. package/lib/commonjs/ui-components/icons/wallet.js +16 -19
  174. package/lib/commonjs/ui-components/icons/wallet.js.map +1 -1
  175. package/lib/commonjs/ui-components/image/image-or-component.js +15 -18
  176. package/lib/commonjs/ui-components/image/image-or-component.js.map +1 -1
  177. package/lib/commonjs/ui-components/image/index.js +2 -9
  178. package/lib/commonjs/ui-components/image/index.js.map +1 -1
  179. package/lib/commonjs/ui-components/index.js.map +1 -1
  180. package/lib/commonjs/ui-components/input/index.js +2 -2
  181. package/lib/commonjs/ui-components/input/index.js.map +1 -1
  182. package/lib/commonjs/ui-components/input/radio-group.js +28 -25
  183. package/lib/commonjs/ui-components/input/radio-group.js.map +1 -1
  184. package/lib/commonjs/ui-components/input/selection-input.js +27 -38
  185. package/lib/commonjs/ui-components/input/selection-input.js.map +1 -1
  186. package/lib/commonjs/ui-components/input/text-input.js +25 -28
  187. package/lib/commonjs/ui-components/input/text-input.js.map +1 -1
  188. package/lib/commonjs/ui-components/list/index.js +20 -2
  189. package/lib/commonjs/ui-components/list/index.js.map +1 -1
  190. package/lib/commonjs/ui-components/list/list-page-loading-indicator.js +14 -0
  191. package/lib/commonjs/ui-components/list/list-page-loading-indicator.js.map +1 -0
  192. package/lib/commonjs/ui-components/list/list-section-header.js +10 -12
  193. package/lib/commonjs/ui-components/list/list-section-header.js.map +1 -1
  194. package/lib/commonjs/ui-components/list/list-title-header.js +6 -8
  195. package/lib/commonjs/ui-components/list/list-title-header.js.map +1 -1
  196. package/lib/commonjs/ui-components/list/wallet/empty-list.js +73 -0
  197. package/lib/commonjs/ui-components/list/wallet/empty-list.js.map +1 -0
  198. package/lib/commonjs/ui-components/list/wallet/empty-search-result.js +41 -0
  199. package/lib/commonjs/ui-components/list/wallet/empty-search-result.js.map +1 -0
  200. package/lib/commonjs/ui-components/list/wallet/index.js +21 -0
  201. package/lib/commonjs/ui-components/list/wallet/index.js.map +1 -0
  202. package/lib/commonjs/ui-components/loader/index.js +2 -2
  203. package/lib/commonjs/ui-components/loader/index.js.map +1 -1
  204. package/lib/commonjs/ui-components/loader/loader.js +17 -17
  205. package/lib/commonjs/ui-components/loader/loader.js.map +1 -1
  206. package/lib/commonjs/ui-components/loader/loading-result.js +22 -21
  207. package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
  208. package/lib/commonjs/ui-components/nerd-view/index.js +2 -8
  209. package/lib/commonjs/ui-components/nerd-view/index.js.map +1 -1
  210. package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js +37 -41
  211. package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
  212. package/lib/commonjs/ui-components/pin/index.js +2 -2
  213. package/lib/commonjs/ui-components/pin/index.js.map +1 -1
  214. package/lib/commonjs/ui-components/pin/keypad.js +19 -23
  215. package/lib/commonjs/ui-components/pin/keypad.js.map +1 -1
  216. package/lib/commonjs/ui-components/pin/pin-code-screen.js +19 -21
  217. package/lib/commonjs/ui-components/pin/pin-code-screen.js.map +1 -1
  218. package/lib/commonjs/ui-components/pin/pin-lock-animation.js +1 -2
  219. package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -1
  220. package/lib/commonjs/ui-components/pin/pin-lock.js +10 -12
  221. package/lib/commonjs/ui-components/pin/pin-lock.js.map +1 -1
  222. package/lib/commonjs/ui-components/pin/pins.js +8 -9
  223. package/lib/commonjs/ui-components/pin/pins.js.map +1 -1
  224. package/lib/commonjs/ui-components/screens/backup-screen.js +15 -18
  225. package/lib/commonjs/ui-components/screens/backup-screen.js.map +1 -1
  226. package/lib/commonjs/ui-components/screens/image-preview-screen.js +12 -14
  227. package/lib/commonjs/ui-components/screens/image-preview-screen.js.map +1 -1
  228. package/lib/commonjs/ui-components/screens/index.js +8 -49
  229. package/lib/commonjs/ui-components/screens/index.js.map +1 -1
  230. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +35 -42
  231. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  232. package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js +14 -16
  233. package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
  234. package/lib/commonjs/ui-components/screens/scroll-view-screen.js +12 -14
  235. package/lib/commonjs/ui-components/screens/scroll-view-screen.js.map +1 -1
  236. package/lib/commonjs/ui-components/screens/section-list-screen.js +13 -15
  237. package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
  238. package/lib/commonjs/ui-components/searchbar/animated-search-bar.js +10 -12
  239. package/lib/commonjs/ui-components/searchbar/animated-search-bar.js.map +1 -1
  240. package/lib/commonjs/ui-components/searchbar/index.js +2 -2
  241. package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
  242. package/lib/commonjs/ui-components/searchbar/search-bar.js +15 -17
  243. package/lib/commonjs/ui-components/searchbar/search-bar.js.map +1 -1
  244. package/lib/commonjs/ui-components/settings/button-setting.js +14 -16
  245. package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
  246. package/lib/commonjs/ui-components/settings/index.js +2 -2
  247. package/lib/commonjs/ui-components/settings/index.js.map +1 -1
  248. package/lib/commonjs/ui-components/settings/setting-item-separator.js +6 -8
  249. package/lib/commonjs/ui-components/settings/setting-item-separator.js.map +1 -1
  250. package/lib/commonjs/ui-components/settings/setting-item.js +11 -13
  251. package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
  252. package/lib/commonjs/ui-components/settings/settings-button.js +7 -9
  253. package/lib/commonjs/ui-components/settings/settings-button.js.map +1 -1
  254. package/lib/commonjs/ui-components/settings/switch-setting.js +11 -13
  255. package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
  256. package/lib/commonjs/ui-components/state/error-screen.js +10 -12
  257. package/lib/commonjs/ui-components/state/error-screen.js.map +1 -1
  258. package/lib/commonjs/ui-components/state/index.js +2 -2
  259. package/lib/commonjs/ui-components/state/index.js.map +1 -1
  260. package/lib/commonjs/ui-components/text/base.js +14 -16
  261. package/lib/commonjs/ui-components/text/base.js.map +1 -1
  262. package/lib/commonjs/ui-components/text/font.js +11 -13
  263. package/lib/commonjs/ui-components/text/font.js.map +1 -1
  264. package/lib/commonjs/ui-components/text/index.js +2 -9
  265. package/lib/commonjs/ui-components/text/index.js.map +1 -1
  266. package/lib/commonjs/ui-components/text/typography.js +10 -13
  267. package/lib/commonjs/ui-components/text/typography.js.map +1 -1
  268. package/lib/commonjs/ui-components/theme/color-scheme-context.js +2 -1
  269. package/lib/commonjs/ui-components/theme/color-scheme-context.js.map +1 -1
  270. package/lib/commonjs/ui-components/theme/color-scheme.js.map +1 -1
  271. package/lib/commonjs/ui-components/theme/index.js.map +1 -1
  272. package/lib/commonjs/utils/array.js.map +1 -1
  273. package/lib/commonjs/utils/backup.js.map +1 -1
  274. package/lib/commonjs/utils/color.js +1 -1
  275. package/lib/commonjs/utils/color.js.map +1 -1
  276. package/lib/commonjs/utils/contrasting-status-bar.js +8 -10
  277. package/lib/commonjs/utils/contrasting-status-bar.js.map +1 -1
  278. package/lib/commonjs/utils/date.js +3 -3
  279. package/lib/commonjs/utils/date.js.map +1 -1
  280. package/lib/commonjs/utils/filtering.js +11 -0
  281. package/lib/commonjs/utils/filtering.js.map +1 -0
  282. package/lib/commonjs/utils/history.js +76 -0
  283. package/lib/commonjs/utils/history.js.map +1 -0
  284. package/lib/commonjs/utils/hooks/connectivity/connectivity.js +37 -23
  285. package/lib/commonjs/utils/hooks/connectivity/connectivity.js.map +1 -1
  286. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +6 -0
  287. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  288. package/lib/commonjs/utils/hooks/core/backup.js +31 -31
  289. package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
  290. package/lib/commonjs/utils/hooks/core/cache.js +44 -0
  291. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -0
  292. package/lib/commonjs/utils/hooks/core/core-config.js +15 -1
  293. package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
  294. package/lib/commonjs/utils/hooks/core/core-context.js +15 -10
  295. package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
  296. package/lib/commonjs/utils/hooks/core/core-init.js +44 -34
  297. package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
  298. package/lib/commonjs/utils/hooks/core/credential-schemas.js +16 -27
  299. package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
  300. package/lib/commonjs/utils/hooks/core/credentials.js +28 -37
  301. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  302. package/lib/commonjs/utils/hooks/core/dids.js +4 -6
  303. package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
  304. package/lib/commonjs/utils/hooks/core/error-code.js +3 -4
  305. package/lib/commonjs/utils/hooks/core/error-code.js.map +1 -1
  306. package/lib/commonjs/utils/hooks/core/history.js +5 -37
  307. package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
  308. package/lib/commonjs/utils/hooks/core/identifiers.js +20 -0
  309. package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -0
  310. package/lib/commonjs/utils/hooks/core/index.js +22 -0
  311. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  312. package/lib/commonjs/utils/hooks/core/proof-schemas.js +23 -38
  313. package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
  314. package/lib/commonjs/utils/hooks/core/proofs.js +108 -76
  315. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  316. package/lib/commonjs/utils/hooks/core/query.js +1 -2
  317. package/lib/commonjs/utils/hooks/core/query.js.map +1 -1
  318. package/lib/commonjs/utils/hooks/core/trust-entity.js +17 -7
  319. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
  320. package/lib/commonjs/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
  321. package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js +1 -2
  322. package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js.map +1 -1
  323. package/lib/commonjs/utils/hooks/http/client.js.map +1 -1
  324. package/lib/commonjs/utils/hooks/index.js.map +1 -1
  325. package/lib/commonjs/utils/hooks/list/list-content-inset.js +9 -10
  326. package/lib/commonjs/utils/hooks/list/list-content-inset.js.map +1 -1
  327. package/lib/commonjs/utils/hooks/navigation/before-remove.js.map +1 -1
  328. package/lib/commonjs/utils/hooks/navigation/close-button-timeout.js.map +1 -1
  329. package/lib/commonjs/utils/hooks/navigation/deep-link.js +3 -4
  330. package/lib/commonjs/utils/hooks/navigation/deep-link.js.map +1 -1
  331. package/lib/commonjs/utils/hooks/navigation/index.js.map +1 -1
  332. package/lib/commonjs/utils/hooks/navigation/open-settings.js +1 -2
  333. package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
  334. package/lib/commonjs/utils/hooks/pin-security/pin-security.js +1 -2
  335. package/lib/commonjs/utils/hooks/pin-security/pin-security.js.map +1 -1
  336. package/lib/commonjs/utils/hooks/revocation/credential-status.js +17 -26
  337. package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
  338. package/lib/commonjs/utils/index.js +37 -1
  339. package/lib/commonjs/utils/index.js.map +1 -1
  340. package/lib/commonjs/utils/navigation.js +5 -5
  341. package/lib/commonjs/utils/navigation.js.map +1 -1
  342. package/lib/commonjs/utils/parsers/credential-images.js +1 -1
  343. package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
  344. package/lib/commonjs/utils/parsers/credential-sharing.js +24 -25
  345. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  346. package/lib/commonjs/utils/parsers/credential.js +23 -26
  347. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  348. package/lib/commonjs/utils/parsers/index.js +11 -0
  349. package/lib/commonjs/utils/parsers/index.js.map +1 -1
  350. package/lib/commonjs/utils/parsers/query.js +4 -3
  351. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  352. package/lib/commonjs/utils/parsers/universal-links.js +33 -0
  353. package/lib/commonjs/utils/parsers/universal-links.js.map +1 -0
  354. package/lib/commonjs/utils/parsers/universal-links.test.js +40 -0
  355. package/lib/commonjs/utils/parsers/universal-links.test.js.map +1 -0
  356. package/lib/commonjs/utils/ref.js.map +1 -1
  357. package/lib/commonjs/utils/reporting.js +4 -2
  358. package/lib/commonjs/utils/reporting.js.map +1 -1
  359. package/lib/commonjs/utils/string.js.map +1 -1
  360. package/lib/commonjs/utils/testID.js +1 -4
  361. package/lib/commonjs/utils/testID.js.map +1 -1
  362. package/lib/commonjs/utils/testID.test.js.map +1 -1
  363. package/lib/commonjs/utils/useMemoAsync.js +9 -0
  364. package/lib/commonjs/utils/useMemoAsync.js.map +1 -1
  365. package/lib/commonjs/utils/uuid.js +1 -1
  366. package/lib/commonjs/utils/uuid.js.map +1 -1
  367. package/lib/module/components/backup/index.js.map +1 -1
  368. package/lib/module/components/backup/preview-credentials.js +17 -21
  369. package/lib/module/components/backup/preview-credentials.js.map +1 -1
  370. package/lib/module/components/credential/credential.js +10 -11
  371. package/lib/module/components/credential/credential.js.map +1 -1
  372. package/lib/module/components/credential/index.js.map +1 -1
  373. package/lib/module/components/entity/EntityButtons.js +17 -21
  374. package/lib/module/components/entity/EntityButtons.js.map +1 -1
  375. package/lib/module/components/entity/entity-attributes.js +13 -14
  376. package/lib/module/components/entity/entity-attributes.js.map +1 -1
  377. package/lib/module/components/entity/entity-details-with-buttons.js +29 -20
  378. package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
  379. package/lib/module/components/entity/entity-details.js +28 -28
  380. package/lib/module/components/entity/entity-details.js.map +1 -1
  381. package/lib/module/components/entity/index.js.map +1 -1
  382. package/lib/module/components/history/history-details-screen.js +59 -0
  383. package/lib/module/components/history/history-details-screen.js.map +1 -0
  384. package/lib/module/components/history/history-list-item-icon.js +87 -0
  385. package/lib/module/components/history/history-list-item-icon.js.map +1 -0
  386. package/lib/module/components/history/history-list-item.js +46 -0
  387. package/lib/module/components/history/history-list-item.js.map +1 -0
  388. package/lib/module/components/history/history-list-screen.js +114 -0
  389. package/lib/module/components/history/history-list-screen.js.map +1 -0
  390. package/lib/module/components/history/history-list-section-header.js +29 -0
  391. package/lib/module/components/history/history-list-section-header.js.map +1 -0
  392. package/lib/module/components/history/history-list.js +90 -0
  393. package/lib/module/components/history/history-list.js.map +1 -0
  394. package/lib/module/components/history/index.js +7 -0
  395. package/lib/module/components/history/index.js.map +1 -0
  396. package/lib/module/components/index.js +1 -0
  397. package/lib/module/components/index.js.map +1 -1
  398. package/lib/module/components/navigation/header-buttons.js +19 -23
  399. package/lib/module/components/navigation/header-buttons.js.map +1 -1
  400. package/lib/module/components/navigation/index.js.map +1 -1
  401. package/lib/module/components/proof-request/group.js +3 -4
  402. package/lib/module/components/proof-request/group.js.map +1 -1
  403. package/lib/module/components/proof-request/index.js.map +1 -1
  404. package/lib/module/components/proof-request/select-credential.js +10 -11
  405. package/lib/module/components/proof-request/select-credential.js.map +1 -1
  406. package/lib/module/components/proof-request/share-credential.js +23 -26
  407. package/lib/module/components/proof-request/share-credential.js.map +1 -1
  408. package/lib/module/index.js.map +1 -1
  409. package/lib/module/normalize-color.d.js.map +1 -1
  410. package/lib/module/ui-components/accessibility/accessibility.js +5 -7
  411. package/lib/module/ui-components/accessibility/accessibility.js.map +1 -1
  412. package/lib/module/ui-components/accessibility/accessibilityHistory.js +4 -8
  413. package/lib/module/ui-components/accessibility/accessibilityHistory.js.map +1 -1
  414. package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js +10 -8
  415. package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  416. package/lib/module/ui-components/accessibility/accessibilityLanguage.js +6 -8
  417. package/lib/module/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
  418. package/lib/module/ui-components/accessibility/index.js +4 -4
  419. package/lib/module/ui-components/accessibility/index.js.map +1 -1
  420. package/lib/module/ui-components/accessibility/locale/index.js.map +1 -1
  421. package/lib/module/ui-components/accessibility/locale.test.js.map +1 -1
  422. package/lib/module/ui-components/action-modal/ActionModal.js +7 -8
  423. package/lib/module/ui-components/action-modal/ActionModal.js.map +1 -1
  424. package/lib/module/ui-components/action-modal/index.js.map +1 -1
  425. package/lib/module/ui-components/activity-indicator/activity-indicator.js +6 -7
  426. package/lib/module/ui-components/activity-indicator/activity-indicator.js.map +1 -1
  427. package/lib/module/ui-components/activity-indicator/index.js.map +1 -1
  428. package/lib/module/ui-components/blur/blur-view.js +10 -11
  429. package/lib/module/ui-components/blur/blur-view.js.map +1 -1
  430. package/lib/module/ui-components/blur/index.js.map +1 -1
  431. package/lib/module/ui-components/buttons/back-button.js +10 -11
  432. package/lib/module/ui-components/buttons/back-button.js.map +1 -1
  433. package/lib/module/ui-components/buttons/button.js +17 -18
  434. package/lib/module/ui-components/buttons/button.js.map +1 -1
  435. package/lib/module/ui-components/buttons/connectivity-button.js +14 -14
  436. package/lib/module/ui-components/buttons/connectivity-button.js.map +1 -1
  437. package/lib/module/ui-components/buttons/filter-button.js +6 -7
  438. package/lib/module/ui-components/buttons/filter-button.js.map +1 -1
  439. package/lib/module/ui-components/buttons/ghost-button.js +9 -10
  440. package/lib/module/ui-components/buttons/ghost-button.js.map +1 -1
  441. package/lib/module/ui-components/buttons/hold-button.js +236 -0
  442. package/lib/module/ui-components/buttons/hold-button.js.map +1 -0
  443. package/lib/module/ui-components/buttons/index.js +8 -7
  444. package/lib/module/ui-components/buttons/index.js.map +1 -1
  445. package/lib/module/ui-components/buttons/scan-button.js +5 -6
  446. package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
  447. package/lib/module/ui-components/camera/camera-overlay.js +7 -9
  448. package/lib/module/ui-components/camera/camera-overlay.js.map +1 -1
  449. package/lib/module/ui-components/camera/index.js.map +1 -1
  450. package/lib/module/ui-components/camera/qr-code-scanner.js +8 -9
  451. package/lib/module/ui-components/camera/qr-code-scanner.js.map +1 -1
  452. package/lib/module/ui-components/control/checkbox.js +9 -10
  453. package/lib/module/ui-components/control/checkbox.js.map +1 -1
  454. package/lib/module/ui-components/control/index.js.map +1 -1
  455. package/lib/module/ui-components/control/switch.js +8 -9
  456. package/lib/module/ui-components/control/switch.js.map +1 -1
  457. package/lib/module/ui-components/credential/card/credential-card.js +16 -17
  458. package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
  459. package/lib/module/ui-components/credential/card/credential-details-card.js +26 -30
  460. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  461. package/lib/module/ui-components/credential/card/credential-details-list-item.js +23 -15
  462. package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  463. package/lib/module/ui-components/credential/card/credential-header.js +21 -19
  464. package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
  465. package/lib/module/ui-components/credential/card/credential-image-carousel.js +23 -23
  466. package/lib/module/ui-components/credential/card/credential-image-carousel.js.map +1 -1
  467. package/lib/module/ui-components/credential/card/index.js +10 -10
  468. package/lib/module/ui-components/credential/card/index.js.map +1 -1
  469. package/lib/module/ui-components/credential/credential-attribute-item.js +47 -55
  470. package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
  471. package/lib/module/ui-components/credential/credential-carousel-images.js +15 -18
  472. package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
  473. package/lib/module/ui-components/credential/index.js +2 -2
  474. package/lib/module/ui-components/credential/index.js.map +1 -1
  475. package/lib/module/ui-components/credential/selector-status.js +3 -3
  476. package/lib/module/ui-components/credential/selector-status.js.map +1 -1
  477. package/lib/module/ui-components/credential/selector.js +5 -6
  478. package/lib/module/ui-components/credential/selector.js.map +1 -1
  479. package/lib/module/ui-components/detail/detail.js +9 -10
  480. package/lib/module/ui-components/detail/detail.js.map +1 -1
  481. package/lib/module/ui-components/detail/index.js.map +1 -1
  482. package/lib/module/ui-components/entity/avatar.js +10 -11
  483. package/lib/module/ui-components/entity/avatar.js.map +1 -1
  484. package/lib/module/ui-components/entity/entity-cluster.js +12 -14
  485. package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
  486. package/lib/module/ui-components/entity/index.js.map +1 -1
  487. package/lib/module/ui-components/header/focus-aware-status-bar.js +1 -1
  488. package/lib/module/ui-components/header/focus-aware-status-bar.js.map +1 -1
  489. package/lib/module/ui-components/header/foldable-header.js +10 -12
  490. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  491. package/lib/module/ui-components/header/header.js +10 -11
  492. package/lib/module/ui-components/header/header.js.map +1 -1
  493. package/lib/module/ui-components/header/index.js +6 -6
  494. package/lib/module/ui-components/header/index.js.map +1 -1
  495. package/lib/module/ui-components/header/navigation-header.js +23 -28
  496. package/lib/module/ui-components/header/navigation-header.js.map +1 -1
  497. package/lib/module/ui-components/history/data-item.js +23 -15
  498. package/lib/module/ui-components/history/data-item.js.map +1 -1
  499. package/lib/module/ui-components/history/history-details.js +171 -0
  500. package/lib/module/ui-components/history/history-details.js.map +1 -0
  501. package/lib/module/ui-components/history/{history-list-item.js → history-item.js} +44 -22
  502. package/lib/module/ui-components/history/history-item.js.map +1 -0
  503. package/lib/module/ui-components/history/history-section-header.js +6 -7
  504. package/lib/module/ui-components/history/history-section-header.js.map +1 -1
  505. package/lib/module/ui-components/history/history-section-list-item.js +8 -9
  506. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  507. package/lib/module/ui-components/history/index.js +5 -4
  508. package/lib/module/ui-components/history/index.js.map +1 -1
  509. package/lib/module/ui-components/icons/connectivity.js +16 -21
  510. package/lib/module/ui-components/icons/connectivity.js.map +1 -1
  511. package/lib/module/ui-components/icons/credential.js +57 -68
  512. package/lib/module/ui-components/icons/credential.js.map +1 -1
  513. package/lib/module/ui-components/icons/entity.js +31 -5
  514. package/lib/module/ui-components/icons/entity.js.map +1 -1
  515. package/lib/module/ui-components/icons/history.js +103 -128
  516. package/lib/module/ui-components/icons/history.js.map +1 -1
  517. package/lib/module/ui-components/icons/icons.js +70 -87
  518. package/lib/module/ui-components/icons/icons.js.map +1 -1
  519. package/lib/module/ui-components/icons/index.js.map +1 -1
  520. package/lib/module/ui-components/icons/input.js.map +1 -1
  521. package/lib/module/ui-components/icons/keypad.js +66 -78
  522. package/lib/module/ui-components/icons/keypad.js.map +1 -1
  523. package/lib/module/ui-components/icons/loader.js +1 -1
  524. package/lib/module/ui-components/icons/loader.js.map +1 -1
  525. package/lib/module/ui-components/icons/nerd-view.js.map +1 -1
  526. package/lib/module/ui-components/icons/selector.js +5 -6
  527. package/lib/module/ui-components/icons/selector.js.map +1 -1
  528. package/lib/module/ui-components/icons/wallet.js +13 -16
  529. package/lib/module/ui-components/icons/wallet.js.map +1 -1
  530. package/lib/module/ui-components/image/image-or-component.js +12 -14
  531. package/lib/module/ui-components/image/image-or-component.js.map +1 -1
  532. package/lib/module/ui-components/image/index.js +2 -2
  533. package/lib/module/ui-components/image/index.js.map +1 -1
  534. package/lib/module/ui-components/index.js.map +1 -1
  535. package/lib/module/ui-components/input/index.js.map +1 -1
  536. package/lib/module/ui-components/input/radio-group.js +26 -22
  537. package/lib/module/ui-components/input/radio-group.js.map +1 -1
  538. package/lib/module/ui-components/input/selection-input.js +21 -31
  539. package/lib/module/ui-components/input/selection-input.js.map +1 -1
  540. package/lib/module/ui-components/input/text-input.js +21 -22
  541. package/lib/module/ui-components/input/text-input.js.map +1 -1
  542. package/lib/module/ui-components/list/index.js +1 -0
  543. package/lib/module/ui-components/list/index.js.map +1 -1
  544. package/lib/module/ui-components/list/list-page-loading-indicator.js +7 -0
  545. package/lib/module/ui-components/list/list-page-loading-indicator.js.map +1 -0
  546. package/lib/module/ui-components/list/list-section-header.js +8 -9
  547. package/lib/module/ui-components/list/list-section-header.js.map +1 -1
  548. package/lib/module/ui-components/list/list-title-header.js +4 -5
  549. package/lib/module/ui-components/list/list-title-header.js.map +1 -1
  550. package/lib/module/ui-components/list/wallet/empty-list.js +66 -0
  551. package/lib/module/ui-components/list/wallet/empty-list.js.map +1 -0
  552. package/lib/module/ui-components/list/wallet/empty-search-result.js +34 -0
  553. package/lib/module/ui-components/list/wallet/empty-search-result.js.map +1 -0
  554. package/lib/module/ui-components/list/wallet/index.js +4 -0
  555. package/lib/module/ui-components/list/wallet/index.js.map +1 -0
  556. package/lib/module/ui-components/loader/index.js.map +1 -1
  557. package/lib/module/ui-components/loader/loader.js +14 -12
  558. package/lib/module/ui-components/loader/loader.js.map +1 -1
  559. package/lib/module/ui-components/loader/loading-result.js +21 -19
  560. package/lib/module/ui-components/loader/loading-result.js.map +1 -1
  561. package/lib/module/ui-components/nerd-view/index.js +2 -2
  562. package/lib/module/ui-components/nerd-view/index.js.map +1 -1
  563. package/lib/module/ui-components/nerd-view/nerd-mode-item.js +31 -34
  564. package/lib/module/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
  565. package/lib/module/ui-components/pin/index.js.map +1 -1
  566. package/lib/module/ui-components/pin/keypad.js +17 -19
  567. package/lib/module/ui-components/pin/keypad.js.map +1 -1
  568. package/lib/module/ui-components/pin/pin-code-screen.js +16 -17
  569. package/lib/module/ui-components/pin/pin-code-screen.js.map +1 -1
  570. package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -1
  571. package/lib/module/ui-components/pin/pin-lock.js +6 -7
  572. package/lib/module/ui-components/pin/pin-lock.js.map +1 -1
  573. package/lib/module/ui-components/pin/pins.js +7 -8
  574. package/lib/module/ui-components/pin/pins.js.map +1 -1
  575. package/lib/module/ui-components/screens/backup-screen.js +13 -14
  576. package/lib/module/ui-components/screens/backup-screen.js.map +1 -1
  577. package/lib/module/ui-components/screens/image-preview-screen.js +9 -10
  578. package/lib/module/ui-components/screens/image-preview-screen.js.map +1 -1
  579. package/lib/module/ui-components/screens/index.js +12 -12
  580. package/lib/module/ui-components/screens/index.js.map +1 -1
  581. package/lib/module/ui-components/screens/nerd-mode-screen.js +30 -35
  582. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  583. package/lib/module/ui-components/screens/qr-code-scanner-screen.js +10 -11
  584. package/lib/module/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
  585. package/lib/module/ui-components/screens/scroll-view-screen.js +10 -11
  586. package/lib/module/ui-components/screens/scroll-view-screen.js.map +1 -1
  587. package/lib/module/ui-components/screens/section-list-screen.js +11 -12
  588. package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
  589. package/lib/module/ui-components/searchbar/animated-search-bar.js +6 -7
  590. package/lib/module/ui-components/searchbar/animated-search-bar.js.map +1 -1
  591. package/lib/module/ui-components/searchbar/index.js.map +1 -1
  592. package/lib/module/ui-components/searchbar/search-bar.js +11 -12
  593. package/lib/module/ui-components/searchbar/search-bar.js.map +1 -1
  594. package/lib/module/ui-components/settings/button-setting.js +10 -11
  595. package/lib/module/ui-components/settings/button-setting.js.map +1 -1
  596. package/lib/module/ui-components/settings/index.js.map +1 -1
  597. package/lib/module/ui-components/settings/setting-item-separator.js +4 -5
  598. package/lib/module/ui-components/settings/setting-item-separator.js.map +1 -1
  599. package/lib/module/ui-components/settings/setting-item.js +7 -8
  600. package/lib/module/ui-components/settings/setting-item.js.map +1 -1
  601. package/lib/module/ui-components/settings/settings-button.js +5 -6
  602. package/lib/module/ui-components/settings/settings-button.js.map +1 -1
  603. package/lib/module/ui-components/settings/switch-setting.js +9 -10
  604. package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
  605. package/lib/module/ui-components/state/error-screen.js +7 -8
  606. package/lib/module/ui-components/state/error-screen.js.map +1 -1
  607. package/lib/module/ui-components/state/index.js.map +1 -1
  608. package/lib/module/ui-components/text/base.js +12 -13
  609. package/lib/module/ui-components/text/base.js.map +1 -1
  610. package/lib/module/ui-components/text/font.js +10 -11
  611. package/lib/module/ui-components/text/font.js.map +1 -1
  612. package/lib/module/ui-components/text/index.js +2 -2
  613. package/lib/module/ui-components/text/index.js.map +1 -1
  614. package/lib/module/ui-components/text/typography.js +8 -10
  615. package/lib/module/ui-components/text/typography.js.map +1 -1
  616. package/lib/module/ui-components/theme/color-scheme-context.js +1 -0
  617. package/lib/module/ui-components/theme/color-scheme-context.js.map +1 -1
  618. package/lib/module/ui-components/theme/color-scheme.js.map +1 -1
  619. package/lib/module/ui-components/theme/index.js.map +1 -1
  620. package/lib/module/utils/array.js.map +1 -1
  621. package/lib/module/utils/backup.js.map +1 -1
  622. package/lib/module/utils/color.js.map +1 -1
  623. package/lib/module/utils/contrasting-status-bar.js +5 -6
  624. package/lib/module/utils/contrasting-status-bar.js.map +1 -1
  625. package/lib/module/utils/date.js +4 -4
  626. package/lib/module/utils/date.js.map +1 -1
  627. package/lib/module/utils/filtering.js +4 -0
  628. package/lib/module/utils/filtering.js.map +1 -0
  629. package/lib/module/utils/history.js +66 -0
  630. package/lib/module/utils/history.js.map +1 -0
  631. package/lib/module/utils/hooks/connectivity/connectivity.js +36 -19
  632. package/lib/module/utils/hooks/connectivity/connectivity.js.map +1 -1
  633. package/lib/module/utils/hooks/connectivity/connectivity.test.js +6 -0
  634. package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  635. package/lib/module/utils/hooks/core/backup.js +31 -31
  636. package/lib/module/utils/hooks/core/backup.js.map +1 -1
  637. package/lib/module/utils/hooks/core/cache.js +37 -0
  638. package/lib/module/utils/hooks/core/cache.js.map +1 -0
  639. package/lib/module/utils/hooks/core/core-config.js +11 -0
  640. package/lib/module/utils/hooks/core/core-config.js.map +1 -1
  641. package/lib/module/utils/hooks/core/core-context.js +14 -9
  642. package/lib/module/utils/hooks/core/core-context.js.map +1 -1
  643. package/lib/module/utils/hooks/core/core-init.js +42 -30
  644. package/lib/module/utils/hooks/core/core-init.js.map +1 -1
  645. package/lib/module/utils/hooks/core/credential-schemas.js +12 -19
  646. package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
  647. package/lib/module/utils/hooks/core/credentials.js +27 -36
  648. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  649. package/lib/module/utils/hooks/core/dids.js +3 -4
  650. package/lib/module/utils/hooks/core/dids.js.map +1 -1
  651. package/lib/module/utils/hooks/core/error-code.js +3 -3
  652. package/lib/module/utils/hooks/core/error-code.js.map +1 -1
  653. package/lib/module/utils/hooks/core/history.js +4 -35
  654. package/lib/module/utils/hooks/core/history.js.map +1 -1
  655. package/lib/module/utils/hooks/core/identifiers.js +13 -0
  656. package/lib/module/utils/hooks/core/identifiers.js.map +1 -0
  657. package/lib/module/utils/hooks/core/index.js +2 -0
  658. package/lib/module/utils/hooks/core/index.js.map +1 -1
  659. package/lib/module/utils/hooks/core/proof-schemas.js +19 -30
  660. package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
  661. package/lib/module/utils/hooks/core/proofs.js +102 -67
  662. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  663. package/lib/module/utils/hooks/core/query.js.map +1 -1
  664. package/lib/module/utils/hooks/core/trust-entity.js +16 -6
  665. package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
  666. package/lib/module/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
  667. package/lib/module/utils/hooks/header/on-scroll-header-state.js +1 -2
  668. package/lib/module/utils/hooks/header/on-scroll-header-state.js.map +1 -1
  669. package/lib/module/utils/hooks/http/client.js.map +1 -1
  670. package/lib/module/utils/hooks/index.js.map +1 -1
  671. package/lib/module/utils/hooks/list/list-content-inset.js +9 -10
  672. package/lib/module/utils/hooks/list/list-content-inset.js.map +1 -1
  673. package/lib/module/utils/hooks/navigation/before-remove.js.map +1 -1
  674. package/lib/module/utils/hooks/navigation/close-button-timeout.js.map +1 -1
  675. package/lib/module/utils/hooks/navigation/deep-link.js +3 -4
  676. package/lib/module/utils/hooks/navigation/deep-link.js.map +1 -1
  677. package/lib/module/utils/hooks/navigation/index.js.map +1 -1
  678. package/lib/module/utils/hooks/navigation/open-settings.js +1 -2
  679. package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
  680. package/lib/module/utils/hooks/pin-security/pin-security.js +1 -2
  681. package/lib/module/utils/hooks/pin-security/pin-security.js.map +1 -1
  682. package/lib/module/utils/hooks/revocation/credential-status.js +17 -26
  683. package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
  684. package/lib/module/utils/index.js +3 -0
  685. package/lib/module/utils/index.js.map +1 -1
  686. package/lib/module/utils/navigation.js +5 -5
  687. package/lib/module/utils/navigation.js.map +1 -1
  688. package/lib/module/utils/parsers/credential-images.js.map +1 -1
  689. package/lib/module/utils/parsers/credential-sharing.js +23 -24
  690. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  691. package/lib/module/utils/parsers/credential.js +23 -25
  692. package/lib/module/utils/parsers/credential.js.map +1 -1
  693. package/lib/module/utils/parsers/index.js +1 -0
  694. package/lib/module/utils/parsers/index.js.map +1 -1
  695. package/lib/module/utils/parsers/query.js +4 -3
  696. package/lib/module/utils/parsers/query.js.map +1 -1
  697. package/lib/module/utils/parsers/universal-links.js +25 -0
  698. package/lib/module/utils/parsers/universal-links.js.map +1 -0
  699. package/lib/module/utils/parsers/universal-links.test.js +38 -0
  700. package/lib/module/utils/parsers/universal-links.test.js.map +1 -0
  701. package/lib/module/utils/ref.js.map +1 -1
  702. package/lib/module/utils/reporting.js +1 -0
  703. package/lib/module/utils/reporting.js.map +1 -1
  704. package/lib/module/utils/string.js.map +1 -1
  705. package/lib/module/utils/testID.js +1 -4
  706. package/lib/module/utils/testID.js.map +1 -1
  707. package/lib/module/utils/testID.test.js.map +1 -1
  708. package/lib/module/utils/useMemoAsync.js +10 -0
  709. package/lib/module/utils/useMemoAsync.js.map +1 -1
  710. package/lib/module/utils/uuid.js.map +1 -1
  711. package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
  712. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -2
  713. package/lib/typescript/components/entity/entity-details.d.ts +3 -2
  714. package/lib/typescript/components/history/history-details-screen.d.ts +20 -0
  715. package/lib/typescript/components/history/history-list-item-icon.d.ts +8 -0
  716. package/lib/typescript/components/history/history-list-item.d.ts +21 -0
  717. package/lib/typescript/components/history/history-list-screen.d.ts +24 -0
  718. package/lib/typescript/components/history/history-list-section-header.d.ts +13 -0
  719. package/lib/typescript/components/history/history-list.d.ts +19 -0
  720. package/lib/typescript/components/history/index.d.ts +6 -0
  721. package/lib/typescript/components/index.d.ts +1 -0
  722. package/lib/typescript/ui-components/accessibility/accessibility.d.ts +2 -2
  723. package/lib/typescript/ui-components/accessibility/accessibilityHistory.d.ts +1 -1
  724. package/lib/typescript/ui-components/accessibility/accessibilityHistoryWrappers.d.ts +3 -3
  725. package/lib/typescript/ui-components/accessibility/index.d.ts +5 -3
  726. package/lib/typescript/ui-components/buttons/button.d.ts +2 -2
  727. package/lib/typescript/ui-components/buttons/hold-button.d.ts +16 -0
  728. package/lib/typescript/ui-components/buttons/index.d.ts +15 -7
  729. package/lib/typescript/ui-components/buttons/scan-button.d.ts +2 -2
  730. package/lib/typescript/ui-components/credential/card/credential-header.d.ts +1 -1
  731. package/lib/typescript/ui-components/credential/card/index.d.ts +10 -5
  732. package/lib/typescript/ui-components/credential/index.d.ts +2 -1
  733. package/lib/typescript/ui-components/header/index.d.ts +6 -3
  734. package/lib/typescript/ui-components/history/data-item.d.ts +2 -2
  735. package/lib/typescript/ui-components/history/history-details.d.ts +51 -0
  736. package/lib/typescript/ui-components/history/{history-list-item.d.ts → history-item.d.ts} +4 -3
  737. package/lib/typescript/ui-components/history/history-section-header.d.ts +2 -2
  738. package/lib/typescript/ui-components/history/history-section-list-item.d.ts +2 -2
  739. package/lib/typescript/ui-components/history/index.d.ts +5 -4
  740. package/lib/typescript/ui-components/icons/entity.d.ts +1 -0
  741. package/lib/typescript/ui-components/icons/history.d.ts +22 -35
  742. package/lib/typescript/ui-components/image/index.d.ts +2 -1
  743. package/lib/typescript/ui-components/input/selection-input.d.ts +1 -1
  744. package/lib/typescript/ui-components/list/index.d.ts +1 -0
  745. package/lib/typescript/ui-components/list/list-page-loading-indicator.d.ts +4 -0
  746. package/lib/typescript/ui-components/list/wallet/empty-list.d.ts +10 -0
  747. package/lib/typescript/ui-components/list/wallet/empty-search-result.d.ts +7 -0
  748. package/lib/typescript/ui-components/list/wallet/index.d.ts +3 -0
  749. package/lib/typescript/ui-components/nerd-view/index.d.ts +2 -1
  750. package/lib/typescript/ui-components/pin/keypad.d.ts +2 -2
  751. package/lib/typescript/ui-components/screens/index.d.ts +12 -6
  752. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +4 -4
  753. package/lib/typescript/ui-components/text/index.d.ts +2 -1
  754. package/lib/typescript/ui-components/text/typography.d.ts +14 -14
  755. package/lib/typescript/ui-components/theme/color-scheme.d.ts +1 -0
  756. package/lib/typescript/utils/filtering.d.ts +1 -0
  757. package/lib/typescript/utils/history.d.ts +10 -0
  758. package/lib/typescript/utils/hooks/connectivity/connectivity.d.ts +1 -1
  759. package/lib/typescript/utils/hooks/core/backup.d.ts +2 -1
  760. package/lib/typescript/utils/hooks/core/cache.d.ts +2 -0
  761. package/lib/typescript/utils/hooks/core/core-config.d.ts +5 -1
  762. package/lib/typescript/utils/hooks/core/core-init.d.ts +10 -1
  763. package/lib/typescript/utils/hooks/core/credentials.d.ts +9 -4
  764. package/lib/typescript/utils/hooks/core/history.d.ts +2 -5
  765. package/lib/typescript/utils/hooks/core/identifiers.d.ts +2 -0
  766. package/lib/typescript/utils/hooks/core/index.d.ts +2 -0
  767. package/lib/typescript/utils/hooks/core/proofs.d.ts +16 -9
  768. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -1
  769. package/lib/typescript/utils/hooks/revocation/credential-status.d.ts +2 -1
  770. package/lib/typescript/utils/index.d.ts +3 -0
  771. package/lib/typescript/utils/parsers/index.d.ts +1 -0
  772. package/lib/typescript/utils/parsers/universal-links.d.ts +1 -0
  773. package/lib/typescript/utils/parsers/universal-links.test.d.ts +1 -0
  774. package/lib/typescript/utils/ref.d.ts +1 -1
  775. package/package.json +61 -47
  776. package/src/components/entity/entity-attributes.tsx +5 -4
  777. package/src/components/entity/entity-details-with-buttons.tsx +20 -13
  778. package/src/components/entity/entity-details.tsx +24 -27
  779. package/src/components/history/history-details-screen.tsx +89 -0
  780. package/src/components/history/history-list-item-icon.tsx +113 -0
  781. package/src/components/history/history-list-item.tsx +64 -0
  782. package/src/components/history/history-list-screen.tsx +157 -0
  783. package/src/components/history/history-list-section-header.tsx +42 -0
  784. package/src/components/history/history-list.tsx +116 -0
  785. package/src/components/history/index.tsx +6 -0
  786. package/src/components/index.ts +1 -0
  787. package/src/components/proof-request/share-credential.tsx +2 -1
  788. package/src/ui-components/accessibility/accessibility.ts +2 -2
  789. package/src/ui-components/accessibility/accessibilityHistory.tsx +2 -2
  790. package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +3 -5
  791. package/src/ui-components/accessibility/index.ts +4 -3
  792. package/src/ui-components/action-modal/ActionModal.stories.tsx +7 -3
  793. package/src/ui-components/activity-indicator/activity-indicator.stories.tsx +3 -6
  794. package/src/ui-components/buttons/back-button.stories.tsx +7 -8
  795. package/src/ui-components/buttons/button.stories.tsx +9 -10
  796. package/src/ui-components/buttons/connectivity-button.stories.tsx +10 -11
  797. package/src/ui-components/buttons/connectivity-button.tsx +1 -1
  798. package/src/ui-components/buttons/ghost-button.stories.tsx +8 -8
  799. package/src/ui-components/buttons/hold-button.stories.tsx +29 -0
  800. package/src/ui-components/buttons/hold-button.tsx +276 -0
  801. package/src/ui-components/buttons/index.ts +16 -6
  802. package/src/ui-components/buttons/scan-button.stories.tsx +8 -4
  803. package/src/ui-components/control/checkbox.stories.tsx +8 -8
  804. package/src/ui-components/control/switch.stories.tsx +11 -8
  805. package/src/ui-components/credential/card/credential-card.stories.tsx +22 -25
  806. package/src/ui-components/credential/card/credential-details-card.stories.tsx +249 -245
  807. package/src/ui-components/credential/card/credential-details-card.tsx +2 -2
  808. package/src/ui-components/credential/card/credential-details-list-item.tsx +16 -6
  809. package/src/ui-components/credential/card/credential-header.stories.tsx +15 -17
  810. package/src/ui-components/credential/card/credential-header.tsx +4 -1
  811. package/src/ui-components/credential/card/credential-image-carousel.tsx +4 -0
  812. package/src/ui-components/credential/card/index.ts +11 -5
  813. package/src/ui-components/credential/index.ts +2 -1
  814. package/src/ui-components/credential/selector.stories.tsx +7 -7
  815. package/src/ui-components/detail/detail.stories.tsx +11 -8
  816. package/src/ui-components/entity/avatar.stories.tsx +10 -7
  817. package/src/ui-components/entity/entity-cluster.stories.tsx +11 -8
  818. package/src/ui-components/entity/entity-cluster.tsx +1 -1
  819. package/src/ui-components/header/header.stories.tsx +10 -7
  820. package/src/ui-components/header/index.ts +6 -3
  821. package/src/ui-components/header/navigation-header.stories.tsx +11 -8
  822. package/src/ui-components/history/data-item.tsx +13 -4
  823. package/src/ui-components/history/history-details.tsx +247 -0
  824. package/src/ui-components/history/{history-list-item.tsx → history-item.tsx} +72 -33
  825. package/src/ui-components/history/history-section-header.tsx +2 -2
  826. package/src/ui-components/history/history-section-list-item.tsx +3 -3
  827. package/src/ui-components/history/index.ts +5 -4
  828. package/src/ui-components/icons/entity.tsx +27 -0
  829. package/src/ui-components/icons/history.tsx +84 -131
  830. package/src/ui-components/image/index.tsx +2 -1
  831. package/src/ui-components/input/radio-group.stories.tsx +34 -0
  832. package/src/ui-components/input/radio-group.tsx +8 -2
  833. package/src/ui-components/input/selection-input.stories.tsx +20 -17
  834. package/src/ui-components/list/index.ts +1 -0
  835. package/src/ui-components/list/list-page-loading-indicator.tsx +8 -0
  836. package/src/ui-components/list/wallet/empty-list.tsx +75 -0
  837. package/src/ui-components/list/wallet/empty-search-result.tsx +39 -0
  838. package/src/ui-components/list/wallet/index.tsx +4 -0
  839. package/src/ui-components/loader/loader.stories.tsx +6 -9
  840. package/src/ui-components/loader/loader.tsx +6 -3
  841. package/src/ui-components/loader/loading-result.stories.tsx +13 -10
  842. package/src/ui-components/loader/loading-result.tsx +8 -4
  843. package/src/ui-components/nerd-view/index.ts +2 -1
  844. package/src/ui-components/nerd-view/nerd-mode-item.tsx +2 -2
  845. package/src/ui-components/pin/pin-code-screen.stories.tsx +20 -13
  846. package/src/ui-components/screens/image-preview-screen.stories.tsx +9 -6
  847. package/src/ui-components/screens/index.ts +12 -6
  848. package/src/ui-components/screens/nerd-mode-screen.tsx +6 -6
  849. package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +10 -7
  850. package/src/ui-components/searchbar/search-bar.stories.tsx +15 -8
  851. package/src/ui-components/searchbar/search-bar.tsx +2 -2
  852. package/src/ui-components/state/error-screen.stories.tsx +8 -9
  853. package/src/ui-components/state/error-screen.tsx +1 -1
  854. package/src/ui-components/text/index.ts +2 -1
  855. package/src/ui-components/text/typography.stories.tsx +19 -12
  856. package/src/ui-components/theme/color-scheme-context.tsx +1 -0
  857. package/src/ui-components/theme/color-scheme.ts +1 -0
  858. package/src/utils/date.ts +5 -5
  859. package/src/utils/filtering.ts +5 -0
  860. package/src/utils/history.ts +71 -0
  861. package/src/utils/hooks/connectivity/connectivity.test.ts +8 -0
  862. package/src/utils/hooks/connectivity/connectivity.ts +28 -4
  863. package/src/utils/hooks/core/backup.ts +25 -21
  864. package/src/utils/hooks/core/cache.ts +43 -0
  865. package/src/utils/hooks/core/core-config.ts +19 -0
  866. package/src/utils/hooks/core/core-context.tsx +15 -2
  867. package/src/utils/hooks/core/core-init.ts +45 -27
  868. package/src/utils/hooks/core/credential-schemas.ts +1 -1
  869. package/src/utils/hooks/core/credentials.ts +18 -17
  870. package/src/utils/hooks/core/history.ts +2 -57
  871. package/src/utils/hooks/core/identifiers.ts +18 -0
  872. package/src/utils/hooks/core/index.ts +3 -1
  873. package/src/utils/hooks/core/proof-schemas.ts +1 -1
  874. package/src/utils/hooks/core/proofs.ts +111 -51
  875. package/src/utils/hooks/core/trust-entity.ts +21 -13
  876. package/src/utils/hooks/navigation/open-settings.ts +2 -3
  877. package/src/utils/hooks/revocation/credential-status.ts +3 -2
  878. package/src/utils/index.ts +3 -0
  879. package/src/utils/navigation.ts +4 -2
  880. package/src/utils/parsers/credential-sharing.tsx +25 -25
  881. package/src/utils/parsers/credential.ts +5 -1
  882. package/src/utils/parsers/index.ts +1 -0
  883. package/src/utils/parsers/query.tsx +4 -2
  884. package/src/utils/parsers/universal-links.test.ts +57 -0
  885. package/src/utils/parsers/universal-links.ts +26 -0
  886. package/src/utils/ref.ts +1 -1
  887. package/src/utils/reporting.ts +1 -0
  888. package/lib/commonjs/ui-components/history/history-list-item.js.map +0 -1
  889. package/lib/module/ui-components/history/history-list-item.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_reactNative","_uiComponents","_utils","_coreConfig","_credentials","_credential","_credentialSharing","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ShareCredential","_ref","_credential$issuerDid","allCredentials","credentialId","expanded","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","request","selectedCredentialId","selectedFields","style","testID","colorScheme","useAppColorScheme","data","credential","isLoading","useCredentialDetail","config","useCoreConfig","selectionOptions","useMemo","applicableCredentials","filter","applicableCredentialId","some","_ref2","id","state","CredentialStateEnum","ACCEPTED","multipleCredentialsAvailable","length","validityState","getValidityState","issuerDid","did","undefined","invalid","lvvcIssuanceDate","validityCredentialNbf","Date","footer","ValidityState","Revoked","createElement","View","styles","notice","backgroundColor","background","concatTestID","Typography","align","color","text","preset","revokedCredentialNotice","Suspended","suspendedCredentialNotice","invalidCredentialNotice","multipleCredentialsNotice","Button","onPress","noticeButton","title","multipleCredentialsSelect","type","ButtonType","Secondary","card","attributes","shareCredentialCardFromCredential","Boolean","CredentialDetailsCardListItem","onAttributeSelected","borderColor","exports","StyleSheet","create","borderRadius","borderWidth","marginBottom","marginHorizontal","padding","marginTop","paddingVertical"],"sources":["share-credential.tsx"],"sourcesContent":["import {\n CredentialListItem,\n CredentialStateEnum,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo } from 'react';\nimport { ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';\nimport { concatTestID } from '../../utils';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { getValidityState, ValidityState } from '../../utils/parsers/credential';\nimport { shareCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport type ShareCredentialLabels = ShareCredentialCardLabels & {\n revokedCredentialNotice: string;\n suspendedCredentialNotice: string;\n invalidCredentialNotice: string;\n multipleCredentialsNotice: string;\n multipleCredentialsSelect: string;\n};\n\nexport const ShareCredential: FunctionComponent<{\n allCredentials: CredentialListItem[];\n credentialId: string;\n expanded?: boolean;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (_id: PresentationDefinitionField['id'], _selected: boolean) => void;\n request: PresentationDefinitionRequestedCredential;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionField['id']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}> = ({\n allCredentials,\n credentialId,\n expanded,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n request,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { data: credential, isLoading } = useCredentialDetail(selectedCredentialId);\n const { data: config } = useCoreConfig();\n\n const selectionOptions = useMemo(\n () =>\n request.applicableCredentials.filter((applicableCredentialId) =>\n allCredentials.some(({ id, state }) => id === applicableCredentialId && state === CredentialStateEnum.ACCEPTED),\n ),\n [allCredentials, request],\n );\n const multipleCredentialsAvailable = selectionOptions.length > 1;\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuerDid: credential?.issuerDid?.did,\n }\n : undefined,\n );\n\n const invalid = useMemo(() => {\n if (!credential?.lvvcIssuanceDate || !request.validityCredentialNbf) {\n return false;\n }\n return new Date(credential.lvvcIssuanceDate) < new Date(request.validityCredentialNbf);\n }, [credential, request]);\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.revoked')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.revokedCredentialNotice}\n </Typography>\n </View>\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.suspended')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.suspendedCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (invalid) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.invalid')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.invalidCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.multiple')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.multipleCredentialsNotice}\n </Typography>\n <Button\n onPress={onSelectCredential}\n style={styles.noticeButton}\n testID={concatTestID(testID, 'notice.multiple.button')}\n title={labels.multipleCredentialsSelect}\n type={ButtonType.Secondary}\n />\n </View>\n );\n }\n }, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);\n\n if (isLoading || !config) {\n return null;\n }\n\n const { card, attributes } = shareCredentialCardFromCredential(\n credential,\n invalid,\n Boolean(expanded),\n multipleCredentialsAvailable,\n request,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId,\n onHeaderPress,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onSelectField}\n onImagePreview={onImagePreview}\n style={[styles.credential, { borderColor: colorScheme.background }, style]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n credential: {\n borderRadius: 10,\n borderWidth: 1,\n marginBottom: 8,\n },\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n noticeButton: {\n marginTop: 24,\n paddingVertical: 11,\n },\n});\n"],"mappings":";;;;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C,MAAM,EAAEA;EAAO,EACf;AAEN,CAAC;AAACkE,OAAA,CAAAlF,eAAA,GAAAA,eAAA;AAEF,MAAMoD,MAAM,GAAG+B,uBAAU,CAACC,MAAM,CAAC;EAC/BhE,UAAU,EAAE;IACViE,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB,CAAC;EACDlC,MAAM,EAAE;IACNkC,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,OAAO,EAAE;EACX,CAAC;EACDpB,YAAY,EAAE;IACZqB,SAAS,EAAE,EAAE;IACbC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_reactNative","_uiComponents","_utils","_coreConfig","_credentials","_credential","_credentialSharing","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ShareCredential","allCredentials","credentialId","expanded","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","request","selectedCredentialId","selectedFields","style","testID","_credential$issuerDid","_credential$issuer","colorScheme","useAppColorScheme","data","credential","isLoading","useCredentialDetail","config","useCoreConfig","selectionOptions","useMemo","applicableCredentials","filter","applicableCredentialId","some","id","state","CredentialStateEnum","ACCEPTED","multipleCredentialsAvailable","length","validityState","getValidityState","issuerDid","issuer","undefined","invalid","lvvcIssuanceDate","validityCredentialNbf","Date","footer","ValidityState","Revoked","createElement","View","styles","notice","backgroundColor","background","concatTestID","Typography","align","color","text","preset","revokedCredentialNotice","Suspended","suspendedCredentialNotice","invalidCredentialNotice","multipleCredentialsNotice","Button","onPress","noticeButton","title","multipleCredentialsSelect","type","ButtonType","Secondary","card","attributes","shareCredentialCardFromCredential","Boolean","CredentialDetailsCardListItem","onAttributeSelected","borderColor","exports","StyleSheet","create","borderRadius","borderWidth","marginBottom","marginHorizontal","padding","marginTop","paddingVertical"],"sources":["share-credential.tsx"],"sourcesContent":["import {\n CredentialListItem,\n CredentialStateEnum,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo } from 'react';\nimport { ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';\nimport { concatTestID } from '../../utils';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { getValidityState, ValidityState } from '../../utils/parsers/credential';\nimport { shareCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport type ShareCredentialLabels = ShareCredentialCardLabels & {\n revokedCredentialNotice: string;\n suspendedCredentialNotice: string;\n invalidCredentialNotice: string;\n multipleCredentialsNotice: string;\n multipleCredentialsSelect: string;\n};\n\nexport const ShareCredential: FunctionComponent<{\n allCredentials: CredentialListItem[];\n credentialId: string;\n expanded?: boolean;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (_id: PresentationDefinitionField['id'], _selected: boolean) => void;\n request: PresentationDefinitionRequestedCredential;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionField['id']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}> = ({\n allCredentials,\n credentialId,\n expanded,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n request,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { data: credential, isLoading } = useCredentialDetail(selectedCredentialId);\n const { data: config } = useCoreConfig();\n\n const selectionOptions = useMemo(\n () =>\n request.applicableCredentials.filter((applicableCredentialId) =>\n allCredentials.some(({ id, state }) => id === applicableCredentialId && state === CredentialStateEnum.ACCEPTED),\n ),\n [allCredentials, request],\n );\n const multipleCredentialsAvailable = selectionOptions.length > 1;\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuerDid: credential?.issuerDid?.id,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const invalid = useMemo(() => {\n if (!credential?.lvvcIssuanceDate || !request.validityCredentialNbf) {\n return false;\n }\n return new Date(credential.lvvcIssuanceDate) < new Date(request.validityCredentialNbf);\n }, [credential, request]);\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.revoked')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.revokedCredentialNotice}\n </Typography>\n </View>\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.suspended')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.suspendedCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (invalid) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.invalid')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.invalidCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.multiple')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.multipleCredentialsNotice}\n </Typography>\n <Button\n onPress={onSelectCredential}\n style={styles.noticeButton}\n testID={concatTestID(testID, 'notice.multiple.button')}\n title={labels.multipleCredentialsSelect}\n type={ButtonType.Secondary}\n />\n </View>\n );\n }\n }, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);\n\n if (isLoading || !config) {\n return null;\n }\n\n const { card, attributes } = shareCredentialCardFromCredential(\n credential,\n invalid,\n Boolean(expanded),\n multipleCredentialsAvailable,\n request,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId,\n onHeaderPress,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onSelectField}\n onImagePreview={onImagePreview}\n style={[styles.credential, { borderColor: colorScheme.background }, style]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n credential: {\n borderRadius: 10,\n borderWidth: 1,\n marginBottom: 8,\n },\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n noticeButton: {\n marginTop: 24,\n paddingVertical: 11,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAMA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AACA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,kBAAA,GAAAT,OAAA;AAAsH,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAA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AO,IAAI;EACb;EAEA,MAAM;IAAEmD,IAAI;IAAEC;EAAW,CAAC,GAAG,IAAAC,oDAAiC,EAC5DxD,UAAU,EACVsB,OAAO,EACPmC,OAAO,CAAC1E,QAAQ,CAAC,EACjBgC,4BAA4B,EAC5BzB,OAAO,EACPE,cAAc,EACdW,MAAM,EACNT,MAAM,EACNV,MACF,CAAC;EAED,oBACEjC,MAAA,CAAAe,OAAA,CAAA+D,aAAA,CAAC3E,aAAA,CAAAwG,6BAA6B;IAC5BH,UAAU,EAAEA,UAAW;IACvBD,IAAI,EAAE;MACJ,GAAGA,IAAI;MACPxE,YAAY;MACZI;IACF,CAAE;IACFH,QAAQ,EAAEA,QAAS;IACnB2C,MAAM,EAAEA,MAAO;IACfzC,QAAQ,EAAEA,QAAS;IACnB0E,mBAAmB,EAAEtE,aAAc;IACnCF,cAAc,EAAEA,cAAe;IAC/BM,KAAK,EAAE,CAACsC,MAAM,CAAC/B,UAAU,EAAE;MAAE4D,WAAW,EAAE/D,WAAW,CAACqC;IAAW,CAAC,EAAEzC,KAAK,CAAE;IAC3EC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAACmE,OAAA,CAAAjF,eAAA,GAAAA,eAAA;AAEF,MAAMmD,MAAM,GAAG+B,uBAAU,CAACC,MAAM,CAAC;EAC/B/D,UAAU,EAAE;IACVgE,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB,CAAC;EACDlC,MAAM,EAAE;IACNkC,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,OAAO,EAAE;EACX,CAAC;EACDpB,YAAY,EAAE;IACZqB,SAAS,EAAE,EAAE;IACbC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_uiComponents","_utils"],"sources":["index.ts"],"sourcesContent":["export * from './components';\nexport * from './ui-components';\nexport * from './utils';\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,aAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,aAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,aAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,aAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_components","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_uiComponents","_utils"],"sources":["index.ts"],"sourcesContent":["export * from './components';\nexport * from './ui-components';\nexport * from './utils';\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,aAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,aAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,aAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,aAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["normalize-color.d.ts"],"sourcesContent":["declare module '@react-native/normalize-color';\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["normalize-color.d.ts"],"sourcesContent":["declare module '@react-native/normalize-color';\n"],"mappings":"","ignoreList":[]}
@@ -12,6 +12,12 @@ exports.useIsOutsideTransition = useIsOutsideTransition;
12
12
  var _native = require("@react-navigation/native");
13
13
  var _react = require("react");
14
14
  var _reactNative = require("react-native");
15
+ /**
16
+ * Global transformer of text for Voice-Over
17
+ * @param {string} text (Visible) text to be announced
18
+ * @returns {string} Text to be read-out by Voice-Over
19
+ */
20
+
15
21
  let textTransformer = null;
16
22
  function setAccessibilityTextTransformer(transformer) {
17
23
  textTransformer = transformer;
@@ -100,8 +106,7 @@ const focusAccessibility = component => {
100
106
  * @returns reference to be used with the target element
101
107
  */
102
108
  exports.focusAccessibility = focusAccessibility;
103
- const useAccessibilityFocus = function () {
104
- let focused = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
109
+ const useAccessibilityFocus = (focused = true) => {
105
110
  const ref = (0, _react.useRef)(null);
106
111
  (0, _react.useEffect)(() => {
107
112
  if (focused) {
@@ -137,11 +142,10 @@ const useAccessibilityAnnouncement = message => {
137
142
  };
138
143
  if (_reactNative.Platform.OS === 'ios') {
139
144
  let retries = 0;
140
- subscription = _reactNative.AccessibilityInfo.addEventListener('announcementFinished', _ref => {
141
- let {
142
- announcement: finished,
143
- success
144
- } = _ref;
145
+ subscription = _reactNative.AccessibilityInfo.addEventListener('announcementFinished', ({
146
+ announcement: finished,
147
+ success
148
+ }) => {
145
149
  if (finished === announcement) {
146
150
  if (success) {
147
151
  setAnnouncementFinished(announcement);
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_react","_reactNative","textTransformer","setAccessibilityTextTransformer","transformer","transformAccessibilityText","text","useAccessibleAfterTransition","navigation","useNavigation","accessible","setAccessible","useState","isFocused","useIsFocused","useEffect","undefined","unsubscribe","addListener","timeout","setTimeout","clearTimeout","useIsOutsideTransition","inTransition","setInTransition","focused","useRef","current","unsubscribeStart","unsubscribeEnd","focusAccessibility","component","Platform","OS","nodeHandle","findNodeHandle","AccessibilityInfo","setAccessibilityFocus","exports","useAccessibilityFocus","arguments","length","ref","useAccessibilityAnnouncement","message","announcement","announcementFinished","setAnnouncementFinished","subscription","_subscription","remove","retries","addEventListener","_ref","finished","success","announceForAccessibility","Boolean","useAccessibilityAnnouncementCumulative","waitForPreviousAnnouncement","wait","announcements","setAnnouncements","prev","nextAnnouncement","filter","m"],"sources":["accessibility.ts"],"sourcesContent":["import { NavigationProp, NavigationState, useIsFocused, useNavigation } from '@react-navigation/native';\nimport { useEffect, useRef, useState } from 'react';\nimport { AccessibilityInfo, EmitterSubscription, findNodeHandle, Platform } from 'react-native';\n\n/**\n * Global transformer of text for Voice-Over\n * @param {string} text (Visible) text to be announced\n * @returns {string} Text to be read-out by Voice-Over\n */\nexport type AccessibilityTextTransformer = (text: string) => string;\nlet textTransformer: AccessibilityTextTransformer | null = null;\nexport function setAccessibilityTextTransformer(transformer: AccessibilityTextTransformer | null) {\n textTransformer = transformer;\n}\nexport function transformAccessibilityText(text: string) {\n return textTransformer && text ? textTransformer(text) : text;\n}\n\n/**\n * Make element accessible after navigation transition is done\n * @returns {boolean} flag to be used as `accessible` prop on the target component(s)\n */\nexport function useAccessibleAfterTransition<\n TNavigationProp extends NavigationProp<\n Record<string, any>,\n string,\n NavigationState<Record<string, any>>,\n {},\n { transitionEnd: {} }\n >,\n>() {\n const navigation = useNavigation<TNavigationProp>();\n const [accessible, setAccessible] = useState(false);\n\n const isFocused = useIsFocused();\n useEffect(() => {\n if (!isFocused) {\n setAccessible(false);\n return undefined;\n }\n const unsubscribe = navigation.addListener('transitionEnd', () => setAccessible(true));\n // fallback for cases when transition doesn't happen (e.g. forceful screen re-render)\n const timeout = setTimeout(() => setAccessible(true), 500);\n return () => {\n unsubscribe();\n clearTimeout(timeout);\n };\n }, [navigation, isFocused]);\n\n return isFocused && accessible;\n}\n\n/**\n * Query whether the current screen is NOT transitioning\n * @returns {boolean} flag signifying whether the current screen is NOT in a transition (either entering or leaving)\n */\nexport function useIsOutsideTransition<\n TNavigationProp extends NavigationProp<\n Record<string, any>,\n string,\n NavigationState<Record<string, any>>,\n {},\n { transitionStart: {}; transitionEnd: {} }\n >,\n>() {\n const navigation = useNavigation<TNavigationProp>();\n const [inTransition, setInTransition] = useState<boolean>(true);\n\n const isFocused = useIsFocused();\n const focused = useRef(isFocused);\n focused.current = isFocused;\n\n useEffect(() => {\n const unsubscribeStart = navigation.addListener('transitionStart', () => setInTransition(true));\n const unsubscribeEnd = navigation.addListener('transitionEnd', () => {\n if (focused.current) {\n setInTransition(false);\n }\n });\n return () => {\n unsubscribeStart();\n unsubscribeEnd();\n };\n }, [navigation]);\n\n useEffect(() => {\n if (!isFocused) {\n return undefined;\n }\n\n setInTransition(true);\n // fallback for cases when transition callback doesn't happen (e.g. forceful screen re-render)\n const timeout = setTimeout(() => setInTransition(false), 500);\n return () => {\n clearTimeout(timeout);\n };\n }, [isFocused]);\n\n return isFocused && !inTransition;\n}\n\n/**\n * Focuses an element for accessibility\n * @param component component ref\n * @note Disabled on android as it is not reliable\n */\nexport const focusAccessibility = (component?: React.Component | React.ComponentClass | null) => {\n if (Platform.OS === 'ios' && component) {\n const nodeHandle = findNodeHandle(component);\n if (nodeHandle) {\n AccessibilityInfo.setAccessibilityFocus(nodeHandle);\n }\n }\n};\n\n/**\n * Focuses an element for accessibility\n * @param {boolean} focused Focusing happens when this changes to `true`\n * @returns reference to be used with the target element\n */\nexport const useAccessibilityFocus = <T extends React.Component | React.ComponentClass>(focused: boolean = true) => {\n const ref = useRef<T>(null);\n\n useEffect(() => {\n if (focused) {\n focusAccessibility(ref.current);\n }\n }, [focused]);\n\n return ref;\n};\n\n/**\n * Posts a screen-reader/voice-over announcement\n * @param {string} message Announcement message\n * * if `null` passed, it resets the cached announcement and the same message can be re-announced again\n * @returns {boolean} When the announcement is successfully finished (only supported on iOS), false otherwise\n * @note Use {@link setAccessibilityTextTransformer} to apply text transformation for the read-out text\n */\nexport const useAccessibilityAnnouncement = (message?: string | null): boolean => {\n const announcement = message ? transformAccessibilityText(message) : message;\n const [announcementFinished, setAnnouncementFinished] = useState<string>();\n useEffect(() => {\n if (announcement === null) {\n // explicitly clearing cached state\n setAnnouncementFinished(undefined);\n }\n\n if (!announcement) {\n return undefined;\n }\n\n let subscription: EmitterSubscription;\n const unsubscribe = () => subscription?.remove();\n if (Platform.OS === 'ios') {\n let retries = 0;\n subscription = AccessibilityInfo.addEventListener(\n 'announcementFinished',\n ({ announcement: finished, success }) => {\n if (finished === announcement) {\n if (success) {\n setAnnouncementFinished(announcement);\n unsubscribe();\n } else if (retries++ < 2) {\n // when the automatic voice-over cancels the first try (e.g. after screen transition), let's attempt again one more time\n AccessibilityInfo.announceForAccessibility(announcement);\n } else {\n unsubscribe();\n }\n }\n },\n );\n }\n\n AccessibilityInfo.announceForAccessibility(announcement);\n return unsubscribe;\n }, [announcement]);\n\n return Boolean(announcement && announcementFinished === announcement);\n};\n\n/**\n * Posts a screen-reader/voice-over announcement\n * @param {string} message Announcement message\n * @param {boolean} waitForPreviousAnnouncement When a new message appears before the previous announcement if finished:\n * - `true`: postpone the new message to be announced after the previous message(s)\n * - `false` (default): cancel the previous announcement and start the new message\n * @returns {boolean} When all announcements are finished (only supported on iOS), false otherwise\n * @see {@link useAccessibilityAnnouncement} for further info\n */\nexport const useAccessibilityAnnouncementCumulative = (\n message?: string,\n waitForPreviousAnnouncement?: boolean,\n): boolean => {\n // waiting only possible on iOS\n const wait = Platform.OS === 'ios' && waitForPreviousAnnouncement;\n\n const [announcements, setAnnouncements] = useState<string[]>([]);\n useEffect(() => {\n if (message) {\n setAnnouncements((prev) => [...prev, message]);\n }\n }, [message]);\n\n const nextAnnouncement = wait ? announcements[0] : message;\n const finished = useAccessibilityAnnouncement(nextAnnouncement);\n\n useEffect(() => {\n if (finished) {\n setAnnouncements((prev) => prev.filter((m) => m !== nextAnnouncement));\n }\n }, [nextAnnouncement, finished]);\n\n return wait ? !announcements.length : finished;\n};\n"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,IAAIuC,QAAQ,EAAE;MACZQ,gBAAgB,CAAEC,IAAI,IAAKA,IAAI,CAACE,MAAM,CAAEC,CAAC,IAAKA,CAAC,KAAKF,gBAAgB,CAAC,CAAC;IACxE;EACF,CAAC,EAAE,CAACA,gBAAgB,EAAEV,QAAQ,CAAC,CAAC;EAEhC,OAAOM,IAAI,GAAG,CAACC,aAAa,CAACpB,MAAM,GAAGa,QAAQ;AAChD,CAAC;AAAChB,OAAA,CAAAoB,sCAAA,GAAAA,sCAAA"}
1
+ {"version":3,"names":["_native","require","_react","_reactNative","textTransformer","setAccessibilityTextTransformer","transformer","transformAccessibilityText","text","useAccessibleAfterTransition","navigation","useNavigation","accessible","setAccessible","useState","isFocused","useIsFocused","useEffect","undefined","unsubscribe","addListener","timeout","setTimeout","clearTimeout","useIsOutsideTransition","inTransition","setInTransition","focused","useRef","current","unsubscribeStart","unsubscribeEnd","focusAccessibility","component","Platform","OS","nodeHandle","findNodeHandle","AccessibilityInfo","setAccessibilityFocus","exports","useAccessibilityFocus","ref","useAccessibilityAnnouncement","message","announcement","announcementFinished","setAnnouncementFinished","subscription","_subscription","remove","retries","addEventListener","finished","success","announceForAccessibility","Boolean","useAccessibilityAnnouncementCumulative","waitForPreviousAnnouncement","wait","announcements","setAnnouncements","prev","nextAnnouncement","filter","m","length"],"sources":["accessibility.ts"],"sourcesContent":["import { NavigationProp, NavigationState, useIsFocused, useNavigation } from '@react-navigation/native';\nimport { useEffect, useRef, useState } from 'react';\nimport { AccessibilityInfo, EmitterSubscription, findNodeHandle, Platform } from 'react-native';\n\n/**\n * Global transformer of text for Voice-Over\n * @param {string} text (Visible) text to be announced\n * @returns {string} Text to be read-out by Voice-Over\n */\nexport type AccessibilityTextTransformer = (text: string) => string;\nlet textTransformer: AccessibilityTextTransformer | null = null;\nexport function setAccessibilityTextTransformer(transformer: AccessibilityTextTransformer | null) {\n textTransformer = transformer;\n}\nexport function transformAccessibilityText(text: string) {\n return textTransformer && text ? textTransformer(text) : text;\n}\n\n/**\n * Make element accessible after navigation transition is done\n * @returns {boolean} flag to be used as `accessible` prop on the target component(s)\n */\nexport function useAccessibleAfterTransition<\n TNavigationProp extends NavigationProp<\n Record<string, any>,\n string,\n NavigationState<Record<string, any>>,\n {},\n { transitionEnd: {} }\n >,\n>() {\n const navigation = useNavigation<TNavigationProp>();\n const [accessible, setAccessible] = useState(false);\n\n const isFocused = useIsFocused();\n useEffect(() => {\n if (!isFocused) {\n setAccessible(false);\n return undefined;\n }\n const unsubscribe = navigation.addListener('transitionEnd', () => setAccessible(true));\n // fallback for cases when transition doesn't happen (e.g. forceful screen re-render)\n const timeout = setTimeout(() => setAccessible(true), 500);\n return () => {\n unsubscribe();\n clearTimeout(timeout);\n };\n }, [navigation, isFocused]);\n\n return isFocused && accessible;\n}\n\n/**\n * Query whether the current screen is NOT transitioning\n * @returns {boolean} flag signifying whether the current screen is NOT in a transition (either entering or leaving)\n */\nexport function useIsOutsideTransition<\n TNavigationProp extends NavigationProp<\n Record<string, any>,\n string,\n NavigationState<Record<string, any>>,\n {},\n { transitionStart: {}; transitionEnd: {} }\n >,\n>() {\n const navigation = useNavigation<TNavigationProp>();\n const [inTransition, setInTransition] = useState<boolean>(true);\n\n const isFocused = useIsFocused();\n const focused = useRef(isFocused);\n focused.current = isFocused;\n\n useEffect(() => {\n const unsubscribeStart = navigation.addListener('transitionStart', () => setInTransition(true));\n const unsubscribeEnd = navigation.addListener('transitionEnd', () => {\n if (focused.current) {\n setInTransition(false);\n }\n });\n return () => {\n unsubscribeStart();\n unsubscribeEnd();\n };\n }, [navigation]);\n\n useEffect(() => {\n if (!isFocused) {\n return undefined;\n }\n\n setInTransition(true);\n // fallback for cases when transition callback doesn't happen (e.g. forceful screen re-render)\n const timeout = setTimeout(() => setInTransition(false), 500);\n return () => {\n clearTimeout(timeout);\n };\n }, [isFocused]);\n\n return isFocused && !inTransition;\n}\n\n/**\n * Focuses an element for accessibility\n * @param component component ref\n * @note Disabled on android as it is not reliable\n */\nexport const focusAccessibility = (component?: React.ElementType<any, any> | null) => {\n if (Platform.OS === 'ios' && component) {\n const nodeHandle = findNodeHandle(component);\n if (nodeHandle) {\n AccessibilityInfo.setAccessibilityFocus(nodeHandle);\n }\n }\n};\n\n/**\n * Focuses an element for accessibility\n * @param {boolean} focused Focusing happens when this changes to `true`\n * @returns reference to be used with the target element\n */\nexport const useAccessibilityFocus = <T extends React.ElementType<any, any>>(focused: boolean = true) => {\n const ref = useRef<T>(null);\n\n useEffect(() => {\n if (focused) {\n focusAccessibility(ref.current);\n }\n }, [focused]);\n\n return ref;\n};\n\n/**\n * Posts a screen-reader/voice-over announcement\n * @param {string} message Announcement message\n * * if `null` passed, it resets the cached announcement and the same message can be re-announced again\n * @returns {boolean} When the announcement is successfully finished (only supported on iOS), false otherwise\n * @note Use {@link setAccessibilityTextTransformer} to apply text transformation for the read-out text\n */\nexport const useAccessibilityAnnouncement = (message?: string | null): boolean => {\n const announcement = message ? transformAccessibilityText(message) : message;\n const [announcementFinished, setAnnouncementFinished] = useState<string>();\n useEffect(() => {\n if (announcement === null) {\n // explicitly clearing cached state\n setAnnouncementFinished(undefined);\n }\n\n if (!announcement) {\n return undefined;\n }\n\n let subscription: EmitterSubscription;\n const unsubscribe = () => subscription?.remove();\n if (Platform.OS === 'ios') {\n let retries = 0;\n subscription = AccessibilityInfo.addEventListener(\n 'announcementFinished',\n ({ announcement: finished, success }) => {\n if (finished === announcement) {\n if (success) {\n setAnnouncementFinished(announcement);\n unsubscribe();\n } else if (retries++ < 2) {\n // when the automatic voice-over cancels the first try (e.g. after screen transition), let's attempt again one more time\n AccessibilityInfo.announceForAccessibility(announcement);\n } else {\n unsubscribe();\n }\n }\n },\n );\n }\n\n AccessibilityInfo.announceForAccessibility(announcement);\n return unsubscribe;\n }, [announcement]);\n\n return Boolean(announcement && announcementFinished === announcement);\n};\n\n/**\n * Posts a screen-reader/voice-over announcement\n * @param {string} message Announcement message\n * @param {boolean} waitForPreviousAnnouncement When a new message appears before the previous announcement if finished:\n * - `true`: postpone the new message to be announced after the previous message(s)\n * - `false` (default): cancel the previous announcement and start the new message\n * @returns {boolean} When all announcements are finished (only supported on iOS), false otherwise\n * @see {@link useAccessibilityAnnouncement} for further info\n */\nexport const useAccessibilityAnnouncementCumulative = (\n message?: string,\n waitForPreviousAnnouncement?: boolean,\n): boolean => {\n // waiting only possible on iOS\n const wait = Platform.OS === 'ios' && waitForPreviousAnnouncement;\n\n const [announcements, setAnnouncements] = useState<string[]>([]);\n useEffect(() => {\n if (message) {\n setAnnouncements((prev) => [...prev, message]);\n }\n }, [message]);\n\n const nextAnnouncement = wait ? announcements[0] : message;\n const finished = useAccessibilityAnnouncement(nextAnnouncement);\n\n useEffect(() => {\n if (finished) {\n setAnnouncements((prev) => prev.filter((m) => m !== nextAnnouncement));\n }\n }, [nextAnnouncement, finished]);\n\n return wait ? !announcements.length : finished;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;;AAEA,IAAIG,eAAoD,GAAG,IAAI;AACxD,SAASC,+BAA+BA,CAACC,WAAgD,EAAE;EAChGF,eAAe,GAAGE,WAAW;AAC/B;AACO,SAASC,0BAA0BA,CAACC,IAAY,EAAE;EACvD,OAAOJ,eAAe,IAAII,IAAI,GAAGJ,eAAe,CAACI,IAAI,CAAC,GAAGA,IAAI;AAC/D;;AAEA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAAA,EAQxC;EACF,MAAMC,UAAU,GAAG,IAAAC,qBAAa,EAAkB,CAAC;EACnD,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,EAAC,KAAK,CAAC;EAEnD,MAAMC,SAAS,GAAG,IAAAC,oBAAY,EAAC,CAAC;EAChC,IAAAC,gBAAS,EAAC,MAAM;IACd,IAAI,CAACF,SAAS,EAAE;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MAAMC,IAAI,GAAGzB,qBAAQ,CAACC,EAAE,KAAK,KAAK,IAAIuB,2BAA2B;EAEjE,MAAM,CAACE,aAAa,EAAEC,gBAAgB,CAAC,GAAG,IAAA/C,eAAQ,EAAW,EAAE,CAAC;EAChE,IAAAG,gBAAS,EAAC,MAAM;IACd,IAAI2B,OAAO,EAAE;MACXiB,gBAAgB,CAAEC,IAAI,IAAK,CAAC,GAAGA,IAAI,EAAElB,OAAO,CAAC,CAAC;IAChD;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,MAAMmB,gBAAgB,GAAGJ,IAAI,GAAGC,aAAa,CAAC,CAAC,CAAC,GAAGhB,OAAO;EAC1D,MAAMS,QAAQ,GAAGV,4BAA4B,CAACoB,gBAAgB,CAAC;EAE/D,IAAA9C,gBAAS,EAAC,MAAM;IACd,IAAIoC,QAAQ,EAAE;MACZQ,gBAAgB,CAAEC,IAAI,IAAKA,IAAI,CAACE,MAAM,CAAEC,CAAC,IAAKA,CAAC,KAAKF,gBAAgB,CAAC,CAAC;IACxE;EACF,CAAC,EAAE,CAACA,gBAAgB,EAAEV,QAAQ,CAAC,CAAC;EAEhC,OAAOM,IAAI,GAAG,CAACC,aAAa,CAACM,MAAM,GAAGb,QAAQ;AAChD,CAAC;AAACb,OAAA,CAAAiB,sCAAA,GAAAA,sCAAA","ignoreList":[]}
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useAccessibilityFocusHistory = exports.AccessibilityFocusHistoryProvider = void 0;
7
7
  var _native = require("@react-navigation/native");
8
8
  var _react = _interopRequireWildcard(require("react"));
9
- var _ref2 = require("../../utils/ref");
9
+ var _ref = require("../../utils/ref");
10
10
  var _accessibility = require("./accessibility");
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
11
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
12
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
13
  const accessibilityFocusHistoryContext = /*#__PURE__*/_react.default.createContext({
14
14
  setRef: () => {},
15
15
  getRef: () => null
@@ -18,10 +18,9 @@ const accessibilityFocusHistoryContext = /*#__PURE__*/_react.default.createConte
18
18
  /**
19
19
  * Adds app support for accessibility focus history
20
20
  */
21
- const AccessibilityFocusHistoryProvider = _ref => {
22
- let {
23
- children
24
- } = _ref;
21
+ const AccessibilityFocusHistoryProvider = ({
22
+ children
23
+ }) => {
25
24
  const Provider = accessibilityFocusHistoryContext.Provider;
26
25
  const refs = (0, _react.useRef)({});
27
26
  const setRef = (0, _react.useCallback)((route, ref) => {
@@ -46,7 +45,7 @@ const AccessibilityFocusHistoryProvider = _ref => {
46
45
  */
47
46
  exports.AccessibilityFocusHistoryProvider = AccessibilityFocusHistoryProvider;
48
47
  const useAccessibilityFocusHistory = (pressHandler, passedRef) => {
49
- const [forwardedRef, refObject] = (0, _ref2.useForwardedRef)(passedRef);
48
+ const [forwardedRef, refObject] = (0, _ref.useForwardedRef)(passedRef);
50
49
  const historyContext = (0, _react.useContext)(accessibilityFocusHistoryContext);
51
50
  const routeKey = (0, _native.useRoute)().key;
52
51
  const previouslyPressed = (0, _react.useRef)(false);
@@ -64,12 +63,9 @@ const useAccessibilityFocusHistory = (pressHandler, passedRef) => {
64
63
  }, [outsideTransition]);
65
64
 
66
65
  // eslint-disable-next-line react-hooks/exhaustive-deps
67
- const onPress = (0, _react.useCallback)(function () {
66
+ const onPress = (0, _react.useCallback)((...args) => {
68
67
  previouslyPressed.current = true;
69
68
  historyContext.setRef(routeKey, refObject.current);
70
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
71
- args[_key] = arguments[_key];
72
- }
73
69
  return pressHandler === null || pressHandler === void 0 ? void 0 : pressHandler(...args);
74
70
  }, [historyContext, routeKey, refObject, pressHandler]);
75
71
  return {
@@ -1 +1 @@
1
- {"version":3,"names":["_native","require","_react","_interopRequireWildcard","_ref2","_accessibility","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","accessibilityFocusHistoryContext","React","createContext","setRef","getRef","AccessibilityFocusHistoryProvider","_ref","children","Provider","refs","useRef","useCallback","route","ref","current","_refs$current$route","value","useMemo","createElement","exports","useAccessibilityFocusHistory","pressHandler","passedRef","forwardedRef","refObject","useForwardedRef","historyContext","useContext","routeKey","useRoute","previouslyPressed","outsideTransition","useAccessibleAfterTransition","useEffect","isStoredInHistory","focusAccessibility","onPress","_len","arguments","length","args","Array","_key"],"sources":["accessibilityHistory.tsx"],"sourcesContent":["import { useRoute } from '@react-navigation/native';\nimport React, { FC, PropsWithChildren, useCallback, useContext, useEffect, useMemo, useRef } from 'react';\n\nimport { useForwardedRef } from '../../utils/ref';\nimport { focusAccessibility, useAccessibleAfterTransition } from './accessibility';\n\ntype AccessibilityRefComponent = React.Component | React.ComponentClass | null;\ninterface AccessibilityRefContextValue {\n setRef: (route: string, ref: AccessibilityRefComponent) => void;\n getRef: (route: string) => AccessibilityRefComponent;\n}\n\nconst accessibilityFocusHistoryContext = React.createContext<AccessibilityRefContextValue>({\n setRef: () => {},\n getRef: () => null,\n});\n\n/**\n * Adds app support for accessibility focus history\n */\nexport const AccessibilityFocusHistoryProvider: FC<PropsWithChildren<{}>> = ({ children }) => {\n const Provider = accessibilityFocusHistoryContext.Provider;\n const refs = useRef<Record<string, AccessibilityRefComponent>>({});\n const setRef = useCallback((route: string, ref: AccessibilityRefComponent) => {\n refs.current[route] = ref;\n }, []);\n const getRef = useCallback((route: string) => {\n return refs.current[route] ?? null;\n }, []);\n const value = useMemo(() => ({ setRef, getRef }), [getRef, setRef]);\n return <Provider value={value}>{children}</Provider>;\n};\n\n/**\n * Wraps `onPress` handler and `ref` to support automatic accessibility focus on back navigation\n * @note This needs to be used inside {@link AccessibilityFocusHistoryProvider} and navigation context\n */\nexport const useAccessibilityFocusHistory = <\n Component extends React.Component<any> | React.ComponentClass<any>,\n OnPress extends (...args: never[]) => void = () => void,\n>(\n pressHandler: OnPress | undefined,\n passedRef?: React.Ref<Component>,\n) => {\n const [forwardedRef, refObject] = useForwardedRef<Component>(passedRef);\n\n const historyContext = useContext(accessibilityFocusHistoryContext);\n const routeKey = useRoute().key;\n\n const previouslyPressed = useRef(false);\n const outsideTransition = useAccessibleAfterTransition();\n\n useEffect(() => {\n const isStoredInHistory = historyContext.getRef(routeKey) === refObject.current;\n if (outsideTransition && isStoredInHistory && previouslyPressed.current) {\n focusAccessibility(refObject.current);\n }\n }, [historyContext, outsideTransition, refObject, routeKey]);\n\n useEffect(() => {\n if (outsideTransition) {\n previouslyPressed.current = false;\n }\n }, [outsideTransition]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const onPress = useCallback(\n ((...args) => {\n previouslyPressed.current = true;\n historyContext.setRef(routeKey, refObject.current);\n return pressHandler?.(...args);\n }) as OnPress,\n [historyContext, routeKey, refObject, pressHandler],\n );\n\n return { onPress, ref: forwardedRef };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AAAmF,SAAAK,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAJ,wBAAAQ,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR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J,SAAS,CAACV,OAAO,CAAC;IAAC,SAAAuB,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAFhDC,IAAI,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAGP,OAAOrB,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAG,GAAGmB,IAAI,CAAC;EAChC,CAAC,EACD,CAACd,cAAc,EAAEE,QAAQ,EAAEJ,SAAS,EAAEH,YAAY,CAAC,CACpD;EAED,OAAO;IAAEe,OAAO;IAAEvB,GAAG,EAAEU;EAAa,CAAC;AACvC,CAAC;AAACJ,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
1
+ {"version":3,"names":["_native","require","_react","_interopRequireWildcard","_ref","_accessibility","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","accessibilityFocusHistoryContext","React","createContext","setRef","getRef","AccessibilityFocusHistoryProvider","children","Provider","refs","useRef","useCallback","route","ref","current","_refs$current$route","value","useMemo","createElement","exports","useAccessibilityFocusHistory","pressHandler","passedRef","forwardedRef","refObject","useForwardedRef","historyContext","useContext","routeKey","useRoute","key","previouslyPressed","outsideTransition","useAccessibleAfterTransition","useEffect","isStoredInHistory","focusAccessibility","onPress","args"],"sources":["accessibilityHistory.tsx"],"sourcesContent":["import { useRoute } from '@react-navigation/native';\nimport React, { FC, PropsWithChildren, useCallback, useContext, useEffect, useMemo, useRef } from 'react';\n\nimport { useForwardedRef } from '../../utils/ref';\nimport { focusAccessibility, useAccessibleAfterTransition } from './accessibility';\n\ntype AccessibilityRefComponent = React.ElementType<any, any> | null;\ninterface AccessibilityRefContextValue {\n setRef: (route: string, ref: AccessibilityRefComponent) => void;\n getRef: (route: string) => AccessibilityRefComponent;\n}\n\nconst accessibilityFocusHistoryContext = React.createContext<AccessibilityRefContextValue>({\n setRef: () => {},\n getRef: () => null,\n});\n\n/**\n * Adds app support for accessibility focus history\n */\nexport const AccessibilityFocusHistoryProvider: FC<PropsWithChildren<{}>> = ({ children }) => {\n const Provider = accessibilityFocusHistoryContext.Provider;\n const refs = useRef<Record<string, AccessibilityRefComponent>>({});\n const setRef = useCallback((route: string, ref: AccessibilityRefComponent) => {\n refs.current[route] = ref;\n }, []);\n const getRef = useCallback((route: string) => {\n return refs.current[route] ?? null;\n }, []);\n const value = useMemo(() => ({ setRef, getRef }), [getRef, setRef]);\n return <Provider value={value}>{children}</Provider>;\n};\n\n/**\n * Wraps `onPress` handler and `ref` to support automatic accessibility focus on back navigation\n * @note This needs to be used inside {@link AccessibilityFocusHistoryProvider} and navigation context\n */\nexport const useAccessibilityFocusHistory = <\n Component extends React.ElementType<any, any>,\n OnPress extends (...args: never[]) => void = () => void,\n>(\n pressHandler: OnPress | undefined,\n passedRef?: React.Ref<Component>,\n) => {\n const [forwardedRef, refObject] = useForwardedRef<Component>(passedRef);\n\n const historyContext = useContext(accessibilityFocusHistoryContext);\n const routeKey = useRoute().key;\n\n const previouslyPressed = useRef(false);\n const outsideTransition = useAccessibleAfterTransition();\n\n useEffect(() => {\n const isStoredInHistory = historyContext.getRef(routeKey) === refObject.current;\n if (outsideTransition && isStoredInHistory && previouslyPressed.current) {\n focusAccessibility(refObject.current);\n }\n }, [historyContext, outsideTransition, refObject, routeKey]);\n\n useEffect(() => {\n if (outsideTransition) {\n previouslyPressed.current = false;\n }\n }, [outsideTransition]);\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const onPress = useCallback(\n ((...args) => {\n previouslyPressed.current = true;\n historyContext.setRef(routeKey, refObject.current);\n return pressHandler?.(...args);\n }) as OnPress,\n [historyContext, routeKey, refObject, pressHandler],\n );\n\n return { onPress, ref: forwardedRef };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAA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AAQ,EAAC,CAAC,CAACC,GAAG;EAE/B,MAAMC,iBAAiB,GAAG,IAAArB,aAAM,EAAC,KAAK,CAAC;EACvC,MAAMsB,iBAAiB,GAAG,IAAAC,2CAA4B,EAAC,CAAC;EAExD,IAAAC,gBAAS,EAAC,MAAM;IACd,MAAMC,iBAAiB,GAAGT,cAAc,CAACrB,MAAM,CAACuB,QAAQ,CAAC,KAAKJ,SAAS,CAACV,OAAO;IAC/E,IAAIkB,iBAAiB,IAAIG,iBAAiB,IAAIJ,iBAAiB,CAACjB,OAAO,EAAE;MACvE,IAAAsB,iCAAkB,EAACZ,SAAS,CAACV,OAAO,CAAC;IACvC;EACF,CAAC,EAAE,CAACY,cAAc,EAAEM,iBAAiB,EAAER,SAAS,EAAEI,QAAQ,CAAC,CAAC;EAE5D,IAAAM,gBAAS,EAAC,MAAM;IACd,IAAIF,iBAAiB,EAAE;MACrBD,iBAAiB,CAACjB,OAAO,GAAG,KAAK;IACnC;EACF,CAAC,EAAE,CAACkB,iBAAiB,CAAC,CAAC;;EAEvB;EACA,MAAMK,OAAO,GAAG,IAAA1B,kBAAW,EACxB,CAAC,GAAG2B,IAAI,KAAK;IACZP,iBAAiB,CAACjB,OAAO,GAAG,IAAI;IAChCY,cAAc,CAACtB,MAAM,CAACwB,QAAQ,EAAEJ,SAAS,CAACV,OAAO,CAAC;IAClD,OAAOO,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAG,GAAGiB,IAAI,CAAC;EAChC,CAAC,EACD,CAACZ,cAAc,EAAEE,QAAQ,EAAEJ,SAAS,EAAEH,YAAY,CACpD,CAAC;EAED,OAAO;IAAEgB,OAAO;IAAExB,GAAG,EAAEU;EAAa,CAAC;AACvC,CAAC;AAACJ,OAAA,CAAAC,4BAAA,GAAAA,4BAAA","ignoreList":[]}
@@ -7,16 +7,15 @@ exports.TouchableWithoutFeedback = exports.TouchableOpacity = exports.TouchableH
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _reactNative = require("react-native");
9
9
  var _accessibilityHistory = require("./accessibilityHistory");
10
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } /* eslint-disable no-restricted-imports */
13
13
  const WithAccessibilityFocusHistory = (C, displayName) => {
14
- const ComponentWithAccessibilityFocusHistory = _ref => {
15
- let {
16
- forwardedRef,
17
- onPress: originalOnPress,
18
- ...props
19
- } = _ref;
14
+ const ComponentWithAccessibilityFocusHistory = ({
15
+ forwardedRef,
16
+ onPress: originalOnPress,
17
+ ...props
18
+ }) => {
20
19
  const {
21
20
  ref,
22
21
  onPress
@@ -37,13 +36,12 @@ const WithAccessibilityFocusHistory = (C, displayName) => {
37
36
  /**
38
37
  * Wrappers of RN touchable components with accessibilty focus history support
39
38
  */
39
+ const TouchableOpacity = exports.TouchableOpacity = WithAccessibilityFocusHistory(_reactNative.TouchableOpacity, 'TouchableOpacity');
40
+ const TouchableWithoutFeedback = exports.TouchableWithoutFeedback = WithAccessibilityFocusHistory(_reactNative.TouchableWithoutFeedback, 'TouchableWithoutFeedback');
41
+ const TouchableHighlight = exports.TouchableHighlight = WithAccessibilityFocusHistory(_reactNative.TouchableHighlight, 'TouchableHighlight');
42
+ const Pressable = exports.Pressable = WithAccessibilityFocusHistory(_reactNative.Pressable, 'Pressable');
40
43
 
41
- const TouchableOpacity = WithAccessibilityFocusHistory(_reactNative.TouchableOpacity, 'TouchableOpacity');
42
- exports.TouchableOpacity = TouchableOpacity;
43
- const TouchableWithoutFeedback = WithAccessibilityFocusHistory(_reactNative.TouchableWithoutFeedback, 'TouchableWithoutFeedback');
44
- exports.TouchableWithoutFeedback = TouchableWithoutFeedback;
45
- const TouchableHighlight = WithAccessibilityFocusHistory(_reactNative.TouchableHighlight, 'TouchableHighlight');
46
- exports.TouchableHighlight = TouchableHighlight;
47
- const Pressable = WithAccessibilityFocusHistory(_reactNative.Pressable, 'Pressable');
48
- exports.Pressable = Pressable;
44
+ /**
45
+ * Ref types to be used in forwardRef for the wrappers
46
+ */
49
47
  //# sourceMappingURL=accessibilityHistoryWrappers.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_accessibilityHistory","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_extends","assign","bind","target","i","arguments","length","source","apply","WithAccessibilityFocusHistory","C","displayName","ComponentWithAccessibilityFocusHistory","_ref","forwardedRef","onPress","originalOnPress","props","ref","useAccessibilityFocusHistory","undefined","createElement","Forwarded","forwardRef","TouchableOpacity","RNTouchableOpacity","exports","TouchableWithoutFeedback","RNTouchableWithoutFeedback","TouchableHighlight","RNTouchableHighlight","Pressable","RNPressable"],"sources":["accessibilityHistoryWrappers.tsx"],"sourcesContent":["/* eslint-disable no-restricted-imports */\nimport React, { FC, ForwardedRef, forwardRef } from 'react';\nimport {\n GestureResponderEvent,\n Pressable as RNPressable,\n PressableProps,\n TouchableHighlight as RNTouchableHighlight,\n TouchableHighlightProps,\n TouchableOpacity as RNTouchableOpacity,\n TouchableOpacityProps,\n TouchableWithoutFeedback as RNTouchableWithoutFeedback,\n TouchableWithoutFeedbackProps,\n View,\n} from 'react-native';\n\nimport { useAccessibilityFocusHistory } from './accessibilityHistory';\n\ntype RNOnPress = (event: GestureResponderEvent) => void;\ninterface OnPressProps {\n onPress?: RNOnPress | null;\n}\n\nconst WithAccessibilityFocusHistory = <ComponentProps extends OnPressProps, RefType extends React.Component>(\n C: React.ComponentType<ComponentProps>,\n displayName: string,\n) => {\n type ForwardedProps = ComponentProps & {\n forwardedRef: ForwardedRef<RefType>;\n };\n\n const ComponentWithAccessibilityFocusHistory: FC<ForwardedProps> = ({\n forwardedRef,\n onPress: originalOnPress,\n ...props\n }) => {\n const { ref, onPress } = useAccessibilityFocusHistory<RefType, RNOnPress>(\n originalOnPress ?? undefined,\n forwardedRef,\n );\n // @ts-ignore\n return <C ref={ref} onPress={onPress} {...props} />;\n };\n\n const Forwarded = forwardRef<RefType, ComponentProps>((props, ref) => (\n <ComponentWithAccessibilityFocusHistory {...props} forwardedRef={ref} />\n ));\n Forwarded.displayName = displayName;\n\n return Forwarded;\n};\n\n/**\n * Wrappers of RN touchable components with accessibilty focus history support\n */\n\nexport const TouchableOpacity = WithAccessibilityFocusHistory<TouchableOpacityProps, RNTouchableOpacity>(\n RNTouchableOpacity,\n 'TouchableOpacity',\n);\nexport const TouchableWithoutFeedback = WithAccessibilityFocusHistory<\n TouchableWithoutFeedbackProps,\n RNTouchableWithoutFeedback\n>(RNTouchableWithoutFeedback, 'TouchableWithoutFeedback');\nexport const TouchableHighlight = WithAccessibilityFocusHistory<TouchableHighlightProps, RNTouchableHighlight>(\n RNTouchableHighlight,\n 'TouchableHighlight',\n);\nexport const Pressable = WithAccessibilityFocusHistory<PressableProps, View>(RNPressable, 'Pressable');\n\ntype WrapperRefType<C extends React.ForwardRefExoticComponent<React.RefAttributes<any>>> =\n C extends React.ForwardRefExoticComponent<React.RefAttributes<infer Ref>> ? Ref : never;\n\n/**\n * Ref types to be used in forwardRef for the wrappers\n */\n\nexport type TouchableOpacityRef = WrapperRefType<typeof TouchableOpacity>;\nexport type TouchableWithoutFeedbackRef = WrapperRefType<typeof TouchableWithoutFeedback>;\nexport type TouchableHighlightRef = WrapperRefType<typeof TouchableHighlight>;\nexport type PressableRef = WrapperRefType<typeof Pressable>;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAaA,IAAAE,qBAAA,GAAAF,OAAA;AAAsE,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAA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C7DqB,+BAAoB,EACpB,oBAAoB,CACrB;AAACJ,OAAA,CAAAG,kBAAA,GAAAA,kBAAA;AACK,MAAME,SAAS,GAAGtB,6BAA6B,CAAuBuB,sBAAW,EAAE,WAAW,CAAC;AAACN,OAAA,CAAAK,SAAA,GAAAA,SAAA"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_accessibilityHistory","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","WithAccessibilityFocusHistory","C","displayName","ComponentWithAccessibilityFocusHistory","forwardedRef","onPress","originalOnPress","props","ref","useAccessibilityFocusHistory","undefined","createElement","Forwarded","forwardRef","TouchableOpacity","exports","RNTouchableOpacity","TouchableWithoutFeedback","RNTouchableWithoutFeedback","TouchableHighlight","RNTouchableHighlight","Pressable","RNPressable"],"sources":["accessibilityHistoryWrappers.tsx"],"sourcesContent":["/* eslint-disable no-restricted-imports */\nimport React, { FC, ForwardedRef, forwardRef } from 'react';\nimport {\n GestureResponderEvent,\n Pressable as RNPressable,\n PressableProps,\n TouchableHighlight as RNTouchableHighlight,\n TouchableHighlightProps,\n TouchableOpacity as RNTouchableOpacity,\n TouchableOpacityProps,\n TouchableWithoutFeedback as RNTouchableWithoutFeedback,\n TouchableWithoutFeedbackProps,\n View,\n} from 'react-native';\n\nimport { useAccessibilityFocusHistory } from './accessibilityHistory';\n\ntype RNOnPress = (event: GestureResponderEvent) => void;\ninterface OnPressProps {\n onPress?: RNOnPress | null;\n}\n\nconst WithAccessibilityFocusHistory = <ComponentProps extends OnPressProps, RefType extends React.ElementType<any, any>>(\n C: React.ComponentType<ComponentProps>,\n displayName: string,\n) => {\n type ForwardedProps = ComponentProps & {\n forwardedRef: ForwardedRef<RefType>;\n };\n\n const ComponentWithAccessibilityFocusHistory: FC<ForwardedProps> = ({\n forwardedRef,\n onPress: originalOnPress,\n ...props\n }) => {\n const { ref, onPress } = useAccessibilityFocusHistory<RefType, RNOnPress>(\n originalOnPress ?? undefined,\n forwardedRef,\n );\n // @ts-ignore\n return <C ref={ref} onPress={onPress} {...props} />;\n };\n\n const Forwarded = forwardRef<RefType, ComponentProps>((props, ref) => (\n <ComponentWithAccessibilityFocusHistory {...props} forwardedRef={ref} />\n ));\n Forwarded.displayName = displayName;\n\n return Forwarded;\n};\n\n/**\n * Wrappers of RN touchable components with accessibilty focus history support\n */\nexport const TouchableOpacity = WithAccessibilityFocusHistory<TouchableOpacityProps, typeof RNTouchableOpacity>(\n RNTouchableOpacity,\n 'TouchableOpacity',\n);\nexport const TouchableWithoutFeedback = WithAccessibilityFocusHistory<\n TouchableWithoutFeedbackProps,\n RNTouchableWithoutFeedback\n>(RNTouchableWithoutFeedback, 'TouchableWithoutFeedback');\nexport const TouchableHighlight = WithAccessibilityFocusHistory<TouchableHighlightProps, typeof RNTouchableHighlight>(\n RNTouchableHighlight,\n 'TouchableHighlight',\n);\nexport const Pressable = WithAccessibilityFocusHistory<PressableProps, View>(RNPressable, 'Pressable');\n\ntype WrapperRefType<C extends React.ForwardRefExoticComponent<React.RefAttributes<any>>> =\n C extends React.ForwardRefExoticComponent<React.RefAttributes<infer Ref>> ? Ref : never;\n\n/**\n * Ref types to be used in forwardRef for the wrappers\n */\nexport type TouchableOpacityRef = WrapperRefType<typeof TouchableOpacity>;\nexport type TouchableWithoutFeedbackRef = WrapperRefType<typeof TouchableWithoutFeedback>;\nexport type TouchableHighlightRef = WrapperRefType<typeof TouchableHighlight>;\nexport type PressableRef = WrapperRefType<typeof Pressable>;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAaA,IAAAE,qBAAA,GAAAF,OAAA;AAAsE,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAA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MC,SAAS,GAAAN,OAAA,CAAAM,SAAA,GAAGrB,6BAA6B,CAAuBsB,sBAAW,EAAE,WAAW,CAAC;;AAKtG;AACA;AACA","ignoreList":[]}
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useAccessibilityTranslation = exports.AccessibilityLanguageProvider = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _locale = require("./locale");
9
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
10
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
9
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
11
  const AccessibilityLanguageContext = /*#__PURE__*/_react.default.createContext(undefined);
12
12
  const Provider = AccessibilityLanguageContext.Provider;
13
13
 
@@ -16,12 +16,11 @@ const Provider = AccessibilityLanguageContext.Provider;
16
16
  * @param {SupportedAccessibilityLanguage} language Currenty selected language of the app
17
17
  * @param {Object} overrides _(optional)_ Custom overrides for specific entries
18
18
  */
19
- const AccessibilityLanguageProvider = _ref => {
20
- let {
21
- language,
22
- overrides,
23
- children
24
- } = _ref;
19
+ const AccessibilityLanguageProvider = ({
20
+ language,
21
+ overrides,
22
+ children
23
+ }) => {
25
24
  const translate = (0, _react.useMemo)(() => {
26
25
  if (typeof overrides === 'function') {
27
26
  return overrides;
@@ -32,8 +31,7 @@ const AccessibilityLanguageProvider = _ref => {
32
31
 
33
32
  // replace params
34
33
  if (translation && params) {
35
- Object.entries(params).forEach(_ref2 => {
36
- let [key, value] = _ref2;
34
+ Object.entries(params).forEach(([key, value]) => {
37
35
  translation = translation.replace(new RegExp(`{${key}}`, 'g'), String(value));
38
36
  });
39
37
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_locale","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","AccessibilityLanguageContext","React","createContext","undefined","Provider","AccessibilityLanguageProvider","_ref","language","overrides","children","translate","useMemo","accessibilityFile","getAccessibilityLanguageFile","entryKey","params","translation","entries","forEach","_ref2","value","replace","RegExp","String","createElement","exports","useAccessibilityTranslation","useContext","Error"],"sources":["accessibilityLanguage.tsx"],"sourcesContent":["import React, { FC, PropsWithChildren, useContext, useMemo } from 'react';\n\nimport { AccessibilityLanguageFile, getAccessibilityLanguageFile, SupportedAccessibilityLanguage } from './locale';\n\nexport type AccessibilityLanguageFileEntryKey = keyof AccessibilityLanguageFile;\ntype AccessibilityLanguageTranslate = (\n entryKey: AccessibilityLanguageFileEntryKey,\n params?: Record<string, string | number>,\n) => string;\n\nconst AccessibilityLanguageContext = React.createContext<AccessibilityLanguageTranslate | undefined>(undefined);\n\nexport interface AccessibilityLanguageProviderProps {\n language: SupportedAccessibilityLanguage;\n overrides?: Partial<AccessibilityLanguageFile> | AccessibilityLanguageTranslate;\n}\n\nconst Provider = AccessibilityLanguageContext.Provider;\n\n/**\n * Adds app support for accessibility language\n * @param {SupportedAccessibilityLanguage} language Currenty selected language of the app\n * @param {Object} overrides _(optional)_ Custom overrides for specific entries\n */\nexport const AccessibilityLanguageProvider: FC<PropsWithChildren<AccessibilityLanguageProviderProps>> = ({\n language,\n overrides,\n children,\n}) => {\n const translate = useMemo<AccessibilityLanguageTranslate>(() => {\n if (typeof overrides === 'function') {\n return overrides;\n }\n\n const accessibilityFile = getAccessibilityLanguageFile(language, overrides);\n return (entryKey, params) => {\n let translation = accessibilityFile[entryKey];\n\n // replace params\n if (translation && params) {\n Object.entries(params).forEach(([key, value]) => {\n translation = translation.replace(new RegExp(`{${key}}`, 'g'), String(value));\n });\n }\n\n return translation;\n };\n }, [language, overrides]);\n\n return <Provider value={translate}>{children}</Provider>;\n};\n\n/**\n * Access accessibility language translations\n * @note This needs to be used inside {@link AccessibilityLanguageProvider} context\n */\nexport const useAccessibilityTranslation = () => {\n const translate = useContext(AccessibilityLanguageContext);\n\n // check context provided\n if (!translate) {\n throw new Error('Accessibility Language not provided!, wrap your components in the AccessibilityLanguageProvider');\n }\n\n return translate;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAAmH,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBA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interopRequireWildcard","require","_locale","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","AccessibilityLanguageContext","React","createContext","undefined","Provider","AccessibilityLanguageProvider","language","overrides","children","translate","useMemo","accessibilityFile","getAccessibilityLanguageFile","entryKey","params","translation","entries","forEach","key","value","replace","RegExp","String","createElement","exports","useAccessibilityTranslation","useContext","Error"],"sources":["accessibilityLanguage.tsx"],"sourcesContent":["import React, { FC, PropsWithChildren, useContext, useMemo } from 'react';\n\nimport { AccessibilityLanguageFile, getAccessibilityLanguageFile, SupportedAccessibilityLanguage } from './locale';\n\nexport type AccessibilityLanguageFileEntryKey = keyof AccessibilityLanguageFile;\ntype AccessibilityLanguageTranslate = (\n entryKey: AccessibilityLanguageFileEntryKey,\n params?: Record<string, string | number>,\n) => string;\n\nconst AccessibilityLanguageContext = React.createContext<AccessibilityLanguageTranslate | undefined>(undefined);\n\nexport interface AccessibilityLanguageProviderProps {\n language: SupportedAccessibilityLanguage;\n overrides?: Partial<AccessibilityLanguageFile> | AccessibilityLanguageTranslate;\n}\n\nconst Provider = AccessibilityLanguageContext.Provider;\n\n/**\n * Adds app support for accessibility language\n * @param {SupportedAccessibilityLanguage} language Currenty selected language of the app\n * @param {Object} overrides _(optional)_ Custom overrides for specific entries\n */\nexport const AccessibilityLanguageProvider: FC<PropsWithChildren<AccessibilityLanguageProviderProps>> = ({\n language,\n overrides,\n children,\n}) => {\n const translate = useMemo<AccessibilityLanguageTranslate>(() => {\n if (typeof overrides === 'function') {\n return overrides;\n }\n\n const accessibilityFile = getAccessibilityLanguageFile(language, overrides);\n return (entryKey, params) => {\n let translation = accessibilityFile[entryKey];\n\n // replace params\n if (translation && params) {\n Object.entries(params).forEach(([key, value]) => {\n translation = translation.replace(new RegExp(`{${key}}`, 'g'), String(value));\n });\n }\n\n return translation;\n };\n }, [language, overrides]);\n\n return <Provider value={translate}>{children}</Provider>;\n};\n\n/**\n * Access accessibility language translations\n * @note This needs to be used inside {@link AccessibilityLanguageProvider} context\n */\nexport const useAccessibilityTranslation = () => {\n const translate = useContext(AccessibilityLanguageContext);\n\n // check context provided\n if (!translate) {\n throw new Error('Accessibility Language not provided!, wrap your components in the AccessibilityLanguageProvider');\n }\n\n return translate;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAAmH,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,I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gB,OAAA,CAAAnB,6BAAA,GAAAA,6BAAA;AAIO,MAAMoB,2BAA2B,GAAGA,CAAA,KAAM;EAC/C,MAAMhB,SAAS,GAAG,IAAAiB,iBAAU,EAAC1B,4BAA4B,CAAC;;EAE1D;EACA,IAAI,CAACS,SAAS,EAAE;IACd,MAAM,IAAIkB,KAAK,CAAC,iGAAiG,CAAC;EACpH;EAEA,OAAOlB,SAAS;AAClB,CAAC;AAACe,OAAA,CAAAC,2BAAA,GAAAA,2BAAA","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  var _exportNames = {
7
- AccessibilityTextTransformer: true,
8
7
  focusAccessibility: true,
9
8
  setAccessibilityTextTransformer: true,
10
9
  transformAccessibilityText: true,
@@ -15,10 +14,7 @@ var _exportNames = {
15
14
  useIsOutsideTransition: true,
16
15
  AccessibilityFocusHistoryProvider: true,
17
16
  useAccessibilityFocusHistory: true,
18
- AccessibilityLanguageProvider: true,
19
- AccessibilityLanguageProviderProps: true,
20
- AccessibilityLanguageFile: true,
21
- SupportedAccessibilityLanguage: true
17
+ AccessibilityLanguageProvider: true
22
18
  };
23
19
  Object.defineProperty(exports, "AccessibilityFocusHistoryProvider", {
24
20
  enumerable: true,
@@ -26,36 +22,12 @@ Object.defineProperty(exports, "AccessibilityFocusHistoryProvider", {
26
22
  return _accessibilityHistory.AccessibilityFocusHistoryProvider;
27
23
  }
28
24
  });
29
- Object.defineProperty(exports, "AccessibilityLanguageFile", {
30
- enumerable: true,
31
- get: function () {
32
- return _locale.AccessibilityLanguageFile;
33
- }
34
- });
35
25
  Object.defineProperty(exports, "AccessibilityLanguageProvider", {
36
26
  enumerable: true,
37
27
  get: function () {
38
28
  return _accessibilityLanguage.AccessibilityLanguageProvider;
39
29
  }
40
30
  });
41
- Object.defineProperty(exports, "AccessibilityLanguageProviderProps", {
42
- enumerable: true,
43
- get: function () {
44
- return _accessibilityLanguage.AccessibilityLanguageProviderProps;
45
- }
46
- });
47
- Object.defineProperty(exports, "AccessibilityTextTransformer", {
48
- enumerable: true,
49
- get: function () {
50
- return _accessibility.AccessibilityTextTransformer;
51
- }
52
- });
53
- Object.defineProperty(exports, "SupportedAccessibilityLanguage", {
54
- enumerable: true,
55
- get: function () {
56
- return _locale.SupportedAccessibilityLanguage;
57
- }
58
- });
59
31
  Object.defineProperty(exports, "focusAccessibility", {
60
32
  enumerable: true,
61
33
  get: function () {
@@ -113,7 +85,6 @@ Object.defineProperty(exports, "useIsOutsideTransition", {
113
85
  var _accessibility = require("./accessibility");
114
86
  var _accessibilityHistory = require("./accessibilityHistory");
115
87
  var _accessibilityLanguage = require("./accessibilityLanguage");
116
- var _locale = require("./locale");
117
88
  var _accessibilityHistoryWrappers = require("./accessibilityHistoryWrappers");
118
89
  Object.keys(_accessibilityHistoryWrappers).forEach(function (key) {
119
90
  if (key === "default" || key === "__esModule") return;
@@ -1 +1 @@
1
- {"version":3,"names":["_accessibility","require","_accessibilityHistory","_accessibilityLanguage","_locale","_accessibilityHistoryWrappers","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["import {\n AccessibilityTextTransformer,\n focusAccessibility,\n setAccessibilityTextTransformer,\n transformAccessibilityText,\n useAccessibilityAnnouncement,\n useAccessibilityAnnouncementCumulative,\n useAccessibilityFocus,\n useAccessibleAfterTransition,\n useIsOutsideTransition,\n} from './accessibility';\nimport { AccessibilityFocusHistoryProvider, useAccessibilityFocusHistory } from './accessibilityHistory';\nimport { AccessibilityLanguageProvider, AccessibilityLanguageProviderProps } from './accessibilityLanguage';\n// @ts-ignore\nimport { AccessibilityLanguageFile, SupportedAccessibilityLanguage } from './locale';\n\nexport * from './accessibilityHistoryWrappers';\n\nexport {\n AccessibilityFocusHistoryProvider,\n AccessibilityLanguageFile,\n AccessibilityLanguageProvider,\n AccessibilityLanguageProviderProps,\n AccessibilityTextTransformer,\n focusAccessibility,\n setAccessibilityTextTransformer,\n SupportedAccessibilityLanguage,\n transformAccessibilityText,\n useAccessibilityAnnouncement,\n useAccessibilityAnnouncementCumulative,\n useAccessibilityFocus,\n useAccessibilityFocusHistory,\n useAccessibleAfterTransition,\n useIsOutsideTransition,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,cAAA,GAAAC,OAAA;AAWA,IAAAC,qBAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAEA,IAAAI,6BAAA,GAAAJ,OAAA;AAAAK,MAAA,CAAAC,IAAA,CAAAF,6BAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,6BAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,6BAAA,CAAAI,GAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_accessibility","require","_accessibilityHistory","_accessibilityLanguage","_accessibilityHistoryWrappers","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["index.ts"],"sourcesContent":["import type { AccessibilityTextTransformer } from './accessibility';\nimport {\n focusAccessibility,\n setAccessibilityTextTransformer,\n transformAccessibilityText,\n useAccessibilityAnnouncement,\n useAccessibilityAnnouncementCumulative,\n useAccessibilityFocus,\n useAccessibleAfterTransition,\n useIsOutsideTransition,\n} from './accessibility';\nimport { AccessibilityFocusHistoryProvider, useAccessibilityFocusHistory } from './accessibilityHistory';\nimport type { AccessibilityLanguageProviderProps } from './accessibilityLanguage';\nimport { AccessibilityLanguageProvider } from './accessibilityLanguage';\n// @ts-ignore\nimport type { AccessibilityLanguageFile, SupportedAccessibilityLanguage } from './locale';\n\nexport * from './accessibilityHistoryWrappers';\n\nexport {\n AccessibilityFocusHistoryProvider,\n AccessibilityLanguageFile,\n AccessibilityLanguageProvider,\n AccessibilityLanguageProviderProps,\n AccessibilityTextTransformer,\n focusAccessibility,\n setAccessibilityTextTransformer,\n SupportedAccessibilityLanguage,\n transformAccessibilityText,\n useAccessibilityAnnouncement,\n useAccessibilityAnnouncementCumulative,\n useAccessibilityFocus,\n useAccessibilityFocusHistory,\n useAccessibleAfterTransition,\n useIsOutsideTransition,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,OAAA;AAUA,IAAAC,qBAAA,GAAAD,OAAA;AAEA,IAAAE,sBAAA,GAAAF,OAAA;AAIA,IAAAG,6BAAA,GAAAH,OAAA;AAAAI,MAAA,CAAAC,IAAA,CAAAF,6BAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,6BAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,6BAAA,CAAAI,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -8,14 +8,13 @@ var _de = _interopRequireDefault(require("./de.json"));
8
8
  var _en = _interopRequireDefault(require("./en.json"));
9
9
  var _fr = _interopRequireDefault(require("./fr.json"));
10
10
  var _it = _interopRequireDefault(require("./it.json"));
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
- const defaultLanguageFiles = {
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ const defaultLanguageFiles = exports.defaultLanguageFiles = {
13
13
  en: _en.default,
14
14
  de: _de.default,
15
15
  fr: _fr.default,
16
16
  it: _it.default
17
17
  };
18
- exports.defaultLanguageFiles = defaultLanguageFiles;
19
18
  const getAccessibilityLanguageFile = (language, overrides) => Object.assign({}, defaultLanguageFiles[language], overrides);
20
19
  exports.getAccessibilityLanguageFile = getAccessibilityLanguageFile;
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_de","_interopRequireDefault","require","_en","_fr","_it","obj","__esModule","default","defaultLanguageFiles","en","de","fr","it","exports","getAccessibilityLanguageFile","language","overrides","Object","assign"],"sources":["index.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport fr from './fr.json';\nimport it from './it.json';\n\nexport const defaultLanguageFiles = { en, de, fr, it };\n\nexport type SupportedAccessibilityLanguage = keyof typeof defaultLanguageFiles;\nexport type AccessibilityLanguageFile = typeof en;\n\nexport const getAccessibilityLanguageFile = (\n language: SupportedAccessibilityLanguage,\n overrides?: Partial<AccessibilityLanguageFile>,\n): AccessibilityLanguageFile =>\n Object.assign<{}, AccessibilityLanguageFile, Partial<AccessibilityLanguageFile> | undefined>(\n {},\n defaultLanguageFiles[language],\n overrides,\n );\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAA2B,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEpB,MAAMG,oBAAoB,GAAG;EAAEC,EAAE,EAAFA,WAAE;EAAEC,EAAE,EAAFA,WAAE;EAAEC,EAAE,EAAFA,WAAE;EAAEC,EAAE,EAAFA;AAAG,CAAC;AAACC,OAAA,CAAAL,oBAAA,GAAAA,oBAAA;AAKhD,MAAMM,4BAA4B,GAAGA,CAC1CC,QAAwC,EACxCC,SAA8C,KAE9CC,MAAM,CAACC,MAAM,CACX,CAAC,CAAC,EACFV,oBAAoB,CAACO,QAAQ,CAAC,EAC9BC,SAAS,CACV;AAACH,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
1
+ {"version":3,"names":["_de","_interopRequireDefault","require","_en","_fr","_it","e","__esModule","default","defaultLanguageFiles","exports","en","de","fr","it","getAccessibilityLanguageFile","language","overrides","Object","assign"],"sources":["index.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport fr from './fr.json';\nimport it from './it.json';\n\nexport const defaultLanguageFiles = { en, de, fr, it };\n\nexport type SupportedAccessibilityLanguage = keyof typeof defaultLanguageFiles;\nexport type AccessibilityLanguageFile = typeof en;\n\nexport const getAccessibilityLanguageFile = (\n language: SupportedAccessibilityLanguage,\n overrides?: Partial<AccessibilityLanguageFile>,\n): AccessibilityLanguageFile =>\n Object.assign<{}, AccessibilityLanguageFile, Partial<AccessibilityLanguageFile> | undefined>(\n {},\n defaultLanguageFiles[language],\n overrides,\n );\n"],"mappings":";;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAA2B,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEpB,MAAMG,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG;EAAEE,EAAE,EAAFA,WAAE;EAAEC,EAAE,EAAFA,WAAE;EAAEC,EAAE,EAAFA,WAAE;EAAEC,EAAE,EAAFA;AAAG,CAAC;AAK/C,MAAMC,4BAA4B,GAAGA,CAC1CC,QAAwC,EACxCC,SAA8C,KAE9CC,MAAM,CAACC,MAAM,CACX,CAAC,CAAC,EACFV,oBAAoB,CAACO,QAAQ,CAAC,EAC9BC,SACF,CAAC;AAACP,OAAA,CAAAK,4BAAA,GAAAA,4BAAA","ignoreList":[]}