@procivis/one-react-native-components 0.3.94 → 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 +1 -41
- 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 +14 -33
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +4 -12
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +31 -32
- 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 +0 -38
- 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 +14 -33
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +4 -12
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +32 -33
- 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 -5
- 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 -9
- package/lib/typescript/utils/parsers/credential.d.ts +15 -35
- 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 -45
- 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 +32 -48
- package/src/utils/parsers/credential-sharing.tsx +26 -36
- package/src/utils/parsers/credential.ts +64 -61
- package/src/utils/parsers/query.ts +16 -14
- package/src/utils/url.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","useCredentialListExpandedCard","CredentialDetails","PreviewCredentials","credentials","labels","onImagePreview","expandedCredential","onHeaderPress","length","createElement","map","credential","index","key","id","credentialId","expanded","lastItem"],"sources":["preview-credentials.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["React","View","useCredentialListExpandedCard","CredentialDetails","PreviewCredentials","credentials","labels","onImagePreview","expandedCredential","onHeaderPress","length","createElement","map","credential","index","key","id","credentialId","expanded","lastItem"],"sources":["preview-credentials.tsx"],"sourcesContent":["import { CredentialListItemBindingDto } from '@procivis/react-native-one-core';\nimport React, { FC } from 'react';\nimport { ImageSourcePropType, View } from 'react-native';\n\nimport { useCredentialListExpandedCard } from '../../utils/hooks/credential-card/credential-card-expanding';\nimport { CardLabels } from '../../utils/parsers/credential';\nimport { CredentialDetails } from '../credential/credential';\n\ninterface PreviewCredentialsProps {\n credentials: CredentialListItemBindingDto[] | undefined;\n labels: CardLabels;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n}\n\nexport const PreviewCredentials: FC<PreviewCredentialsProps> = ({ credentials, labels, onImagePreview }) => {\n const { expandedCredential, onHeaderPress } = useCredentialListExpandedCard();\n\n if (!credentials || credentials.length === 0) {\n return null;\n }\n\n return (\n <View>\n {credentials.map((credential, index, { length }) => (\n <View key={credential.id}>\n <CredentialDetails\n credentialId={credential.id}\n expanded={expandedCredential === credential.id}\n labels={labels}\n lastItem={index === length - 1}\n onHeaderPress={onHeaderPress}\n onImagePreview={onImagePreview}\n />\n </View>\n ))}\n </View>\n );\n};\n"],"mappings":"AACA,OAAOA,KAAK,MAAc,OAAO;AACjC,SAA8BC,IAAI,QAAQ,cAAc;AAExD,SAASC,6BAA6B,QAAQ,6DAA6D;AAE3G,SAASC,iBAAiB,QAAQ,0BAA0B;AAQ5D,OAAO,MAAMC,kBAA+C,GAAGA,CAAC;EAAEC,WAAW;EAAEC,MAAM;EAAEC;AAAe,CAAC,KAAK;EAC1G,MAAM;IAAEC,kBAAkB;IAAEC;EAAc,CAAC,GAAGP,6BAA6B,CAAC,CAAC;EAE7E,IAAI,CAACG,WAAW,IAAIA,WAAW,CAACK,MAAM,KAAK,CAAC,EAAE;IAC5C,OAAO,IAAI;EACb;EAEA,oBACEV,KAAA,CAAAW,aAAA,CAACV,IAAI,QACFI,WAAW,CAACO,GAAG,CAAC,CAACC,UAAU,EAAEC,KAAK,EAAE;IAAEJ;EAAO,CAAC,kBAC7CV,KAAA,CAAAW,aAAA,CAACV,IAAI;IAACc,GAAG,EAAEF,UAAU,CAACG;EAAG,gBACvBhB,KAAA,CAAAW,aAAA,CAACR,iBAAiB;IAChBc,YAAY,EAAEJ,UAAU,CAACG,EAAG;IAC5BE,QAAQ,EAAEV,kBAAkB,KAAKK,UAAU,CAACG,EAAG;IAC/CV,MAAM,EAAEA,MAAO;IACfa,QAAQ,EAAEL,KAAK,KAAKJ,MAAM,GAAG,CAAE;IAC/BD,aAAa,EAAEA,aAAc;IAC7BF,cAAc,EAAEA;EAAe,CAChC,CACG,CACP,CACG,CAAC;AAEX,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Dimensions","StyleSheet","CredentialDetailsCardListItem","concatTestID","useCoreConfig","useCredentialDetail","detailsCardFromCredentialWithClaims","CredentialDetails","claims","credentialId","expanded","labels","lastItem","onHeaderPress","onImagePreview","headerAccessory","data","credential","config","cardWidth","get","width","testID","id","card","attributes","header","accessory","createElement","style","styles","create","marginBottom"],"sources":["credential.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["React","useMemo","Dimensions","StyleSheet","CredentialDetailsCardListItem","concatTestID","useCoreConfig","useCredentialDetail","detailsCardFromCredentialWithClaims","CredentialDetails","claims","credentialId","expanded","labels","lastItem","onHeaderPress","onImagePreview","headerAccessory","data","credential","config","cardWidth","get","width","testID","id","card","attributes","header","accessory","createElement","style","styles","create","marginBottom"],"sources":["credential.tsx"],"sourcesContent":["import { ClaimBindingDto } from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleSheet } from 'react-native';\n\nimport { CredentialDetailsCardListItem, CredentialHeaderProps } from '../../ui-components/credential/card';\nimport { concatTestID } from '../../utils';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { CardLabels, detailsCardFromCredentialWithClaims } from '../../utils/parsers/credential';\n\nexport interface CredentialDetailsProps {\n claims?: ClaimBindingDto[];\n credentialId: string;\n expanded?: boolean;\n headerAccessory?: CredentialHeaderProps['accessory'];\n labels: CardLabels;\n lastItem?: boolean;\n onHeaderPress?: (credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n}\n\nexport const CredentialDetails: FC<CredentialDetailsProps> = ({\n claims,\n credentialId,\n expanded = false,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n headerAccessory,\n}) => {\n const { data: credential } = useCredentialDetail(credentialId);\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n if (!credential || !config) {\n return null;\n }\n const testID = concatTestID('Credential.credential', credential.id);\n\n const { card, attributes } = detailsCardFromCredentialWithClaims(\n credential,\n claims ?? credential.claims,\n config,\n testID,\n labels,\n );\n if (headerAccessory) {\n card.header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n lastItem={lastItem}\n onImagePreview={onImagePreview}\n style={styles.credential}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n credential: {\n marginBottom: 8,\n },\n});\n"],"mappings":"AACA,OAAOA,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAC1C,SAASC,UAAU,EAAuBC,UAAU,QAAQ,cAAc;AAE1E,SAASC,6BAA6B,QAA+B,qCAAqC;AAC1G,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,aAAa,QAAQ,oCAAoC;AA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MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAED,MAAMQ,MAAM,GAAG7B,UAAU,CAAC8B,MAAM,CAAC;EAC/Bd,UAAU,EAAE;IACVe,YAAY,EAAE;EAChB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","useCallback","useMemo","Linking","StyleSheet","View","Button","ButtonType","concatTestID","reportException","EntityButtons","entity","labels","testID","buttons","label","visitWebsite","url","website","termsAndServices","termsUrl","privacyPolicy","privacyUrl","filter","btn","Boolean","openURL","catch","e","createElement","style","styles","map","testIdSuffix","key","title","onPress","urlButton","type","SmallTech","create","paddingBottom","paddingHorizontal","borderRadius","borderWidth","marginTop"],"sources":["EntityButtons.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["React","memo","useCallback","useMemo","Linking","StyleSheet","View","Button","ButtonType","concatTestID","reportException","EntityButtons","entity","labels","testID","buttons","label","visitWebsite","url","website","termsAndServices","termsUrl","privacyPolicy","privacyUrl","filter","btn","Boolean","openURL","catch","e","createElement","style","styles","map","testIdSuffix","key","title","onPress","urlButton","type","SmallTech","create","paddingBottom","paddingHorizontal","borderRadius","borderWidth","marginTop"],"sources":["EntityButtons.tsx"],"sourcesContent":["import { GetTrustEntityResponseBindingDto } from '@procivis/react-native-one-core';\nimport React, { FC, memo, useCallback, useMemo } from 'react';\nimport { Linking, StyleSheet, View } from 'react-native';\n\nimport { Button, ButtonType } from '../../ui-components/buttons';\nimport { EntityLabels } from '../../ui-components/screens/nerd-mode-screen';\nimport { concatTestID, reportException } from '../../utils';\n\nexport interface EntityButton {\n url: string;\n label: string;\n}\n\ninterface EntityButtonsProps {\n entity?: GetTrustEntityResponseBindingDto;\n labels: EntityLabels;\n testID?: string;\n}\n\nconst EntityButtons: FC<EntityButtonsProps> = ({ entity, labels, testID }) => {\n const buttons = useMemo(\n () =>\n [\n {\n label: labels.visitWebsite,\n url: entity?.website || '',\n testID: 'website',\n },\n {\n label: labels.termsAndServices,\n url: entity?.termsUrl || '',\n testID: 'termsOfService',\n },\n {\n label: labels.privacyPolicy,\n url: entity?.privacyUrl || '',\n testID: 'privacyPolicy',\n },\n ].filter((btn) => Boolean(btn.url)),\n [entity, labels],\n );\n\n const openURL = useCallback(\n (url: string) => () => {\n Linking.openURL(url).catch((e) => {\n reportException(e, 'Error opening entity link');\n });\n },\n [],\n );\n return (\n <View style={[styles.buttons]} testID={testID}>\n {buttons.map(({ label, url, testID: testIdSuffix }) => (\n <Button\n key={label}\n title={label}\n onPress={openURL(url)}\n style={styles.urlButton}\n testID={concatTestID(testID, testIdSuffix)}\n type={ButtonType.SmallTech}\n />\n ))}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n buttons: {\n paddingBottom: 10,\n paddingHorizontal: 12,\n },\n urlButton: {\n borderRadius: 4,\n borderWidth: 0,\n marginTop: 4,\n },\n});\n\nexport default memo(EntityButtons);\n"],"mappings":"AACA,OAAOA,KAAK,IAAQC,IAAI,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC7D,SAASC,OAAO,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAExD,SAASC,MAAM,EAAEC,UAAU,QAAQ,6BAA6B;AAEhE,SAASC,YAAY,EAAEC,eAAe,QAAQ,aAAa;AAa3D,MAAMC,aAAqC,GAAGA,CAAC;EAAEC,MAAM;EAAEC,MAAM;EAAEC;AAAO,CAAC,KAAK;EAC5E,MAAMC,OAAO,GAAGZ,OAAO,CACrB,MACE,CACE;IACEa,KAAK,EAAEH,MAAM,CAACI,YAAY;IAC1BC,GAAG,EAAE,CAAAN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEO,OAAO,KAAI,EAAE;IAC1BL,MAAM,EAAE;EACV,CAAC,EACD;IACEE,KAAK,EAAEH,MAAM,CAACO,gBAAgB;IAC9BF,GAAG,EAAE,CAAAN,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAES,QAAQ,K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L,SAAS,EAAE;IACTM,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdC,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,4BAAe7C,IAAI,CAACU,aAAa,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","memo","StyleSheet","View","NerdModeItem","EntityType","addElementIf","EntityAttributes","certificate","did","trustEntity","trusted","labels","entityType","testID","onCopyToClipboard","_did$split","didSections","split","identifier","pop","didMethod","length","join","attributes","attributeKey","trustRegistry","highlightedText","trustAnchor","name","Boolean","CredentialEntity","issuerIdentifier","entityIdentifier","attributeText","canBeCopied","role","createElement","style","styles","wrapper","map","attribute","_extends","key","create","marginBottom"],"sources":["entity-attributes.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["React","memo","StyleSheet","View","NerdModeItem","EntityType","addElementIf","EntityAttributes","certificate","did","trustEntity","trusted","labels","entityType","testID","onCopyToClipboard","_did$split","didSections","split","identifier","pop","didMethod","length","join","attributes","attributeKey","trustRegistry","highlightedText","trustAnchor","name","Boolean","CredentialEntity","issuerIdentifier","entityIdentifier","attributeText","canBeCopied","role","createElement","style","styles","wrapper","map","attribute","_extends","key","create","marginBottom"],"sources":["entity-attributes.tsx"],"sourcesContent":["import { GetTrustEntityResponseBindingDto } from '@procivis/react-native-one-core';\nimport React, { FC, memo } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { NerdModeItem } from '../../ui-components/nerd-view';\nimport { AttributesLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';\nimport { addElementIf } from '../../utils/array';\n\ninterface EntityAttributesProps {\n certificate?: string;\n did?: string;\n trustEntity?: GetTrustEntityResponseBindingDto;\n trusted: boolean;\n labels: AttributesLabels;\n onCopyToClipboard: (value: string) => void;\n entityType: EntityType;\n testID?: string;\n}\n\nconst EntityAttributes: FC<EntityAttributesProps> = ({\n certificate,\n did,\n trustEntity,\n trusted,\n labels,\n entityType,\n testID,\n onCopyToClipboard,\n}) => {\n const didSections = did?.split(':') ?? [];\n const identifier = didSections.pop();\n const didMethod = didSections.length ? didSections.join(':') + ':' : '';\n\n const attributes = [\n ...addElementIf(trusted, {\n attributeKey: labels.trustRegistry,\n highlightedText: trustEntity?.trustAnchor.name,\n testID: 'trustRegistry',\n }),\n ...addElementIf(Boolean(did), {\n attributeKey: entityType === EntityType.CredentialEntity ? labels.issuerIdentifier : labels.entityIdentifier,\n attributeText: identifier,\n canBeCopied: true,\n highlightedText: didMethod,\n testID: 'issuerDID',\n }),\n ...addElementIf(Boolean(certificate), {\n attributeKey: entityType === EntityType.CredentialEntity ? labels.issuerIdentifier : labels.entityIdentifier,\n attributeText: certificate,\n canBeCopied: true,\n testID: 'issuerCertificate',\n }),\n ...addElementIf(trusted && Boolean(trustEntity?.role), {\n attributeKey: labels.role,\n highlightedText: trustEntity?.role,\n testID: 'role',\n }),\n ];\n return (\n <View style={styles.wrapper}>\n {attributes.map((attribute) => (\n <NerdModeItem\n key={attribute.attributeKey}\n {...attribute}\n labels={labels}\n onCopyToClipboard={onCopyToClipboard}\n testID={testID}\n />\n ))}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n wrapper: {\n marginBottom: 20,\n },\n});\n\nexport default memo(EntityAttributes);\n"],"mappings":";AACA,OAAOA,KAAK,IAAQC,IAAI,QAAQ,OAAO;AACvC,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,YAAY,QAAQ,+BAA+B;AAC5D,SAA2BC,UAAU,QAAQ,8CAA8C;AAC3F,SAASC,YAAY,QAAQ,mBAAmB;AAahD,MAAMC,gBAA2C,GAAGA,CAAC;EACnDC,WAAW;EACXC,GAAG;EACHC,WAAW;EACXC,OAAO;EACPC,MAAM;EACNC,UAAU;EACVC,MAAM;EACNC;AACF,CAAC,KAAK;EAAA,IAAAC,UAAA;EACJ,MAAMC,WAAW,IAAAD,UAAA,GAAGP,GAAG,aAAHA,GAAG,uBAAHA,G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AAW,CAAE0B,IAAI;IAClCtB,MAAM,EAAE;EACV,CAAC,CAAC,CACH;EACD,oBACEd,KAAA,CAAAqC,aAAA,CAAClC,IAAI;IAACmC,KAAK,EAAEC,MAAM,CAACC;EAAQ,GACzBhB,UAAU,CAACiB,GAAG,CAAEC,SAAS,iBACxB1C,KAAA,CAAAqC,aAAA,CAACjC,YAAY,EAAAuC,QAAA;IACXC,GAAG,EAAEF,SAAS,CAACjB;EAAa,GACxBiB,SAAS;IACb9B,MAAM,EAAEA,MAAO;IACfG,iBAAiB,EAAEA,iBAAkB;IACrCD,MAAM,EAAEA;EAAO,EAChB,CACF,CACG,CAAC;AAEX,CAAC;AAED,MAAMyB,MAAM,GAAGrC,UAAU,CAAC2C,MAAM,CAAC;EAC/BL,OAAO,EAAE;IACPM,YAAY,EAAE;EAChB;AACF,CAAC,CAAC;AAEF,4BAAe7C,IAAI,CAACM,gBAAgB,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import {
|
|
2
|
+
import { TrustEntityRoleBindingEnum, TrustEntityStateBindingEnum } from '@procivis/react-native-one-core';
|
|
3
3
|
import React, { memo } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { useAppColorScheme } from '../../ui-components/theme/color-scheme-context';
|
|
@@ -27,7 +27,7 @@ const EntityDetailsWithButtons = ({
|
|
|
27
27
|
} = useIdentifierDetails(identifier === null || identifier === void 0 ? void 0 : identifier.id);
|
|
28
28
|
const trustEntity = data !== null && data !== void 0 ? data : undefined;
|
|
29
29
|
const colorScheme = useAppColorScheme();
|
|
30
|
-
const trusted = Boolean(trustEntity && trustEntity.state ===
|
|
30
|
+
const trusted = Boolean(trustEntity && trustEntity.state === TrustEntityStateBindingEnum.ACTIVE && (trustEntity.role === TrustEntityRoleBindingEnum.BOTH || trustEntity.role === role));
|
|
31
31
|
return /*#__PURE__*/React.createElement(View, {
|
|
32
32
|
style: {
|
|
33
33
|
backgroundColor: colorScheme.nerdView.background
|
|
@@ -35,7 +35,7 @@ const EntityDetailsWithButtons = ({
|
|
|
35
35
|
}, /*#__PURE__*/React.createElement(EntityDetails, _extends({
|
|
36
36
|
identifier: identifier,
|
|
37
37
|
labels: {
|
|
38
|
-
unknown: role ===
|
|
38
|
+
unknown: role === TrustEntityRoleBindingEnum.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier
|
|
39
39
|
},
|
|
40
40
|
role: role,
|
|
41
41
|
testID: testID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["TrustEntityRoleBindingEnum","TrustEntityStateBindingEnum","React","memo","View","useAppColorScheme","concatTestID","useIdentifierDetails","useTrustEntity","EntityAttributes","EntityDetails","EntityButtons","EntityDetailsWithButtons","identifier","entityLabels","attributesLabels","onCopyToClipboard","role","entityType","testID","props","_identifierDetail$cer","_identifierDetail$did","data","id","identifierDetail","trustEntity","undefined","colorScheme","trusted","Boolean","state","ACTIVE","BOTH","createElement","style","backgroundColor","nerdView","background","_extends","labels","unknown","ISSUER","unknownIssuer","unknownVerifier","entity","certificate","certificates","chain","did"],"sources":["entity-details-with-buttons.tsx"],"sourcesContent":["import {\n GetIdentifierListItemBindingDto,\n TrustEntityRoleBindingEnum,\n TrustEntityStateBindingEnum,\n} from '@procivis/react-native-one-core';\nimport React, { FC, memo } from 'react';\nimport { StyleProp, View, ViewStyle } from 'react-native';\n\nimport { AttributesLabels, EntityLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';\nimport { useAppColorScheme } from '../../ui-components/theme/color-scheme-context';\nimport { concatTestID, useIdentifierDetails } from '../../utils';\nimport { useTrustEntity } from '../../utils/hooks/core/trust-entity';\nimport EntityAttributes from './entity-attributes';\nimport EntityDetails from './entity-details';\nimport EntityButtons from './EntityButtons';\n\nexport type ContextRole = Exclude<TrustEntityRoleBindingEnum, TrustEntityRoleBindingEnum.BOTH>;\n\ninterface EntityDetailsWithButtonsProps {\n identifier?: GetIdentifierListItemBindingDto;\n entityLabels: EntityLabels;\n attributesLabels: AttributesLabels;\n style?: StyleProp<ViewStyle>;\n textColor?: string;\n testID?: string;\n role: ContextRole;\n onCopyToClipboard: (value: string) => void;\n entityType: EntityType;\n}\n\nconst EntityDetailsWithButtons: FC<EntityDetailsWithButtonsProps> = ({\n identifier,\n entityLabels,\n attributesLabels,\n onCopyToClipboard,\n role,\n entityType,\n testID,\n ...props\n}) => {\n let { data } = useTrustEntity(identifier?.id);\n let { data: identifierDetail } = useIdentifierDetails(identifier?.id);\n const trustEntity = data ?? undefined;\n\n const colorScheme = useAppColorScheme();\n\n const trusted = Boolean(\n trustEntity &&\n trustEntity.state === TrustEntityStateBindingEnum.ACTIVE &&\n (trustEntity.role === TrustEntityRoleBindingEnum.BOTH || trustEntity.role === role),\n );\n\n return (\n <View style={{ backgroundColor: colorScheme.nerdView.background }}>\n <EntityDetails\n identifier={identifier}\n labels={{\n unknown:\n role === TrustEntityRoleBindingEnum.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier,\n }}\n role={role}\n testID={testID}\n {...props}\n />\n {trusted && <EntityButtons entity={trustEntity} labels={entityLabels} testID={concatTestID(testID, 'links')} />}\n <EntityAttributes\n certificate={identifierDetail?.certificates?.[0]?.chain}\n did={identifierDetail?.did?.did}\n trustEntity={trustEntity}\n trusted={trusted}\n labels={attributesLabels}\n onCopyToClipboard={onCopyToClipboard}\n entityType={entityType}\n testID={testID}\n />\n </View>\n );\n};\n\nexport default memo(EntityDetailsWithButtons);\n"],"mappings":";AAAA,SAEEA,0BAA0B,EAC1BC,2BAA2B,QACtB,iCAAiC;AACxC,OAAOC,KAAK,IAAQC,IAAI,QAAQ,OAAO;AACvC,SAAoBC,I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LxB,IAAI,KAAKjB,0BAA0B,CAAC0C,MAAM,GAAG5B,YAAY,CAAC6B,aAAa,GAAG7B,YAAY,CAAC8B;IAC3F,CAAE;IACF3B,IAAI,EAAEA,IAAK;IACXE,MAAM,EAAEA;EAAO,GACXC,KAAK,CACV,CAAC,EACDS,OAAO,iBAAI3B,KAAA,CAAAgC,aAAA,CAACvB,aAAa;IAACkC,MAAM,EAAEnB,WAAY;IAACc,MAAM,EAAE1B,YAAa;IAACK,MAAM,EAAEb,YAAY,CAACa,MAAM,EAAE,OAAO;EAAE,CAAE,CAAC,eAC/GjB,KAAA,CAAAgC,aAAA,CAACzB,gBAAgB;IACfqC,WAAW,EAAErB,gBAAgB,aAAhBA,gBAAgB,gBAAAJ,qBAAA,GAAhBI,gBAAgB,CAAEsB,YAAY,cAAA1B,qBAAA,gBAAAA,qBAAA,GAA9BA,qBAAA,CAAiC,CAAC,CAAC,cAAAA,qBAAA,uBAAnCA,qBAAA,CAAqC2B,KAAM;IACxDC,GAAG,EAAExB,gBAAgB,aAAhBA,gBAAgB,gBAAAH,qBAAA,GAAhBG,gBAAgB,CAAEwB,GAAG,cAAA3B,qBAAA,uBAArBA,qBAAA,CAAuB2B,GAAI;IAChCvB,WAAW,EAAEA,WAAY;IACzBG,OAAO,EAAEA,OAAQ;IACjBW,MAAM,EAAEzB,gBAAiB;IACzBC,iBAAiB,EAAEA,iBAAkB;IACrCE,UAAU,EAAEA,UAAW;IACvBC,MAAM,EAAEA;EAAO,CAChB,CACG,CAAC;AAEX,CAAC;AAED,4BAAehB,IAAI,CAACS,wBAAwB,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IdentifierTypeBindingEnum, TrustEntityRoleBindingEnum, TrustEntityStateBindingEnum } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import EntityCluster from '../../ui-components/entity/entity-cluster';
|
|
4
4
|
import { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';
|
|
@@ -28,7 +28,7 @@ const EntityDetails = ({
|
|
|
28
28
|
data: identifierDetail,
|
|
29
29
|
isLoading: isLoadingIdentifier
|
|
30
30
|
} = useIdentifierDetails('identifier' in props ? (_props$identifier2 = props.identifier) === null || _props$identifier2 === void 0 ? void 0 : _props$identifier2.id : undefined);
|
|
31
|
-
const trusted = trustEntity && trustEntity.state ===
|
|
31
|
+
const trusted = trustEntity && trustEntity.state === TrustEntityStateBindingEnum.ACTIVE && (trustEntity.role === TrustEntityRoleBindingEnum.BOTH || trustEntity.role === role);
|
|
32
32
|
const isLoading = isLoadingIdentifier || isLoadingTrustEntity;
|
|
33
33
|
const avatarProps = useMemo(() => {
|
|
34
34
|
var _identifierDetail$cer, _getCertificateCommon;
|
|
@@ -40,7 +40,7 @@ const EntityDetails = ({
|
|
|
40
40
|
uri: trustEntity.logo
|
|
41
41
|
}
|
|
42
42
|
} : undefined;
|
|
43
|
-
const placeholderText = (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) ===
|
|
43
|
+
const placeholderText = (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === IdentifierTypeBindingEnum.CERTIFICATE && (_identifierDetail$cer = identifierDetail.certificates) !== null && _identifierDetail$cer !== void 0 && _identifierDetail$cer[0] ? (_getCertificateCommon = getCertificateCommonName(identifierDetail.certificates[0])) === null || _getCertificateCommon === void 0 ? void 0 : _getCertificateCommon.substring(0, 1) : 'D';
|
|
44
44
|
const statusIcon = trusted ? /*#__PURE__*/React.createElement(EntityTrustedIcon, {
|
|
45
45
|
testID: concatTestID(testID, 'statusIcon', 'trusted')
|
|
46
46
|
}) : /*#__PURE__*/React.createElement(EntityNotTrustedIcon, {
|
|
@@ -64,7 +64,7 @@ const EntityDetails = ({
|
|
|
64
64
|
if (isLoading) {
|
|
65
65
|
return '';
|
|
66
66
|
}
|
|
67
|
-
if ((identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) ===
|
|
67
|
+
if ((identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === IdentifierTypeBindingEnum.CERTIFICATE && (_identifierDetail$cer2 = identifierDetail.certificates) !== null && _identifierDetail$cer2 !== void 0 && _identifierDetail$cer2[0]) {
|
|
68
68
|
const commonName = getCertificateCommonName(identifierDetail.certificates[0]);
|
|
69
69
|
if (commonName) {
|
|
70
70
|
return commonName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["IdentifierTypeBindingEnum","TrustEntityRoleBindingEnum","TrustEntityStateBindingEnum","React","useMemo","EntityCluster","EntityNotTrustedIcon","EntityTrustedIcon","concatTestID","replaceBreakingHyphens","useIdentifierDetails","useTrustEntity","getCertificateCommonName","certificate","_certificate$x509Attr","x509Attributes","subject","split","find","s","startsWith","pop","EntityDetails","labels","renderMore","role","style","testID","sublineColor","textColor","props","_props$identifier","_props$identifier2","data","isLoading","isLoadingTrustEntity","identifier","id","undefined","trustEntity","entity","identifierDetail","isLoadingIdentifier","trusted","state","ACTIVE","BOTH","avatarProps","_identifierDetail$cer","_getCertificateCommon","avatar","type","logo","imageSource","uri","placeholderText","CERTIFICATE","certificates","substring","statusIcon","createElement","name","trustEntityName","_identifierDetail$cer2","_identifierDetail$did","commonName","did","unknown","Fragment","entityName"],"sources":["entity-details.tsx"],"sourcesContent":["import {\n CertificateResponseBindingDto,\n GetIdentifierListItemBindingDto,\n GetTrustEntityResponseBindingDto,\n IdentifierTypeBindingEnum,\n TrustEntityRoleBindingEnum,\n TrustEntityStateBindingEnum,\n} from '@procivis/react-native-one-core';\nimport React, { FC, ReactNode, useMemo } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\n\nimport { AvatarProps } from '../../ui-components';\nimport EntityCluster from '../../ui-components/entity/entity-cluster';\nimport { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';\nimport { concatTestID, replaceBreakingHyphens, useIdentifierDetails } from '../../utils';\nimport { useTrustEntity } from '../../utils/hooks/core/trust-entity';\n\nexport type EntityDetailsLabels = {\n unknown: string;\n};\n\nexport type EntityDetailsProps = {\n labels: EntityDetailsLabels;\n renderMore?: (trustEntity: GetTrustEntityResponseBindingDto) => ReactNode;\n role: Exclude<TrustEntityRoleBindingEnum, TrustEntityRoleBindingEnum.BOTH>;\n style?: StyleProp<ViewStyle>;\n sublineColor?: string;\n textColor?: string;\n testID?: string;\n} & (\n | {\n identifier?: GetIdentifierListItemBindingDto;\n }\n | {\n entity: GetTrustEntityResponseBindingDto;\n }\n);\n\nconst getCertificateCommonName = (certificate: CertificateResponseBindingDto): string | undefined => {\n return certificate.x509Attributes.subject\n .split(', ')\n .find((s) => s.startsWith('CN'))\n ?.split('=')\n ?.pop();\n};\n\nconst EntityDetails: FC<EntityDetailsProps> = ({\n labels,\n renderMore,\n role,\n style,\n testID,\n sublineColor,\n textColor,\n ...props\n}) => {\n const { data, isLoading: isLoadingTrustEntity } = useTrustEntity(\n 'identifier' in props ? props.identifier?.id : undefined,\n );\n const trustEntity: GetTrustEntityResponseBindingDto | undefined =\n 'entity' in props ? props.entity : data ?? undefined;\n const { data: identifierDetail, isLoading: isLoadingIdentifier } = useIdentifierDetails(\n 'identifier' in props ? props.identifier?.id : undefined,\n );\n\n const trusted =\n trustEntity &&\n trustEntity.state === TrustEntityStateBindingEnum.ACTIVE &&\n (trustEntity.role === TrustEntityRoleBindingEnum.BOTH || trustEntity.role === role);\n\n const isLoading = isLoadingIdentifier || isLoadingTrustEntity;\n\n const avatarProps: AvatarProps | undefined = useMemo(() => {\n if (isLoading) {\n return undefined;\n }\n\n const avatar =\n trusted && identifierDetail?.type === 'DID' && trustEntity.logo\n ? { imageSource: { uri: trustEntity.logo } }\n : undefined;\n\n const placeholderText =\n identifierDetail?.type === IdentifierTypeBindingEnum.CERTIFICATE && identifierDetail.certificates?.[0]\n ? getCertificateCommonName(identifierDetail.certificates[0])?.substring(0, 1)\n : 'D';\n\n const statusIcon = trusted ? (\n <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />\n ) : (\n <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />\n );\n\n if (trustEntity) {\n return {\n avatar,\n placeholderText:\n trusted && identifierDetail?.type === 'DID' ? trustEntity.name.substring(0, 1) : placeholderText,\n statusIcon,\n testID: concatTestID(testID, 'avatar'),\n };\n }\n\n return {\n placeholderText,\n statusIcon,\n };\n }, [trustEntity, trusted, identifierDetail, isLoading, testID]);\n\n const trustEntityName = useMemo(() => {\n if (isLoading) {\n return '';\n }\n if (identifierDetail?.type === IdentifierTypeBindingEnum.CERTIFICATE && identifierDetail.certificates?.[0]) {\n const commonName = getCertificateCommonName(identifierDetail.certificates[0]);\n if (commonName) {\n return commonName;\n }\n }\n if (trustEntity) {\n return trustEntity.name;\n }\n if (identifierDetail?.did?.did) {\n return replaceBreakingHyphens(identifierDetail.did.did);\n }\n\n return labels.unknown;\n }, [labels.unknown, trustEntity, identifierDetail, isLoading]);\n\n return (\n <>\n <EntityCluster\n avatar={avatarProps}\n entityName={trustEntityName}\n style={style}\n testID={testID}\n textColor={textColor}\n sublineColor={sublineColor}\n isLoading={isLoading}\n />\n {trustEntity && renderMore && renderMore(trustEntity)}\n </>\n );\n};\n\nexport default EntityDetails;\n"],"mappings":"AAAA,SAIEA,yBAAyB,EACzBC,0BAA0B,EAC1BC,2BAA2B,QACtB,iCAAiC;AACxC,OAAOC,KAAK,IAAmBC,OAAO,QAAQ,OAAO;AAIrD,OAAOC,aAAa,MAAM,2CAA2C;AACrE,SAASC,oBAAoB,EAAEC,iBAAiB,QAAQ,2BAA2B;AACnF,SAASC,YAAY,EAAEC,sBAAsB,EAAEC,oBAAoB,QAAQ,aAAa;AACxF,SAASC,cAAc,QAAQ,qCAAqC;AAuBpE,MAAMC,wBAAwB,GAAIC,WAA0C,IAAyB;EAAA,IAAAC,qBAAA;EACnG,QAAAA,qBAAA,GAAOD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CAAAzD,KAAA,CAAAiE,QAAA,qBACEjE,KAAA,CAAAyD,aAAA,CAACvD,aAAa;IACZ6C,MAAM,EAAEH,WAAY;IACpBsB,UAAU,EAAEP,eAAgB;IAC5BpC,KAAK,EAAEA,KAAM;IACbC,MAAM,EAAEA,MAAO;IACfE,SAAS,EAAEA,SAAU;IACrBD,YAAY,EAAEA,YAAa;IAC3BM,SAAS,EAAEA;EAAU,CACtB,CAAC,EACDK,WAAW,IAAIf,UAAU,IAAIA,UAAU,CAACe,WAAW,CACpD,CAAC;AAEP,CAAC;AAED,eAAejB,aAAa","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryActionBindingEnum } from '@procivis/react-native-one-core';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useAppColorScheme } from '../../ui-components';
|
|
4
4
|
import { HistoryDetailsView } from '../../ui-components/history/history-details';
|
|
@@ -6,17 +6,17 @@ import { capitalizeFirstLetter, concatTestID, formatDateTimeLocalized } from '..
|
|
|
6
6
|
import { getHistoryItemActionIcon } from './history-list-item-icon';
|
|
7
7
|
const getStatusTextColor = (action, colorScheme) => {
|
|
8
8
|
switch (action) {
|
|
9
|
-
case
|
|
10
|
-
case
|
|
11
|
-
case
|
|
12
|
-
case
|
|
13
|
-
case
|
|
14
|
-
case
|
|
9
|
+
case HistoryActionBindingEnum.CLAIMS_REMOVED:
|
|
10
|
+
case HistoryActionBindingEnum.DEACTIVATED:
|
|
11
|
+
case HistoryActionBindingEnum.DELETED:
|
|
12
|
+
case HistoryActionBindingEnum.REJECTED:
|
|
13
|
+
case HistoryActionBindingEnum.REVOKED:
|
|
14
|
+
case HistoryActionBindingEnum.ERRORED:
|
|
15
15
|
return colorScheme.errorText;
|
|
16
|
-
case
|
|
17
|
-
case
|
|
18
|
-
case
|
|
19
|
-
case
|
|
16
|
+
case HistoryActionBindingEnum.SUSPENDED:
|
|
17
|
+
case HistoryActionBindingEnum.OFFERED:
|
|
18
|
+
case HistoryActionBindingEnum.PENDING:
|
|
19
|
+
case HistoryActionBindingEnum.REQUESTED:
|
|
20
20
|
return colorScheme.text;
|
|
21
21
|
default:
|
|
22
22
|
return colorScheme.successText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["HistoryActionBindingEnum","React","useAppColorScheme","HistoryDetailsView","capitalizeFirstLetter","concatTestID","formatDateTimeLocalized","getHistoryItemActionIcon","getStatusTextColor","action","colorScheme","CLAIMS_REMOVED","DEACTIVATED","DELETED","REJECTED","REVOKED","ERRORED","errorText","SUSPENDED","OFFERED","PENDING","REQUESTED","text","successText","HistoryDetailsScreen","assets","dataHeader","headerButton","item","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_formatDateTimeLocali","actionValueColor","createElement","data","header","date","Date","createdDate","icon","label","actions","color"],"sources":["history-details-screen.tsx"],"sourcesContent":["import { HistoryActionBindingEnum, HistoryListItemBindingDto } from '@procivis/react-native-one-core';\nimport React, { FC, ReactElement } from 'react';\nimport { ImageSourcePropType } from 'react-native';\n\nimport { ColorScheme, useAppColorScheme } from '../../ui-components';\nimport {\n HistoryDetailsLabels,\n HistoryDetailsView,\n HistoryDetailsViewProps,\n} from '../../ui-components/history/history-details';\nimport { capitalizeFirstLetter, concatTestID, formatDateTimeLocalized } from '../../utils';\nimport { HistoryListItemLabels } from './history-list-item';\nimport { getHistoryItemActionIcon } from './history-list-item-icon';\n\nconst getStatusTextColor = (action: HistoryActionBindingEnum, colorScheme: Readonly<ColorScheme>) => {\n switch (action) {\n case HistoryActionBindingEnum.CLAIMS_REMOVED:\n case HistoryActionBindingEnum.DEACTIVATED:\n case HistoryActionBindingEnum.DELETED:\n case HistoryActionBindingEnum.REJECTED:\n case HistoryActionBindingEnum.REVOKED:\n case HistoryActionBindingEnum.ERRORED:\n return colorScheme.errorText;\n case HistoryActionBindingEnum.SUSPENDED:\n case HistoryActionBindingEnum.OFFERED:\n case HistoryActionBindingEnum.PENDING:\n case HistoryActionBindingEnum.REQUESTED:\n return colorScheme.text;\n default:\n return colorScheme.successText;\n }\n};\n\nexport type HistoryDetailsScreenLabels = HistoryDetailsLabels & {\n item: HistoryListItemLabels;\n};\n\nexport type HistoryDetailsScreenProps = {\n assets: HistoryDetailsViewProps['assets'];\n dataHeader: HistoryDetailsViewProps['data']['header'];\n headerButton?: ReactElement;\n item: HistoryListItemBindingDto;\n labels: HistoryDetailsScreenLabels;\n onBackPressed: () => void;\n onInfoPressed?: () => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n testID?: string;\n};\n\nexport const HistoryDetailsScreen: FC<HistoryDetailsScreenProps> = ({\n assets,\n dataHeader,\n headerButton,\n item,\n labels,\n onBackPressed,\n onInfoPressed,\n onImagePreview,\n testID = 'HistoryDetailScreen',\n}) => {\n const colorScheme = useAppColorScheme();\n\n const actionValueColor = getStatusTextColor(item.action, colorScheme);\n\n return (\n <HistoryDetailsView\n assets={assets}\n data={{\n header: dataHeader,\n date: formatDateTimeLocalized(new Date(item.createdDate)) ?? '',\n action: {\n icon: getHistoryItemActionIcon(item.action),\n label: capitalizeFirstLetter(labels.item.actions[item.action]),\n color: actionValueColor,\n testID: concatTestID(testID, 'action', item.action),\n },\n }}\n headerButton={headerButton}\n labels={labels}\n onBackPressed={onBackPressed}\n onInfoPressed={onInfoPressed}\n onImagePreview={onImagePreview}\n testID={testID}\n />\n );\n};\n"],"mappings":"AAAA,SAASA,wBAAwB,QAAmC,iCAAiC;AACrG,OAAOC,KAAK,MAA4B,OAAO;AAG/C,SAAsBC,iBAAiB,QAAQ,qBAAqB;AACpE,SAEEC,kBAAkB,QAEb,6CAA6C;AACpD,SAASC,qBAAqB,EAAEC,YAAY,EAAEC,uBAAuB,QAAQ,aAAa;AAE1F,SAASC,wBAAwB,QAAQ,0BAA0B;AAEnE,MAAMC,kBAAkB,GAAGA,CAACC,MAAgC,EAAEC,WAAkC,KAAK;EACnG,QAAQD,MAAM;IACZ,K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AM,CAAC,CAAC;QAC9DoC,KAAK,EAAEV,gBAAgB;QACvBF,MAAM,EAAE5B,YAAY,CAAC4B,MAAM,EAAE,QAAQ,EAAEL,IAAI,CAACnB,MAAM;MACpD;IACF,CAAE;IACFkB,YAAY,EAAEA,YAAa;IAC3BE,MAAM,EAAEA,MAAO;IACfC,aAAa,EAAEA,aAAc;IAC7BC,aAAa,EAAEA,aAAc;IAC7BC,cAAc,EAAEA,cAAe;IAC/BC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryActionBindingEnum, HistoryEntityTypeBindingEnum } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { HistoryBackupCreatedIcon, HistoryBackupRestoredIcon, HistoryCertificateIcon, HistoryCredentialIcon, HistoryDidIcon, HistoryIdentifierIcon, HistoryIssueIcon, HistoryItemIcon, HistoryKeyIcon, HistoryOrganisationIcon, HistoryProofRequestIcon, HistoryRevokeIcon, HistorySchemaIcon, HistoryStatusAcceptedIcon, HistoryStatusDeleteIcon, HistoryStatusErrorIcon, HistoryStatusSuspendIcon, HistorySuspendIcon, HistoryTrustAnchorIcon, HistoryTrustedEntityIcon } from '../../ui-components';
|
|
4
4
|
const defaultIcons = {
|
|
@@ -28,7 +28,10 @@ const defaultIcons = {
|
|
|
28
28
|
CSR_GENERATED: HistoryStatusAcceptedIcon,
|
|
29
29
|
EXPIRED: HistoryStatusErrorIcon,
|
|
30
30
|
INTERACTION_CREATED: HistoryStatusAcceptedIcon,
|
|
31
|
-
INTERACTION_ERRORED: HistoryStatusErrorIcon
|
|
31
|
+
INTERACTION_ERRORED: HistoryStatusErrorIcon,
|
|
32
|
+
INTERACTION_EXPIRED: HistoryStatusErrorIcon,
|
|
33
|
+
REGISTRATION_CERTIFICATE_CREATED: HistoryStatusAcceptedIcon,
|
|
34
|
+
REGISTRATION_CERTIFICATE_REVOKED: HistoryStatusErrorIcon
|
|
32
35
|
},
|
|
33
36
|
entityTypes: {
|
|
34
37
|
BACKUP: HistoryRevokeIcon,
|
|
@@ -50,7 +53,8 @@ const defaultIcons = {
|
|
|
50
53
|
STS_ROLE: HistoryIdentifierIcon,
|
|
51
54
|
STS_ORGANISATION: HistoryOrganisationIcon,
|
|
52
55
|
STS_IAM_ROLE: HistoryIdentifierIcon,
|
|
53
|
-
STS_TOKEN: HistoryKeyIcon
|
|
56
|
+
STS_TOKEN: HistoryKeyIcon,
|
|
57
|
+
SIGNATURE: HistoryCertificateIcon
|
|
54
58
|
}
|
|
55
59
|
};
|
|
56
60
|
export const getHistoryItemActionIcon = action => {
|
|
@@ -64,21 +68,21 @@ export const HistoryListItemIcon = ({
|
|
|
64
68
|
const typeIcon = useMemo(() => {
|
|
65
69
|
var _defaultIcons$entityT;
|
|
66
70
|
switch (item.entityType) {
|
|
67
|
-
case
|
|
71
|
+
case HistoryEntityTypeBindingEnum.BACKUP:
|
|
68
72
|
switch (item.action) {
|
|
69
|
-
case
|
|
73
|
+
case HistoryActionBindingEnum.CREATED:
|
|
70
74
|
return HistoryBackupCreatedIcon;
|
|
71
|
-
case
|
|
75
|
+
case HistoryActionBindingEnum.RESTORED:
|
|
72
76
|
return HistoryBackupRestoredIcon;
|
|
73
77
|
default:
|
|
74
78
|
break;
|
|
75
79
|
}
|
|
76
80
|
break;
|
|
77
|
-
case
|
|
81
|
+
case HistoryEntityTypeBindingEnum.CREDENTIAL:
|
|
78
82
|
switch (item.action) {
|
|
79
|
-
case
|
|
83
|
+
case HistoryActionBindingEnum.REVOKED:
|
|
80
84
|
return HistoryRevokeIcon;
|
|
81
|
-
case
|
|
85
|
+
case HistoryActionBindingEnum.SUSPENDED:
|
|
82
86
|
return HistorySuspendIcon;
|
|
83
87
|
default:
|
|
84
88
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["HistoryActionBindingEnum","HistoryEntityTypeBindingEnum","React","useMemo","HistoryBackupCreatedIcon","HistoryBackupRestoredIcon","HistoryCertificateIcon","HistoryCredentialIcon","HistoryDidIcon","HistoryIdentifierIcon","HistoryIssueIcon","HistoryItemIcon","HistoryKeyIcon","HistoryOrganisationIcon","HistoryProofRequestIcon","HistoryRevokeIcon","HistorySchemaIcon","HistoryStatusAcceptedIcon","HistoryStatusDeleteIcon","HistoryStatusErrorIcon","HistoryStatusSuspendIcon","HistorySuspendIcon","HistoryTrustAnchorIcon","HistoryTrustedEntityIcon","defaultIcons","actions","ACCEPTED","ACTIVATED","CLAIMS_REMOVED","CREATED","DEACTIVATED","DELETED","ERRORED","IMPORTED","ISSUED","OFFERED","PENDING","REJECTED","REMOVED","REQUESTED","RESTORED","RETRACTED","REVOKED","SHARED","SUSPENDED","UPDATED","WITHDRAWN","REACTIVATED","CSR_GENERATED","EXPIRED","INTERACTION_CREATED","INTERACTION_ERRORED","INTERACTION_EXPIRED","REGISTRATION_CERTIFICATE_CREATED","REGISTRATION_CERTIFICATE_REVOKED","entityTypes","BACKUP","CERTIFICATE","CREDENTIAL","CREDENTIAL_SCHEMA","DID","IDENTIFIER","KEY","ORGANISATION","PROOF","PROOF_SCHEMA","TRUST_ANCHOR","TRUST_ENTITY","WALLET_UNIT","WALLET_RELYING_PARTY","USER","PROVIDER","STS_ROLE","STS_ORGANISATION","STS_IAM_ROLE","STS_TOKEN","SIGNATURE","getHistoryItemActionIcon","action","_defaultIcons$actions","HistoryListItemIcon","item","statusIcon","typeIcon","_defaultIcons$entityT","entityType","createElement","StatusIcon","TypeIcon"],"sources":["history-list-item-icon.tsx"],"sourcesContent":["import {\n HistoryActionBindingEnum,\n HistoryEntityTypeBindingEnum,\n HistoryListItemBindingDto,\n} from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { SvgProps } from 'react-native-svg';\n\nimport {\n HistoryBackupCreatedIcon,\n HistoryBackupRestoredIcon,\n HistoryCertificateIcon,\n HistoryCredentialIcon,\n HistoryDidIcon,\n HistoryIdentifierIcon,\n HistoryIssueIcon,\n HistoryItemIcon,\n HistoryKeyIcon,\n HistoryOrganisationIcon,\n HistoryProofRequestIcon,\n HistoryRevokeIcon,\n HistorySchemaIcon,\n HistoryStatusAcceptedIcon,\n HistoryStatusDeleteIcon,\n HistoryStatusErrorIcon,\n HistoryStatusSuspendIcon,\n HistorySuspendIcon,\n HistoryTrustAnchorIcon,\n HistoryTrustedEntityIcon,\n} from '../../ui-components';\n\nconst defaultIcons: {\n actions: { [key in keyof typeof HistoryActionBindingEnum]: FC<SvgProps> };\n entityTypes: { [key in keyof typeof HistoryEntityTypeBindingEnum]: FC<SvgProps> };\n} = {\n actions: {\n ACCEPTED: HistoryStatusAcceptedIcon,\n ACTIVATED: HistoryStatusAcceptedIcon,\n CLAIMS_REMOVED: HistoryStatusDeleteIcon,\n CREATED: HistoryStatusAcceptedIcon,\n DEACTIVATED: HistoryStatusErrorIcon,\n DELETED: HistoryStatusDeleteIcon,\n ERRORED: HistoryStatusErrorIcon,\n IMPORTED: HistoryStatusAcceptedIcon,\n ISSUED: HistoryStatusAcceptedIcon,\n OFFERED: HistoryStatusAcceptedIcon,\n PENDING: HistoryStatusAcceptedIcon,\n REJECTED: HistoryStatusErrorIcon,\n REMOVED: HistoryStatusDeleteIcon,\n REQUESTED: HistoryStatusAcceptedIcon,\n RESTORED: HistoryStatusAcceptedIcon,\n RETRACTED: HistoryStatusErrorIcon,\n REVOKED: HistoryStatusErrorIcon,\n SHARED: HistoryStatusAcceptedIcon,\n SUSPENDED: HistoryStatusSuspendIcon,\n UPDATED: HistoryStatusAcceptedIcon,\n WITHDRAWN: HistoryStatusErrorIcon,\n REACTIVATED: HistoryStatusAcceptedIcon,\n CSR_GENERATED: HistoryStatusAcceptedIcon,\n EXPIRED: HistoryStatusErrorIcon,\n INTERACTION_CREATED: HistoryStatusAcceptedIcon,\n INTERACTION_ERRORED: HistoryStatusErrorIcon,\n INTERACTION_EXPIRED: HistoryStatusErrorIcon,\n REGISTRATION_CERTIFICATE_CREATED: HistoryStatusAcceptedIcon,\n REGISTRATION_CERTIFICATE_REVOKED: HistoryStatusErrorIcon,\n },\n entityTypes: {\n BACKUP: HistoryRevokeIcon,\n CERTIFICATE: HistoryCertificateIcon,\n CREDENTIAL: HistoryCredentialIcon,\n CREDENTIAL_SCHEMA: HistorySchemaIcon,\n DID: HistoryDidIcon,\n IDENTIFIER: HistoryIdentifierIcon,\n KEY: HistoryKeyIcon,\n ORGANISATION: HistoryOrganisationIcon,\n PROOF: HistoryProofRequestIcon,\n PROOF_SCHEMA: HistorySchemaIcon,\n TRUST_ANCHOR: HistoryTrustAnchorIcon,\n TRUST_ENTITY: HistoryTrustedEntityIcon,\n WALLET_UNIT: HistoryTrustedEntityIcon,\n WALLET_RELYING_PARTY: HistoryTrustedEntityIcon,\n USER: HistoryIdentifierIcon,\n PROVIDER: HistoryIdentifierIcon,\n STS_ROLE: HistoryIdentifierIcon,\n STS_ORGANISATION: HistoryOrganisationIcon,\n STS_IAM_ROLE: HistoryIdentifierIcon,\n STS_TOKEN: HistoryKeyIcon,\n SIGNATURE: HistoryCertificateIcon,\n },\n};\n\nexport const getHistoryItemActionIcon = (action: HistoryActionBindingEnum) => {\n return defaultIcons.actions[action] ?? HistoryStatusAcceptedIcon;\n};\n\nexport type HistoryListItemIconProps = {\n item: HistoryListItemBindingDto;\n};\n\nexport const HistoryListItemIcon: FC<HistoryListItemIconProps> = ({ item }) => {\n const statusIcon = getHistoryItemActionIcon(item.action);\n const typeIcon = useMemo(() => {\n switch (item.entityType) {\n case HistoryEntityTypeBindingEnum.BACKUP:\n switch (item.action) {\n case HistoryActionBindingEnum.CREATED:\n return HistoryBackupCreatedIcon;\n case HistoryActionBindingEnum.RESTORED:\n return HistoryBackupRestoredIcon;\n default:\n break;\n }\n break;\n case HistoryEntityTypeBindingEnum.CREDENTIAL:\n switch (item.action) {\n case HistoryActionBindingEnum.REVOKED:\n return HistoryRevokeIcon;\n case HistoryActionBindingEnum.SUSPENDED:\n return HistorySuspendIcon;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return defaultIcons.entityTypes[item.entityType] ?? HistoryIssueIcon;\n }, [item.action, item.entityType]);\n return <HistoryItemIcon StatusIcon={statusIcon} TypeIcon={typeIcon} />;\n};\n"],"mappings":"AAAA,SACEA,wBAAwB,EACxBC,4BAA4B,QAEvB,iCAAiC;AACxC,OAAOC,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAG1C,SACEC,wBAAwB,EACxBC,yBAAyB,EACzBC,sBAAsB,EACtBC,qBAAqB,EACrBC,cAAc,EACdC,qBAAqB,EACrBC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,uBAAuB,EACvBC,uBAAuB,EACvBC,iBAAiB,EACjBC,iBAAiB,EACjBC,yBAAyB,EACzBC,uBAAuB,EACvBC,sBAAsB,EACtBC,wBAAwB,EACxBC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,QACnB,qBAAqB;AAE5B,MAAMC,YAGL,GAAG;EACFC,OAAO,EAAE;IACPC,QAAQ,EAAET,yBAAyB;IACnCU,SAAS,EAAEV,yBAAyB;IACpCW,cAAc,EAAEV,uBAAuB;IACvCW,OAAO,EAAEZ,yBAAyB;IAClCa,WAAW,EAAEX,sBAAsB;IACnCY,OAAO,EAAEb,uBAAuB;IAChCc,OAAO,EAAEb,sBAAsB;IAC/Bc,QAAQ,EAAEhB,yBAAyB;IACnCiB,MAAM,EAAEjB,yBAAyB;IACjCkB,OAAO,EAAElB,yBAAyB;IAClCmB,OAAO,EAAEnB,yBAAyB;IAClCoB,QAAQ,EAAElB,sBAAsB;IAChCmB,OAAO,EAAEpB,uBAAuB;IAChCqB,SAAS,EAAEtB,yBAAyB;IACpCuB,QAAQ,EAAEvB,yBAAyB;IACnCwB,SAAS,EAAEtB,sBAAsB;IACjCuB,OAAO,EAAEvB,sBAAsB;IAC/BwB,MAAM,EAAE1B,yBA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AAyB;AAClE,CAAC;AAMD,OAAO,MAAM+D,mBAAiD,GAAGA,CAAC;EAAEC;AAAK,CAAC,KAAK;EAC7E,MAAMC,UAAU,GAAGL,wBAAwB,CAACI,IAAI,CAACH,MAAM,CAAC;EACxD,MAAMK,QAAQ,GAAGhF,OAAO,CAAC,MAAM;IAAA,IAAAiF,qBAAA;IAC7B,QAAQH,IAAI,CAACI,UAAU;MACrB,KAAKpF,4BAA4B,CAACuD,MAAM;QACtC,QAAQyB,IAAI,CAACH,MAAM;UACjB,KAAK9E,wBAAwB,CAAC6B,OAAO;YACnC,OAAOzB,wBAAwB;UACjC,KAAKJ,wBAAwB,CAACwC,QAAQ;YACpC,OAAOnC,yBAAyB;UAClC;YACE;QACJ;QACA;MACF,KAAKJ,4BAA4B,CAACyD,UAAU;QAC1C,QAAQuB,IAAI,CAACH,MAAM;UACjB,KAAK9E,wBAAwB,CAAC0C,OAAO;YACnC,OAAO3B,iBAAiB;UAC1B,KAAKf,wBAAwB,CAAC4C,SAAS;YACrC,OAAOvB,kBAAkB;UAC3B;YACE;QACJ;QACA;MACF;QACE;IACJ;IAEA,QAAA+D,qBAAA,GAAO5D,YAAY,CAAC+B,WAAW,CAAC0B,IAAI,CAACI,UAAU,CAAC,cAAAD,qBAAA,cAAAA,qBAAA,GAAI1E,gBAAgB;EACtE,CAAC,EAAE,CAACuE,IAAI,CAACH,MAAM,EAAEG,IAAI,CAACI,UAAU,CAAC,CAAC;EAClC,oBAAOnF,KAAA,CAAAoF,aAAA,CAAC3E,eAAe;IAAC4E,UAAU,EAAEL,UAAW;IAACM,QAAQ,EAAEL;EAAS,CAAE,CAAC;AACxE,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","HistoryItemView","formatTime","useTrustEntity","HistoryListItemIcon","HistoryListItemView","dateFormatter","first","infoLabelMode","item","labels","last","onPress","testID","_dateFormatter","identifierId","target","undefined","data","trustEntity","label","entityTypes","entityType","actions","action","info","name","icon","createElement","pressHandler","time","Date","createdDate"],"sources":["history-list-item.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","HistoryItemView","formatTime","useTrustEntity","HistoryListItemIcon","HistoryListItemView","dateFormatter","first","infoLabelMode","item","labels","last","onPress","testID","_dateFormatter","identifierId","target","undefined","data","trustEntity","label","entityTypes","entityType","actions","action","info","name","icon","createElement","pressHandler","time","Date","createdDate"],"sources":["history-list-item.tsx"],"sourcesContent":["import {\n HistoryActionBindingEnum,\n HistoryEntityTypeBindingEnum,\n HistoryListItemBindingDto,\n} from '@procivis/react-native-one-core';\nimport React, { FC, useCallback, useMemo } from 'react';\n\nimport { HistoryItemView } from '../../ui-components';\nimport { formatTime, useTrustEntity } from '../../utils';\nimport { HistoryListItemIcon } from './history-list-item-icon';\n\nexport type HistoryListItemLabels = {\n actions: { [key in keyof typeof HistoryActionBindingEnum]: string };\n entityTypes: { [key in keyof typeof HistoryEntityTypeBindingEnum]: string };\n};\n\nexport interface HistoryListItemViewProps {\n dateFormatter?: (date: Date) => string;\n first?: boolean;\n infoLabelMode?: 'entity' | 'associatedLabel' | 'none';\n item: HistoryListItemBindingDto;\n labels: HistoryListItemLabels;\n last?: boolean;\n onPress?: (item: HistoryListItemBindingDto) => void;\n testID?: string;\n}\n\nexport const HistoryListItemView: FC<HistoryListItemViewProps> = ({\n dateFormatter = formatTime,\n first,\n infoLabelMode = 'entity',\n item,\n labels,\n last,\n onPress,\n testID,\n}) => {\n const identifierId = infoLabelMode === 'entity' ? item.target : undefined;\n const { data: trustEntity } = useTrustEntity(identifierId);\n\n const label = `${labels.entityTypes[item.entityType]} ${labels.actions[item.action]}`;\n\n const info = useMemo(() => {\n switch (infoLabelMode) {\n case 'entity':\n return trustEntity?.name;\n case 'associatedLabel':\n return item.name;\n case 'none':\n return undefined;\n }\n }, [infoLabelMode, item, trustEntity]);\n\n const icon = <HistoryListItemIcon item={item} />;\n\n const pressHandler = useCallback(() => {\n onPress?.(item);\n }, [onPress, item]);\n\n return (\n <HistoryItemView\n first={first}\n icon={icon}\n info={info}\n label={label}\n last={last}\n onPress={pressHandler}\n testID={testID}\n time={dateFormatter(new Date(item.createdDate)) ?? ''}\n />\n );\n};\n"],"mappings":"AAKA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAEvD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,UAAU,EAAEC,cAAc,QAAQ,aAAa;AACxD,SAASC,mBAAmB,QAAQ,0BAA0B;AAkB9D,OAAO,MAAMC,mBAAiD,GAAGA,CAAC;EAChEC,aAAa,GAAGJ,UAAU;EAC1BK,KAAK;EACLC,aAAa,GAAG,QAAQ;EACxBC,IAAI;EACJC,MAAM;EACNC,IAAI;EACJC,OAAO;EACPC;AACF,CAAC,KAAK;EAAA,IAAAC,cAAA;EACJ,MAAMC,YAAY,GAAGP,aAAa,KAAK,QAAQ,GAAGC,IAAI,CAACO,MAAM,GAAGC,SAAS;EACzE,MAAM;IAAEC,IAAI,EAAEC;EAAY,CAAC,GAAGhB,cAAc,CAACY,YAAY,CAAC;EAE1D,MAAMK,KAAK,GAAG,GAAGV,MAAM,CAACW,WAAW,CAACZ,IAAI,CAACa,UAAU,CAAC,IAAIZ,MAAM,CAACa,OAAO,CAACd,IAAI,CAACe,MAAM,CAAC,EAAE;EAErF,MAAMC,IAAI,GAAGzB,OAAO,CAAC,MAAM;IACzB,QAAQQ,aAAa;MACnB,KAAK,QAAQ;QACX,OAAOW,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEO,IAAI;MAC1B,KAAK,iBAAiB;QACpB,OAAOjB,IAAI,CAACiB,IAAI;MAClB,KAAK,MAAM;QACT,OAAOT,SAAS;IACpB;EACF,CAAC,EAAE,CAACT,aAAa,EAAEC,IAAI,EAAEU,WAAW,CAAC,CAAC;EAEtC,MAAMQ,IAAI,gBAAG7B,KAAA,CAAA8B,aAAA,CAACxB,mBAAmB;IAACK,IAAI,EAAEA;EAAK,CAAE,CAAC;EAEhD,MAAMoB,YAAY,GAAG9B,WAAW,CAAC,MAAM;IACrCa,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAGH,IAAI,CAAC;EACjB,CAAC,EAAE,CAACG,OAAO,EAAEH,IAAI,CAAC,CAAC;EAEnB,oBACEX,KAAA,CAAA8B,aAAA,CAAC3B,eAAe;IACdM,KAAK,EAAEA,KAAM;IACboB,IAAI,EAAEA,IAAK;IACXF,IAAI,EAAEA,IAAK;IACXL,KAAK,EAAEA,KAAM;IACbT,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEiB,YAAa;IACtBhB,MAAM,EAAEA,MAAO;IACfiB,IAAI,GAAAhB,cAAA,GAAER,aAAa,CAAC,IAAIyB,IAAI,CAACtB,IAAI,CAACuB,WAAW,CAAC,CAAC,cAAAlB,cAAA,cAAAA,cAAA,GAAI;EAAG,CACvD,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["debounce","React","useEffect","useMemo","useState","Animated","StyleSheet","View","BackButton","FilterButton","FoldableHeader","NavigationHeader","Typography","useAppColorScheme","concatTestID","groupEntriesByDay","useListContentInset","HistoryListView","HistoryListScreen","children","groupItems","itemInfoLabelMode","labels","onBackPressed","onHistoryItemPressed","onOpenFilter","onSearchPhraseChange","queryParams","testID","_queryParams$search","colorScheme","empty","setEmpty","scrollOffset","Value","searchPhrase","setSearchPhrase","searchBarVisible","Boolean","search","text","handleSearchPhraseChange","undefined","headerHeight","insets","additionalBottomPadding","createElement","style","styles","container","backgroundColor","background","emptyNotice","white","marginTop","paddingTop","align","color","preset","emptyTitle","shaded","emptySubtitle","contentContainerStyle","itemProps","infoLabelMode","onPress","onEmpty","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","query","list","header","leftItem","title","searchBar","rightButtons","active","credentialSchemaId","rightButtonAlwaysVisible","searchBarProps","placeholder","staticHeader","create","flex","borderRadius","marginHorizontal","paddingBottom","paddingHorizontal","opacity"],"sources":["history-list-screen.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["debounce","React","useEffect","useMemo","useState","Animated","StyleSheet","View","BackButton","FilterButton","FoldableHeader","NavigationHeader","Typography","useAppColorScheme","concatTestID","groupEntriesByDay","useListContentInset","HistoryListView","HistoryListScreen","children","groupItems","itemInfoLabelMode","labels","onBackPressed","onHistoryItemPressed","onOpenFilter","onSearchPhraseChange","queryParams","testID","_queryParams$search","colorScheme","empty","setEmpty","scrollOffset","Value","searchPhrase","setSearchPhrase","searchBarVisible","Boolean","search","text","handleSearchPhraseChange","undefined","headerHeight","insets","additionalBottomPadding","createElement","style","styles","container","backgroundColor","background","emptyNotice","white","marginTop","paddingTop","align","color","preset","emptyTitle","shaded","emptySubtitle","contentContainerStyle","itemProps","infoLabelMode","onPress","onEmpty","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","query","list","header","leftItem","title","searchBar","rightButtons","active","credentialSchemaId","rightButtonAlwaysVisible","searchBarProps","placeholder","staticHeader","create","flex","borderRadius","marginHorizontal","paddingBottom","paddingHorizontal","opacity"],"sources":["history-list-screen.tsx"],"sourcesContent":["import { HistoryListItemBindingDto, HistoryListQueryBindingDto } from '@procivis/react-native-one-core';\nimport { debounce } from 'lodash';\nimport React, { FC, PropsWithChildren, useEffect, useMemo, useState } from 'react';\nimport { Animated, StyleSheet, View } from 'react-native';\n\nimport {\n BackButton,\n FilterButton,\n FoldableHeader,\n NavigationHeader,\n Typography,\n useAppColorScheme,\n} from '../../ui-components';\nimport { concatTestID, groupEntriesByDay, HistoryGroupByDaySection, useListContentInset } from '../../utils';\nimport { HistoryListLabels, HistoryListView } from './history-list';\nimport { HistoryListItemViewProps } from './history-list-item';\n\nexport type HistoryListScreenLabels = {\n emptyTitle: string;\n emptySubtitle: string;\n list: HistoryListLabels;\n title: string;\n search: string;\n};\n\nexport type HistoryListScreenProps = {\n groupItems?: (entries: HistoryListItemBindingDto[]) => HistoryGroupByDaySection[];\n itemInfoLabelMode?: HistoryListItemViewProps['infoLabelMode'];\n labels: HistoryListScreenLabels;\n onBackPressed: () => void;\n onHistoryItemPressed: (historyItem: HistoryListItemBindingDto) => void;\n onOpenFilter?: () => void;\n onSearchPhraseChange: (searchPhrase: string | undefined) => void;\n queryParams: Partial<HistoryListQueryBindingDto>;\n testID?: string;\n};\n\nexport const HistoryListScreen: FC<PropsWithChildren<HistoryListScreenProps>> = ({\n children,\n groupItems = groupEntriesByDay,\n itemInfoLabelMode = 'entity',\n labels,\n onBackPressed,\n onHistoryItemPressed,\n onOpenFilter,\n onSearchPhraseChange,\n queryParams,\n testID = 'HistoryScreen',\n}) => {\n const colorScheme = useAppColorScheme();\n const [empty, setEmpty] = useState<boolean>(false);\n const [scrollOffset] = useState(() => new Animated.Value(0));\n\n const [searchPhrase, setSearchPhrase] = useState<string>('');\n const searchBarVisible = !empty || Boolean(queryParams.search?.text);\n\n const handleSearchPhraseChange = useMemo(() => debounce(onSearchPhraseChange, 500), [onSearchPhraseChange]);\n useEffect(() => {\n handleSearchPhraseChange(searchPhrase || undefined);\n }, [searchPhrase, handleSearchPhraseChange]);\n\n const headerHeight = searchBarVisible ? 112 : 70;\n\n const insets = useListContentInset({\n additionalBottomPadding: 24,\n headerHeight,\n });\n\n return (\n <View\n style={[\n styles.container,\n {\n backgroundColor: colorScheme.background,\n },\n ]}\n testID={testID}>\n {empty && (\n <View\n style={[\n styles.emptyNotice,\n {\n backgroundColor: colorScheme.white,\n marginTop: insets.paddingTop,\n },\n ]}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s\">\n {labels.emptyTitle}\n </Typography>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-small\" style={styles.shaded}>\n {labels.emptySubtitle}\n </Typography>\n </View>\n )}\n <HistoryListView\n contentContainerStyle={insets}\n groupItems={groupItems}\n itemProps={{ infoLabelMode: itemInfoLabelMode, onPress: onHistoryItemPressed }}\n onEmpty={setEmpty}\n onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: scrollOffset } } }], {\n useNativeDriver: true,\n })}\n query={queryParams}\n testID={concatTestID(testID, 'list')}\n labels={labels.list}\n />\n {children}\n <FoldableHeader\n header={\n <NavigationHeader\n backgroundColor={'transparent'}\n leftItem={<BackButton onPress={onBackPressed} testID={concatTestID(testID, 'back')} />}\n title={labels.title}\n />\n }\n scrollOffset={scrollOffset}\n searchBar={\n !searchBarVisible\n ? undefined\n : {\n rightButtons: onOpenFilter\n ? [\n <FilterButton\n active={Boolean(queryParams.credentialSchemaId)}\n onPress={onOpenFilter}\n testID={concatTestID(testID, 'filter')}\n />,\n ]\n : undefined,\n rightButtonAlwaysVisible: true,\n searchBarProps: {\n onSearchPhraseChange: setSearchPhrase,\n placeholder: labels.search,\n searchPhrase,\n testID: concatTestID(testID, 'search'),\n },\n }\n }\n staticHeader={!searchBarVisible}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n emptyNotice: {\n borderRadius: 12,\n marginHorizontal: 16,\n paddingBottom: 20,\n paddingHorizontal: 12,\n paddingTop: 16,\n },\n shaded: {\n opacity: 0.7,\n },\n});\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,KAAK,IAA2BC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAClF,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,SACEC,UAAU,EACVC,YAAY,EACZC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,QACZ,qBAAqB;AAC5B,SAASC,YAAY,EAAEC,iBAAiB,EAA4BC,mBAAmB,QAAQ,aAAa;AAC5G,SAA4BC,eAAe,QAAQ,gBAAgB;AAuBnE,OAAO,MAAMC,iBAAgE,GAAGA,CAAC;EAC/EC,QAAQ;EACRC,UAAU,GAAGL,iBAAiB;EAC9BM,iBAAiB,GAAG,QAAQ;EAC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AA,CAAA6C,aAAA,CAACtC,UAAU;QAACyD,OAAO,EAAE1C,aAAc;QAACK,MAAM,EAAEd,YAAY,CAACc,MAAM,EAAE,MAAM;MAAE,CAAE,CAAE;MACvFiD,KAAK,EAAEvD,MAAM,CAACuD;IAAM,CACrB,CACF;IACD5C,YAAY,EAAEA,YAAa;IAC3B6C,SAAS,EACP,CAACzC,gBAAgB,GACbK,SAAS,GACT;MACEqC,YAAY,EAAEtD,YAAY,GACtB,cACExB,KAAA,CAAA6C,aAAA,CAACrC,YAAY;QACXuE,MAAM,EAAE1C,OAAO,CAACX,WAAW,CAACsD,kBAAkB,CAAE;QAChDhB,OAAO,EAAExC,YAAa;QACtBG,MAAM,EAAEd,YAAY,CAACc,MAAM,EAAE,QAAQ;MAAE,CACxC,CAAC,CACH,GACDc,SAAS;MACbwC,wBAAwB,EAAE,IAAI;MAC9BC,cAAc,EAAE;QACdzD,oBAAoB,EAAEU,eAAe;QACrCgD,WAAW,EAAE9D,MAAM,CAACiB,MAAM;QAC1BJ,YAAY;QACZP,MAAM,EAAEd,YAAY,CAACc,MAAM,EAAE,QAAQ;MACvC;IACF,CACL;IACDyD,YAAY,EAAE,CAAChD;EAAiB,CACjC,CACG,CAAC;AAEX,CAAC;AAED,MAAMW,MAAM,GAAG1C,UAAU,CAACgF,MAAM,CAAC;EAC/BrC,SAAS,EAAE;IACTsC,IAAI,EAAE;EACR,CAAC;EACDnC,WAAW,EAAE;IACXoC,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,aAAa,EAAE,EAAE;IACjBC,iBAAiB,EAAE,EAAE;IACrBpC,UAAU,EAAE;EACd,CAAC;EACDK,MAAM,EAAE;IACNgC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import moment from 'moment';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { HistorySectionHeaderView } from '../../ui-components';
|
|
4
|
-
// components used on the history section lists (Settings->History,
|
|
4
|
+
// components used on the history section lists (Settings->History, CredentialDetailBindingDto->History)
|
|
5
5
|
// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev
|
|
6
6
|
|
|
7
7
|
export const HistoryListSectionHeaderView = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["moment","React","useMemo","HistorySectionHeaderView","HistoryListSectionHeaderView","date","firstYearEntry","labels","testID","day","now","dateString","isSame","today","subtract","yesterday","format","createElement","year","toString","undefined"],"sources":["history-list-section-header.tsx"],"sourcesContent":["import moment, { Moment } from 'moment';\nimport React, { FC, useMemo } from 'react';\n\nimport { HistorySectionHeaderView } from '../../ui-components';\n\nexport type HistoryListSectionHeaderLabels = {\n today: string;\n yesterday: string;\n};\n\nexport type HistoryListSectionHeaderViewProps = {\n date: Moment;\n firstYearEntry: boolean;\n labels: HistoryListSectionHeaderLabels;\n testID?: string;\n};\n\n// components used on the history section lists (Settings->History,
|
|
1
|
+
{"version":3,"names":["moment","React","useMemo","HistorySectionHeaderView","HistoryListSectionHeaderView","date","firstYearEntry","labels","testID","day","now","dateString","isSame","today","subtract","yesterday","format","createElement","year","toString","undefined"],"sources":["history-list-section-header.tsx"],"sourcesContent":["import moment, { Moment } from 'moment';\nimport React, { FC, useMemo } from 'react';\n\nimport { HistorySectionHeaderView } from '../../ui-components';\n\nexport type HistoryListSectionHeaderLabels = {\n today: string;\n yesterday: string;\n};\n\nexport type HistoryListSectionHeaderViewProps = {\n date: Moment;\n firstYearEntry: boolean;\n labels: HistoryListSectionHeaderLabels;\n testID?: string;\n};\n\n// components 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 const HistoryListSectionHeaderView: FC<HistoryListSectionHeaderViewProps> = ({\n date,\n firstYearEntry,\n labels,\n testID,\n}) => {\n const day = useMemo(() => {\n const now = moment();\n const dateString = moment(date);\n\n if (dateString.isSame(now, 'day')) {\n return labels.today;\n } else if (dateString.isSame(now.subtract(1, 'day'), 'day')) {\n return labels.yesterday;\n }\n return dateString.format('Do MMMM');\n }, [date, labels]);\n\n return (\n <HistorySectionHeaderView day={day} testID={testID} year={firstYearEntry ? date.year().toString() : undefined} />\n );\n};\n"],"mappings":"AAAA,OAAOA,MAAM,MAAkB,QAAQ;AACvC,OAAOC,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAE1C,SAASC,wBAAwB,QAAQ,qBAAqB;AAc9D;AACA;;AAEA,OAAO,MAAMC,4BAAmE,GAAGA,CAAC;EAClFC,IAAI;EACJC,cAAc;EACdC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,MAAMC,GAAG,GAAGP,OAAO,CAAC,MAAM;IACxB,MAAMQ,GAAG,GAAGV,MAAM,CAAC,CAAC;IACpB,MAAMW,UAAU,GAAGX,MAAM,CAACK,IAAI,CAAC;IAE/B,IAAIM,UAAU,CAACC,MAAM,CAACF,GAAG,EAAE,KAAK,CAAC,EAAE;MACjC,OAAOH,MAAM,CAACM,KAAK;IACrB,CAAC,MAAM,IAAIF,UAAU,CAACC,MAAM,CAACF,GAAG,CAACI,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE;MAC3D,OAAOP,MAAM,CAACQ,SAAS;IACzB;IACA,OAAOJ,UAAU,CAACK,MAAM,CAAC,SAAS,CAAC;EACrC,CAAC,EAAE,CAACX,IAAI,EAAEE,MAAM,CAAC,CAAC;EAElB,oBACEN,KAAA,CAAAgB,aAAA,CAACd,wBAAwB;IAACM,GAAG,EAAEA,GAAI;IAACD,MAAM,EAAEA,MAAO;IAACU,IAAI,EAAEZ,cAAc,GAAGD,IAAI,CAACa,IAAI,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC,GAAGC;EAAU,CAAE,CAAC;AAErH,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useIsFocused","React","useCallback","useMemo","Animated","StyleSheet","ActivityIndicator","useAppColorScheme","ListPageLoadingIndicator","concatTestID","useHistory","groupEntriesByDay","HistoryListItemView","HistoryListSectionHeaderView","HistoryListView","query","contentContainerStyle","getItemProps","groupItems","itemProps","labels","onEmpty","onScroll","props","isFocused","colorScheme","data","historyData","fetchNextPage","fetchNextHistoryPage","hasNextPage","hasNextHistoryPage","isLoading","history","items","pages","flat","map","page","values","undefined","setImmediate","length","onEndReached","catch","createElement","animate","SectionList","_extends","ListFooterComponent","color","accent","style","styles","footer","listContent","keyExtractor","item","id","renderItem","index","section","first","last","testID","toString","renderSectionHeader","date","firstYearEntry","sectionHeader","sections","stickySectionHeadersEnabled","create","marginVertical","paddingHorizontal"],"sources":["history-list.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["useIsFocused","React","useCallback","useMemo","Animated","StyleSheet","ActivityIndicator","useAppColorScheme","ListPageLoadingIndicator","concatTestID","useHistory","groupEntriesByDay","HistoryListItemView","HistoryListSectionHeaderView","HistoryListView","query","contentContainerStyle","getItemProps","groupItems","itemProps","labels","onEmpty","onScroll","props","isFocused","colorScheme","data","historyData","fetchNextPage","fetchNextHistoryPage","hasNextPage","hasNextHistoryPage","isLoading","history","items","pages","flat","map","page","values","undefined","setImmediate","length","onEndReached","catch","createElement","animate","SectionList","_extends","ListFooterComponent","color","accent","style","styles","footer","listContent","keyExtractor","item","id","renderItem","index","section","first","last","testID","toString","renderSectionHeader","date","firstYearEntry","sectionHeader","sections","stickySectionHeadersEnabled","create","marginVertical","paddingHorizontal"],"sources":["history-list.tsx"],"sourcesContent":["import { HistoryListItemBindingDto, HistoryListQueryBindingDto } from '@procivis/react-native-one-core';\nimport { useIsFocused } from '@react-navigation/native';\nimport React, { FC, useCallback, useMemo } from 'react';\nimport { Animated, SectionListProps, StyleSheet } from 'react-native';\n\nimport { ActivityIndicator, useAppColorScheme } from '../../ui-components';\nimport ListPageLoadingIndicator from '../../ui-components/list/list-page-loading-indicator';\nimport { concatTestID, useHistory } from '../../utils';\nimport { groupEntriesByDay, HistoryGroupByDaySection } from '../../utils/history';\nimport { HistoryListItemLabels, HistoryListItemView, HistoryListItemViewProps } from './history-list-item';\nimport { HistoryListSectionHeaderLabels, HistoryListSectionHeaderView } from './history-list-section-header';\n\nexport type HistoryListLabels = {\n sectionHeader: HistoryListSectionHeaderLabels;\n item: HistoryListItemLabels;\n};\n\nexport interface HistoryListViewProps\n extends Omit<SectionListProps<HistoryListItemBindingDto, HistoryGroupByDaySection>, 'sections'> {\n // optional customization of item props\n getItemProps?: (item: HistoryListItemBindingDto) => Partial<HistoryListItemViewProps> | undefined;\n groupItems?: (entries: HistoryListItemBindingDto[]) => HistoryGroupByDaySection[];\n itemProps?: Partial<HistoryListItemViewProps>;\n labels: HistoryListLabels;\n // callback when empty list displayed\n onEmpty?: (empty: boolean) => void;\n query: Partial<HistoryListQueryBindingDto>;\n}\n\nexport const HistoryListView: FC<HistoryListViewProps> = ({\n query,\n contentContainerStyle,\n getItemProps,\n groupItems = groupEntriesByDay,\n itemProps,\n labels,\n onEmpty,\n onScroll,\n ...props\n}) => {\n const isFocused = useIsFocused();\n const colorScheme = useAppColorScheme();\n const {\n data: historyData,\n fetchNextPage: fetchNextHistoryPage,\n hasNextPage: hasNextHistoryPage,\n isLoading,\n } = useHistory(query);\n\n const history = useMemo(() => {\n const items = historyData?.pages\n .flat()\n .map((page) => page.values)\n .flat();\n if (!items) {\n return undefined;\n }\n if (historyData) {\n setImmediate(() => onEmpty?.(!items.length));\n }\n return groupItems(items);\n }, [historyData, onEmpty, groupItems]);\n\n const onEndReached = useCallback(() => {\n if (hasNextHistoryPage) {\n fetchNextHistoryPage().catch(() => {});\n }\n }, [fetchNextHistoryPage, hasNextHistoryPage]);\n\n if (!history) {\n return <ActivityIndicator animate={isFocused} />;\n }\n\n return (\n <Animated.SectionList<HistoryListItemBindingDto, HistoryGroupByDaySection>\n ListFooterComponent={\n isLoading ? <ListPageLoadingIndicator color={colorScheme.accent} style={styles.footer} /> : undefined\n }\n contentContainerStyle={[styles.listContent, contentContainerStyle]}\n keyExtractor={(item) => item.id}\n onEndReached={onEndReached}\n onScroll={onScroll}\n renderItem={({ item, index, section }) => (\n <HistoryListItemView\n first={!index}\n item={item}\n labels={labels.item}\n last={index === section.data.length - 1}\n testID={concatTestID(props.testID, 'item', index.toString())}\n {...itemProps}\n {...getItemProps?.(item)}\n />\n )}\n renderSectionHeader={({ section }) => (\n <HistoryListSectionHeaderView\n date={section.date}\n firstYearEntry={section.firstYearEntry}\n labels={labels.sectionHeader}\n testID={concatTestID(props.testID, 'section')}\n />\n )}\n sections={history}\n stickySectionHeadersEnabled={false}\n {...props}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n footer: {\n marginVertical: 16,\n },\n listContent: {\n paddingHorizontal: 16,\n },\n});\n"],"mappings":";AACA,SAASA,YAAY,QAAQ,0BAA0B;AACvD,OAAOC,KAAK,IAAQC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACvD,SAASC,QAAQ,EAAoBC,UAAU,QAAQ,cAAc;AAErE,SAASC,iBAAiB,EAAEC,iBAAiB,QAAQ,qBAAqB;AAC1E,OAAOC,wBAAwB,MAAM,sDAAsD;AAC3F,SAASC,YAAY,EAAEC,UAAU,QAAQ,aAAa;AACtD,SAASC,iBAAiB,QAAkC,qBAAqB;AACjF,SAAgCC,mBAAmB,QAAkC,qBAAqB;AAC1G,SAAyCC,4BAA4B,QAAQ,+BAA+B;AAmB5G,OAAO,MAAMC,eAAyC,GAAGA,CAAC;EACxDC,KAAK;EACLC,qBAAqB;EACrBC,YAAY;EACZC,UAAU,GAAGP,iBAAiB;EAC9BQ,SAAS;EACTC,MAAM;EACNC,OAAO;EACPC,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,SAAS,GAAGxB,YAAY,CAAC,CAAC;EAChC,MAAMyB,WA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IACNmB,cAAc,EAAE;EAClB,CAAC;EACDlB,WAAW,EAAE;IACXmB,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","StyleSheet","View","Typography","useAppColorScheme","ShareCredentialCardNotice","children","testID","text","colorScheme","createElement","style","styles","notice","backgroundColor","background","align","color","preset","create","marginBottom","marginHorizontal","padding"],"sources":["share-credential-card-notice.tsx"],"sourcesContent":["import React, { FC, PropsWithChildren } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { Typography,useAppColorScheme } from '../../ui-components';\n\nexport type ShareCredentialCardNoticeProps = {\n testID: string;\n text: string;\n};\n\nexport const ShareCredentialCardNotice: FC<PropsWithChildren<ShareCredentialCardNoticeProps>> = ({\n children,\n testID,\n text,\n}) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.notice, { backgroundColor: colorScheme.background }]} testID={testID}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {text}\n </Typography>\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAiC,OAAO;AACpD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,UAAU,
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","View","Typography","useAppColorScheme","ShareCredentialCardNotice","children","testID","text","colorScheme","createElement","style","styles","notice","backgroundColor","background","align","color","preset","create","marginBottom","marginHorizontal","padding"],"sources":["share-credential-card-notice.tsx"],"sourcesContent":["import React, { FC, PropsWithChildren } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { Typography, useAppColorScheme } from '../../ui-components';\n\nexport type ShareCredentialCardNoticeProps = {\n testID: string;\n text: string;\n};\n\nexport const ShareCredentialCardNotice: FC<PropsWithChildren<ShareCredentialCardNoticeProps>> = ({\n children,\n testID,\n text,\n}) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.notice, { backgroundColor: colorScheme.background }]} testID={testID}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {text}\n </Typography>\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAiC,OAAO;AACpD,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAE/C,SAASC,UAAU,EAAEC,iBAAiB,QAAQ,qBAAqB;AAOnE,OAAO,MAAMC,yBAAgF,GAAGA,CAAC;EAC/FC,QAAQ;EACRC,MAAM;EACNC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGL,iBAAiB,CAAC,CAAC;EACvC,oBACEJ,KAAA,CAAAU,aAAA,CAACR,IAAI;IAACS,KAAK,EAAE,CAACC,MAAM,CAACC,MAAM,EAAE;MAAEC,eAAe,EAAEL,WAAW,CAACM;IAAW,CAAC,CAAE;IAACR,MAAM,EAAEA;EAAO,gBACxFP,KAAA,CAAAU,aAAA,CAACP,UAAU;IAACa,KAAK,EAAC,QAAQ;IAACC,KAAK,EAAER,WAAW,CAACD,IAAK;IAACU,MAAM,EAAC;EAAsB,GAC9EV,IACS,CAAC,EACZF,QACG,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGX,UAAU,CAACkB,MAAM,CAAC;EAC/BN,MAAM,EAAE;IACNO,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|