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

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 (261) hide show
  1. package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
  4. package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
  5. package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -2
  6. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
  7. package/lib/commonjs/components/entity/entity-details.js +3 -3
  8. package/lib/commonjs/components/entity/entity-details.js.map +1 -1
  9. package/lib/commonjs/components/history/history-details-screen.js +10 -10
  10. package/lib/commonjs/components/history/history-details-screen.js.map +1 -1
  11. package/lib/commonjs/components/history/history-list-item-icon.js +12 -8
  12. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  13. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  14. package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
  15. package/lib/commonjs/components/history/history-list-section-header.js +1 -1
  16. package/lib/commonjs/components/history/history-list-section-header.js.map +1 -1
  17. package/lib/commonjs/components/history/history-list.js.map +1 -1
  18. package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -1
  19. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
  20. package/lib/commonjs/components/proof-request/v1/share-credential.js +1 -1
  21. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
  22. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
  23. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +2 -2
  24. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  25. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +2 -2
  26. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  27. package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  28. package/lib/commonjs/ui-components/accessibility/locale/fi.json +1 -1
  29. package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
  30. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  31. package/lib/commonjs/ui-components/history/history-section-header.js +1 -1
  32. package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
  33. package/lib/commonjs/ui-components/history/history-section-list-item.js +1 -1
  34. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  35. package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
  36. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  37. package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
  38. package/lib/commonjs/ui-components/settings/button-setting.js +3 -1
  39. package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
  40. package/lib/commonjs/ui-components/settings/setting-item.js +4 -2
  41. package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
  42. package/lib/commonjs/ui-components/settings/switch-setting.js +4 -2
  43. package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
  44. package/lib/commonjs/utils/date.js.map +1 -1
  45. package/lib/commonjs/utils/history.js.map +1 -1
  46. package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  47. package/lib/commonjs/utils/hooks/core/backup.js +3 -3
  48. package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
  49. package/lib/commonjs/utils/hooks/core/cache.js +10 -10
  50. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  51. package/lib/commonjs/utils/hooks/core/core-context.js +5 -5
  52. package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
  53. package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
  54. package/lib/commonjs/utils/hooks/core/credentials.js +3 -3
  55. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  56. package/lib/commonjs/utils/hooks/core/dids.js +1 -1
  57. package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
  58. package/lib/commonjs/utils/hooks/core/history.js +1 -1
  59. package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
  60. package/lib/commonjs/utils/hooks/core/identifiers.js +3 -3
  61. package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
  62. package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
  63. package/lib/commonjs/utils/hooks/core/proofs.js +9 -9
  64. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  65. package/lib/commonjs/utils/hooks/core/trust-entity.js +5 -5
  66. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
  67. package/lib/commonjs/utils/hooks/core/wallet-unit.js +1 -1
  68. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  69. package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
  70. package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
  71. package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
  72. package/lib/commonjs/utils/parsers/credential-images.js +11 -10
  73. package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
  74. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +11 -8
  75. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  76. package/lib/commonjs/utils/parsers/credential-sharing.js +2 -2
  77. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  78. package/lib/commonjs/utils/parsers/credential.js +29 -16
  79. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  80. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  81. package/lib/commonjs/utils/url.js.map +1 -1
  82. package/lib/module/components/backup/preview-credentials.js.map +1 -1
  83. package/lib/module/components/credential/credential.js.map +1 -1
  84. package/lib/module/components/entity/EntityButtons.js.map +1 -1
  85. package/lib/module/components/entity/entity-attributes.js.map +1 -1
  86. package/lib/module/components/entity/entity-details-with-buttons.js +3 -3
  87. package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
  88. package/lib/module/components/entity/entity-details.js +4 -4
  89. package/lib/module/components/entity/entity-details.js.map +1 -1
  90. package/lib/module/components/history/history-details-screen.js +11 -11
  91. package/lib/module/components/history/history-details-screen.js.map +1 -1
  92. package/lib/module/components/history/history-list-item-icon.js +13 -9
  93. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  94. package/lib/module/components/history/history-list-item.js.map +1 -1
  95. package/lib/module/components/history/history-list-screen.js.map +1 -1
  96. package/lib/module/components/history/history-list-section-header.js +1 -1
  97. package/lib/module/components/history/history-list-section-header.js.map +1 -1
  98. package/lib/module/components/history/history-list.js.map +1 -1
  99. package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -1
  100. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
  101. package/lib/module/components/proof-request/v1/share-credential.js +2 -2
  102. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
  103. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
  104. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +2 -2
  105. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  106. package/lib/module/components/proof-request/v2/share-credential-v2.js +2 -2
  107. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  108. package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
  109. package/lib/module/ui-components/accessibility/locale/fi.json +1 -1
  110. package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
  111. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  112. package/lib/module/ui-components/history/history-section-header.js +1 -1
  113. package/lib/module/ui-components/history/history-section-header.js.map +1 -1
  114. package/lib/module/ui-components/history/history-section-list-item.js +1 -1
  115. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  116. package/lib/module/ui-components/icons/entity.js.map +1 -1
  117. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  118. package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
  119. package/lib/module/ui-components/settings/button-setting.js +3 -1
  120. package/lib/module/ui-components/settings/button-setting.js.map +1 -1
  121. package/lib/module/ui-components/settings/setting-item.js +4 -2
  122. package/lib/module/ui-components/settings/setting-item.js.map +1 -1
  123. package/lib/module/ui-components/settings/switch-setting.js +4 -2
  124. package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
  125. package/lib/module/utils/date.js.map +1 -1
  126. package/lib/module/utils/history.js.map +1 -1
  127. package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
  128. package/lib/module/utils/hooks/core/backup.js +4 -4
  129. package/lib/module/utils/hooks/core/backup.js.map +1 -1
  130. package/lib/module/utils/hooks/core/cache.js +11 -11
  131. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  132. package/lib/module/utils/hooks/core/core-context.js +5 -5
  133. package/lib/module/utils/hooks/core/core-context.js.map +1 -1
  134. package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
  135. package/lib/module/utils/hooks/core/credentials.js +4 -4
  136. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  137. package/lib/module/utils/hooks/core/dids.js +2 -2
  138. package/lib/module/utils/hooks/core/dids.js.map +1 -1
  139. package/lib/module/utils/hooks/core/history.js +1 -1
  140. package/lib/module/utils/hooks/core/history.js.map +1 -1
  141. package/lib/module/utils/hooks/core/identifiers.js +4 -4
  142. package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
  143. package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
  144. package/lib/module/utils/hooks/core/proofs.js +10 -10
  145. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  146. package/lib/module/utils/hooks/core/trust-entity.js +6 -6
  147. package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
  148. package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
  149. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  150. package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
  151. package/lib/module/utils/hooks/revocation/credential-status.js +2 -2
  152. package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
  153. package/lib/module/utils/parsers/credential-images.js +12 -11
  154. package/lib/module/utils/parsers/credential-images.js.map +1 -1
  155. package/lib/module/utils/parsers/credential-sharing-v2.js +11 -8
  156. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  157. package/lib/module/utils/parsers/credential-sharing.js +2 -2
  158. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  159. package/lib/module/utils/parsers/credential.js +30 -17
  160. package/lib/module/utils/parsers/credential.js.map +1 -1
  161. package/lib/module/utils/parsers/query.js.map +1 -1
  162. package/lib/module/utils/url.js.map +1 -1
  163. package/lib/typescript/components/backup/preview-credentials.d.ts +2 -2
  164. package/lib/typescript/components/credential/credential.d.ts +2 -2
  165. package/lib/typescript/components/entity/EntityButtons.d.ts +2 -2
  166. package/lib/typescript/components/entity/entity-attributes.d.ts +2 -2
  167. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -3
  168. package/lib/typescript/components/entity/entity-details.d.ts +5 -5
  169. package/lib/typescript/components/history/history-details-screen.d.ts +2 -2
  170. package/lib/typescript/components/history/history-list-item-icon.d.ts +3 -3
  171. package/lib/typescript/components/history/history-list-item.d.ts +5 -5
  172. package/lib/typescript/components/history/history-list-screen.d.ts +4 -4
  173. package/lib/typescript/components/history/history-list.d.ts +5 -5
  174. package/lib/typescript/components/proof-request/v1/select-credential.d.ts +2 -2
  175. package/lib/typescript/components/proof-request/v1/share-credential.d.ts +6 -6
  176. package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +3 -3
  177. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +4 -4
  178. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +5 -5
  179. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
  180. package/lib/typescript/ui-components/settings/setting-item.d.ts +1 -0
  181. package/lib/typescript/utils/history.d.ts +3 -3
  182. package/lib/typescript/utils/hooks/core/backup.d.ts +3 -3
  183. package/lib/typescript/utils/hooks/core/cache.d.ts +2 -2
  184. package/lib/typescript/utils/hooks/core/core-context.d.ts +1 -1
  185. package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +6 -6
  186. package/lib/typescript/utils/hooks/core/credentials.d.ts +8 -8
  187. package/lib/typescript/utils/hooks/core/dids.d.ts +2 -2
  188. package/lib/typescript/utils/hooks/core/history.d.ts +2 -2
  189. package/lib/typescript/utils/hooks/core/identifiers.d.ts +3 -3
  190. package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
  191. package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -9
  192. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -6
  193. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -5
  194. package/lib/typescript/utils/parsers/credential-images.d.ts +2 -2
  195. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +7 -7
  196. package/lib/typescript/utils/parsers/credential-sharing.d.ts +8 -8
  197. package/lib/typescript/utils/parsers/credential.d.ts +15 -14
  198. package/lib/typescript/utils/parsers/query.d.ts +8 -8
  199. package/package.json +6 -4
  200. package/src/components/backup/preview-credentials.tsx +2 -2
  201. package/src/components/credential/credential.tsx +2 -2
  202. package/src/components/entity/EntityButtons.tsx +2 -2
  203. package/src/components/entity/entity-attributes.tsx +4 -4
  204. package/src/components/entity/entity-details-with-buttons.tsx +11 -6
  205. package/src/components/entity/entity-details.tsx +17 -16
  206. package/src/components/history/history-details-screen.tsx +13 -16
  207. package/src/components/history/history-list-item-icon.tsx +19 -11
  208. package/src/components/history/history-list-item.tsx +9 -5
  209. package/src/components/history/history-list-screen.tsx +4 -4
  210. package/src/components/history/history-list-section-header.tsx +1 -1
  211. package/src/components/history/history-list.tsx +6 -6
  212. package/src/components/proof-request/share-credential-card-notice.tsx +1 -1
  213. package/src/components/proof-request/v1/select-credential.tsx +2 -2
  214. package/src/components/proof-request/v1/share-credential.tsx +13 -11
  215. package/src/components/proof-request/v2/select-credential-v2.tsx +6 -3
  216. package/src/components/proof-request/v2/share-credential-v2-group.tsx +12 -12
  217. package/src/components/proof-request/v2/share-credential-v2.tsx +11 -11
  218. package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +4 -1
  219. package/src/ui-components/accessibility/locale/fi.json +1 -1
  220. package/src/ui-components/buttons/ghost-button.stories.tsx +0 -1
  221. package/src/ui-components/control/checkbox.stories.tsx +1 -1
  222. package/src/ui-components/control/switch.stories.tsx +1 -1
  223. package/src/ui-components/credential/card/credential-header.stories.tsx +0 -1
  224. package/src/ui-components/entity/entity-cluster.tsx +7 -6
  225. package/src/ui-components/header/foldable-header.tsx +8 -11
  226. package/src/ui-components/history/history-section-header.tsx +1 -1
  227. package/src/ui-components/history/history-section-list-item.tsx +1 -1
  228. package/src/ui-components/icons/entity.tsx +2 -2
  229. package/src/ui-components/pin/pin-code-screen.stories.tsx +1 -1
  230. package/src/ui-components/screens/image-preview-screen.stories.tsx +1 -1
  231. package/src/ui-components/screens/nerd-mode-screen.tsx +2 -2
  232. package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +1 -1
  233. package/src/ui-components/screens/section-list-screen.tsx +10 -1
  234. package/src/ui-components/searchbar/search-bar.stories.tsx +0 -1
  235. package/src/ui-components/settings/button-setting.tsx +2 -1
  236. package/src/ui-components/settings/setting-item.tsx +9 -2
  237. package/src/ui-components/settings/switch-setting.tsx +9 -2
  238. package/src/ui-components/text/typography.stories.tsx +2 -2
  239. package/src/utils/date.ts +2 -2
  240. package/src/utils/history.ts +4 -4
  241. package/src/utils/hooks/connectivity/connectivity.test.ts +2 -2
  242. package/src/utils/hooks/core/backup.ts +4 -4
  243. package/src/utils/hooks/core/cache.ts +13 -13
  244. package/src/utils/hooks/core/core-context.tsx +6 -6
  245. package/src/utils/hooks/core/credential-schemas.ts +7 -4
  246. package/src/utils/hooks/core/credentials.ts +21 -13
  247. package/src/utils/hooks/core/dids.ts +3 -3
  248. package/src/utils/hooks/core/history.ts +3 -3
  249. package/src/utils/hooks/core/identifiers.ts +9 -5
  250. package/src/utils/hooks/core/proof-schemas.ts +21 -16
  251. package/src/utils/hooks/core/proofs.ts +31 -27
  252. package/src/utils/hooks/core/trust-entity.ts +19 -12
  253. package/src/utils/hooks/core/wallet-unit.ts +21 -11
  254. package/src/utils/hooks/navigation/open-settings.ts +1 -1
  255. package/src/utils/hooks/revocation/credential-status.ts +2 -2
  256. package/src/utils/parsers/credential-images.tsx +19 -13
  257. package/src/utils/parsers/credential-sharing-v2.tsx +29 -24
  258. package/src/utils/parsers/credential-sharing.tsx +24 -24
  259. package/src/utils/parsers/credential.ts +63 -40
  260. package/src/utils/parsers/query.ts +16 -14
  261. package/src/utils/url.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useMemo","Dimensions","StyleSheet","CredentialDetailsCardListItem","useAppColorScheme","concatTestID","getValidityState","useCoreConfig","ValidityState","shareCredentialCardFromV2PresentationCredential","SelectShareCredentialCardNotice","ShareCredentialCardNotice","GroupedShareCredentialV2Padding","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credential$issuer","colorScheme","applicableCredentials","undefined","failureHint","credential","find","c","id","data","config","cardWidth","get","width","multipleCredentialsAvailable","Boolean","length","validityState","issuer","footer","Revoked","createElement","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","fieldPath","selected","card","header","attributes","accessory","credentialId","styles","groupedCredential","bordered","borderColor","background","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n CredentialListItem,\n PresentationDefinitionV2CredentialClaim,\n PresentationDefinitionV2CredentialQuery,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: PresentationDefinitionV2CredentialQuery;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItem['id'],\n fieldPath: PresentationDefinitionV2CredentialClaim['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionV2CredentialClaim['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n 'applicableCredentials' in credentialQuery ? credentialQuery.applicableCredentials : undefined;\n const failureHint = 'failureHint' in credentialQuery ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2CredentialClaim['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n marginBottom: 8,\n },\n groupedCredential: {\n marginHorizontal: GroupedShareCredentialV2Padding,\n },\n});\n"],"mappings":"AAKA,OAAOA,KAAK,IAAuBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACtE,SAASC,UAAU,EAAkCC,UAAU,QAAmB,cAAc;AAEhG,SAASC,6BAA6B,EAAEC,iBAAiB,QAAQ,wBAAwB;AACzF,SAASC,YAAY,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,gBAAgB;AAC7F,SAASC,+CAA+C,QAAQ,8CAA8C;AAC9G,SAASC,+BAA+B,QAAQ,wCAAwC;AACxF,SAASC,yBAAyB,QAAQ,iCAAiC;AAyB3E,OAAO,MAAMC,+BAA+B,GAAG,CAAC;AAEhD,OAAO,MAAMC,iBAA4D,GAAGA,CAAC;EAC3EC,eAAe;EACfC,mBAAmB;EACnBC,QAAQ;EACRC,OAAO;EACPC,eAAe;EACfC,MAAM;EACNC,QAAQ;EACRC,aAAa;EACbC,cAAc;EACdC,kBAAkB;EAClBC,aAAa;EACbC,oBAAoB;EACpBC,cAAc;EACdC,KAAK;EACLC;AACF,CAAC,KAAK;EAAA,IAAAC,qBAAA,EAAAC,kBAAA;EACJ,MAAMC,WAAW,GAAG3B,iBAAiB,CAAC,CAAC;EACvC,MAAM4B,qBAAqB,GACzB,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QAAQ,EAAE;IACRI,WAAW,EAAE;EACf,CAAC;EACDzC,UAAU,EAAE;IACV0C,YAAY,EAAE,EAAE;IAChBC,YAAY,EAAE;EAChB,CAAC;EACDP,iBAAiB,EAAE;IACjBQ,gBAAgB,EAAEnE;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","useCallback","useMemo","Dimensions","StyleSheet","CredentialDetailsCardListItem","useAppColorScheme","concatTestID","getValidityState","useCoreConfig","ValidityState","shareCredentialCardFromV2PresentationCredential","SelectShareCredentialCardNotice","ShareCredentialCardNotice","GroupedShareCredentialV2Padding","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credential$issuer","colorScheme","applicableCredentials","type_","undefined","failureHint","credential","find","c","id","data","config","cardWidth","get","width","multipleCredentialsAvailable","Boolean","length","validityState","issuer","footer","Revoked","createElement","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","fieldPath","selected","card","header","attributes","accessory","credentialId","styles","groupedCredential","bordered","borderColor","background","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n ApplicableCredentialOrFailureHintBindingEnum,\n CredentialListItemBindingDto,\n PresentationDefinitionV2ClaimBindingDto,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: ApplicableCredentialOrFailureHintBindingEnum;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItemBindingDto['id'],\n fieldPath: PresentationDefinitionV2ClaimBindingDto['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItemBindingDto['id'];\n selectedFields?: Array<PresentationDefinitionV2ClaimBindingDto['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;\n const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2ClaimBindingDto['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n marginBottom: 8,\n },\n groupedCredential: {\n marginHorizontal: GroupedShareCredentialV2Padding,\n },\n});\n"],"mappings":"AAKA,OAAOA,KAAK,IAAuBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACtE,SAASC,UAAU,EAAkCC,UAAU,QAAmB,cAAc;AAEhG,SAASC,6BAA6B,EAAEC,iBAAiB,QAAQ,wBAAwB;AACzF,SAASC,YAAY,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,gBAAgB;AAC7F,SAASC,+CAA+C,QAAQ,8CAA8C;AAC9G,SAASC,+BAA+B,QAAQ,wCAAwC;AACxF,SAASC,yBAAyB,QAAQ,iCAAiC;AAyB3E,OAAO,MAAMC,+BAA+B,GAAG,CAAC;AAEhD,OAAO,MAAMC,iBAA4D,GAAGA,CAAC;EAC3EC,eAAe;EACfC,mBAAmB;EACnBC,QAAQ;EACRC,OAAO;EACPC,eAAe;EACfC,MAAM;EACNC,QAAQ;EACRC,aAAa;EACbC,cAAc;EACdC,kBAAkB;EAClBC,aAAa;EACbC,oBAAoB;EACpBC,cAAc;EACdC,KAAK;EACLC;AACF,CAAC,KAAK;EAAA,IAAAC,qBAAA,EAAAC,kBAAA;EACJ,MAAMC,WAAW,GAAG3B,iBAAiB,CAAC,CAAC;EACvC,MAAM4B,qBAAqB,GACzBlB,eAAe,CAACmB,KAAK,KAAK,wBAAwB,GAAGnB,eAAe,CAACkB,qBAAqB,GAAGE,SAAS;EACxG,MAAMC,WAAW,GAAGrB,eAAe,CAACmB,KAAK,KAAK,cAAc,GAAGnB,eAAe,CAACqB,WAAW,GAAGD,SAAS;EACtG,MAAME,UAAU,IAAAP,qBAAA,GAAGG,qBAAqB,aAArBA,qBAAqB,uBAAr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,"names":["React","forwardRef","Pressable","RNPressable","TouchableHighlight","RNTouchableHighlight","TouchableOpacity","RNTouchableOpacity","TouchableWithoutFeedback","RNTouchableWithoutFeedback","useAccessibilityFocusHistory","WithAccessibilityFocusHistory","C","displayName","ComponentWithAccessibilityFocusHistory","forwardedRef","onPress","originalOnPress","props","ref","undefined","createElement","_extends","Forwarded"],"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":";AAAA;AACA,OAAOA,KAAK,IAAsBC,UAAU,QAAQ,OAAO;AAC3D,SAEEC,SAAS,IAAIC,WAAW,EAExBC,kBAAkB,IAAIC,oBAAoB,EAE1CC,gBAAgB,IAAIC,kBAAkB,EAEtCC,wBAAwB,IAAIC,0BAA0B,QAGjD,cAAc;AAErB,SAASC,4BAA4B,QAAQ,wBAAwB;AAOrE,MAAMC,6BAA6B,GAAGA,CACpCC,CAAsC,EACtCC,WAAmB,KAChB;EAKH,MAAMC,sCAA0D,GAAGA,CAAC;IAClEC,YAAY;IACZC,OAAO,EAAEC,eAAe;IACxB,GAAGC;EACL,CAAC,KAAK;IACJ,MAAM;MAAEC,GAAG;MAAEH;IAAQ,CAAC,GAAGN,4BAA4B,CACnDO,eAAe,aAAfA,eAAe,cAAfA,eAAe,GAAIG,SAAS,EAC5BL,YACF,CAAC;IACD;IACA,oBAAOf,KAAA,CAAAqB,aAAA,CAACT,CAAC,EAAAU,QAAA;MAACH,GAAG,EAAEA,GAAI;MAACH,OAAO,EAAEA;IAAQ,GAAKE,KAAK,CAAG,CAAC;EACrD,CAAC;EAED,MAAMK,SAAS,gBAAGtB,UAAU,CAA0B,CAACiB,KAAK,EAAEC,GAAG,kBAC/DnB,KAAA,CAAAqB,aAAA,CAACP,sCAAsC,EAAAQ,QAAA,KAAKJ,KAAK;IAAEH,YAAY,EAAEI;EAAI,EAAE,CACxE,CAAC;EACFI,SAAS,CAACV,WAAW,GAAGA,WAAW;EAEnC,OAAOU,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMjB,gBAAgB,GAAGK,6BAA6B,CAC3DJ,kBAAkB,EAClB,kBACF,CAAC;AACD,OAAO,MAAMC,wBAAwB,GAAGG,6BAA6B,CAGnEF,0BAA0B,EAAE,0BAA0B,CAAC;AACzD,OAAO,MAAML,kBAAkB,GAAGO,6BAA6B,CAC7DN,oBAAoB,EACpB,oBACF,CAAC;AACD,OAAO,MAAMH,SAAS,GAAGS,6BAA6B,CAAuBR,WAAW,EAAE,WAAW,CAAC;;AAKtG;AACA;AACA","ignoreList":[]}
1
+ {"version":3,"names":["React","forwardRef","Pressable","RNPressable","TouchableHighlight","RNTouchableHighlight","TouchableOpacity","RNTouchableOpacity","TouchableWithoutFeedback","RNTouchableWithoutFeedback","useAccessibilityFocusHistory","WithAccessibilityFocusHistory","C","displayName","ComponentWithAccessibilityFocusHistory","forwardedRef","onPress","originalOnPress","props","ref","undefined","createElement","_extends","Forwarded"],"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 = <\n ComponentProps extends OnPressProps,\n RefType extends React.ElementType<any, any>,\n>(\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":";AAAA;AACA,OAAOA,KAAK,IAAsBC,UAAU,QAAQ,OAAO;AAC3D,SAEEC,SAAS,IAAIC,WAAW,EAExBC,kBAAkB,IAAIC,oBAAoB,EAE1CC,gBAAgB,IAAIC,kBAAkB,EAEtCC,wBAAwB,IAAIC,0BAA0B,QAGjD,cAAc;AAErB,SAASC,4BAA4B,QAAQ,wBAAwB;AAOrE,MAAMC,6BAA6B,GAAGA,CAIpCC,CAAsC,EACtCC,WAAmB,KAChB;EAKH,MAAMC,sCAA0D,GAAGA,CAAC;IAClEC,YAAY;IACZC,OAAO,EAAEC,eAAe;IACxB,GAAGC;EACL,CAAC,KAAK;IACJ,MAAM;MAAEC,GAAG;MAAEH;IAAQ,CAAC,GAAGN,4BAA4B,CACnDO,eAAe,aAAfA,eAAe,cAAfA,eAAe,GAAIG,SAAS,EAC5BL,YACF,CAAC;IACD;IACA,oBAAOf,KAAA,CAAAqB,aAAA,CAACT,CAAC,EAAAU,QAAA;MAACH,GAAG,EAAEA,GAAI;MAACH,OAAO,EAAEA;IAAQ,GAAKE,KAAK,CAAG,CAAC;EACrD,CAAC;EAED,MAAMK,SAAS,gBAAGtB,UAAU,CAA0B,CAACiB,KAAK,EAAEC,GAAG,kBAC/DnB,KAAA,CAAAqB,aAAA,CAACP,sCAAsC,EAAAQ,QAAA,KAAKJ,KAAK;IAAEH,YAAY,EAAEI;EAAI,EAAE,CACxE,CAAC;EACFI,SAAS,CAACV,WAAW,GAAGA,WAAW;EAEnC,OAAOU,SAAS;AAClB,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMjB,gBAAgB,GAAGK,6BAA6B,CAC3DJ,kBAAkB,EAClB,kBACF,CAAC;AACD,OAAO,MAAMC,wBAAwB,GAAGG,6BAA6B,CAGnEF,0BAA0B,EAAE,0BAA0B,CAAC;AACzD,OAAO,MAAML,kBAAkB,GAAGO,6BAA6B,CAC7DN,oBAAoB,EACpB,oBACF,CAAC;AACD,OAAO,MAAMH,SAAS,GAAGS,6BAA6B,CAAuBR,WAAW,EAAE,WAAW,CAAC;;AAKtG;AACA;AACA","ignoreList":[]}
@@ -18,4 +18,4 @@
18
18
  "accessibility.icon.scan": "skannaa",
19
19
  "accessibility.key.faceId": "faceId",
20
20
  "accessibility.key.fingerprint": "sormenjälki"
21
- }
21
+ }
@@ -1 +1 @@
1
- {"version":3,"names":["React","useEffect","useMemo","Platform","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withRepeat","withTiming","LoaderView","LoaderViewState","concatTestID","Typography","useAppColorScheme","Avatar","EntityCluster","avatar","entityName","subline","textColor","style","sublineColor","testID","isLoading","viewProps","colorScheme","opacity","animatedStyle","value","duration","avatarProps","_avatar$placeholderTe","component","createElement","styles","loaderWrapper","backgroundColor","grayDark","loader","animate","state","InProgress","initials","split","map","word","placeholderText","length","join","_extends","entity","labels","color","text","numberOfLines","preset","undefined","create","alignItems","flexDirection","letterSpacing","OS","flex","marginLeft","transform","scale","height","paddingLeft","paddingTop","width"],"sources":["entity-cluster.tsx"],"sourcesContent":["import React, { FunctionComponent, useEffect, useMemo } from 'react';\nimport { Platform, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { LoaderView, LoaderViewState } from '../../ui-components/loader';\nimport { concatTestID } from '../../utils';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport Avatar, { AvatarProps } from './avatar';\n\nexport type EntityClusterProps = ViewProps & {\n avatar?: AvatarProps;\n entityName: string;\n subline?: string;\n textColor?: string;\n sublineColor?: string;\n testID?: string;\n isLoading?: boolean;\n};\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25595&mode=design&t=YI1oD2BfBie5HcvJ-0\nconst EntityCluster: FunctionComponent<EntityClusterProps> = ({\n avatar,\n entityName,\n subline,\n textColor,\n style,\n sublineColor,\n testID,\n isLoading,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n \n const opacity = useSharedValue<number>(1);\n\n const animatedStyle = useAnimatedStyle(() => ({\n opacity: opacity.value,\n }));\n\n useEffect(() => {\n if (!isLoading) {\n return;\n }\n opacity.value = withRepeat(\n withTiming(0.3, { duration: 1000 }),\n 0,\n true\n );\n }, [opacity, isLoading]);\n\n const avatarProps = useMemo<AvatarProps>(() => {\n if (isLoading) {\n return {\n avatar: {\n component: \n <View style={[styles.loaderWrapper, { backgroundColor: colorScheme.grayDark }]}>\n <View style={styles.loader}>\n <LoaderView animate={true} state={LoaderViewState.InProgress} />\n </View>\n </View>\n }\n }\n }\n const initials = entityName.split(' ', 3).map((word: string) => word[0]);\n const placeholderText = initials.length > 0 ? initials.join('') : '';\n return {\n ...avatar,\n placeholderText: avatar?.placeholderText ?? placeholderText,\n };\n }, [avatar, entityName, colorScheme.grayDark, isLoading]);\n\n return (\n <View style={[styles.entity, style]} testID={testID} {...viewProps}>\n <Avatar testID={concatTestID(testID, 'avatar')} {...avatarProps} />\n <View style={styles.labels}>\n {isLoading ? (\n <Animated.View style={[{ backgroundColor: colorScheme.grayDark }, animatedStyle]}>\n <Typography color={colorScheme.grayDark} />\n </Animated.View>\n ) : (\n <Typography\n testID={concatTestID(testID, 'entityName')}\n color={textColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"m\"\n style={styles.entityName}>\n {!isLoading ? entityName : undefined}\n </Typography>\n )}\n {subline && (\n <View>\n <Typography\n testID={concatTestID(testID, 'subline')}\n color={sublineColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"xs\">\n {subline}\n </Typography>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n entity: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n entityName: {\n letterSpacing: Platform.OS === 'ios' ? -0.2 : -0.3, // -0.2 breaks layout on Android\n },\n labels: {\n flex: 1,\n marginLeft: 12,\n },\n loader: {\n transform: [{scale: 0.5}],\n },\n loaderWrapper: {\n height: 72,\n paddingLeft: 3,\n paddingTop: 4,\n width: 72,\n }\n});\n\nexport default EntityCluster;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAuBC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACpE,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACpE,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAEhC,SAASC,UAAU,EAAEC,eAAe,QAAQ,4BAA4B;AACxE,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,MAAM,MAAuB,UAAU;AAY9C;AACA,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,SAAS;EACTC,KAAK;EACLC,YAAY;EACZC,MAAM;EACNC,SAAS;EACT,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGZ,iBAAiB,CAAC,CAAC;EAEvC,MAAMa,OAAO,GAAGpB,cAAc,CAAS,CAAC,CAAC;EAEzC,MAAMqB,aAAa,GAAGtB,gBAAgB,CAAC,OAAO;IAC5CqB,OAAO,EAAEA,OAAO,CAACE;EACnB,CAAC,CAAC,CAAC;EAEH7B,SAAS,CAAC,MAAM;IACd,IAAI,CAACwB,SAAS,EAAE;MACd;IACF;IACAG,OAAO,CAACE,KAAK,GAAGrB,UAAU,CACxBC,UAAU,CAAC,GAAG,EAAE;MAAEqB,QAAQ,EAAE;IAAK,CAAC,CAAC,EACnC,CAAC,EACD,IACF,CAAC;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AAE;IACNQ,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB,CAAC;EACD1C,UAAU,EAAE;IACV2C,aAAa,EAAE3D,QAAQ,CAAC4D,EAAE,KAAK,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAE;EACtD,CAAC;EACDV,MAAM,EAAE;IACNW,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd,CAAC;EACDzB,MAAM,EAAE;IACN0B,SAAS,EAAE,CAAC;MAACC,KAAK,EAAE;IAAG,CAAC;EAC1B,CAAC;EACD9B,aAAa,EAAE;IACb+B,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,UAAU,EAAE,CAAC;IACbC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAetD,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["React","useEffect","useMemo","Platform","StyleSheet","View","Animated","useAnimatedStyle","useSharedValue","withRepeat","withTiming","LoaderView","LoaderViewState","concatTestID","Typography","useAppColorScheme","Avatar","EntityCluster","avatar","entityName","subline","textColor","style","sublineColor","testID","isLoading","viewProps","colorScheme","opacity","animatedStyle","value","duration","avatarProps","_avatar$placeholderTe","component","createElement","styles","loaderWrapper","backgroundColor","grayDark","loader","animate","state","InProgress","initials","split","map","word","placeholderText","length","join","_extends","entity","labels","color","text","numberOfLines","preset","undefined","create","alignItems","flexDirection","letterSpacing","OS","flex","marginLeft","transform","scale","height","paddingLeft","paddingTop","width"],"sources":["entity-cluster.tsx"],"sourcesContent":["import React, { FunctionComponent, useEffect, useMemo } from 'react';\nimport { Platform, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { LoaderView, LoaderViewState } from '../../ui-components/loader';\nimport { concatTestID } from '../../utils';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport Avatar, { AvatarProps } from './avatar';\n\nexport type EntityClusterProps = ViewProps & {\n avatar?: AvatarProps;\n entityName: string;\n subline?: string;\n textColor?: string;\n sublineColor?: string;\n testID?: string;\n isLoading?: boolean;\n};\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25595&mode=design&t=YI1oD2BfBie5HcvJ-0\nconst EntityCluster: FunctionComponent<EntityClusterProps> = ({\n avatar,\n entityName,\n subline,\n textColor,\n style,\n sublineColor,\n testID,\n isLoading,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n\n const opacity = useSharedValue<number>(1);\n\n const animatedStyle = useAnimatedStyle(() => ({\n opacity: opacity.value,\n }));\n\n useEffect(() => {\n if (!isLoading) {\n return;\n }\n opacity.value = withRepeat(\n withTiming(0.3, { duration: 1000 }),\n 0,\n true\n );\n }, [opacity, isLoading]);\n\n const avatarProps = useMemo<AvatarProps>(() => {\n if (isLoading) {\n return {\n avatar: {\n component: (\n <View style={[styles.loaderWrapper, { backgroundColor: colorScheme.grayDark }]}>\n <View style={styles.loader}>\n <LoaderView animate={true} state={LoaderViewState.InProgress} />\n </View>\n </View>\n ),\n },\n };\n }\n const initials = entityName.split(' ', 3).map((word: string) => word[0]);\n const placeholderText = initials.length > 0 ? initials.join('') : '';\n return {\n ...avatar,\n placeholderText: avatar?.placeholderText ?? placeholderText,\n };\n }, [avatar, entityName, colorScheme.grayDark, isLoading]);\n\n return (\n <View style={[styles.entity, style]} testID={testID} {...viewProps}>\n <Avatar testID={concatTestID(testID, 'avatar')} {...avatarProps} />\n <View style={styles.labels}>\n {isLoading ? (\n <Animated.View style={[{ backgroundColor: colorScheme.grayDark }, animatedStyle]}>\n <Typography color={colorScheme.grayDark} />\n </Animated.View>\n ) : (\n <Typography\n testID={concatTestID(testID, 'entityName')}\n color={textColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"m\"\n style={styles.entityName}>\n {!isLoading ? entityName : undefined}\n </Typography>\n )}\n {subline && (\n <View>\n <Typography\n testID={concatTestID(testID, 'subline')}\n color={sublineColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"xs\">\n {subline}\n </Typography>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n entity: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n entityName: {\n letterSpacing: Platform.OS === 'ios' ? -0.2 : -0.3, // -0.2 breaks layout on Android\n },\n labels: {\n flex: 1,\n marginLeft: 12,\n },\n loader: {\n transform: [{ scale: 0.5 }],\n },\n loaderWrapper: {\n height: 72,\n paddingLeft: 3,\n paddingTop: 4,\n width: 72,\n },\n});\n\nexport default EntityCluster;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAuBC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AACpE,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACpE,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,cAAc,EACdC,UAAU,EACVC,UAAU,QACL,yBAAyB;AAEhC,SAASC,UAAU,EAAEC,eAAe,QAAQ,4BAA4B;AACxE,SAASC,YAAY,QAAQ,aAAa;AAC1C,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,MAAM,MAAuB,UAAU;AAY9C;AACA,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC,SAAS;EACTC,KAAK;EACLC,YAAY;EACZC,MAAM;EACNC,SAAS;EACT,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGZ,iBAAiB,CAAC,CAAC;EAEvC,MAAMa,OAAO,GAAGpB,cAAc,CAAS,CAAC,CAAC;EAEzC,MAAMqB,aAAa,GAAGtB,gBAAgB,CAAC,OAAO;IAC5CqB,OAAO,EAAEA,OAAO,CAACE;EACnB,CAAC,CAAC,CAAC;EAEH7B,SAAS,CAAC,MAAM;IACd,IAAI,CAACwB,SA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AAa,EAAE,CAAE;IACjBC,MAAM,EAAC;EAAI,GACVrC,OACS,CACR,CAEJ,CACF,CAAC;AAEX,CAAC;AAED,MAAMgB,MAAM,GAAGhC,UAAU,CAACuD,MAAM,CAAC;EAC/BP,MAAM,EAAE;IACNQ,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB,CAAC;EACD1C,UAAU,EAAE;IACV2C,aAAa,EAAE3D,QAAQ,CAAC4D,EAAE,KAAK,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAE;EACtD,CAAC;EACDV,MAAM,EAAE;IACNW,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd,CAAC;EACDzB,MAAM,EAAE;IACN0B,SAAS,EAAE,CAAC;MAAEC,KAAK,EAAE;IAAI,CAAC;EAC5B,CAAC;EACD9B,aAAa,EAAE;IACb+B,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,UAAU,EAAE,CAAC;IACbC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAetD,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useCallback","useEffect","useState","Animated","StyleSheet","View","useSafeAreaInsets","BlurView","AnimatedSearchBar","useAppColorScheme","FoldableSearchHeader","staticHeader","scrollOffset","searchBar","header","withNotice","safeAreaInsets","colorScheme","collapsed","setCollapsed","headerHeight","setHeaderHeight","containerPaddingStyle","paddingTop","top","id","addListener","value","removeListener","playHeaderFoldAnimation","scrollHeaderAnimatedStyle","interpolate","extrapolate","inputRange","outputRange","undefined","fadeHeaderOutAnimatedStyle","opacity","onHeaderLayout","event","nativeEvent","layout","height","createElement","style","styles","headerContainer","noticeBorderRadius","blurWrapper","absoluteFill","blurStyle","color","background","_extends","onLayout","create","overflow","position","width","borderTopLeftRadius","borderTopRightRadius"],"sources":["foldable-header.tsx"],"sourcesContent":["import React, { FunctionComponent, ReactElement, useCallback, useEffect, useState } from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport BlurView from '../blur/blur-view';\nimport AnimatedSearchBar, { AnimatedSearchBarProps } from '../searchbar/animated-search-bar';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type FoldableHeaderProps = {\n header: ReactElement;\n scrollOffset: Animated.Value;\n searchBar?: Omit<AnimatedSearchBarProps, 'collapsed'>;\n // if true, the header won't fold / fade out on scroll\n staticHeader?: boolean;\n withNotice?: boolean;\n};\n\nconst FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({\n staticHeader = false,\n scrollOffset,\n searchBar,\n header,\n withNotice,\n}) => {\n const safeAreaInsets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [collapsed, setCollapsed] = useState(header ? false : true);\n const [headerHeight, setHeaderHeight] = useState<number>();\n\n const containerPaddingStyle = {\n paddingTop: withNotice ? 15 : safeAreaInsets.top,\n };\n\n useEffect(() => {\n const id = scrollOffset.addListener(({ value }) => {\n if (!headerHeight) {\n return;\n }\n\n if (value > headerHeight) {\n setCollapsed(true);\n } else {\n setCollapsed(false);\n }\n });\n return () => {\n scrollOffset.removeListener(id);\n };\n }, [scrollOffset, searchBar, headerHeight]);\n\n const playHeaderFoldAnimation = !staticHeader && headerHeight;\n\n const scrollHeaderAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n paddingTop: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight],\n outputRange: [headerHeight, 0]\n })\n }\n : undefined;\n\n const fadeHeaderOutAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n opacity: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight / 2],\n outputRange: [1, 0],\n }),\n }\n : undefined;\n\n const onHeaderLayout = useCallback(\n (event: LayoutChangeEvent) => {\n setHeaderHeight(event.nativeEvent.layout.height);\n },\n [setHeaderHeight],\n );\n\n return (\n <Animated.View\n style={[\n styles.headerContainer,\n containerPaddingStyle,\n withNotice ? styles.noticeBorderRadius : undefined,\n ]}>\n <View style={[styles.blurWrapper, StyleSheet.absoluteFill]}>\n <BlurView blurStyle={'header'} color={colorScheme.background} style={[\n StyleSheet.absoluteFill,\n withNotice ? styles.noticeBorderRadius : undefined,\n ]} />\n </View>\n <View>\n <Animated.View style={scrollHeaderAnimatedStyle}>\n {searchBar && <AnimatedSearchBar {...searchBar} collapsed={collapsed} />}\n </Animated.View>\n {header && (\n <Animated.View onLayout={onHeaderLayout} style={[styles.headerContainer, fadeHeaderOutAnimatedStyle]}>\n {header}\n </Animated.View>\n )}\n </View>\n </Animated.View>\n );\n};\n\nconst styles = StyleSheet.create({\n blurWrapper: {\n overflow: 'hidden',\n },\n headerContainer: {\n position: 'absolute',\n width: '100%',\n },\n noticeBorderRadius: {\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n overflow: 'hidden',\n },\n});\n\nexport default FoldableSearchHeader;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAChG,SAASC,QAAQ,EAAqBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACvF,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,OAAOC,iBAAiB,MAAkC,kCAAkC;AAC5F,SAASC,iBAAiB,QAAQ,+BAA+B;AAWjE,MAAMC,oBAA4D,GAAGA,CAAC;EACpEC,YAAY,GAAG,KAAK;EACpBC,YAAY;EACZC,SAAS;EACTC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,MAAMC,cAAc,GAAGV,iBAAiB,CAAC,CAAC;EAC1C,MAAMW,WAAW,GAAGR,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACS,SAAS,EAAEC,YAAY,CAAC,GAAGjB,QAAQ,CAACY,MA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CAAC;EACDV,eAAe,EAAE;IACfW,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDX,kBAAkB,EAAE;IAClBY,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBJ,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAe9C,oBAAoB","ignoreList":[]}
1
+ {"version":3,"names":["React","useCallback","useEffect","useState","Animated","StyleSheet","View","useSafeAreaInsets","BlurView","AnimatedSearchBar","useAppColorScheme","FoldableSearchHeader","staticHeader","scrollOffset","searchBar","header","withNotice","safeAreaInsets","colorScheme","collapsed","setCollapsed","headerHeight","setHeaderHeight","containerPaddingStyle","paddingTop","top","id","addListener","value","removeListener","playHeaderFoldAnimation","scrollHeaderAnimatedStyle","interpolate","extrapolate","inputRange","outputRange","undefined","fadeHeaderOutAnimatedStyle","opacity","onHeaderLayout","event","nativeEvent","layout","height","createElement","style","styles","headerContainer","noticeBorderRadius","blurWrapper","absoluteFill","blurStyle","color","background","_extends","onLayout","create","overflow","position","width","borderTopLeftRadius","borderTopRightRadius"],"sources":["foldable-header.tsx"],"sourcesContent":["import React, { FunctionComponent, ReactElement, useCallback, useEffect, useState } from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport BlurView from '../blur/blur-view';\nimport AnimatedSearchBar, { AnimatedSearchBarProps } from '../searchbar/animated-search-bar';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type FoldableHeaderProps = {\n header: ReactElement;\n scrollOffset: Animated.Value;\n searchBar?: Omit<AnimatedSearchBarProps, 'collapsed'>;\n // if true, the header won't fold / fade out on scroll\n staticHeader?: boolean;\n withNotice?: boolean;\n};\n\nconst FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({\n staticHeader = false,\n scrollOffset,\n searchBar,\n header,\n withNotice,\n}) => {\n const safeAreaInsets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [collapsed, setCollapsed] = useState(header ? false : true);\n const [headerHeight, setHeaderHeight] = useState<number>();\n\n const containerPaddingStyle = {\n paddingTop: withNotice ? 15 : safeAreaInsets.top,\n };\n\n useEffect(() => {\n const id = scrollOffset.addListener(({ value }) => {\n if (!headerHeight) {\n return;\n }\n\n if (value > headerHeight) {\n setCollapsed(true);\n } else {\n setCollapsed(false);\n }\n });\n return () => {\n scrollOffset.removeListener(id);\n };\n }, [scrollOffset, searchBar, headerHeight]);\n\n const playHeaderFoldAnimation = !staticHeader && headerHeight;\n\n const scrollHeaderAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n paddingTop: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight],\n outputRange: [headerHeight, 0],\n }),\n }\n : undefined;\n\n const fadeHeaderOutAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n opacity: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight / 2],\n outputRange: [1, 0],\n }),\n }\n : undefined;\n\n const onHeaderLayout = useCallback(\n (event: LayoutChangeEvent) => {\n setHeaderHeight(event.nativeEvent.layout.height);\n },\n [setHeaderHeight],\n );\n\n return (\n <Animated.View\n style={[styles.headerContainer, containerPaddingStyle, withNotice ? styles.noticeBorderRadius : undefined]}>\n <View style={[styles.blurWrapper, StyleSheet.absoluteFill]}>\n <BlurView\n blurStyle={'header'}\n color={colorScheme.background}\n style={[StyleSheet.absoluteFill, withNotice ? styles.noticeBorderRadius : undefined]}\n />\n </View>\n <View>\n <Animated.View style={scrollHeaderAnimatedStyle}>\n {searchBar && <AnimatedSearchBar {...searchBar} collapsed={collapsed} />}\n </Animated.View>\n {header && (\n <Animated.View onLayout={onHeaderLayout} style={[styles.headerContainer, fadeHeaderOutAnimatedStyle]}>\n {header}\n </Animated.View>\n )}\n </View>\n </Animated.View>\n );\n};\n\nconst styles = StyleSheet.create({\n blurWrapper: {\n overflow: 'hidden',\n },\n headerContainer: {\n position: 'absolute',\n width: '100%',\n },\n noticeBorderRadius: {\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n overflow: 'hidden',\n },\n});\n\nexport default FoldableSearchHeader;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAqCC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAChG,SAASC,QAAQ,EAAqBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AACvF,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,OAAOC,iBAAiB,MAAkC,kCAAkC;AAC5F,SAASC,iBAAiB,QAAQ,+BAA+B;AAWjE,MAAMC,oBAA4D,GAAGA,CAAC;EACpEC,YAAY,GAAG,KAAK;EACpBC,YAAY;EACZC,SAAS;EACTC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,MAAMC,cAAc,GAAGV,iBAAiB,CAAC,CAAC;EAC1C,MAAMW,WAAW,GAAGR,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACS,SAAS,EAAEC,YAAY,CAAC,GAAGjB,QAAQ,CAACY,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC;EACjE,MAAM,CAACM,YAAY,EAAEC,eAAe,CAAC,GAAGnB,QAAQ,CAAS,CAAC;EAE1D,MAAMoB,qBAAqB,GAAG;IAC5BC,UAAU,EAAER,UAAU,GAAG,EAAE,GAAGC,cAAc,CAACQ;EAC/C,CAAC;EAEDvB,SAAS,CAAC,MAAM;IACd,MAAMwB,EAAE,GAAGb,YAAY,CAACc,WAAW,CAAC,CAAC;MAAEC;IAAM,CAAC,KAAK;MACjD,IAAI,CAACP,YAAY,EAAE;QACjB;MACF;MAEA,IAAIO,KAAK,GAAGP,YAAY,EAAE;QACxBD,YAAY,CAAC,IAAI,CAAC;MACpB,CAAC,MAAM;QACLA,YAAY,CAAC,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aAAA,CAACpC,QAAQ;IACP2C,SAAS,EAAE,QAAS;IACpBC,KAAK,EAAElC,WAAW,CAACmC,UAAW;IAC9BR,KAAK,EAAE,CAACxC,UAAU,CAAC6C,YAAY,EAAElC,UAAU,GAAG8B,MAAM,CAACE,kBAAkB,GAAGZ,SAAS;EAAE,CACtF,CACG,CAAC,eACPpC,KAAA,CAAA4C,aAAA,CAACtC,IAAI,qBACHN,KAAA,CAAA4C,aAAA,CAACxC,QAAQ,CAACE,IAAI;IAACuC,KAAK,EAAEd;EAA0B,GAC7CjB,SAAS,iBAAId,KAAA,CAAA4C,aAAA,CAACnC,iBAAiB,EAAA6C,QAAA,KAAKxC,SAAS;IAAEK,SAAS,EAAEA;EAAU,EAAE,CAC1D,CAAC,EACfJ,MAAM,iBACLf,KAAA,CAAA4C,aAAA,CAACxC,QAAQ,CAACE,IAAI;IAACiD,QAAQ,EAAEhB,cAAe;IAACM,KAAK,EAAE,CAACC,MAAM,CAACC,eAAe,EAAEV,0BAA0B;EAAE,GAClGtB,MACY,CAEb,CACO,CAAC;AAEpB,CAAC;AAED,MAAM+B,MAAM,GAAGzC,UAAU,CAACmD,MAAM,CAAC;EAC/BP,WAAW,EAAE;IACXQ,QAAQ,EAAE;EACZ,CAAC;EACDV,eAAe,EAAE;IACfW,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDX,kBAAkB,EAAE;IAClBY,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBJ,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAEF,eAAe9C,oBAAoB","ignoreList":[]}
@@ -4,7 +4,7 @@ import { concatTestID } from '../../utils/testID';
4
4
  import Typography from '../text/typography';
5
5
  import { useAppColorScheme } from '../theme/color-scheme-context';
6
6
 
7
- // component used on the history section lists (Settings->History, CredentialDetail->History)
7
+ // component used on the history section lists (Settings->History, CredentialDetailBindingDto->History)
8
8
  // https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev
9
9
 
10
10
  const HistorySectionHeaderView = ({
@@ -1 +1 @@
1
- {"version":3,"names":["React","StyleSheet","View","concatTestID","Typography","useAppColorScheme","HistorySectionHeaderView","day","year","testID","colorScheme","createElement","style","styles","header","accessibilityRole","color","text","preset","accent","create","flexDirection","justifyContent","marginVertical","paddingHorizontal","opacity"],"sources":["history-section-header.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { concatTestID } from '../../utils/testID';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\n// component used on the history section lists (Settings->History, CredentialDetail->History)\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev\n\nconst HistorySectionHeaderView: FC<{\n day: string;\n testID?: string;\n year?: string;\n}> = ({ day, year, testID }) => {\n const colorScheme = useAppColorScheme();\n\n return (\n <View style={styles.header}>\n <Typography accessibilityRole=\"header\" color={colorScheme.text} preset=\"m\" testID={concatTestID(testID, 'title')}>\n {day}\n </Typography>\n {year && (\n <Typography color={colorScheme.accent} preset=\"s/line-height-small\" style={styles.year}>\n {year}\n </Typography>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n header: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginVertical: 16,\n paddingHorizontal: 4,\n },\n year: {\n opacity: 0.7,\n },\n});\n\nexport default HistorySectionHeaderView;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;;AAEjE;AACA;;AAEA,MAAMC,wBAIJ,GAAGA,CAAC;EAAEC,GAAG;EAAEC,IAAI;EAAEC;AAAO,CAAC,KAAK;EAC9B,MAAMC,WAAW,GAAGL,iBAAiB,CAAC,CAAC;EAEvC,oBACEL,KAAA,CAAAW,aAAA,CAACT,IAAI;IAACU,KAAK,EAAEC,MAAM,CAACC;EAAO,gBACzBd,KAAA,CAAAW,aAAA,CAACP,UAAU;IAACW,iBAAiB,EAAC,QAAQ;IAACC,KAAK,EAAEN,WAAW,CAACO,IAAK;IAACC,MAAM,EAAC,GAAG;IAACT,MAAM,EAAEN,YAAY,CAACM,MAAM,EAAE,OAAO;EAAE,GAC9GF,GACS,CAAC,EACZC,IAAI,iBACHR,KAAA,CAAAW,aAAA,CAACP,UAAU;IAACY,KAAK,EAAEN,WAAW,CAACS,MAAO;IAACD,MAAM,EAAC,qBAAqB;IAACN,KAAK,EAAEC,MAAM,CAACL;EAAK,GACpFA,IACS,CAEV,CAAC;AAEX,CAAC;AAED,MAAMK,MAAM,GAAGZ,UAAU,CAACmB,MAAM,CAAC;EAC/BN,MAAM,EAAE;IACNO,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,cAAc,EAAE,EAAE;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDhB,IAAI,EAAE;IACJiB,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAenB,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["React","StyleSheet","View","concatTestID","Typography","useAppColorScheme","HistorySectionHeaderView","day","year","testID","colorScheme","createElement","style","styles","header","accessibilityRole","color","text","preset","accent","create","flexDirection","justifyContent","marginVertical","paddingHorizontal","opacity"],"sources":["history-section-header.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { concatTestID } from '../../utils/testID';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\n// component used on the history section lists (Settings->History, CredentialDetailBindingDto->History)\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev\n\nconst HistorySectionHeaderView: FC<{\n day: string;\n testID?: string;\n year?: string;\n}> = ({ day, year, testID }) => {\n const colorScheme = useAppColorScheme();\n\n return (\n <View style={styles.header}>\n <Typography accessibilityRole=\"header\" color={colorScheme.text} preset=\"m\" testID={concatTestID(testID, 'title')}>\n {day}\n </Typography>\n {year && (\n <Typography color={colorScheme.accent} preset=\"s/line-height-small\" style={styles.year}>\n {year}\n </Typography>\n )}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n header: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n marginVertical: 16,\n paddingHorizontal: 4,\n },\n year: {\n opacity: 0.7,\n },\n});\n\nexport default HistorySectionHeaderView;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,YAAY,QAAQ,oBAAoB;AACjD,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;;AAEjE;AACA;;AAEA,MAAMC,wBAIJ,GAAGA,CAAC;EAAEC,GAAG;EAAEC,IAAI;EAAEC;AAAO,CAAC,KAAK;EAC9B,MAAMC,WAAW,GAAGL,iBAAiB,CAAC,CAAC;EAEvC,oBACEL,KAAA,CAAAW,aAAA,CAACT,IAAI;IAACU,KAAK,EAAEC,MAAM,CAACC;EAAO,gBACzBd,KAAA,CAAAW,aAAA,CAACP,UAAU;IAACW,iBAAiB,EAAC,QAAQ;IAACC,KAAK,EAAEN,WAAW,CAACO,IAAK;IAACC,MAAM,EAAC,GAAG;IAACT,MAAM,EAAEN,YAAY,CAACM,MAAM,EAAE,OAAO;EAAE,GAC9GF,GACS,CAAC,EACZC,IAAI,iBACHR,KAAA,CAAAW,aAAA,CAACP,UAAU;IAACY,KAAK,EAAEN,WAAW,CAACS,MAAO;IAACD,MAAM,EAAC,qBAAqB;IAACN,KAAK,EAAEC,MAAM,CAACL;EAAK,GACpFA,IACS,CAEV,CAAC;AAEX,CAAC;AAED,MAAMK,MAAM,GAAGZ,UAAU,CAACmB,MAAM,CAAC;EAC/BN,MAAM,EAAE;IACNO,aAAa,EAAE,KAAK;IACpBC,cAAc,EAAE,eAAe;IAC/BC,cAAc,EAAE,EAAE;IAClBC,iBAAiB,EAAE;EACrB,CAAC;EACDhB,IAAI,EAAE;IACJiB,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAenB,wBAAwB","ignoreList":[]}
@@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native';
4
4
  import { useAppColorScheme } from '../theme/color-scheme-context';
5
5
  import HistoryItemView from './history-item';
6
6
 
7
- // component used on the history section lists (Settings->History, CredentialDetail->History)
7
+ // component used on the history section lists (Settings->History, CredentialDetailBindingDto->History)
8
8
  // https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev
9
9
 
10
10
  const HistorySectionListItem = ({
@@ -1 +1 @@
1
- {"version":3,"names":["React","StyleSheet","View","useAppColorScheme","HistoryItemView","HistorySectionListItem","first","last","props","colorScheme","createElement","style","styles","item","backgroundColor","white","_extends","create","borderTopLeftRadius","borderTopRightRadius","marginTop","paddingTop","paddingHorizontal","borderBottomLeftRadius","borderBottomRightRadius","marginBottom","paddingBottom"],"sources":["history-section-list-item.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport HistoryItemView, { HistoryItemViewProps } from './history-item';\n\n// component used on the history section lists (Settings->History, CredentialDetail->History)\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev\n\nexport interface HistorySectionListItemProps extends HistoryItemViewProps {\n first?: boolean;\n}\n\nconst HistorySectionListItem: FC<HistorySectionListItemProps> = ({ first, last, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.item, first && styles.first, last && styles.last, { backgroundColor: colorScheme.white }]}>\n <HistoryItemView last={last} {...props} />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n first: {\n borderTopLeftRadius: 20,\n borderTopRightRadius: 20,\n marginTop: 8,\n paddingTop: 12,\n },\n item: {\n paddingHorizontal: 12,\n },\n last: {\n borderBottomLeftRadius: 20,\n borderBottomRightRadius: 20,\n marginBottom: 12,\n paddingBottom: 12,\n },\n});\n\nexport default HistorySectionListItem;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,eAAe,MAAgC,gBAAgB;;AAEtE;AACA;;AAMA,MAAMC,sBAAuD,GAAGA,CAAC;EAAEC,KAAK;EAAEC,IAAI;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC7F,MAAMC,WAAW,GAAGN,iBAAiB,CAAC,CAAC;EACvC,oBACEH,KAAA,CAAAU,aAAA,CAACR,IAAI;IAACS,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAEP,KAAK,IAAIM,MAAM,CAACN,KAAK,EAAEC,IAAI,IAAIK,MAAM,CAACL,IAAI,EAAE;MAAEO,eAAe,EAAEL,WAAW,CAACM;IAAM,CAAC;EAAE,gBAC7Gf,KAAA,CAAAU,aAAA,CAACN,eAAe,EAAAY,QAAA;IAACT,IAAI,EAAEA;EAAK,GAAKC,KAAK,CAAG,CACrC,CAAC;AAEX,CAAC;AAED,MAAMI,MAAM,GAAGX,UAAU,CAACgB,MAAM,CAAC;EAC/BX,KAAK,EAAE;IACLY,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBC,SAAS,EAAE,CAAC;IACZC,UAAU,EAAE;EACd,CAAC;EACDR,IAAI,EAAE;IACJS,iBAAiB,EAAE;EACrB,CAAC;EACDf,IAAI,EAAE;IACJgB,sBAAsB,EAAE,EAAE;IAC1BC,uBAAuB,EAAE,EAAE;IAC3BC,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAEF,eAAerB,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["React","StyleSheet","View","useAppColorScheme","HistoryItemView","HistorySectionListItem","first","last","props","colorScheme","createElement","style","styles","item","backgroundColor","white","_extends","create","borderTopLeftRadius","borderTopRightRadius","marginTop","paddingTop","paddingHorizontal","borderBottomLeftRadius","borderBottomRightRadius","marginBottom","paddingBottom"],"sources":["history-section-list-item.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport HistoryItemView, { HistoryItemViewProps } from './history-item';\n\n// component used on the history section lists (Settings->History, CredentialDetailBindingDto->History)\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev\n\nexport interface HistorySectionListItemProps extends HistoryItemViewProps {\n first?: boolean;\n}\n\nconst HistorySectionListItem: FC<HistorySectionListItemProps> = ({ first, last, ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.item, first && styles.first, last && styles.last, { backgroundColor: colorScheme.white }]}>\n <HistoryItemView last={last} {...props} />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n first: {\n borderTopLeftRadius: 20,\n borderTopRightRadius: 20,\n marginTop: 8,\n paddingTop: 12,\n },\n item: {\n paddingHorizontal: 12,\n },\n last: {\n borderBottomLeftRadius: 20,\n borderBottomRightRadius: 20,\n marginBottom: 12,\n paddingBottom: 12,\n },\n});\n\nexport default HistorySectionListItem;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,eAAe,MAAgC,gBAAgB;;AAEtE;AACA;;AAMA,MAAMC,sBAAuD,GAAGA,CAAC;EAAEC,KAAK;EAAEC,IAAI;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC7F,MAAMC,WAAW,GAAGN,iBAAiB,CAAC,CAAC;EACvC,oBACEH,KAAA,CAAAU,aAAA,CAACR,IAAI;IAACS,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAEP,KAAK,IAAIM,MAAM,CAACN,KAAK,EAAEC,IAAI,IAAIK,MAAM,CAACL,IAAI,EAAE;MAAEO,eAAe,EAAEL,WAAW,CAACM;IAAM,CAAC;EAAE,gBAC7Gf,KAAA,CAAAU,aAAA,CAACN,eAAe,EAAAY,QAAA;IAACT,IAAI,EAAEA;EAAK,GAAKC,KAAK,CAAG,CACrC,CAAC;AAEX,CAAC;AAED,MAAMI,MAAM,GAAGX,UAAU,CAACgB,MAAM,CAAC;EAC/BX,KAAK,EAAE;IACLY,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBC,SAAS,EAAE,CAAC;IACZC,UAAU,EAAE;EACd,CAAC;EACDR,IAAI,EAAE;IACJS,iBAAiB,EAAE;EACrB,CAAC;EACDf,IAAI,EAAE;IACJgB,sBAAsB,EAAE,EAAE;IAC1BC,uBAAuB,EAAE,EAAE;IAC3BC,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAEF,eAAerB,sBAAsB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","Svg","Mask","Path","useAppColorScheme","EntityTrustedIcon","props","colorScheme","createElement","_extends","width","height","viewBox","fill","id","maskUnits","x","y","black","white","d","success","fillOpacity","mask","EntityNotTrustedIcon","error","stroke","strokeOpacity","strokeWidth"],"sources":["entity.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport Svg, { Mask, Path, SvgProps } from 'react-native-svg';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=415-5402&mode=design&t=YI1oD2BfBie5HcvJ-0\nexport const EntityTrustedIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={16} height={19} viewBox=\"0 0 16 19\" fill=\"none\" {...props}>\n <Mask id=\"a\" maskUnits=\"userSpaceOnUse\" x={0} y={0.0496979} width={18} height={21} fill={colorScheme.black}>\n <Path fill={colorScheme.white} d=\"M0 0.0496979H18V21.0496979H0z\" />\n <Path d=\"M10.265 2.255a4 4 0 00-2.53 0l-3 1A4 4 0 002 7.05v4.117a7 7 0 007 7 7 7 0 007-7V7.05a4 4 0 00-2.735-3.795l-3-1z\" />\n </Mask>\n <Path\n d=\"M10.265 2.255a4 4 0 00-2.53 0l-3 1A4 4 0 002 7.05v4.117a7 7 0 007 7 7 7 0 007-7V7.05a4 4 0 00-2.735-3.795l-3-1z\"\n fill={colorScheme.success}\n />\n <Path\n d=\"M4.735 3.255l-.632-1.897.632 1.897zm8.53 0l.632-1.897-.632 1.897zm-5.53-1l.633 1.897-.633-1.897zm2.53 0l-.633 1.897.633-1.897zM7.103.358l-3 1 1.265 3.794 3-1L7.103.358zM0 7.05v4.117h4V7.05H0zm0 4.117a9 9 0 009 9v-4a5 5 0 01-5-5H0zm9 9a9 9 0 009-9h-4a5 5 0 01-5 5v4zm9-9V7.05h-4v4.117h4zm-4.103-9.81l-3-1-1.265 3.795 3 1 1.265-3.794zm-9.794 0A6 6 0 000 7.05h4a2 2 0 011.368-1.898L4.103 1.358zM18 7.05a6 6 0 00-4.103-5.692l-1.264 3.794A2 2 0 0114 7.05h4zM8.368 4.152a2 2 0 011.264 0L10.897.358a6 6 0 00-3.794 0l1.265 3.794z\"\n fill={colorScheme.white}\n fillOpacity={0.2}\n mask=\"url(#a)\"\n />\n <Path\n d=\"M7.914 13.383c.156 0 .3-.037.43-.11a1.06 1.06 0 00.344-.32l3.648-5.64c.057-.089.104-.183.14-.282a.761.761 0 00.063-.297.652.652 0 00-.25-.53.839.839 0 00-.555-.204c-.276 0-.507.148-.695.445l-3.148 5.032-1.446-1.813a.98.98 0 00-.312-.273.717.717 0 00-.352-.086.742.742 0 00-.554.234.754.754 0 00-.227.555c0 .104.018.206.055.304.041.094.099.19.172.29l1.882 2.265c.115.146.237.255.368.328.13.068.276.102.437.102z\"\n fill={colorScheme.white}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=415-5402&t=8jP7yF4eYj70Gm9A-0\nexport const EntityNotTrustedIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={22} height={22} viewBox=\"0 0 22 22\" fill=\"none\" {...props}>\n <Path\n d=\"M10.575 20a8.241 8.241 0 01-3.312-.672 8.649 8.649 0 01-2.74-1.851 8.837 8.837 0 01-1.85-2.74A8.242 8.242 0 012 11.425c0-1.173.224-2.277.672-3.312a8.793 8.793 0 014.582-4.59 8.243 8.243 0 013.312-.672c1.18 0 2.286.224 3.32.672a8.766 8.766 0 012.74 1.86 8.667 8.667 0 011.86 2.73 8.243 8.243 0 01.672 3.312 8.243 8.243 0 01-.673 3.312 8.768 8.768 0 01-4.598 4.59 8.241 8.241 0 01-3.312.673z\"\n fill={colorScheme.error}\n />\n <Path\n d=\"M10.566 1.85c1.31 0 2.552.25 3.718.755a9.765 9.765 0 013.047 2.068l.321.335a9.671 9.671 0 011.751 2.708 9.244 9.244 0 01.755 3.71c0 1.304-.25 2.544-.755 3.709a9.766 9.766 0 01-5.123 5.112h0a9.242 9.242 0 01-3.705.753 9.244 9.244 0 01-3.706-.754 9.648 9.648 0 01-3.053-2.062l-.003-.002a9.836 9.836 0 01-2.058-3.047A9.242 9.242 0 011 11.425c0-1.304.25-2.544.755-3.71a9.793 9.793 0 015.1-5.11h.001a9.244 9.244 0 013.71-.754z\"\n stroke={colorScheme.white}\n strokeOpacity={0.2}\n strokeWidth={2}\n />\n <Path\n d=\"M8.433 14.712a.822.822 0 01-.58.225.773.773 0 01-.557-.225.773.773 0 01-.224-.556c0-.216.077-.398.232-.548l2.167-2.174-2.167-2.159a.768.768 0 01-.232-.547c0-.227.074-.413.224-.557a.773.773 0 01.556-.224c.216 0 .401.072.556.216l2.175 2.167 2.183-2.167a.759.759 0 01.556-.232c.216 0 .399.077.548.232.155.15.232.332.232.548 0 .21-.077.396-.232.556l-2.175 2.167 2.167 2.166c.155.144.232.33.232.556a.759.759 0 01-.232.556.755.755 0 01-.556.225.765.765 0 01-.565-.225l-2.158-2.166-2.15 2.166z\"\n fill={colorScheme.white}\n />\n </Svg>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,QAAkB,kBAAkB;AAE5D,SAASC,iBAAiB,QAAQ,+BAA+B;;AAEjE;AACA,OAAO,MAAMC,iBAA+B,GAAGA,CAAC;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC/D,MAAMC,WAAW,GAAGH,iBAAiB,CAAC,CAAC;EACvC,oBACEJ,KAAA,CAAAQ,aAAA,CAACP,GAAG,EAAAQ,QAAA;IAACC,KAAK,EAAE,EAAG;IAACC,MAAM,EAAE,EAAG;IAACC,OAAO,EAAC,WAAW;IAACC,IAAI,EAAC;EAAM,GAAKP,KAAK,gBACnEN,KAAA,CAAAQ,aAAA,CAACN,IAAI;IAACY,EAAE,EAAC,GAAG;IAACC,SAAS,EAAC,gBAAgB;IAACC,CAAC,EAAE,CAAE;IAACC,CAAC,EAAE,SAAU;IAACP,KAAK,EAAE,EAAG;IAACC,MAAM,EAAE,EAAG;IAACE,IAAI,EAAEN,WAAW,CAACW;EAAM,gBACzGlB,KAAA,CAAAQ,aAAA,CAACL,IAAI;IAACU,IAAI,EAAEN,WAAW,CAACY,KAAM;IAACC,CAAC,EAAC;EAA+B,CAAE,CAAC,eACnEpB,KAAA,CAAAQ,aAAA,CAACL,IAAI;IAACiB,CAAC,EAAC;EAAiH,CAAE,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on","props","colorScheme","createElement","_extends","width","height","viewBox","fill","id","maskUnits","x","y","black","white","d","success","fillOpacity","mask","EntityNotTrustedIcon","error","stroke","strokeOpacity","strokeWidth"],"sources":["entity.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport Svg, { Mask, Path, SvgProps } from 'react-native-svg';\n\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=415-5402&mode=design&t=YI1oD2BfBie5HcvJ-0\nexport const EntityTrustedIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={16} height={19} viewBox=\"0 0 16 19\" fill=\"none\" {...props}>\n <Mask id=\"a\" maskUnits=\"userSpaceOnUse\" x={0} y={0.0496979} width={18} height={21} fill={colorScheme.black}>\n <Path fill={colorScheme.white} d=\"M0 0.0496979H18V21.0496979H0z\" />\n <Path d=\"M10.265 2.255a4 4 0 00-2.53 0l-3 1A4 4 0 002 7.05v4.117a7 7 0 007 7 7 7 0 007-7V7.05a4 4 0 00-2.735-3.795l-3-1z\" />\n </Mask>\n <Path\n d=\"M10.265 2.255a4 4 0 00-2.53 0l-3 1A4 4 0 002 7.05v4.117a7 7 0 007 7 7 7 0 007-7V7.05a4 4 0 00-2.735-3.795l-3-1z\"\n fill={colorScheme.success}\n />\n <Path\n d=\"M4.735 3.255l-.632-1.897.632 1.897zm8.53 0l.632-1.897-.632 1.897zm-5.53-1l.633 1.897-.633-1.897zm2.53 0l-.633 1.897.633-1.897zM7.103.358l-3 1 1.265 3.794 3-1L7.103.358zM0 7.05v4.117h4V7.05H0zm0 4.117a9 9 0 009 9v-4a5 5 0 01-5-5H0zm9 9a9 9 0 009-9h-4a5 5 0 01-5 5v4zm9-9V7.05h-4v4.117h4zm-4.103-9.81l-3-1-1.265 3.795 3 1 1.265-3.794zm-9.794 0A6 6 0 000 7.05h4a2 2 0 011.368-1.898L4.103 1.358zM18 7.05a6 6 0 00-4.103-5.692l-1.264 3.794A2 2 0 0114 7.05h4zM8.368 4.152a2 2 0 011.264 0L10.897.358a6 6 0 00-3.794 0l1.265 3.794z\"\n fill={colorScheme.white}\n fillOpacity={0.2}\n mask=\"url(#a)\"\n />\n <Path\n d=\"M7.914 13.383c.156 0 .3-.037.43-.11a1.06 1.06 0 00.344-.32l3.648-5.64c.057-.089.104-.183.14-.282a.761.761 0 00.063-.297.652.652 0 00-.25-.53.839.839 0 00-.555-.204c-.276 0-.507.148-.695.445l-3.148 5.032-1.446-1.813a.98.98 0 00-.312-.273.717.717 0 00-.352-.086.742.742 0 00-.554.234.754.754 0 00-.227.555c0 .104.018.206.055.304.041.094.099.19.172.29l1.882 2.265c.115.146.237.255.368.328.13.068.276.102.437.102z\"\n fill={colorScheme.white}\n />\n </Svg>\n );\n};\n\n// https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=415-5402&t=8jP7yF4eYj70Gm9A-0\nexport const EntityNotTrustedIcon: FC<SvgProps> = ({ ...props }) => {\n const colorScheme = useAppColorScheme();\n return (\n <Svg width={22} height={22} viewBox=\"0 0 22 22\" fill=\"none\" {...props}>\n <Path\n d=\"M10.575 20a8.241 8.241 0 01-3.312-.672 8.649 8.649 0 01-2.74-1.851 8.837 8.837 0 01-1.85-2.74A8.242 8.242 0 012 11.425c0-1.173.224-2.277.672-3.312a8.793 8.793 0 014.582-4.59 8.243 8.243 0 013.312-.672c1.18 0 2.286.224 3.32.672a8.766 8.766 0 012.74 1.86 8.667 8.667 0 011.86 2.73 8.243 8.243 0 01.672 3.312 8.243 8.243 0 01-.673 3.312 8.768 8.768 0 01-4.598 4.59 8.241 8.241 0 01-3.312.673z\"\n fill={colorScheme.error}\n />\n <Path\n d=\"M10.566 1.85c1.31 0 2.552.25 3.718.755a9.765 9.765 0 013.047 2.068l.321.335a9.671 9.671 0 011.751 2.708 9.244 9.244 0 01.755 3.71c0 1.304-.25 2.544-.755 3.709a9.766 9.766 0 01-5.123 5.112h0a9.242 9.242 0 01-3.705.753 9.244 9.244 0 01-3.706-.754 9.648 9.648 0 01-3.053-2.062l-.003-.002a9.836 9.836 0 01-2.058-3.047A9.242 9.242 0 011 11.425c0-1.304.25-2.544.755-3.71a9.793 9.793 0 015.1-5.11h.001a9.244 9.244 0 013.71-.754z\"\n stroke={colorScheme.white}\n strokeOpacity={0.2}\n strokeWidth={2}\n />\n <Path\n d=\"M8.433 14.712a.822.822 0 01-.58.225.773.773 0 01-.557-.225.773.773 0 01-.224-.556c0-.216.077-.398.232-.548l2.167-2.174-2.167-2.159a.768.768 0 01-.232-.547c0-.227.074-.413.224-.557a.773.773 0 01.556-.224c.216 0 .401.072.556.216l2.175 2.167 2.183-2.167a.759.759 0 01.556-.232c.216 0 .399.077.548.232.155.15.232.332.232.548 0 .21-.077.396-.232.556l-2.175 2.167 2.167 2.166c.155.144.232.33.232.556a.759.759 0 01-.232.556.755.755 0 01-.556.225.765.765 0 01-.565-.225l-2.158-2.166-2.15 2.166z\"\n fill={colorScheme.white}\n />\n </Svg>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,MAAc,OAAO;AACjC,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,QAAkB,kBAAkB;AAE5D,SAASC,iBAAiB,QAAQ,+BAA+B;;AAEjE;AACA,OAAO,MAAMC,iBAA+B,GAAGA,CAAC;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC/D,MAAMC,WAAW,GAAGH,iBAAiB,CAAC,CAAC;EACvC,oBACEJ,KAAA,CAAAQ,aAAA,CAACP,GAAG,EAAAQ,QAAA;IAACC,KAAK,EAAE,EAAG;IAACC,MAAM,EAAE,EAAG;IAACC,OAAO,EAAC,WAAW;IAACC,IAAI,EAAC;EAAM,GAAKP,KAAK,gBACnEN,KAAA,CAAAQ,aAAA,CAACN,IAAI;IAACY,EAAE,EAAC,GAAG;IAACC,SAAS,EAAC,gBAAgB;IAACC,CAAC,EAAE,CAA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aM,MAAM,EAAEnB,WAAW,CAACY,KAAM;IAC1BQ,aAAa,EAAE,GAAI;IACnBC,WAAW,EAAE;EAAE,CAChB,CAAC,eACF5B,KAAA,CAAAQ,aAAA,CAACL,IAAI;IACHiB,CAAC,EAAC,weAAwe;IAC1eP,IAAI,EAAEN,WAAW,CAACY;EAAM,CACzB,CACE,CAAC;AAEV,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","SectionList","StyleSheet","View","Animated","useAnimatedScrollHandler","useSharedValue","useSafeAreaInsets","EntityDetailsWithButtons","ContrastingStatusBar","concatTestID","TouchableOpacity","SectionEntityCluster","NavigationHeader","CloseIcon","NerdModeItem","Typography","useAppColorScheme","EntityType","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","createAnimatedComponent","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","colorScheme","scrollOffset","expandedAttributes","setExpandedAttributes","onExpand","expanded","prev","onScroll","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","length","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","onPress","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","_extends","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { IdentifierListItem } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: IdentifierListItem;\n subline?: string;\n entityLabels: EntityLabels;\n role: ContextRole;\n testID?: string;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={\n entityCluster ? (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n ) : null\n }\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n});\n\nexport default NerdModeScreen;\n"],"mappings":";AACA,OAAOA,KAAK,IAAuBC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,WAAW,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC5D,OAAOC,QAAQ,IAAIC,wBAAwB,EAAEC,cAAc,QAAQ,yBAAyB;AAC5F,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,wBAAwB,MAAuB,qDAAqD;AAC3G,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,YAAY,MAA6B,6BAA6B;AAC7E,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AA+CjE,WAAYC,UAAU,0BAAVA,UA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AEA,QAAS;UACnBH,YAAY,EAAEA,YAAa;UAC3BL,MAAM,EAAErB,YAAY,CAACqB,MAAM,EAAEX,IAAI,CAACW,MAAM;QAAE,EAC3C,CAAC;MAEN;IACF,CAAE;IACFmD,mBAAmB,EAAEA,CAAC;MAAEN;IAAQ,CAAC,KAAK;MACpC,OAAOA,OAAO,CAAC5C,KAAK,gBAClBjC,KAAA,CAAAuD,aAAA,CAACnD,IAAI;QAAC4D,KAAK,EAAEU,MAAM,CAACU,sBAAuB;QAACpD,MAAM,EAAErB,YAAY,CAACqB,MAAM,EAAE6C,OAAO,CAAC5C,KAAK;MAAE,gBACtFjC,KAAA,CAAAuD,aAAA,CAACtC,UAAU;QAAC6C,KAAK,EAAE1B,WAAW,CAAC2B,KAAM;QAACC,KAAK,EAAEU,MAAM,CAACW;MAAkB,GACnER,OAAO,CAAC5C,KACC,CACR,CAAC,GACL,IAAI;IACV,CAAE;IACFqD,mBAAmB,EAAE,EAAG;IACxB3D,QAAQ,EAAEA,QAAS;IACnB4D,2BAA2B,EAAE,KAAM;IACnCvB,KAAK,EAAE;MAAEP,eAAe,EAAErB,WAAW,CAACsB,QAAQ,CAACC;IAAW,CAAE;IAC5D3B,MAAM,EAAEA;EAAO,CAChB,CACD,CAAC;AAEP,CAAC;AAED,MAAM0C,MAAM,GAAGvE,UAAU,CAACqF,MAAM,CAAC;EAC/BzD,aAAa,EAAE;IACb0D,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDN,sBAAsB,EAAE;IACtBO,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDL,iBAAiB,EAAE;IACjBQ,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAe/D,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["React","useState","SectionList","StyleSheet","View","Animated","useAnimatedScrollHandler","useSharedValue","useSafeAreaInsets","EntityDetailsWithButtons","ContrastingStatusBar","concatTestID","TouchableOpacity","SectionEntityCluster","NavigationHeader","CloseIcon","NerdModeItem","Typography","useAppColorScheme","EntityType","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","createAnimatedComponent","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","colorScheme","scrollOffset","expandedAttributes","setExpandedAttributes","onExpand","expanded","prev","onScroll","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","length","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","onPress","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","_extends","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { GetIdentifierListItemBindingDto } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: GetIdentifierListItemBindingDto;\n subline?: string;\n entityLabels: EntityLabels;\n role: ContextRole;\n testID?: string;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={\n entityCluster ? (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n ) : null\n }\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n});\n\nexport default NerdModeScreen;\n"],"mappings":";AACA,OAAOA,KAAK,IAAuBC,QAAQ,QAAQ,OAAO;AAC1D,SAASC,WAAW,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC5D,OAAOC,QAAQ,IAAIC,wBAAwB,EAAEC,cAAc,QAAQ,yBAAyB;AAC5F,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,OAAOC,wBAAwB,MAAuB,qDAAqD;AAC3G,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,YAAY,MAA6B,6BAA6B;AAC7E,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AA+CjE,WAAYC,UAAU,0BAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAVA,UAAU,CAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAKtB,SAASC,sBAAsBA,CAACC,IAAyB,EAAgC;EACvF,OAAQA,IAAI,CAA0BC,UAAU,KAAKC,SAAS;AAChE;AAEA,MAAMC,mBAAmB,GAAGnB,QAAQ,CAACoB,uBAAuB,CAACvB,WAAgC,CAAC;AAE9F,MAAMwB,cAAsD,GAAGA,CAAC;EAC9DC,QAAQ;EACRC,MAAM;EACNC,O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AAM,EAAErB,YAAY,CAACqB,MAAM,EAAE6C,OAAO,CAAC5C,KAAK;MAAE,gBACtFjC,KAAA,CAAAuD,aAAA,CAACtC,UAAU;QAAC6C,KAAK,EAAE1B,WAAW,CAAC2B,KAAM;QAACC,KAAK,EAAEU,MAAM,CAACW;MAAkB,GACnER,OAAO,CAAC5C,KACC,CACR,CAAC,GACL,IAAI;IACV,CAAE;IACFqD,mBAAmB,EAAE,EAAG;IACxB3D,QAAQ,EAAEA,QAAS;IACnB4D,2BAA2B,EAAE,KAAM;IACnCvB,KAAK,EAAE;MAAEP,eAAe,EAAErB,WAAW,CAACsB,QAAQ,CAACC;IAAW,CAAE;IAC5D3B,MAAM,EAAEA;EAAO,CAChB,CACD,CAAC;AAEP,CAAC;AAED,MAAM0C,MAAM,GAAGvE,UAAU,CAACqF,MAAM,CAAC;EAC/BzD,aAAa,EAAE;IACb0D,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDN,sBAAsB,EAAE;IACtBO,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDL,iBAAiB,EAAE;IACjBQ,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAe/D,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","Platform","SectionList","StyleSheet","View","useSafeAreaInsets","useOnScrollHeaderState","useListContentInset","NavigationHeader","ListTitleHeader","useAppColorScheme","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","top","contentInsetsStyle","headerHeight","OS","titleVisible","onScroll","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","undefined","isValidElement","HeaderComponent","createElement","_extends","container","backgroundColor","background","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","create","flex","position","width"],"sources":["section-list-screen.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Platform, SectionList, SectionListProps, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { useOnScrollHeaderState } from '../../utils/hooks/header/on-scroll-header-state';\nimport { useListContentInset } from '../../utils/hooks/list/list-content-inset';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport ListTitleHeader from '../list/list-title-header';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type SectionListScreenProps<ItemT, SectionT> = ViewProps & {\n header: Omit<NavigationHeaderProps, 'animate' | 'blurred' | 'style' | 'title' | 'titleVisible'> & {\n static?: boolean;\n title: string;\n };\n list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'> & {\n header?: React.ComponentType<any> | React.ReactElement;\n };\n modalPresentation?: boolean;\n};\n\nconst SectionListScreen = <ItemT, SectionT>({\n header,\n list: { contentContainerStyle, header: listHeader, stickySectionHeadersEnabled, ...listProps },\n modalPresentation,\n style,\n ...viewProps\n}: SectionListScreenProps<ItemT, SectionT>) => {\n const colorScheme = useAppColorScheme();\n const { top } = useSafeAreaInsets();\n const contentInsetsStyle = useListContentInset({\n headerHeight: modalPresentation && Platform.OS === 'ios' ? 63 : 48,\n modalPresentation,\n });\n const { titleVisible, onScroll } = useOnScrollHeaderState();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (!modalPresentation || Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (modalPresentation && !header.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n const headerView: React.ReactElement | undefined = useMemo(() => {\n if (!listHeader) {\n return undefined;\n }\n if (React.isValidElement(listHeader)) {\n return listHeader;\n } else {\n const HeaderComponent = listHeader as React.ComponentType<any>;\n return <HeaderComponent />;\n }\n }, [listHeader]);\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <SectionList<ItemT, SectionT>\n ListHeaderComponent={!header.static ? <View><ListTitleHeader title={header.title} />{headerView}</View> : headerView}\n contentContainerStyle={[contentInsetsStyle, contentContainerStyle]}\n onScroll={onScroll}\n scrollEventThrottle={100}\n stickySectionHeadersEnabled={stickySectionHeadersEnabled ?? false}\n {...listProps}\n />\n <NavigationHeader\n animate\n blurred\n style={[styles.header, headerPaddingStyle]}\n titleVisible={header.static || titleVisible}\n {...header}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n header: {\n position: 'absolute',\n width: '100%',\n },\n modalHeaderWithoutHandle: {\n paddingTop: 15,\n },\n});\n\nexport default SectionListScreen;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,WAAW,EAAoBC,UAAU,EAAEC,IAAI,QAA8B,cAAc;AAC9G,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,OAAOC,gBAAgB,MAAiC,6BAA6B;AACrF,OAAOC,eAAe,MAAM,2BAA2B;AACvD,SAASC,iBAAiB,QAAQ,+BAA+B;AAajE,MAAMC,iBAAiB,GAAGA,CAAkB;EAC1CC,MAAM;EACNC,IAAI,EAAE;IAAEC,qBAAqB;IAAEF,MAAM,EAAEG,UAAU;IAAEC,2BAA2B;IAAE,GAAGC;EAAU,CAAC;EAC9FC,iBAAiB;EACjBC,KAAK;EACL,GAAGC;AACoC,CAAC,KAAK;EAC7C,MAAMC,WAAW,GAAGX,iBAAiB,CAAC,CAAC;EACvC,MAAM;IAAEY;EAAI,CAAC,GAAGjB,iBAAiB,CAAC,CAAC;EACnC,MAAMkB,kBAAkB,GAAGhB,mBAAmB,CAAC;IAC7CiB,YAAY,EAAEN,iBAAiB,IAAIjB,QAAQ,CAACwB,E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CAAC,EAACX,UAAiB,CAAC,GAAGA,UAAW;IACrHnB,qBAAqB,EAAE,CAACS,kBAAkB,EAAET,qBAAqB,CAAE;IACnEa,QAAQ,EAAEA,QAAS;IACnBkB,mBAAmB,EAAE,GAAI;IACzB7B,2BAA2B,EAAEA,2BAA2B,aAA3BA,2BAA2B,cAA3BA,2BAA2B,GAAI;EAAM,GAC9DC,SAAS,CACd,CAAC,eACFlB,KAAA,CAAAsC,aAAA,CAAC7B,gBAAgB,EAAA8B,QAAA;IACfQ,OAAO;IACPC,OAAO;IACP5B,KAAK,EAAE,CAACY,MAAM,CAACnB,MAAM,EAAEgB,kBAAkB,CAAE;IAC3CF,YAAY,EAAEd,MAAM,CAAC+B,MAAM,IAAIjB;EAAa,GACxCd,MAAM,CACX,CACG,CAAC;AAEX,CAAC;AAED,MAAMmB,MAAM,GAAG5B,UAAU,CAAC6C,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE;EACR,CAAC;EACDrC,MAAM,EAAE;IACNsC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDnB,wBAAwB,EAAE;IACxBH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAelB,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","Platform","SectionList","StyleSheet","View","useSafeAreaInsets","useOnScrollHeaderState","useListContentInset","NavigationHeader","ListTitleHeader","useAppColorScheme","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","top","contentInsetsStyle","headerHeight","OS","titleVisible","onScroll","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","undefined","isValidElement","HeaderComponent","createElement","_extends","container","backgroundColor","background","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","create","flex","position","width"],"sources":["section-list-screen.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Platform, SectionList, SectionListProps, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { useOnScrollHeaderState } from '../../utils/hooks/header/on-scroll-header-state';\nimport { useListContentInset } from '../../utils/hooks/list/list-content-inset';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport ListTitleHeader from '../list/list-title-header';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type SectionListScreenProps<ItemT, SectionT> = ViewProps & {\n header: Omit<NavigationHeaderProps, 'animate' | 'blurred' | 'style' | 'title' | 'titleVisible'> & {\n static?: boolean;\n title: string;\n };\n list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'> & {\n header?: React.ComponentType<any> | React.ReactElement;\n };\n modalPresentation?: boolean;\n};\n\nconst SectionListScreen = <ItemT, SectionT>({\n header,\n list: { contentContainerStyle, header: listHeader, stickySectionHeadersEnabled, ...listProps },\n modalPresentation,\n style,\n ...viewProps\n}: SectionListScreenProps<ItemT, SectionT>) => {\n const colorScheme = useAppColorScheme();\n const { top } = useSafeAreaInsets();\n const contentInsetsStyle = useListContentInset({\n headerHeight: modalPresentation && Platform.OS === 'ios' ? 63 : 48,\n modalPresentation,\n });\n const { titleVisible, onScroll } = useOnScrollHeaderState();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (!modalPresentation || Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (modalPresentation && !header.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n const headerView: React.ReactElement | undefined = useMemo(() => {\n if (!listHeader) {\n return undefined;\n }\n if (React.isValidElement(listHeader)) {\n return listHeader;\n } else {\n const HeaderComponent = listHeader as React.ComponentType<any>;\n return <HeaderComponent />;\n }\n }, [listHeader]);\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <SectionList<ItemT, SectionT>\n ListHeaderComponent={\n !header.static ? (\n <View>\n <ListTitleHeader title={header.title} />\n {headerView}\n </View>\n ) : (\n headerView\n )\n }\n contentContainerStyle={[contentInsetsStyle, contentContainerStyle]}\n onScroll={onScroll}\n scrollEventThrottle={100}\n stickySectionHeadersEnabled={stickySectionHeadersEnabled ?? false}\n {...listProps}\n />\n <NavigationHeader\n animate\n blurred\n style={[styles.header, headerPaddingStyle]}\n titleVisible={header.static || titleVisible}\n {...header}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n header: {\n position: 'absolute',\n width: '100%',\n },\n modalHeaderWithoutHandle: {\n paddingTop: 15,\n },\n});\n\nexport default SectionListScreen;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,QAAQ,EAAEC,WAAW,EAAoBC,UAAU,EAAEC,IAAI,QAA8B,cAAc;AAC9G,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,sBAAsB,QAAQ,iDAAiD;AACxF,SAASC,mBAAmB,QAAQ,2CAA2C;AAC/E,OAAOC,gBAAgB,MAAiC,6BAA6B;AACrF,OAAOC,eAAe,MAAM,2BAA2B;AACvD,SAASC,iBAAiB,QAAQ,+BAA+B;AAajE,MAAMC,iBAAiB,GAAGA,CAAkB;EAC1CC,MAAM;EACNC,IAAI,EAAE;IAAEC,qBAAqB;IAAEF,MAAM,EAAEG,UAAU;IAAEC,2BAA2B;IAAE,GAAGC;EAAU,CAAC;EAC9FC,iBAAiB;EACjBC,KAAK;EACL,GAAGC;AACoC,CAAC,KAAK;EAC7C,MAAMC,WAAW,GAAGX,iBAAiB,CAAC,CAAC;EACvC,MAAM;IAAEY;EAAI,CAAC,GAAGjB,iBAAiB,CAAC,CAAC;EACnC,MAAMkB,kBAAkB,GAAGhB,mBAAmB,CAAC;IAC7CiB,YAAY,EAAEN,iBAAiB,IAAIjB,QAAQ,CAACwB,EAAE,KAAK,KAAK,GAAG,EAAE,GAAG,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H;IACDnB,qBAAqB,EAAE,CAACS,kBAAkB,EAAET,qBAAqB,CAAE;IACnEa,QAAQ,EAAEA,QAAS;IACnBkB,mBAAmB,EAAE,GAAI;IACzB7B,2BAA2B,EAAEA,2BAA2B,aAA3BA,2BAA2B,cAA3BA,2BAA2B,GAAI;EAAM,GAC9DC,SAAS,CACd,CAAC,eACFlB,KAAA,CAAAsC,aAAA,CAAC7B,gBAAgB,EAAA8B,QAAA;IACfQ,OAAO;IACPC,OAAO;IACP5B,KAAK,EAAE,CAACY,MAAM,CAACnB,MAAM,EAAEgB,kBAAkB,CAAE;IAC3CF,YAAY,EAAEd,MAAM,CAAC+B,MAAM,IAAIjB;EAAa,GACxCd,MAAM,CACX,CACG,CAAC;AAEX,CAAC;AAED,MAAMmB,MAAM,GAAG5B,UAAU,CAAC6C,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE;EACR,CAAC;EACDrC,MAAM,EAAE;IACNsC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDnB,wBAAwB,EAAE;IACxBH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAelB,iBAAiB","ignoreList":[]}
@@ -1,5 +1,6 @@
1
1
  import React, { useMemo } from 'react';
2
2
  import { StyleSheet, View } from 'react-native';
3
+ import { concatTestID } from '../../utils';
3
4
  import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
4
5
  import { NextIcon } from '../icons/wallet';
5
6
  import { useAppColorScheme } from '../theme/color-scheme-context';
@@ -38,7 +39,8 @@ const ButtonSetting = ({
38
39
  }, /*#__PURE__*/React.createElement(SettingItem, {
39
40
  icon: icon,
40
41
  style: style,
41
- title: title
42
+ title: title,
43
+ testID: concatTestID(testID, 'text')
42
44
  }, accessoryView));
43
45
  };
44
46
  const styles = StyleSheet.create({
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","StyleSheet","View","TouchableOpacity","NextIcon","useAppColorScheme","SettingItem","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","accessoryView","createElement","styles","arrow","color","text","isValidElement","AccessoryComponent","accessibilityRole","container","create","alignItems","height","justifyContent","width"],"sources":["button-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport { NextIcon } from '../icons/wallet';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport SettingItem from './setting-item';\n\nexport type ButtonSettingProps = {\n accessory?: ComponentType<any> | ReactElement;\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onPress: () => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n};\n\nconst ButtonSetting: FunctionComponent<ButtonSettingProps> = ({\n accessory,\n disabled,\n title,\n onPress,\n icon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return (\n <View style={styles.arrow}>\n <NextIcon color={colorScheme.text} />\n </View>\n );\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory, colorScheme.text]);\n\n return (\n <TouchableOpacity\n disabled={disabled}\n accessibilityRole=\"button\"\n onPress={onPress}\n style={styles.container}\n testID={testID}>\n <SettingItem icon={icon} style={style} title={title}>\n {accessoryView}\n </SettingItem>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n arrow: {\n alignItems: 'center',\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n container: {\n width: '100%',\n },\n});\n\nexport default ButtonSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAoDC,OAAO,QAAQ,OAAO;AACtF,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,gBAAgB,QAAQ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BP,KAAK,EAAE;IACLQ,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDL,SAAS,EAAE;IACTK,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAevB,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","TouchableOpacity","NextIcon","useAppColorScheme","SettingItem","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","accessoryView","createElement","styles","arrow","color","text","isValidElement","AccessoryComponent","accessibilityRole","container","create","alignItems","height","justifyContent","width"],"sources":["button-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport { NextIcon } from '../icons/wallet';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport SettingItem from './setting-item';\n\nexport type ButtonSettingProps = {\n accessory?: ComponentType<any> | ReactElement;\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onPress: () => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n};\n\nconst ButtonSetting: FunctionComponent<ButtonSettingProps> = ({\n accessory,\n disabled,\n title,\n onPress,\n icon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return (\n <View style={styles.arrow}>\n <NextIcon color={colorScheme.text} />\n </View>\n );\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory, colorScheme.text]);\n\n return (\n <TouchableOpacity\n disabled={disabled}\n accessibilityRole=\"button\"\n onPress={onPress}\n style={styles.container}\n testID={testID}>\n <SettingItem icon={icon} style={style} title={title} testID={concatTestID(testID, 'text')}>\n {accessoryView}\n </SettingItem>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n arrow: {\n alignItems: 'center',\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n container: {\n width: '100%',\n },\n});\n\nexport default ButtonSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAoDC,OAAO,QAAQ,OAAO;AACtF,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGV,iBAAiB,CAAC,CAAC;EAEvC,MAAMW,aAA6C,GAAGjB,OAAO,CAAC,MAAM;IAClE,IAAI,CAACS,SAAS,EAAE;MACd,oBACEV,KAAA,CAAAmB,aAAA,CAAChB,IAAI;QAACY,KAAK,EAAEK,MAAM,CAACC;MAAM,gBACxBrB,KAAA,CAAAmB,aAAA,CAACb,QAAQ;QAACgB,KAAK,EAAEL,WAAW,CAACM;MAAK,CAAE,CAChC,CAAC;IAEX;IACA,iBAAIvB,KAAK,CAACwB,cAAc,CAACd,SAAS,CAAC,EAAE;MACnC,OAAOA,SAAS;IAClB,CAAC,MAAM;MACL,MAAMe,kBAAkB,GAAGf,SAAqC;MAChE,oBAAOV,KAAA,CAAAmB,aAAA,CAACM,kBAAkB,MAAE,CAAC;IAC/B;EACF,CAAC,EAAE,CAACf,SAAS,EAAEO,WAAW,CAACM,IAAI,CAAC,CAAC;EAEjC,oBACEvB,KAAA,CAAAmB,aAAA,CAACd,gBAAgB;IACfM,QAAQ,EAAEA,QAAS;IACnBe,iBAAiB,EAAC,QAAQ;IAC1Bb,OAAO,EAAEA,OAAQ;IACjBE,KAAK,EAAEK,MAAM,CAACO,SAAU;IACxBX,MAAM,EAAEA;EAAO,gBACfhB,KAAA,CAAAmB,aAAA,CAACX,WAAW;IAACM,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACH,KAAK,EAAEA,KAAM;IAACI,MAAM,EAAEZ,YAAY,CAACY,MAAM,EAAE,MAAM;EAAE,GACvFE,aACU,CACG,CAAC;AAEvB,CAAC;AAED,MAAME,MAAM,GAAGlB,UAAU,CAAC0B,MAAM,CAAC;EAC/BP,KAAK,EAAE;IACLQ,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDL,SAAS,EAAE;IACTK,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAevB,aAAa","ignoreList":[]}
@@ -33,7 +33,8 @@ const SettingItem = ({
33
33
  title,
34
34
  icon,
35
35
  style,
36
- children
36
+ children,
37
+ testID
37
38
  }) => {
38
39
  const colorScheme = useAppColorScheme();
39
40
  const iconView = useMemo(() => {
@@ -61,7 +62,8 @@ const SettingItem = ({
61
62
  accessible: false,
62
63
  color: colorScheme.text,
63
64
  preset: "s",
64
- style: styles.label
65
+ style: styles.label,
66
+ testID: testID
65
67
  }, title), children));
66
68
  };
67
69
  export default SettingItem;
@@ -1 +1 @@
1
- {"version":3,"names":["React","useMemo","StyleSheet","View","Typography","useAppColorScheme","styles","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","colorScheme","iconView","undefined","isValidElement","IconComponent","createElement","backgroundColor","white","background","accessible","color","text","preset"],"sources":["setting-item.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n justifyContent: 'center',\n width: '100%',\n },\n icon: {\n alignItems: 'center',\n borderRadius: 18,\n height: 36,\n justifyContent: 'center',\n marginRight: 12,\n width: 36,\n },\n label: {\n flex: 1,\n marginBottom: 0,\n marginTop: 0,\n },\n wrapper: {\n justifyContent: 'center',\n marginHorizontal: 16,\n paddingHorizontal: 12,\n },\n});\n\nexport type SettingItemProps = {\n icon?: ComponentType<any> | ReactElement;\n style?: StyleProp<ViewStyle>;\n title: string;\n};\n\nconst SettingItem: FunctionComponent<PropsWithChildren<SettingItemProps>> = ({ title, icon, style, children }) => {\n const colorScheme = useAppColorScheme();\n const iconView: React.ReactElement | undefined = useMemo(() => {\n if (!icon) {\n return undefined;\n }\n if (React.isValidElement(icon)) {\n return icon;\n } else {\n const IconComponent = icon as React.ComponentType<any>;\n return <IconComponent />;\n }\n }, [icon]);\n\n return (\n <View style={[styles.wrapper, { backgroundColor: colorScheme.white }, style]}>\n <View style={styles.container}>\n {iconView && <View style={[styles.icon, { backgroundColor: colorScheme.background }]}>{iconView}</View>}\n <Typography accessible={false} color={colorScheme.text} preset=\"s\" style={styles.label}>\n {title}\n </Typography>\n {children}\n </View>\n </View>\n );\n};\n\nexport default SettingItem;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAuEC,OAAO,QAAQ,OAAO;AACzG,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EA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BAAI7B,KAAA,CAAAiC,aAAA,CAAC9B,IAAI;IAACuB,KAAK,EAAE,CAACpB,MAAM,CAACQ,IAAI,EAAE;MAAEoB,eAAe,EAAEN,WAAW,CAACQ;IAAW,CAAC;EAAE,GAAEP,QAAe,CAAC,eACvG7B,KAAA,CAAAiC,aAAA,CAAC7B,UAAU;IAACiC,UAAU,EAAE,KAAM;IAACC,KAAK,EAAEV,WAAW,CAACW,IAAK;IAACC,MAAM,EAAC,GAAG;IAACd,KAAK,EAAEpB,MAAM,CAACW;EAAM,GACpFQ,KACS,CAAC,EACZE,QACG,CACF,CAAC;AAEX,CAAC;AAED,eAAeH,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["React","useMemo","StyleSheet","View","Typography","useAppColorScheme","styles","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","testID","colorScheme","iconView","undefined","isValidElement","IconComponent","createElement","backgroundColor","white","background","accessible","color","text","preset"],"sources":["setting-item.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n justifyContent: 'center',\n width: '100%',\n },\n icon: {\n alignItems: 'center',\n borderRadius: 18,\n height: 36,\n justifyContent: 'center',\n marginRight: 12,\n width: 36,\n },\n label: {\n flex: 1,\n marginBottom: 0,\n marginTop: 0,\n },\n wrapper: {\n justifyContent: 'center',\n marginHorizontal: 16,\n paddingHorizontal: 12,\n },\n});\n\nexport type SettingItemProps = {\n icon?: ComponentType<any> | ReactElement;\n style?: StyleProp<ViewStyle>;\n title: string;\n testID?: string;\n};\n\nconst SettingItem: FunctionComponent<PropsWithChildren<SettingItemProps>> = ({\n title,\n icon,\n style,\n children,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const iconView: React.ReactElement | undefined = useMemo(() => {\n if (!icon) {\n return undefined;\n }\n if (React.isValidElement(icon)) {\n return icon;\n } else {\n const IconComponent = icon as React.ComponentType<any>;\n return <IconComponent />;\n }\n }, [icon]);\n\n return (\n <View style={[styles.wrapper, { backgroundColor: colorScheme.white }, style]}>\n <View style={styles.container}>\n {iconView && <View style={[styles.icon, { backgroundColor: colorScheme.background }]}>{iconView}</View>}\n <Typography accessible={false} color={colorScheme.text} preset=\"s\" style={styles.label} testID={testID}>\n {title}\n </Typography>\n {children}\n </View>\n </View>\n );\n};\n\nexport default SettingItem;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAuEC,OAAO,QAAQ,OAAO;AACzG,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,IAAI,EAAE;IACJL,UAAU,EAAE,QAAQ;IACpBM,YAAY,EAAE,EAAE;IAChBJ,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBI,WAAW,EAAE,EAAE;IACfH,KAAK,EAAE;EACT,CAAC;EACDI,KAAK,EAAE;IACLC,IAAI,EAAE,CAAC;IACPC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb,CAAC;EACDC,OAAO,EAAE;IACPT,cAAc,EAAE,QAAQ;IACxBU,gBAAgB,EAAE,EAAE;IACpBC,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AASF,MAAMC,WAAmE,GAAGA,C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../../utils';
2
3
  import { Switch } from '../control/switch';
3
4
  import SettingItem from './setting-item';
4
5
  const SwitchSetting = ({
@@ -13,12 +14,13 @@ const SwitchSetting = ({
13
14
  return /*#__PURE__*/React.createElement(SettingItem, {
14
15
  icon: icon,
15
16
  style: style,
16
- title: title
17
+ title: title,
18
+ testID: concatTestID(testID, 'text')
17
19
  }, /*#__PURE__*/React.createElement(Switch, {
18
20
  accessibilityLabel: title,
19
21
  disabled: disabled,
20
22
  onChange: onChange,
21
- testID: testID,
23
+ testID: concatTestID(testID, 'switch'),
22
24
  value: value
23
25
  }));
24
26
  };
@@ -1 +1 @@
1
- {"version":3,"names":["React","Switch","SettingItem","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","accessibilityLabel"],"sources":["switch-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Switch } from '../control/switch';\nimport SettingItem from './setting-item';\n\nexport type SwitchSettingProps = {\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onChange: (newValue: boolean) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n value: boolean;\n};\n\nconst SwitchSetting: FunctionComponent<SwitchSettingProps> = ({\n title,\n value,\n onChange,\n icon,\n style,\n disabled = false,\n testID,\n}) => {\n return (\n <SettingItem icon={icon} style={style} title={title}>\n <Switch accessibilityLabel={title} disabled={disabled} onChange={onChange} testID={testID} value={value} />\n </SettingItem>\n );\n};\n\nexport default SwitchSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0D,OAAO;AAG7E,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC;AACF,CAAC,KAAK;EACJ,oBACEV,KAAA,CAAAW,aAAA,CAACT,WAAW;IAACK,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACJ,KAAK,EAAEA;EAAM,gBAClDJ,KAAA,CAAAW,aAAA,CAACV,MAAM;IAACW,kBAAkB,EAAER,KAAM;IAACK,QAAQ,EAAEA,QAAS;IAACH,QAAQ,EAAEA,QAAS;IAACI,MAAM,EAAEA,MAAO;IAACL,KAAK,EAAEA;EAAM,CAAE,CAC/F,CAAC;AAElB,CAAC;AAED,eAAeF,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["React","concatTestID","Switch","SettingItem","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","accessibilityLabel"],"sources":["switch-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { Switch } from '../control/switch';\nimport SettingItem from './setting-item';\n\nexport type SwitchSettingProps = {\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onChange: (newValue: boolean) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n value: boolean;\n};\n\nconst SwitchSetting: FunctionComponent<SwitchSettingProps> = ({\n title,\n value,\n onChange,\n icon,\n style,\n disabled = false,\n testID,\n}) => {\n return (\n <SettingItem icon={icon} style={style} title={title} testID={concatTestID(testID, 'text')}>\n <Switch\n accessibilityLabel={title}\n disabled={disabled}\n onChange={onChange}\n testID={concatTestID(testID, 'switch')}\n value={value}\n />\n </SettingItem>\n );\n};\n\nexport default SwitchSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0D,OAAO;AAG7E,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC;AACF,CAAC,KAAK;EACJ,oBACEX,KAAA,CAAAY,aAAA,CAACT,WAAW;IAACK,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACJ,KAAK,EAAEA,KAAM;IAACM,MAAM,EAAEV,YAAY,CAACU,MAAM,EAAE,MAAM;EAAE,gBACxFX,KAAA,CAAAY,aAAA,CAACV,MAAM;IACLW,kBAAkB,EAAER,KAAM;IAC1BK,QAAQ,EAAEA,QAAS;IACnBH,QAAQ,EAAEA,QAAS;IACnBI,MAAM,EAAEV,YAAY,CAACU,MAAM,EAAE,QAAQ,CAAE;IACvCL,KAAK,EAAEA;EAAM,CACd,CACU,CAAC;AAElB,CAAC;AAED,eAAeF,aAAa","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["I18nManager","Platform","Settings","format","MINUTE","DAY","systemLocale","_I18nManager$getConst","getConstants","localeIdentifier","replace","split","formatDate","date","locale","options","toLocaleDateString","undefined","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","formatTimestamp","nowLabel","_formatDateTime2","now","Date","timestamp","getTime","_formatDateTime","pad","x","String","convertDateToUTCTimestamp","parse","getMonth","getDate","convertDateStrToLocalDate","select","android","timezoneOffset","getTimezoneOffset","default","formatDateOnlyFromUTCTimestamp","utcTimestamp","_formatDate","utcDate","getUTCFullYear","getUTCMonth","getUTCDate","_ref","OS","get","formatDateTimeLocalized","formatDateLocalized"],"sources":["date.ts"],"sourcesContent":["// Date & Time formatted as specified in SW-610\n\nimport { I18nManager, Platform, Settings } from 'react-native';\nimport { format } from 'timeago.js';\n\nconst MINUTE = 60 * 1000;\nconst DAY = 24 * 60 * MINUTE;\n\n// OS locale\nconst systemLocale: string | undefined = I18nManager.getConstants().localeIdentifier\n ?.replace(/_/g, '-')\n .split(/[#@]/)[0]\n .replace(/-$/, '');\n\n/**\n * Date only format\n */\nexport const formatDate = (date: Date, locale?: string, options?: Intl.DateTimeFormatOptions) => {\n try {\n return date.toLocaleDateString(locale || systemLocale, options);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Time only format\n */\nexport const formatTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleTimeString(locale || systemLocale, { hour: '2-digit', minute: '2-digit' });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Date and time format\n */\nexport const formatDateTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleString(locale || systemLocale, {\n hour: '2-digit',\n minute: '2-digit',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour12: locale === 'en-US',\n });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Month format\n */\nexport const formatMonth = (date: Date, locale: string): string => {\n return `${date.toLocaleString(locale, {\n month: 'long',\n })} ${date.getFullYear()}`;\n};\n\n/**\n * Time-ago format\n */\nexport const formatTimeAgo = (date: Date, locale: string): string => {\n return format(date, locale);\n};\n\n/**\n * Timestamp formatted for general use\n */\nexport const formatTimestamp = (date: Date, locale: string, nowLabel: string): string => {\n const now = Date.now();\n const timestamp = date.getTime();\n if (now < timestamp) {\n // in the future\n return formatDateTime(date, locale) ?? '';\n }\n\n // in the past\n if (now - timestamp < MINUTE) {\n // less than a minute ago\n return nowLabel;\n }\n\n // less than a day ago\n if (now - timestamp < DAY) {\n return formatTimeAgo(date, locale);\n }\n\n // longer ago\n return formatDateTime(date, locale) ?? '';\n};\n\nconst pad = (x: number) => (x >= 0 && x < 10 ? `0${x}` : String(x));\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {Date} date local timezone representation\n * @returns {number} the same day, but UTC timezone with midnight time\n */\nexport const convertDateToUTCTimestamp = (date: Date): number =>\n Date.parse(`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`);\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {string} date in YYYY-MM-DD representation\n * @returns {Date} the same day, but local timezone with midnight time\n */\nexport const convertDateStrToLocalDate = (date: string): Date =>\n Platform.select({\n // android conversion using the standard date parsing doesn't work, computing the timestamp manually\n android: (() => {\n const timestamp = Date.parse(date);\n const timezoneOffset = new Date(date).getTimezoneOffset();\n return new Date(timestamp + timezoneOffset * MINUTE);\n })(),\n default: new Date(`${date}T00:00:00`),\n });\n\n/**\n * Inverted function to {@link convertDateToUTCTimestamp}\n * @param {number} utcTimestamp date timestamp represented as midnight UTC time\n * @returns {string} formatted date (based on locale settings, e.g. `21/02/2021`)\n */\nexport const formatDateOnlyFromUTCTimestamp = (utcTimestamp: number): string => {\n const utcDate = new Date(utcTimestamp);\n return (\n formatDate(\n convertDateStrToLocalDate(\n `${utcDate.getUTCFullYear()}-${pad(utcDate.getUTCMonth() + 1)}-${pad(utcDate.getUTCDate())}`,\n ),\n ) ?? ''\n );\n};\n\nconst locale = (\n Platform.OS === 'ios'\n ? Settings.get('AppleLocale')\n : I18nManager.getConstants().localeIdentifier\n)\n ?.split('@')[0]\n .replace('_', '-');\n\nexport const formatDateTimeLocalized = (date: Date) => {\n return formatDateTime(date, locale);\n};\n\nexport const formatDateLocalized = (date: Date) => {\n return formatDate(date, locale);\n};\n"],"mappings":";AAAA;;AAEA,SAASA,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAC9D,SAASC,MAAM,QAAQ,YAAY;AAEnC,MAAMC,MAAM,GAAG,EAAE,GAAG,IAAI;AACxB,MAAMC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAGD,MAAM;;AAE5B;AACA,MAAME,YAAgC,IAAAC,qBAAA,GAAGP,WAAW,CAACQ,YAAY,CAAC,CAAC,CAACC,gBAAgB,cAAAF,qBAAA,uBAA3CA,qBAAA,CACrCG,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CACnBC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAChBD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;;AAEpB;AACA;AACA;AACA,OAAO,MAAME,UAAU,GAAGA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AAM,CAAC;AACrC,CAAC;AAED,OAAO,MAAMiD,mBAAmB,GAAIlD,IAAU,IAAK;EACjD,OAAOD,UAAU,CAACC,IAAI,EAAEC,MAAM,CAAC;AACjC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["I18nManager","Platform","Settings","format","MINUTE","DAY","systemLocale","_I18nManager$getConst","getConstants","localeIdentifier","replace","split","formatDate","date","locale","options","toLocaleDateString","undefined","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","formatTimestamp","nowLabel","_formatDateTime2","now","Date","timestamp","getTime","_formatDateTime","pad","x","String","convertDateToUTCTimestamp","parse","getMonth","getDate","convertDateStrToLocalDate","select","android","timezoneOffset","getTimezoneOffset","default","formatDateOnlyFromUTCTimestamp","utcTimestamp","_formatDate","utcDate","getUTCFullYear","getUTCMonth","getUTCDate","_ref","OS","get","formatDateTimeLocalized","formatDateLocalized"],"sources":["date.ts"],"sourcesContent":["// Date & Time formatted as specified in SW-610\n\nimport { I18nManager, Platform, Settings } from 'react-native';\nimport { format } from 'timeago.js';\n\nconst MINUTE = 60 * 1000;\nconst DAY = 24 * 60 * MINUTE;\n\n// OS locale\nconst systemLocale: string | undefined = I18nManager.getConstants()\n .localeIdentifier?.replace(/_/g, '-')\n .split(/[#@]/)[0]\n .replace(/-$/, '');\n\n/**\n * Date only format\n */\nexport const formatDate = (date: Date, locale?: string, options?: Intl.DateTimeFormatOptions) => {\n try {\n return date.toLocaleDateString(locale || systemLocale, options);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Time only format\n */\nexport const formatTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleTimeString(locale || systemLocale, { hour: '2-digit', minute: '2-digit' });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Date and time format\n */\nexport const formatDateTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleString(locale || systemLocale, {\n hour: '2-digit',\n minute: '2-digit',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour12: locale === 'en-US',\n });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Month format\n */\nexport const formatMonth = (date: Date, locale: string): string => {\n return `${date.toLocaleString(locale, {\n month: 'long',\n })} ${date.getFullYear()}`;\n};\n\n/**\n * Time-ago format\n */\nexport const formatTimeAgo = (date: Date, locale: string): string => {\n return format(date, locale);\n};\n\n/**\n * Timestamp formatted for general use\n */\nexport const formatTimestamp = (date: Date, locale: string, nowLabel: string): string => {\n const now = Date.now();\n const timestamp = date.getTime();\n if (now < timestamp) {\n // in the future\n return formatDateTime(date, locale) ?? '';\n }\n\n // in the past\n if (now - timestamp < MINUTE) {\n // less than a minute ago\n return nowLabel;\n }\n\n // less than a day ago\n if (now - timestamp < DAY) {\n return formatTimeAgo(date, locale);\n }\n\n // longer ago\n return formatDateTime(date, locale) ?? '';\n};\n\nconst pad = (x: number) => (x >= 0 && x < 10 ? `0${x}` : String(x));\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {Date} date local timezone representation\n * @returns {number} the same day, but UTC timezone with midnight time\n */\nexport const convertDateToUTCTimestamp = (date: Date): number =>\n Date.parse(`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`);\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {string} date in YYYY-MM-DD representation\n * @returns {Date} the same day, but local timezone with midnight time\n */\nexport const convertDateStrToLocalDate = (date: string): Date =>\n Platform.select({\n // android conversion using the standard date parsing doesn't work, computing the timestamp manually\n android: (() => {\n const timestamp = Date.parse(date);\n const timezoneOffset = new Date(date).getTimezoneOffset();\n return new Date(timestamp + timezoneOffset * MINUTE);\n })(),\n default: new Date(`${date}T00:00:00`),\n });\n\n/**\n * Inverted function to {@link convertDateToUTCTimestamp}\n * @param {number} utcTimestamp date timestamp represented as midnight UTC time\n * @returns {string} formatted date (based on locale settings, e.g. `21/02/2021`)\n */\nexport const formatDateOnlyFromUTCTimestamp = (utcTimestamp: number): string => {\n const utcDate = new Date(utcTimestamp);\n return (\n formatDate(\n convertDateStrToLocalDate(\n `${utcDate.getUTCFullYear()}-${pad(utcDate.getUTCMonth() + 1)}-${pad(utcDate.getUTCDate())}`,\n ),\n ) ?? ''\n );\n};\n\nconst locale = (\n Platform.OS === 'ios'\n ? Settings.get('AppleLocale')\n : I18nManager.getConstants().localeIdentifier\n)\n ?.split('@')[0]\n .replace('_', '-');\n\nexport const formatDateTimeLocalized = (date: Date) => {\n return formatDateTime(date, locale);\n};\n\nexport const formatDateLocalized = (date: Date) => {\n return formatDate(date, locale);\n};\n"],"mappings":";AAAA;;AAEA,SAASA,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAC9D,SAASC,MAAM,QAAQ,YAAY;AAEnC,MAAMC,MAAM,GAAG,EAAE,GAAG,IAAI;AACxB,MAAMC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAGD,MAAM;;AAE5B;AACA,MAAME,YAAgC,IAAAC,qBAAA,GAAGP,WAAW,CAACQ,YAAY,CAAC,CAAC,CAChEC,gBAAgB,cAAAF,qBAAA,uBADsBA,qBAAA,CACpBG,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CACpCC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAChBD,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;;AAEpB;AACA;AACA;AACA,OAAO,MAAME,UAAU,GAAGA,CAACC,IAAU,EAAEC,MAAe,EAAEC,OAAoC,KAAK;EAC/F,IAAI;IACF,OAAOF,IAAI,CAACG,kBAAkB,CAACF,MAAM,IAAIR,YAAY,EAAES,OAAO,CAAC;EACjE,CAAC,CAAC,MAAM;IACN,OAAOE,SAAS;EAClB;AACF,CAAC;;AAED;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAGA,CAACL,IAAU,EAAEC,MAAe,KAAK;EACzD,IAAI;IACF,OAAOD,IAAI,CAACM,kBAAkB,CAACL,MAAM,IAAIR,YAAY,EAAE;MAAEc,IA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GAAGtB,IAAI,WAAW;AACtC,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMuC,8BAA8B,GAAIC,YAAoB,IAAa;EAAA,IAAAC,WAAA;EAC9E,MAAMC,OAAO,GAAG,IAAIpB,IAAI,CAACkB,YAAY,CAAC;EACtC,QAAAC,WAAA,GACE1C,UAAU,CACRkC,yBAAyB,CACvB,GAAGS,OAAO,CAACC,cAAc,CAAC,CAAC,IAAIjB,GAAG,CAACgB,OAAO,CAACE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAIlB,GAAG,CAACgB,OAAO,CAACG,UAAU,CAAC,CAAC,CAAC,EAC5F,CACF,CAAC,cAAAJ,WAAA,cAAAA,WAAA,GAAI,EAAE;AAEX,CAAC;AAED,MAAMxC,MAAM,IAAA6C,IAAA,GACV1D,QAAQ,CAAC2D,EAAE,KAAK,KAAK,GACjB1D,QAAQ,CAAC2D,GAAG,CAAC,aAAa,CAAC,GAC3B7D,WAAW,CAACQ,YAAY,CAAC,CAAC,CAACC,gBAAgB,cAAAkD,IAAA,uBAHlCA,IAAA,CAKXhD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CACdD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AAEpB,OAAO,MAAMoD,uBAAuB,GAAIjD,IAAU,IAAK;EACrD,OAAOS,cAAc,CAACT,IAAI,EAAEC,MAAM,CAAC;AACrC,CAAC;AAED,OAAO,MAAMiD,mBAAmB,GAAIlD,IAAU,IAAK;EACjD,OAAOD,UAAU,CAACC,IAAI,EAAEC,MAAM,CAAC;AACjC,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["moment","groupEntriesByDay","entries","groupedEntries","reduce","result","entry","entryDate","createdDate","matchingEntry","find","date","isSame","data","push","firstYearEntry","sort","a","b","valueOf","map","item","index","list"],"sources":["history.ts"],"sourcesContent":["import { HistoryListItem } from '@procivis/react-native-one-core';\nimport moment, { Moment } from 'moment';\n\nexport interface HistoryGroupByDaySection {\n data: HistoryListItem[];\n date: Moment;\n firstYearEntry: boolean;\n}\n\nexport const groupEntriesByDay = (entries: HistoryListItem[]) => {\n const groupedEntries = entries.reduce((result: HistoryGroupByDaySection[], entry: HistoryListItem) => {\n const entryDate = moment(entry.createdDate);\n\n const matchingEntry = result.find(({ date }) => date.isSame(entryDate, 'day'));\n if (matchingEntry) {\n matchingEntry.data.push(entry);\n } else {\n result.push({ data: [entry], date: entryDate, firstYearEntry: false });\n }\n\n return result;\n }, []);\n\n return groupedEntries\n .sort(({ date: a }, { date: b }) => b.valueOf() - a.valueOf())\n .map((item, index, list) => {\n item.firstYearEntry = !index || !list[index - 1].date.isSame(item.date, 'year');\n return item;\n });\n};\n"],"mappings":"AACA,OAAOA,MAAM,MAAkB,QAAQ;AAQvC,OAAO,MAAMC,iBAAiB,GAAIC,OAA0B,IAAK;EAC/D,MAAMC,cAAc,GAAGD,OAAO,CAACE,MAAM,CAAC,CAACC,MAAkC,EAAEC,KAAsB,KAAK;IACpG,MAAMC,SAAS,GAAGP,MAAM,CAACM,KAAK,CAACE,WAAW,CAAC;IAE3C,MAAMC,aAAa,GAAGJ,MAAM,CAACK,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAACC,MAAM,CAACL,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9E,IAAIE,aAAa,EAAE;MACjBA,aAAa,CAACI,IAAI,CAACC,IAAI,CAACR,KAAK,CAAC;IAChC,CAAC,MAAM;MACLD,MAAM,CAACS,IAAI,CAAC;QAAED,IAAI,EAAE,CAACP,KAAK,CAAC;QAAEK,IAAI,EAAEJ,SAAS;QAAEQ,cAAc,EAAE;MAAM,CAAC,CAAC;IACxE;IAEA,OAAOV,MAAM;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,cAAc,CAClBa,IAAI,CAAC,CAAC;IAAEL,IAAI,EAAEM;EAAE,CAAC,EAAE;IAAEN,IAAI,EAAEO;EAAE,CAAC,KAAKA,CAAC,CAACC,OAAO,CAAC,CAAC,GAAGF,CAAC,CAACE,OAAO,CAAC,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,EAAEC,IAAI,KAAK;IAC1BF,IAAI,CAACN,cAAc,GAAG,CAACO,KAAK,IAAI,CAACC,IAAI,CAACD,KAAK,GAAG,CAAC,CAAC,CAACX,IAAI,CAACC,MAAM,CAACS,IAAI,CAACV,IAAI,EAAE,MAAM,CAAC;IAC/E,OAAOU,IAAI;EACb,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["moment","groupEntriesByDay","entries","groupedEntries","reduce","result","entry","entryDate","createdDate","matchingEntry","find","date","isSame","data","push","firstYearEntry","sort","a","b","valueOf","map","item","index","list"],"sources":["history.ts"],"sourcesContent":["import { HistoryListItemBindingDto } from '@procivis/react-native-one-core';\nimport moment, { Moment } from 'moment';\n\nexport interface HistoryGroupByDaySection {\n data: HistoryListItemBindingDto[];\n date: Moment;\n firstYearEntry: boolean;\n}\n\nexport const groupEntriesByDay = (entries: HistoryListItemBindingDto[]) => {\n const groupedEntries = entries.reduce((result: HistoryGroupByDaySection[], entry: HistoryListItemBindingDto) => {\n const entryDate = moment(entry.createdDate);\n\n const matchingEntry = result.find(({ date }) => date.isSame(entryDate, 'day'));\n if (matchingEntry) {\n matchingEntry.data.push(entry);\n } else {\n result.push({ data: [entry], date: entryDate, firstYearEntry: false });\n }\n\n return result;\n }, []);\n\n return groupedEntries\n .sort(({ date: a }, { date: b }) => b.valueOf() - a.valueOf())\n .map((item, index, list) => {\n item.firstYearEntry = !index || !list[index - 1].date.isSame(item.date, 'year');\n return item;\n });\n};\n"],"mappings":"AACA,OAAOA,MAAM,MAAkB,QAAQ;AAQvC,OAAO,MAAMC,iBAAiB,GAAIC,OAAoC,IAAK;EACzE,MAAMC,cAAc,GAAGD,OAAO,CAACE,MAAM,CAAC,CAACC,MAAkC,EAAEC,KAAgC,KAAK;IAC9G,MAAMC,SAAS,GAAGP,MAAM,CAACM,KAAK,CAACE,WAAW,CAAC;IAE3C,MAAMC,aAAa,GAAGJ,MAAM,CAACK,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAACC,MAAM,CAACL,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9E,IAAIE,aAAa,EAAE;MACjBA,aAAa,CAACI,IAAI,CAACC,IAAI,CAACR,KAAK,CAAC;IAChC,CAAC,MAAM;MACLD,MAAM,CAACS,IAAI,CAAC;QAAED,IAAI,EAAE,CAACP,KAAK,CAAC;QAAEK,IAAI,EAAEJ,SAAS;QAAEQ,cAAc,EAAE;MAAM,CAAC,CAAC;IACxE;IAEA,OAAOV,MAAM;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,cAAc,CAClBa,IAAI,CAAC,CAAC;IAAEL,IAAI,EAAEM;EAAE,CAAC,EAAE;IAAEN,IAAI,EAAEO;EAAE,CAAC,KAAKA,CAAC,CAACC,OAAO,CAAC,CAAC,GAAGF,CAAC,CAACE,OAAO,CAAC,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,EAAEC,IAAI,KAAK;IAC1BF,IAAI,CAACN,cAAc,GAAG,CAACO,KAAK,IAAI,CAACC,IAAI,CAACD,KAAK,GAAG,CAAC,CAAC,CAACX,IAAI,CAACC,MAAM,CAACS,IAAI,CAACV,IAAI,EAAE,MAAM,CAAC;IAC/E,OAAOU,IAAI;EACb,CAAC,CAAC;AACN,CAAC","ignoreList":[]}