@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.
- package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -2
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +3 -3
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/history/history-details-screen.js +10 -10
- package/lib/commonjs/components/history/history-details-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +12 -8
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js.map +1 -1
- package/lib/commonjs/components/history/history-list.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +2 -2
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +2 -2
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale/fi.json +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/ui-components/settings/button-setting.js +3 -1
- package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item.js +4 -2
- package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
- package/lib/commonjs/ui-components/settings/switch-setting.js +4 -2
- package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +3 -3
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +10 -10
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-context.js +5 -5
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +3 -3
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/history.js +1 -1
- package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +3 -3
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +9 -9
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +5 -5
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +11 -10
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +11 -8
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +2 -2
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +29 -16
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/url.js.map +1 -1
- package/lib/module/components/backup/preview-credentials.js.map +1 -1
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/entity/EntityButtons.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +3 -3
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +4 -4
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/history/history-details-screen.js +11 -11
- package/lib/module/components/history/history-details-screen.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +13 -9
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/history/history-list-section-header.js +1 -1
- package/lib/module/components/history/history-list-section-header.js.map +1 -1
- package/lib/module/components/history/history-list.js.map +1 -1
- package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -1
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -2
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +2 -2
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js +2 -2
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale/fi.json +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-header.js +1 -1
- package/lib/module/ui-components/history/history-section-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/ui-components/settings/button-setting.js +3 -1
- package/lib/module/ui-components/settings/button-setting.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item.js +4 -2
- package/lib/module/ui-components/settings/setting-item.js.map +1 -1
- package/lib/module/ui-components/settings/switch-setting.js +4 -2
- package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/history.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +4 -4
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +11 -11
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/core-context.js +5 -5
- package/lib/module/utils/hooks/core/core-context.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +4 -4
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/dids.js +2 -2
- package/lib/module/utils/hooks/core/dids.js.map +1 -1
- package/lib/module/utils/hooks/core/history.js +1 -1
- package/lib/module/utils/hooks/core/history.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +4 -4
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +10 -10
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +6 -6
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js +2 -2
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/parsers/credential-images.js +12 -11
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +11 -8
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +2 -2
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +30 -17
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/url.js.map +1 -1
- package/lib/typescript/components/backup/preview-credentials.d.ts +2 -2
- package/lib/typescript/components/credential/credential.d.ts +2 -2
- package/lib/typescript/components/entity/EntityButtons.d.ts +2 -2
- package/lib/typescript/components/entity/entity-attributes.d.ts +2 -2
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -3
- package/lib/typescript/components/entity/entity-details.d.ts +5 -5
- package/lib/typescript/components/history/history-details-screen.d.ts +2 -2
- package/lib/typescript/components/history/history-list-item-icon.d.ts +3 -3
- package/lib/typescript/components/history/history-list-item.d.ts +5 -5
- package/lib/typescript/components/history/history-list-screen.d.ts +4 -4
- package/lib/typescript/components/history/history-list.d.ts +5 -5
- package/lib/typescript/components/proof-request/v1/select-credential.d.ts +2 -2
- package/lib/typescript/components/proof-request/v1/share-credential.d.ts +6 -6
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +3 -3
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +4 -4
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +5 -5
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
- package/lib/typescript/ui-components/settings/setting-item.d.ts +1 -0
- package/lib/typescript/utils/history.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/backup.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/cache.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/core-context.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +6 -6
- package/lib/typescript/utils/hooks/core/credentials.d.ts +8 -8
- package/lib/typescript/utils/hooks/core/dids.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/history.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
- package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -9
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -6
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -5
- package/lib/typescript/utils/parsers/credential-images.d.ts +2 -2
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +7 -7
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +8 -8
- package/lib/typescript/utils/parsers/credential.d.ts +15 -14
- package/lib/typescript/utils/parsers/query.d.ts +8 -8
- package/package.json +6 -4
- package/src/components/backup/preview-credentials.tsx +2 -2
- package/src/components/credential/credential.tsx +2 -2
- package/src/components/entity/EntityButtons.tsx +2 -2
- package/src/components/entity/entity-attributes.tsx +4 -4
- package/src/components/entity/entity-details-with-buttons.tsx +11 -6
- package/src/components/entity/entity-details.tsx +17 -16
- package/src/components/history/history-details-screen.tsx +13 -16
- package/src/components/history/history-list-item-icon.tsx +19 -11
- package/src/components/history/history-list-item.tsx +9 -5
- package/src/components/history/history-list-screen.tsx +4 -4
- package/src/components/history/history-list-section-header.tsx +1 -1
- package/src/components/history/history-list.tsx +6 -6
- package/src/components/proof-request/share-credential-card-notice.tsx +1 -1
- package/src/components/proof-request/v1/select-credential.tsx +2 -2
- package/src/components/proof-request/v1/share-credential.tsx +13 -11
- package/src/components/proof-request/v2/select-credential-v2.tsx +6 -3
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +12 -12
- package/src/components/proof-request/v2/share-credential-v2.tsx +11 -11
- package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +4 -1
- package/src/ui-components/accessibility/locale/fi.json +1 -1
- package/src/ui-components/buttons/ghost-button.stories.tsx +0 -1
- package/src/ui-components/control/checkbox.stories.tsx +1 -1
- package/src/ui-components/control/switch.stories.tsx +1 -1
- package/src/ui-components/credential/card/credential-header.stories.tsx +0 -1
- package/src/ui-components/entity/entity-cluster.tsx +7 -6
- package/src/ui-components/header/foldable-header.tsx +8 -11
- package/src/ui-components/history/history-section-header.tsx +1 -1
- package/src/ui-components/history/history-section-list-item.tsx +1 -1
- package/src/ui-components/icons/entity.tsx +2 -2
- package/src/ui-components/pin/pin-code-screen.stories.tsx +1 -1
- package/src/ui-components/screens/image-preview-screen.stories.tsx +1 -1
- package/src/ui-components/screens/nerd-mode-screen.tsx +2 -2
- package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +1 -1
- package/src/ui-components/screens/section-list-screen.tsx +10 -1
- package/src/ui-components/searchbar/search-bar.stories.tsx +0 -1
- package/src/ui-components/settings/button-setting.tsx +2 -1
- package/src/ui-components/settings/setting-item.tsx +9 -2
- package/src/ui-components/settings/switch-setting.tsx +9 -2
- package/src/ui-components/text/typography.stories.tsx +2 -2
- package/src/utils/date.ts +2 -2
- package/src/utils/history.ts +4 -4
- package/src/utils/hooks/connectivity/connectivity.test.ts +2 -2
- package/src/utils/hooks/core/backup.ts +4 -4
- package/src/utils/hooks/core/cache.ts +13 -13
- package/src/utils/hooks/core/core-context.tsx +6 -6
- package/src/utils/hooks/core/credential-schemas.ts +7 -4
- package/src/utils/hooks/core/credentials.ts +21 -13
- package/src/utils/hooks/core/dids.ts +3 -3
- package/src/utils/hooks/core/history.ts +3 -3
- package/src/utils/hooks/core/identifiers.ts +9 -5
- package/src/utils/hooks/core/proof-schemas.ts +21 -16
- package/src/utils/hooks/core/proofs.ts +31 -27
- package/src/utils/hooks/core/trust-entity.ts +19 -12
- package/src/utils/hooks/core/wallet-unit.ts +21 -11
- package/src/utils/hooks/navigation/open-settings.ts +1 -1
- package/src/utils/hooks/revocation/credential-status.ts +2 -2
- package/src/utils/parsers/credential-images.tsx +19 -13
- package/src/utils/parsers/credential-sharing-v2.tsx +29 -24
- package/src/utils/parsers/credential-sharing.tsx +24 -24
- package/src/utils/parsers/credential.ts +63 -40
- package/src/utils/parsers/query.ts +16 -14
- package/src/utils/url.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colorSchemeContext","_historyItem","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","HistorySectionListItem","first","last","props","colorScheme","useAppColorScheme","createElement","View","style","styles","item","backgroundColor","white","StyleSheet","create","borderTopLeftRadius","borderTopRightRadius","marginTop","paddingTop","paddingHorizontal","borderBottomLeftRadius","borderBottomRightRadius","marginBottom","paddingBottom","_default","exports"],"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,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_colorSchemeContext","_historyItem","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","HistorySectionListItem","first","last","props","colorScheme","useAppColorScheme","createElement","View","style","styles","item","backgroundColor","white","StyleSheet","create","borderTopLeftRadius","borderTopRightRadius","marginTop","paddingTop","paddingHorizontal","borderBottomLeftRadius","borderBottomRightRadius","marginBottom","paddingBottom","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAuE,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAAAD,CAAA,CAAAC,CAAA,aAAAJ,CAAA,KAAAJ,QAAA,CAAAW,KAAA,OAAAN,SAAA;AAEvE;AACA;;AAMA,MAAMO,sBAAuD,GAAGA,CAAC;EAAEC,KAAK;EAAEC,IAAI;EAAE,GAAGC;AAAM,CAAC,KAAK;EAC7F,MAAMC,WAAW,GAAG,IAAAC,qCAAiB,EAAC,CAAC;EACvC,oBACE1B,MAAA,CAAAQ,OAAA,CAAAmB,aAAA,CAACxB,YAAA,CAAAyB,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAET,KAAK,IAAIQ,MAAM,CAACR,KAAK,EAAEC,IAAI,IAAIO,MAAM,CAACP,IAAI,EAAE;MAAES,eAAe,EAAEP,WAAW,CAACQ;IAAM,CAAC;EAAE,gBAC7GjC,MAAA,CAAAQ,OAAA,CAAAmB,aAAA,CAACtB,YAAA,CAAAG,OAAe,EAAAC,QAAA;IAACc,IAAI,EAAEA;EAAK,GAAKC,KAAK,CAAG,CACrC,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGI,uBAAU,CAACC,MAAM,CAAC;EAC/Bb,KAAK,EAAE;IACLc,mBAAmB,EAAE,EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBC,SAAS,EAAE,CAAC;IACZC,UAAU,EAAE;EACd,CAAC;EACDR,IAAI,EAAE;IACJS,iBAAiB,EAAE;EACrB,CAAC;EACDjB,IAAI,EAAE;IACJkB,sBAAsB,EAAE,EAAE;IAC1BC,uBAAuB,EAAE,EAAE;IAC3BC,YAAY,EAAE,EAAE;IAChBC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAtC,OAAA,GAEYa,sBAAsB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNativeSvg","_interopRequireWildcard","_colorSchemeContext","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityTrustedIcon","props","colorScheme","useAppColorScheme","createElement","width","height","viewBox","fill","Mask","id","maskUnits","x","y","black","Path","white","d","success","fillOpacity","mask","exports","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 )
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNativeSvg","_interopRequireWildcard","_colorSchemeContext","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityTrustedIcon","props","colorScheme","useAppColorScheme","createElement","width","height","viewBox","fill","Mask","id","maskUnits","x","y","black","Path","white","d","success","fillOpacity","mask","exports","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":";;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M,EAAEtB,WAAW,CAACc,KAAM;IAC1BS,aAAa,EAAE,GAAI;IACnBC,WAAW,EAAE;EAAE,CAChB,CAAC,eACF1D,MAAA,CAAAY,OAAA,CAAAwB,aAAA,CAACjC,eAAA,CAAA4C,IAAI;IACHE,CAAC,EAAC,weAAwe;IAC1eT,IAAI,EAAEN,WAAW,CAACc;EAAM,CACzB,CACE,CAAC;AAEV,CAAC;AAACK,OAAA,CAAAC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeSafeAreaContext","_entityDetailsWithButtons","_interopRequireDefault","_contrastingStatusBar","_testID","_accessibilityHistoryWrappers","_entityCluster","_navigationHeader","_icons","_nerdModeItem","_typography","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityType","exports","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","Animated","createAnimatedComponent","SectionList","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","useSafeAreaInsets","colorScheme","useAppColorScheme","scrollOffset","useSharedValue","expandedAttributes","setExpandedAttributes","useState","onExpand","expanded","prev","onScroll","useAnimatedScrollHandler","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","TouchableOpacity","onPress","concatTestID","CloseIcon","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","View","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","StyleSheet","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity","_default"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAEA,IAAAI,yBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAA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F,YAAA,CAAAkH,IAAI;QAACnB,KAAK,EAAES,MAAM,CAACW,sBAAuB;QAAC3D,MAAM,EAAE,IAAAmC,oBAAY,EAACnC,MAAM,EAAEmD,OAAO,CAAClD,KAAK;MAAE,gBACtF5D,MAAA,CAAAmB,OAAA,CAAAmE,aAAA,CAACvE,WAAA,CAAAI,OAAU;QAAC6E,KAAK,EAAEhC,WAAW,CAACiC,KAAM;QAACC,KAAK,EAAES,MAAM,CAACY;MAAkB,GACnET,OAAO,CAAClD,KACC,CACR,CAAC,GACL,IAAI;IACV,CAAE;IACF4D,mBAAmB,EAAE,EAAG;IACxBlE,QAAQ,EAAEA,QAAS;IACnBmE,2BAA2B,EAAE,KAAM;IACnCvB,KAAK,EAAE;MAAEV,eAAe,EAAExB,WAAW,CAACyB,QAAQ,CAACC;IAAW,CAAE;IAC5D/B,MAAM,EAAEA;EAAO,CAChB,CACD,CAAC;AAEP,CAAC;AAED,MAAMgD,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC/BjE,aAAa,EAAE;IACbkE,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDP,sBAAsB,EAAE;IACtBQ,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDN,iBAAiB,EAAE;IACjBS,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAAC,IAAAK,QAAA,GAAArF,OAAA,CAAAzB,OAAA,GAEYkC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeSafeAreaContext","_entityDetailsWithButtons","_interopRequireDefault","_contrastingStatusBar","_testID","_accessibilityHistoryWrappers","_entityCluster","_navigationHeader","_icons","_nerdModeItem","_typography","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityType","exports","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","Animated","createAnimatedComponent","SectionList","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","useSafeAreaInsets","colorScheme","useAppColorScheme","scrollOffset","useSharedValue","expandedAttributes","setExpandedAttributes","useState","onExpand","expanded","prev","onScroll","useAnimatedScrollHandler","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","TouchableOpacity","onPress","concatTestID","CloseIcon","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","View","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","StyleSheet","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity","_default"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAEA,IAAAI,yBAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,qBAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,6BAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAJ,sBAAA,CAAAL,OAAA;AACA,IAAAU,iBAAA,GAAAL,sBAAA,CAAAL,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,aAAA,GAAAP,sBAAA,CAAAL,OAAA;AACA,IAAAa,WAAA,GAAAR,sBAAA,CAAAL,OAAA;AACA,IAAAc,mBAAA,GAAAd,OAAA;AAAkE,SAAAK,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA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AAC;AAED,MAAMgD,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC/BjE,aAAa,EAAE;IACbkE,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDP,sBAAsB,EAAE;IACtBQ,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDN,iBAAiB,EAAE;IACjBS,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAAC,IAAAK,QAAA,GAAArF,OAAA,CAAAzB,OAAA,GAEYkC,cAAc","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_onScrollHeaderState","_listContentInset","_navigationHeader","_interopRequireDefault","_listTitleHeader","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","useAppColorScheme","top","useSafeAreaInsets","contentInsetsStyle","useListContentInset","headerHeight","Platform","OS","titleVisible","onScroll","useOnScrollHeaderState","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","useMemo","undefined","React","isValidElement","HeaderComponent","createElement","View","container","backgroundColor","background","SectionList","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","StyleSheet","create","flex","position","width","_default","exports"],"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
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_onScrollHeaderState","_listContentInset","_navigationHeader","_interopRequireDefault","_listTitleHeader","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","useAppColorScheme","top","useSafeAreaInsets","contentInsetsStyle","useListContentInset","headerHeight","Platform","OS","titleVisible","onScroll","useOnScrollHeaderState","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","useMemo","undefined","React","isValidElement","HeaderComponent","createElement","View","container","backgroundColor","background","SectionList","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","StyleSheet","create","flex","position","width","_default","exports"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAC,sBAAA,CAAAN,OAAA;AAC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,SAAS,CACd,CAAC,eACF3C,MAAA,CAAAa,OAAA,CAAAyD,aAAA,CAAC/D,iBAAA,CAAAM,OAAgB,EAAAkB,QAAA;IACfiD,OAAO;IACPC,OAAO;IACPpC,KAAK,EAAE,CAACiB,MAAM,CAACxB,MAAM,EAAEqB,kBAAkB,CAAE;IAC3CH,YAAY,EAAElB,MAAM,CAACuC,MAAM,IAAIrB;EAAa,GACxClB,MAAM,CACX,CACG,CAAC;AAEX,CAAC;AAED,MAAMwB,MAAM,GAAGoB,uBAAU,CAACC,MAAM,CAAC;EAC/BX,SAAS,EAAE;IACTY,IAAI,EAAE;EACR,CAAC;EACD9C,MAAM,EAAE;IACN+C,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDvB,wBAAwB,EAAE;IACxBH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAA2B,QAAA,GAAAC,OAAA,CAAA3E,OAAA,GAEYwB,iBAAiB","ignoreList":[]}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _utils = require("../../utils");
|
|
9
10
|
var _accessibilityHistoryWrappers = require("../accessibility/accessibilityHistoryWrappers");
|
|
10
11
|
var _wallet = require("../icons/wallet");
|
|
11
12
|
var _colorSchemeContext = require("../theme/color-scheme-context");
|
|
@@ -47,7 +48,8 @@ const ButtonSetting = ({
|
|
|
47
48
|
}, /*#__PURE__*/_react.default.createElement(_settingItem.default, {
|
|
48
49
|
icon: icon,
|
|
49
50
|
style: style,
|
|
50
|
-
title: title
|
|
51
|
+
title: title,
|
|
52
|
+
testID: (0, _utils.concatTestID)(testID, 'text')
|
|
51
53
|
}, accessoryView));
|
|
52
54
|
};
|
|
53
55
|
const styles = _reactNative.StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_accessibilityHistoryWrappers","_wallet","_colorSchemeContext","_settingItem","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","useAppColorScheme","accessoryView","useMemo","createElement","View","styles","arrow","NextIcon","color","text","React","isValidElement","AccessoryComponent","TouchableOpacity","accessibilityRole","container","StyleSheet","create","alignItems","height","justifyContent","width","_default","exports"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_utils","_accessibilityHistoryWrappers","_wallet","_colorSchemeContext","_settingItem","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","useAppColorScheme","accessoryView","useMemo","createElement","View","styles","arrow","NextIcon","color","text","React","isValidElement","AccessoryComponent","TouchableOpacity","accessibilityRole","container","concatTestID","StyleSheet","create","alignItems","height","justifyContent","width","_default","exports"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAC,sBAAA,CAAAP,OAAA;AAAyC,SAAAO,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAT,wBAAAS,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GA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AC,MAAM;MACL,MAAMoB,kBAAkB,GAAGpB,SAAqC;MAChE,oBAAO/B,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACS,kBAAkB,MAAE,CAAC;IAC/B;EACF,CAAC,EAAE,CAACpB,SAAS,EAAEO,WAAW,CAACU,IAAI,CAAC,CAAC;EAEjC,oBACEhD,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAACrC,6BAAA,CAAA+C,gBAAgB;IACfpB,QAAQ,EAAEA,QAAS;IACnBqB,iBAAiB,EAAC,QAAQ;IAC1BnB,OAAO,EAAEA,OAAQ;IACjBE,KAAK,EAAEQ,MAAM,CAACU,SAAU;IACxBjB,MAAM,EAAEA;EAAO,gBACfrC,MAAA,CAAAY,OAAA,CAAA8B,aAAA,CAAClC,YAAA,CAAAI,OAAW;IAACuB,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACH,KAAK,EAAEA,KAAM;IAACI,MAAM,EAAE,IAAAkB,mBAAY,EAAClB,MAAM,EAAE,MAAM;EAAE,GACvFG,aACU,CACG,CAAC;AAEvB,CAAC;AAED,MAAMI,MAAM,GAAGY,uBAAU,CAACC,MAAM,CAAC;EAC/BZ,KAAK,EAAE;IACLa,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDP,SAAS,EAAE;IACTO,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnD,OAAA,GAEYkB,aAAa","ignoreList":[]}
|
|
@@ -42,7 +42,8 @@ const SettingItem = ({
|
|
|
42
42
|
title,
|
|
43
43
|
icon,
|
|
44
44
|
style,
|
|
45
|
-
children
|
|
45
|
+
children,
|
|
46
|
+
testID
|
|
46
47
|
}) => {
|
|
47
48
|
const colorScheme = (0, _colorSchemeContext.useAppColorScheme)();
|
|
48
49
|
const iconView = (0, _react.useMemo)(() => {
|
|
@@ -70,7 +71,8 @@ const SettingItem = ({
|
|
|
70
71
|
accessible: false,
|
|
71
72
|
color: colorScheme.text,
|
|
72
73
|
preset: "s",
|
|
73
|
-
style: styles.label
|
|
74
|
+
style: styles.label,
|
|
75
|
+
testID: testID
|
|
74
76
|
}, title), children));
|
|
75
77
|
};
|
|
76
78
|
var _default = exports.default = SettingItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_typography","_interopRequireDefault","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","styles","StyleSheet","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","colorScheme","useAppColorScheme","iconView","useMemo","undefined","React","isValidElement","IconComponent","createElement","View","backgroundColor","white","background","accessible","color","text","preset","_default","exports"],"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>> = ({
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_typography","_interopRequireDefault","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","styles","StyleSheet","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","testID","colorScheme","useAppColorScheme","iconView","useMemo","undefined","React","isValidElement","IconComponent","createElement","View","backgroundColor","white","background","accessible","color","text","preset","_default","exports"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,mBAAA,GAAAJ,OAAA;AAAkE,SAAAG,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAG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AI;IACb,CAAC,MAAM;MACL,MAAMsB,aAAa,GAAGtB,IAAgC;MACtD,oBAAOpC,MAAA,CAAAS,OAAA,CAAAkD,aAAA,CAACD,aAAa,MAAE,CAAC;IAC1B;EACF,CAAC,EAAE,CAACtB,IAAI,CAAC,CAAC;EAEV,oBACEpC,MAAA,CAAAS,OAAA,CAAAkD,aAAA,CAACxD,YAAA,CAAAyD,IAAI;IAACZ,KAAK,EAAE,CAACrB,MAAM,CAACgB,OAAO,EAAE;MAAEkB,eAAe,EAAEV,WAAW,CAACW;IAAM,CAAC,EAAEd,KAAK;EAAE,gBAC3EhD,MAAA,CAAAS,OAAA,CAAAkD,aAAA,CAACxD,YAAA,CAAAyD,IAAI;IAACZ,KAAK,EAAErB,MAAM,CAACG;EAAU,GAC3BuB,QAAQ,iBAAIrD,MAAA,CAAAS,OAAA,CAAAkD,aAAA,CAACxD,YAAA,CAAAyD,IAAI;IAACZ,KAAK,EAAE,CAACrB,MAAM,CAACS,IAAI,EAAE;MAAEyB,eAAe,EAAEV,WAAW,CAACY;IAAW,CAAC;EAAE,GAAEV,QAAe,CAAC,eACvGrD,MAAA,CAAAS,OAAA,CAAAkD,aAAA,CAACvD,WAAA,CAAAK,OAAU;IAACuD,UAAU,EAAE,KAAM;IAACC,KAAK,EAAEd,WAAW,CAACe,IAAK;IAACC,MAAM,EAAC,GAAG;IAACnB,KAAK,EAAErB,MAAM,CAACY,KAAM;IAACW,MAAM,EAAEA;EAAO,GACpGH,KACS,CAAC,EACZE,QACG,CACF,CAAC;AAEX,CAAC;AAAC,IAAAmB,QAAA,GAAAC,OAAA,CAAA5D,OAAA,GAEaqC,WAAW","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _utils = require("../../utils");
|
|
8
9
|
var _switch = require("../control/switch");
|
|
9
10
|
var _settingItem = _interopRequireDefault(require("./setting-item"));
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -20,12 +21,13 @@ const SwitchSetting = ({
|
|
|
20
21
|
return /*#__PURE__*/_react.default.createElement(_settingItem.default, {
|
|
21
22
|
icon: icon,
|
|
22
23
|
style: style,
|
|
23
|
-
title: title
|
|
24
|
+
title: title,
|
|
25
|
+
testID: (0, _utils.concatTestID)(testID, 'text')
|
|
24
26
|
}, /*#__PURE__*/_react.default.createElement(_switch.Switch, {
|
|
25
27
|
accessibilityLabel: title,
|
|
26
28
|
disabled: disabled,
|
|
27
29
|
onChange: onChange,
|
|
28
|
-
testID: testID,
|
|
30
|
+
testID: (0, _utils.concatTestID)(testID, 'switch'),
|
|
29
31
|
value: value
|
|
30
32
|
}));
|
|
31
33
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_switch","_settingItem","e","__esModule","default","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","Switch","accessibilityLabel","_default","exports"],"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
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_utils","_switch","_settingItem","e","__esModule","default","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","concatTestID","Switch","accessibilityLabel","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAAyC,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAYzC,MAAMG,aAAoD,GAAGA,CAAC;EAC5DC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC;AACF,CAAC,KAAK;EACJ,oBACEhB,MAAA,CAAAQ,OAAA,CAAAS,aAAA,CAACZ,YAAA,CAAAG,OAAW;IAACK,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACJ,KAAK,EAAEA,KAAM;IAACM,MAAM,EAAE,IAAAE,mBAAY,EAACF,MAAM,EAAE,MAAM;EAAE,gBACxFhB,MAAA,CAAAQ,OAAA,CAAAS,aAAA,CAACb,OAAA,CAAAe,MAAM;IACLC,kBAAkB,EAAEV,KAAM;IAC1BK,QAAQ,EAAEA,QAAS;IACnBH,QAAQ,EAAEA,QAAS;IACnBI,MAAM,EAAE,IAAAE,mBAAY,EAACF,MAAM,EAAE,QAAQ,CAAE;IACvCL,KAAK,EAAEA;EAAM,CACd,CACU,CAAC;AAElB,CAAC;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAAd,OAAA,GAEaC,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_timeago","_I18nManager$getConst","_ref","MINUTE","DAY","systemLocale","I18nManager","getConstants","localeIdentifier","replace","split","formatDate","date","locale","options","toLocaleDateString","undefined","exports","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","format","formatTimestamp","nowLabel","_formatDateTime2","now","Date","timestamp","getTime","_formatDateTime","pad","x","String","convertDateToUTCTimestamp","parse","getMonth","getDate","convertDateStrToLocalDate","Platform","select","android","timezoneOffset","getTimezoneOffset","default","formatDateOnlyFromUTCTimestamp","utcTimestamp","_formatDate","utcDate","getUTCFullYear","getUTCMonth","getUTCDate","OS","Settings","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()
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_timeago","_I18nManager$getConst","_ref","MINUTE","DAY","systemLocale","I18nManager","getConstants","localeIdentifier","replace","split","formatDate","date","locale","options","toLocaleDateString","undefined","exports","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","format","formatTimestamp","nowLabel","_formatDateTime2","now","Date","timestamp","getTime","_formatDateTime","pad","x","String","convertDateToUTCTimestamp","parse","getMonth","getDate","convertDateStrToLocalDate","Platform","select","android","timezoneOffset","getTimezoneOffset","default","formatDateOnlyFromUTCTimestamp","utcTimestamp","_formatDate","utcDate","getUTCFullYear","getUTCMonth","getUTCDate","OS","Settings","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"],"m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A,yBAAA;AAKO,MAAMO,8BAA8B,GAAIC,YAAoB,IAAa;EAAA,IAAAC,WAAA;EAC9E,MAAMC,OAAO,GAAG,IAAIrB,IAAI,CAACmB,YAAY,CAAC;EACtC,QAAAC,WAAA,GACE7C,UAAU,CACRoC,yBAAyB,CACvB,GAAGU,OAAO,CAACC,cAAc,CAAC,CAAC,IAAIlB,GAAG,CAACiB,OAAO,CAACE,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,IAAInB,GAAG,CAACiB,OAAO,CAACG,UAAU,CAAC,CAAC,CAAC,EAC5F,CACF,CAAC,cAAAJ,WAAA,cAAAA,WAAA,GAAI,EAAE;AAEX,CAAC;AAACvC,OAAA,CAAAqC,8BAAA,GAAAA,8BAAA;AAEF,MAAMzC,MAAM,IAAAX,IAAA,GACV8C,qBAAQ,CAACa,EAAE,KAAK,KAAK,GACjBC,qBAAQ,CAACC,GAAG,CAAC,aAAa,CAAC,GAC3BzD,wBAAW,CAACC,YAAY,CAAC,CAAC,CAACC,gBAAgB,cAAAN,IAAA,uBAHlCA,IAAA,CAKXQ,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CACdD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AAEb,MAAMuD,uBAAuB,GAAIpD,IAAU,IAAK;EACrD,OAAOU,cAAc,CAACV,IAAI,EAAEC,MAAM,CAAC;AACrC,CAAC;AAACI,OAAA,CAAA+C,uBAAA,GAAAA,uBAAA;AAEK,MAAMC,mBAAmB,GAAIrD,IAAU,IAAK;EACjD,OAAOD,UAAU,CAACC,IAAI,EAAEC,MAAM,CAAC;AACjC,CAAC;AAACI,OAAA,CAAAgD,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_moment","_interopRequireDefault","require","e","__esModule","default","groupEntriesByDay","entries","groupedEntries","reduce","result","entry","entryDate","moment","createdDate","matchingEntry","find","date","isSame","data","push","firstYearEntry","sort","a","b","valueOf","map","item","index","list","exports"],"sources":["history.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["_moment","_interopRequireDefault","require","e","__esModule","default","groupEntriesByDay","entries","groupedEntries","reduce","result","entry","entryDate","moment","createdDate","matchingEntry","find","date","isSame","data","push","firstYearEntry","sort","a","b","valueOf","map","item","index","list","exports"],"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,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAQjC,MAAMG,iBAAiB,GAAIC,OAAoC,IAAK;EACzE,MAAMC,cAAc,GAAGD,OAAO,CAACE,MAAM,CAAC,CAACC,MAAkC,EAAEC,KAAgC,KAAK;IAC9G,MAAMC,SAAS,GAAG,IAAAC,eAAM,EAACF,KAAK,CAACG,WAAW,CAAC;IAE3C,MAAMC,aAAa,GAAGL,MAAM,CAACM,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAACC,MAAM,CAACN,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9E,IAAIG,aAAa,EAAE;MACjBA,aAAa,CAACI,IAAI,CAACC,IAAI,CAACT,KAAK,CAAC;IAChC,CAAC,MAAM;MACLD,MAAM,CAACU,IAAI,CAAC;QAAED,IAAI,EAAE,CAACR,KAAK,CAAC;QAAEM,IAAI,EAAEL,SAAS;QAAES,cAAc,EAAE;MAAM,CAAC,CAAC;IACxE;IAEA,OAAOX,MAAM;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,cAAc,CAClBc,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;AAACG,OAAA,CAAAxB,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_connectivity","require","jest","mock","initializeCore","Promise","resolve","captureException","getEnabledTransports","useCoreConfig","addEventListener","onStateChange","describe","test","transports","getInvitationUrlTransports","expect","toStrictEqual","Transport","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@procivis/react-native-one-core', () => ({\n initializeCore: () => Promise.resolve({} as any),\n}));\n\njest.mock('@sentry/react-native', () => ({\n captureException: () => {},\n}));\n\njest.mock('../core/core-config', () => ({\n getEnabledTransports: () => [],\n useCoreConfig: () => ({}),\n}));\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {
|
|
1
|
+
{"version":3,"names":["_connectivity","require","jest","mock","initializeCore","Promise","resolve","captureException","getEnabledTransports","useCoreConfig","addEventListener","onStateChange","describe","test","transports","getInvitationUrlTransports","expect","toStrictEqual","Transport","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@procivis/react-native-one-core', () => ({\n initializeCore: () => Promise.resolve({} as any),\n}));\n\njest.mock('@sentry/react-native', () => ({\n captureException: () => {},\n}));\n\njest.mock('../core/core-config', () => ({\n getEnabledTransports: () => [],\n useCoreConfig: () => ({}),\n}));\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {},\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => {},\n}));\n\ndescribe('getInvitationUrlTransports', () => {\n test('BLE OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('BLE OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('HTTP OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with requestUri', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID credential offer url', () => {\n const transports = getInvitationUrlTransports(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n\n test('Invalid link', () => {\n const transports = getInvitationUrlTransports('invalid');\n expect(transports).toStrictEqual([]);\n });\n});\n"],"mappings":";;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEAC,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDC,cAAc,EAAEA,CAAA,KAAMC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAQ;AACjD,CAAC,CAAC,CAAC;AAEHJ,IAAI,CAACC,IAAI,CAAC,sBAAsB,EAAE,OAAO;EACvCI,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHL,IAAI,CAACC,IAAI,CAAC,qBAAqB,EAAE,OAAO;EACtCK,oBAAoB,EAAEA,CAAA,KAAM,EAAE;EAC9BC,aAAa,EAAEA,CAAA,MAAO,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEHP,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDO,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHR,IAAI,CAACC,IAAI,CAAC,sCAAsC,EAAE,OAAO;EACvDQ,aAAa,EAAEA,CAAA,KAAM,CAAC;AACxB,CAAC,CAAC,CAAC;AAEHC,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EAC3CC,IAAI,CAAC,mBAAmB,EAAE,MAAM;IAC9B,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAC3C,wGAAwG,EACxG,gBACF,CAAC;IACDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,CAACC,uBAAS,CAACC,SAAS,CAAC,CAAC;EACzD,CAAC,CAAC;EACFN,IAAI,CAAC,oBAAoB,EAAE,MAAM;IAC/B,MAAMC,UAA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AACG,aAAa,CAAC,CAACC,uBAAS,CAACG,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFR,IAAI,CAAC,uCAAuC,EAAE,MAAM;IAClD,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAC3C,upBAAupB,EACvpB,gBACF,CAAC;IACDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,CAACC,uBAAS,CAACG,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFR,IAAI,CAAC,oCAAoC,EAAE,MAAM;IAC/C,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAC3C,6OAA6O,EAC7O,gBACF,CAAC;IACDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,CAACC,uBAAS,CAACG,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFR,IAAI,CAAC,kCAAkC,EAAE,MAAM;IAC7C,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAC3C,wMAAwM,EACxM,gBACF,CAAC;IACDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,CAACC,uBAAS,CAACG,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EAEFR,IAAI,CAAC,cAAc,EAAE,MAAM;IACzB,MAAMC,UAAU,GAAG,IAAAC,wCAA0B,EAAC,SAAS,CAAC;IACxDC,MAAM,CAACF,UAAU,CAAC,CAACG,aAAa,CAAC,EAAE,CAAC;EACtC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -91,12 +91,12 @@ const useBackupFinalizeImportProcedure = ({
|
|
|
91
91
|
let swIdentifierId;
|
|
92
92
|
if (generateSwKey) {
|
|
93
93
|
var _identifiers$values$f;
|
|
94
|
-
const identifiers = await core.
|
|
95
|
-
states: [_reactNativeOneCore.
|
|
94
|
+
const identifiers = await core.listIdentifiers({
|
|
95
|
+
states: [_reactNativeOneCore.IdentifierStateBindingEnum.ACTIVE],
|
|
96
96
|
organisationId,
|
|
97
97
|
page: 0,
|
|
98
98
|
pageSize: 1,
|
|
99
|
-
types: [_reactNativeOneCore.
|
|
99
|
+
types: [_reactNativeOneCore.IdentifierTypeBindingEnum.DID],
|
|
100
100
|
isRemote: false
|
|
101
101
|
});
|
|
102
102
|
swIdentifierId = (_identifiers$values$f = identifiers.values.find(identifier => identifier.name.startsWith(_coreInit.SW_DID_NAME_PREFIX))) === null || _identifiers$values$f === void 0 ? void 0 : _identifiers$values$f.id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeOneCore","require","_react","_reactQuery","_reporting","_coreContext","_coreInit","_history","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","useONECore","useQuery","backupInfo","keepPreviousData","exports","useCreateBackup","queryClient","useQueryClient","useMutation","password","outputPath","createBackup","onSuccess","invalidateQueries","HISTORY_LIST_QUERY_KEY","useUnpackBackup","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","generateHwKey","generateSwKey","mutateAsync","organisationId","useCallback","swIdentifierId","_identifiers$values$f","identifiers","
|
|
1
|
+
{"version":3,"names":["_reactNativeOneCore","require","_react","_reactQuery","_reporting","_coreContext","_coreInit","_history","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","useONECore","useQuery","backupInfo","keepPreviousData","exports","useCreateBackup","queryClient","useQueryClient","useMutation","password","outputPath","createBackup","onSuccess","invalidateQueries","HISTORY_LIST_QUERY_KEY","useUnpackBackup","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","generateHwKey","generateSwKey","mutateAsync","organisationId","useCallback","swIdentifierId","_identifiers$values$f","identifiers","listIdentifiers","states","IdentifierStateBindingEnum","ACTIVE","page","pageSize","types","IdentifierTypeBindingEnum","DID","isRemote","values","find","identifier","name","startsWith","SW_DID_NAME_PREFIX","id","Promise","all","generateHwIdentifier","generateSwIdentifier","catch","err","reportException"],"sources":["backup.ts"],"sourcesContent":["import { IdentifierStateBindingEnum, IdentifierTypeBindingEnum } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport {\n generateHwIdentifier,\n generateSwIdentifier,\n IdentifiersInitializationConfig,\n SW_DID_NAME_PREFIX,\n} from './core-init';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst BACKUP_INFO_QUERY_KEY = 'backup-info';\n\nexport const useBackupInfo = () => {\n const { core } = useONECore();\n\n return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {\n keepPreviousData: true,\n });\n};\n\nexport const useCreateBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, outputPath }: { outputPath: string; password: string }) =>\n core.createBackup(password, outputPath),\n {\n onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY),\n },\n );\n};\n\nexport const useUnpackBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, inputPath }: { inputPath: string; password: string }) => core.unpackBackup(password, inputPath),\n {\n onSuccess: () => queryClient.resetQueries(),\n },\n );\n};\n\nexport const useFinalizeImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.finalizeImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useRollbackImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.rollbackImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\n/**\n * Finalize backup import and extract/prepare identifiers\n * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be restored/created\n * @returns [hwIdentifierId, swIdentifierId]\n */\nexport const useBackupFinalizeImportProcedure = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {\n const { mutateAsync: finalizeImport } = useFinalizeImport();\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n await finalizeImport();\n\n // update wallet identifier references\n let swIdentifierId: string | undefined;\n if (generateSwKey) {\n const identifiers = await core.listIdentifiers({\n states: [IdentifierStateBindingEnum.ACTIVE],\n organisationId,\n page: 0,\n pageSize: 1,\n types: [IdentifierTypeBindingEnum.DID],\n isRemote: false,\n });\n swIdentifierId = identifiers.values.find((identifier) => identifier.name.startsWith(SW_DID_NAME_PREFIX))?.id;\n }\n\n return Promise.all([\n generateHwKey ? generateHwIdentifier(core, organisationId) : null,\n !swIdentifierId && generateSwKey ? generateSwIdentifier(core, organisationId) : swIdentifierId,\n ]).catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [finalizeImport, generateSwKey, generateHwKey, core, organisationId]);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAEA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAMA,IAAAM,QAAA,GAAAN,OAAA;AAEA,MAAMO,qBAAqB,GAAG,aAAa;AAEpC,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IAAAC,oBAAQ,EAAC,CAACJ,qBAAqB,CAAC,EAAE,MAAME,IAAI,CAACG,UAAU,CAAC,CAAC,EAAE;IAChEC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA;AAEK,MAAMO,eAAe,GAAGA,CAAA,KAAM;EACnC,MAAMC,WAAW,GAAG,IAAAC,0BAAc,EAAC,CAAC;EACpC,MAAM;IAAER;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IA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4B,cAAc,CAAC,GAAGE,cAAc,CAC/F,CAAC,CAACwB,KAAK,CAAEC,GAAG,IAAK;MAChB,IAAAC,0BAAe,EAACD,GAAG,EAAE,mCAAmC,CAAC;MACzD,MAAMA,GAAG;IACX,CAAC,CAAC;EACJ,CAAC,EAAE,CAAClC,cAAc,EAAEK,aAAa,EAAED,aAAa,EAAEzB,IAAI,EAAE4B,cAAc,CAAC,CAAC;AAC1E,CAAC;AAACvB,OAAA,CAAAmB,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
|
@@ -12,17 +12,17 @@ var _trustEntity = require("./trust-entity");
|
|
|
12
12
|
const CREDENTIAL_QUERY_KEYS = [_credentials.CREDENTIAL_LIST_QUERY_KEY, _credentials.CREDENTIAL_LIST_PAGED_QUERY_KEY, _credentials.CREDENTIAL_DETAIL_QUERY_KEY];
|
|
13
13
|
const TRUST_ENTITY_QUERY_KEYS = [_trustEntity.TRUST_ENTITY_DETAIL_QUERY_KEY, _trustEntity.REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];
|
|
14
14
|
|
|
15
|
-
// Map each
|
|
15
|
+
// Map each CacheTypeBindingDto to the query keys that should be invalidated when that cache is cleared.
|
|
16
16
|
const cacheTypeToQueryKeys = {
|
|
17
|
-
[_reactNativeOneCore.
|
|
18
|
-
[_reactNativeOneCore.
|
|
19
|
-
[_reactNativeOneCore.
|
|
20
|
-
[_reactNativeOneCore.
|
|
21
|
-
[_reactNativeOneCore.
|
|
22
|
-
[_reactNativeOneCore.
|
|
23
|
-
[_reactNativeOneCore.
|
|
24
|
-
[_reactNativeOneCore.
|
|
25
|
-
[_reactNativeOneCore.
|
|
17
|
+
[_reactNativeOneCore.CacheTypeBindingDto.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,
|
|
18
|
+
[_reactNativeOneCore.CacheTypeBindingDto.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,
|
|
19
|
+
[_reactNativeOneCore.CacheTypeBindingDto.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
|
|
20
|
+
[_reactNativeOneCore.CacheTypeBindingDto.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
|
|
21
|
+
[_reactNativeOneCore.CacheTypeBindingDto.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
|
|
22
|
+
[_reactNativeOneCore.CacheTypeBindingDto.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
|
|
23
|
+
[_reactNativeOneCore.CacheTypeBindingDto.X509_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
24
|
+
[_reactNativeOneCore.CacheTypeBindingDto.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
25
|
+
[_reactNativeOneCore.CacheTypeBindingDto.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS
|
|
26
26
|
};
|
|
27
27
|
const useCacheClear = () => {
|
|
28
28
|
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeOneCore","require","_reactQuery","_coreContext","_credentials","_trustEntity","CREDENTIAL_QUERY_KEYS","CREDENTIAL_LIST_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_DETAIL_QUERY_KEY","TRUST_ENTITY_QUERY_KEYS","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","cacheTypeToQueryKeys","
|
|
1
|
+
{"version":3,"names":["_reactNativeOneCore","require","_reactQuery","_coreContext","_credentials","_trustEntity","CREDENTIAL_QUERY_KEYS","CREDENTIAL_LIST_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_DETAIL_QUERY_KEY","TRUST_ENTITY_QUERY_KEYS","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","cacheTypeToQueryKeys","CacheTypeBindingDto","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","OPEN_ID_METADATA","useCacheClear","queryClient","useQueryClient","core","useONECore","useMutation","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries","exports"],"sources":["cache.ts"],"sourcesContent":["import { CacheTypeBindingDto } from '@procivis/react-native-one-core';\nimport { useMutation, useQueryClient } from 'react-query';\n\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';\nimport { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];\n\n// Map each CacheTypeBindingDto to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheTypeBindingDto, string[]> = {\n [CacheTypeBindingDto.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],\n [CacheTypeBindingDto.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS,\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheTypeBindingDto[]) => {\n await core.deleteCache(cacheTypes);\n return cacheTypes;\n },\n {\n onSuccess: async (_, cacheTypes) => {\n const queryKeysToInvalidate = new Set<string>();\n\n cacheTypes.forEach((cacheType) => {\n const keys = cacheTypeToQueryKeys[cacheType] || [];\n keys.forEach((key) => queryKeysToInvalidate.add(key));\n });\n\n await Promise.all([...queryKeysToInvalidate].map((queryKey) => queryClient.invalidateQueries(queryKey)));\n },\n },\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,MAAMK,qBAAqB,GAAG,CAACC,sCAAyB,EAAEC,4CAA+B,EAAEC,wCAA2B,CAAC;AACvH,MAAMC,uBAAuB,GAAG,CAACC,0CAA6B,EAAEC,iDAAoC,CAAC;;AAErG;AACA,MAAMC,oBAA2D,GAAG;EAClE,CAACC,uCAAmB,CAACC,YAAY,GAAGT,qBAAqB;EACzD,CAACQ,uCAAmB,CAACE,eAAe,GAAGV,qBAAqB;EAC5D,CAACQ,uCAAmB,CAACG,sBAAsB,GAAGX,qBAAqB;EACnE,CAACQ,uCAAmB,CAACI,YAAY,GAAGZ,qBAAqB;EACzD,CAACQ,uCAAmB,CAACK,WAAW,GAAGb,qBAAqB;EACxD,CAACQ,uCAAmB,CAACM,UAAU,GAAG,CAAC,GAAGV,uBAAu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