@procivis/one-react-native-components 0.3.27 → 0.3.47
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/entity/entity-attributes.js +14 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +9 -42
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +60 -32
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/entity/index.js +2 -15
- package/lib/commonjs/components/entity/index.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js +14 -12
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +1 -2
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/ui-components/blur/index.js +2 -9
- package/lib/commonjs/ui-components/blur/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/hold-button.js +3 -2
- package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/commonjs/ui-components/camera/index.js +2 -9
- package/lib/commonjs/ui-components/camera/index.js.map +1 -1
- package/lib/commonjs/ui-components/control/index.js +0 -12
- package/lib/commonjs/ui-components/control/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js +50 -2
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/entity/index.js +3 -16
- package/lib/commonjs/ui-components/entity/index.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +1 -1
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/history/index.js +4 -27
- package/lib/commonjs/ui-components/history/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js +10 -13
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/input/index.js +3 -32
- package/lib/commonjs/ui-components/input/index.js.map +1 -1
- package/lib/commonjs/ui-components/list/index.js +4 -19
- package/lib/commonjs/ui-components/list/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/index.js +2 -13
- package/lib/commonjs/ui-components/loader/index.js.map +1 -1
- package/lib/commonjs/ui-components/pin/index.js +2 -21
- package/lib/commonjs/ui-components/pin/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/index.js +3 -16
- package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
- package/lib/commonjs/ui-components/settings/index.js +6 -37
- package/lib/commonjs/ui-components/settings/index.js.map +1 -1
- package/lib/commonjs/ui-components/state/index.js +2 -15
- package/lib/commonjs/ui-components/state/index.js.map +1 -1
- package/lib/commonjs/utils/date.js +1 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +22 -66
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +6 -2
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +23 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +24 -14
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +55 -14
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +6 -15
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +21 -3
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js +15 -2
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +11 -44
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +60 -32
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/entity/index.js +2 -2
- package/lib/module/components/entity/index.js.map +1 -1
- package/lib/module/components/history/history-list-item.js +15 -13
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +1 -2
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/ui-components/blur/index.js +2 -2
- package/lib/module/ui-components/blur/index.js.map +1 -1
- package/lib/module/ui-components/buttons/hold-button.js +4 -3
- package/lib/module/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/module/ui-components/camera/index.js +2 -2
- package/lib/module/ui-components/camera/index.js.map +1 -1
- package/lib/module/ui-components/control/index.js +3 -3
- package/lib/module/ui-components/control/index.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js +51 -3
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/entity/index.js +4 -4
- package/lib/module/ui-components/entity/index.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +1 -1
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/history/index.js +6 -6
- package/lib/module/ui-components/history/index.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js +10 -13
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/input/index.js +6 -6
- package/lib/module/ui-components/input/index.js.map +1 -1
- package/lib/module/ui-components/list/index.js +4 -4
- package/lib/module/ui-components/list/index.js.map +1 -1
- package/lib/module/ui-components/loader/index.js +4 -4
- package/lib/module/ui-components/loader/index.js.map +1 -1
- package/lib/module/ui-components/pin/index.js +3 -3
- package/lib/module/ui-components/pin/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/index.js +4 -4
- package/lib/module/ui-components/searchbar/index.js.map +1 -1
- package/lib/module/ui-components/settings/index.js +10 -10
- package/lib/module/ui-components/settings/index.js.map +1 -1
- package/lib/module/ui-components/state/index.js +2 -2
- package/lib/module/ui-components/state/index.js.map +1 -1
- package/lib/module/utils/date.js +1 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +24 -68
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +5 -3
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +21 -0
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +24 -14
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +55 -14
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +6 -15
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/query.js +19 -2
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +1 -2
- package/lib/typescript/components/entity/entity-details.d.ts +3 -2
- package/lib/typescript/components/entity/index.d.ts +2 -1
- package/lib/typescript/ui-components/blur/index.d.ts +2 -1
- package/lib/typescript/ui-components/buttons/hold-button.d.ts +2 -2
- package/lib/typescript/ui-components/camera/index.d.ts +2 -1
- package/lib/typescript/ui-components/control/index.d.ts +4 -2
- package/lib/typescript/ui-components/credential/credential-carousel-images.d.ts +1 -0
- package/lib/typescript/ui-components/entity/entity-cluster.d.ts +1 -0
- package/lib/typescript/ui-components/entity/index.d.ts +4 -2
- package/lib/typescript/ui-components/history/history-details.d.ts +4 -1
- package/lib/typescript/ui-components/history/index.d.ts +6 -3
- package/lib/typescript/ui-components/input/index.d.ts +6 -3
- package/lib/typescript/ui-components/list/index.d.ts +4 -2
- package/lib/typescript/ui-components/loader/index.d.ts +4 -2
- package/lib/typescript/ui-components/pin/index.d.ts +4 -2
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +1 -1
- package/lib/typescript/ui-components/searchbar/index.d.ts +4 -2
- package/lib/typescript/ui-components/settings/index.d.ts +10 -5
- package/lib/typescript/ui-components/state/index.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/backup.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/core-init.d.ts +4 -1
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +4 -1
- package/lib/typescript/utils/hooks/core/proofs.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +9 -3
- package/lib/typescript/utils/parsers/query.d.ts +3 -2
- package/package.json +10 -5
- package/src/components/entity/entity-attributes.tsx +16 -2
- package/src/components/entity/entity-details-with-buttons.tsx +11 -42
- package/src/components/entity/entity-details.tsx +60 -30
- package/src/components/entity/index.ts +2 -1
- package/src/components/history/history-list-item.tsx +17 -13
- package/src/components/proof-request/share-credential.tsx +0 -1
- package/src/ui-components/blur/index.ts +2 -1
- package/src/ui-components/buttons/hold-button.tsx +6 -5
- package/src/ui-components/camera/index.tsx +2 -1
- package/src/ui-components/control/index.ts +4 -2
- package/src/ui-components/credential/card/credential-details-card.tsx +1 -1
- package/src/ui-components/credential/credential-carousel-images.tsx +15 -8
- package/src/ui-components/entity/entity-cluster.tsx +63 -10
- package/src/ui-components/entity/index.ts +4 -2
- package/src/ui-components/history/history-details.tsx +5 -2
- package/src/ui-components/history/index.ts +6 -3
- package/src/ui-components/icons/entity.tsx +8 -12
- package/src/ui-components/input/index.ts +6 -3
- package/src/ui-components/list/index.ts +4 -2
- package/src/ui-components/loader/index.ts +4 -2
- package/src/ui-components/pin/index.ts +4 -2
- package/src/ui-components/screens/nerd-mode-screen.tsx +1 -1
- package/src/ui-components/searchbar/index.ts +4 -2
- package/src/ui-components/settings/index.ts +10 -5
- package/src/ui-components/state/index.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/hooks/connectivity/connectivity.test.ts +7 -2
- package/src/utils/hooks/core/backup.ts +30 -72
- package/src/utils/hooks/core/core-init.ts +5 -3
- package/src/utils/hooks/core/identifiers.ts +22 -1
- package/src/utils/hooks/core/proofs.ts +27 -16
- package/src/utils/hooks/core/trust-entity.ts +45 -11
- package/src/utils/parsers/credential-sharing.tsx +8 -14
- package/src/utils/parsers/query.tsx +12 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Selector","SelectorStatus","CredentialNoticeWarningIcon","CredentialWarningIcon","RequiredAttributeIcon","concatTestID","detailsCardAttributeFromClaim","getCredentialCardPropsFromCredential","getValidityState","nestAttributes","supportsSelectiveDisclosure","ValidityState","validityCheckedCardFromCredential","credential","invalidLVVC","expanded","multipleCredentialsAvailable","config","notice","testID","labels","credentialHeaderDetail","credentialDetailErrorColor","credentialDetailPrimary","revoked","credentialDetailTestID","multipleCredentials","statusIcon","card","claims","header","missingCredentialCardFromRequest","request","_request$name","cardImage","undefined","color","missingCredential","credentialName","name","id","getAttributeSelectorStatus","field","validityState","claim","selected","Valid","Rejected","required","Required","Disabled","SelectedCheckmark","Empty","spreadClaims","parentClaimPath","reduce","acc","result","Array","isArray","value","claimPath","key","push","getDisplayedAttributes","selectiveDisclosureSupported","selectedFields","map","status","fields","includes","find","keyMap","shareCredentialCardAttributeFromClaim","_field$name$split$pop","_field$name","_field$name2","split","pop","path","missingAttribute","valueErrorColor","setStatusForNestedObjectOrArrayFields","attribute","disabled","accessory","createElement","isObject","attributes","length","values","rightAccessory","_attribute$attributes","nested","nestedAttribute","shareCredentialCardFromCredential","_credential$issuerDid","_credential$issuer","_credential$issuerDid2","_credential$issuer2","issuerDid","issuer","text","selectiveDisclosureNotice","noticeIcon","cardTestId","displayedAttributes","index","selectCredentialCardAttributeFromClaim","selectCredentialCardFromCredential","_credential$issuerDid3","_credential$issuer3","SelectedRadio","cardProps"],"sources":["credential-sharing.tsx"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React from 'react';\n\nimport {\n CredentialAttribute,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n Selector,\n SelectorStatus,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialNoticeWarningIcon, CredentialWarningIcon, RequiredAttributeIcon } from '../../ui-components/icons';\nimport { concatTestID } from '../testID';\nimport {\n CardLabels,\n detailsCardAttributeFromClaim,\n getCredentialCardPropsFromCredential,\n getValidityState,\n nestAttributes,\n supportsSelectiveDisclosure,\n ValidityState,\n} from './credential';\n\nexport const validityCheckedCardFromCredential = (\n credential: CredentialDetail,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID'> => {\n let credentialHeaderDetail:\n | Pick<\n CredentialHeaderProps,\n | 'credentialDetailPrimary'\n | 'credentialDetailSecondary'\n | 'credentialDetailErrorColor'\n | 'credentialDetailTestID'\n | 'statusIcon'\n >\n | undefined;\n if (invalidLVVC) {\n credentialHeaderDetail = {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.revoked,\n credentialDetailTestID: concatTestID(testID, 'header.invalid'),\n };\n } else if (!expanded && multipleCredentialsAvailable) {\n credentialHeaderDetail = {\n credentialDetailPrimary: labels.multipleCredentials,\n credentialDetailTestID: concatTestID(testID, 'header.multiple'),\n statusIcon: CredentialWarningIcon,\n };\n }\n\n const card = getCredentialCardPropsFromCredential(credential, credential.claims, config, notice, testID, labels);\n return {\n ...card,\n header: {\n ...card.header,\n ...credentialHeaderDetail,\n },\n };\n};\n\nexport const missingCredentialCardFromRequest = (\n request: PresentationDefinitionRequestedCredential,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n return {\n cardImage: undefined,\n color: undefined,\n testID,\n header: {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.missingCredential,\n credentialDetailTestID: concatTestID(testID, 'header.missing'),\n credentialName: request.name ?? request.id,\n statusIcon: CredentialWarningIcon,\n },\n ...notice,\n };\n};\n\ninterface DisplayedAttribute {\n claim?: Claim;\n field?: PresentationDefinitionField;\n id: string;\n selected?: boolean;\n status: SelectorStatus;\n}\n\nconst getAttributeSelectorStatus = (\n field: PresentationDefinitionField,\n validityState: ValidityState,\n credential?: CredentialDetail,\n claim?: Claim,\n selected?: boolean,\n): SelectorStatus => {\n if (!credential || validityState !== ValidityState.Valid) {\n return SelectorStatus.Rejected;\n }\n if (field.required) {\n if (claim) {\n return SelectorStatus.Required;\n } else {\n return SelectorStatus.Rejected;\n }\n }\n if (!claim) {\n return SelectorStatus.Disabled;\n }\n return selected ? SelectorStatus.SelectedCheckmark : SelectorStatus.Empty;\n};\n\n// Returns a spread list of all claims with their full JSON path as key, including all intermediate objects\nconst spreadClaims = (claims: Claim[], parentClaimPath = ''): Claim[] => {\n return claims.reduce((acc, claim) => {\n const result = [claim];\n if (Array.isArray(claim.value)) {\n const claimPath = parentClaimPath ? `${parentClaimPath}/${claim.key}` : claim.key;\n result.push(...spreadClaims(claim.value, claimPath));\n }\n return [...acc, ...result];\n }, [] as Claim[]);\n};\n\nconst getDisplayedAttributes = (\n request: PresentationDefinitionRequestedCredential,\n validityState: ValidityState,\n credential?: CredentialDetail,\n selectiveDisclosureSupported?: boolean,\n selectedFields?: string[],\n): DisplayedAttribute[] => {\n if (credential && selectiveDisclosureSupported === false) {\n return credential.claims.map((claim) => ({\n claim,\n id: claim.id,\n status: SelectorStatus.Required,\n }));\n }\n\n return request.fields.map((field) => {\n const selected = !field.required && selectedFields?.includes(field.id);\n const claim =\n credential &&\n spreadClaims(credential.claims).find(({ key }) => {\n return key === field.keyMap[credential.id];\n });\n const status = getAttributeSelectorStatus(field, validityState, credential, claim, selected);\n return { claim, field, id: field.id, selected, status };\n });\n};\n\nexport const shareCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n if (claim) {\n return { ...detailsCardAttributeFromClaim(claim, config, testID), id };\n }\n return {\n id,\n name: field?.name?.split('/').pop() ?? id,\n path: field?.name ?? id,\n value: labels.missingAttribute,\n valueErrorColor: true,\n };\n};\n\n// Will propagate the attribute status (right accessory + selected?) for all nested attributes\n// Note: This function MUTATES the input attribute\nconst setStatusForNestedObjectOrArrayFields = (\n attribute: CredentialAttribute,\n status?: SelectorStatus,\n disabled?: boolean,\n) => {\n const accessory = status && <Selector status={status} />;\n const isObject = attribute.attributes && attribute.attributes.length > 0;\n const isArray = attribute.values && attribute.values.length > 0;\n\n // If the attribute is not an object or array, we update the attribute and return\n if (!isObject && !isArray) {\n attribute.rightAccessory = accessory;\n attribute.disabled = disabled;\n return attribute;\n }\n\n // The object can be optional (tappable radio-checkmark), or required (checkmark)\n if (status === SelectorStatus.SelectedCheckmark || status === SelectorStatus.Empty) {\n // If it's a selectable object, the accessory is rendered next to the object title,\n // The nested attributes have no accessory, and can not be selected\n attribute.rightAccessory = accessory;\n setStatusForNestedObjectOrArrayFields(attribute, undefined, true);\n } else {\n const nested = attribute.attributes ?? attribute.values;\n // If the object is required / rejected, the accessory is rendered next to each nested attribute (except other object titles)\n // all fields are disabled\n for (const nestedAttribute of nested) {\n setStatusForNestedObjectOrArrayFields(nestedAttribute, status, true);\n }\n }\n};\n\nexport type ShareCredentialCardLabels = CardLabels & {\n selectiveDisclosureNotice: string;\n missingAttribute: string;\n missingCredential: string;\n multipleCredentials: string;\n};\n\nexport const shareCredentialCardFromCredential = (\n credential: CredentialDetail | undefined,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n request: PresentationDefinitionRequestedCredential,\n selectedFields: string[] | undefined,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuerDid: credential.issuerDid?.id, issuer: credential.issuer?.id } : undefined,\n config,\n );\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const cardTestId = concatTestID(testID, 'card');\n const card = credential\n ? validityCheckedCardFromCredential(\n credential,\n invalidLVVC,\n expanded,\n multipleCredentialsAvailable,\n config,\n notice,\n cardTestId,\n labels,\n )\n : missingCredentialCardFromRequest(request, notice, cardTestId, labels);\n const validityState = getValidityState(\n credential ? { ...credential, issuerDid: credential.issuerDid?.id, issuer: credential.issuer?.id } : undefined,\n );\n const displayedAttributes = getDisplayedAttributes(\n request,\n validityState,\n credential,\n selectiveDisclosureSupported,\n selectedFields,\n );\n\n const attributes: CredentialAttribute[] = displayedAttributes.map(({ claim, field, id, selected, status }, index) => {\n const disabled = !credential || !field || field.required || !claim;\n const attribute: CredentialAttribute = {\n ...shareCredentialCardAttributeFromClaim(\n id,\n config,\n concatTestID(testID, 'attribute', `${index}`),\n labels,\n claim,\n field,\n ),\n selected,\n };\n\n setStatusForNestedObjectOrArrayFields(attribute, status, disabled);\n return attribute;\n });\n return {\n attributes: nestAttributes(attributes),\n card,\n };\n};\n\nexport const selectCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n const attribute = shareCredentialCardAttributeFromClaim(id, config, testID, labels, claim, field);\n if (!claim) {\n return attribute;\n }\n return {\n ...attribute,\n rightAccessory: RequiredAttributeIcon,\n };\n};\n\nexport const selectCredentialCardFromCredential = (\n credential: CredentialDetail,\n selected: boolean,\n request: PresentationDefinitionRequestedCredential,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuerDid: credential.issuerDid?.id, issuer: credential.issuer?.id } : undefined,\n config,\n );\n const rightAccessory = <Selector status={selected ? SelectorStatus.SelectedRadio : SelectorStatus.Empty} />;\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const { header, ...cardProps } = getCredentialCardPropsFromCredential(\n credential,\n credential.claims,\n config,\n notice,\n testID,\n labels,\n );\n const card = {\n header: {\n ...header,\n accessory: rightAccessory,\n },\n ...cardProps,\n };\n const attributes: CredentialAttribute[] = request.fields.map((field) => {\n const claim = spreadClaims(credential.claims).find(({ key }) => {\n return key === field.keyMap[credential.id];\n });\n\n const attribute = selectCredentialCardAttributeFromClaim(field.id, config, testID, labels, claim, field);\n return {\n ...attribute,\n rightAccessory: (\n <Selector status={field.required && !claim ? SelectorStatus.Rejected : SelectorStatus.Required} />\n ),\n };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AAS,CAAE;IAErG,CAAC;EACH,CAAC,CAAC;EACF,OAAO;IACLuC,UAAU,EAAE/E,cAAc,CAAC+E,UAAU,CAAC;IACtC5D;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","Selector","SelectorStatus","CredentialNoticeWarningIcon","CredentialWarningIcon","RequiredAttributeIcon","concatTestID","detailsCardAttributeFromClaim","getCredentialCardPropsFromCredential","getValidityState","nestAttributes","supportsSelectiveDisclosure","ValidityState","validityCheckedCardFromCredential","credential","invalidLVVC","expanded","multipleCredentialsAvailable","config","notice","testID","labels","credentialHeaderDetail","credentialDetailErrorColor","credentialDetailPrimary","revoked","credentialDetailTestID","multipleCredentials","statusIcon","card","claims","header","missingCredentialCardFromRequest","request","_request$name","cardImage","undefined","color","missingCredential","credentialName","name","id","getAttributeSelectorStatus","field","validityState","claim","selected","Valid","Rejected","required","Required","Disabled","SelectedCheckmark","Empty","spreadClaims","parentClaimPath","reduce","acc","result","Array","isArray","value","claimPath","key","push","getDisplayedAttributes","selectiveDisclosureSupported","selectedFields","fields","map","includes","find","keyMap","status","shareCredentialCardAttributeFromClaim","_field$name$split$pop","_field$name","_field$name2","split","pop","path","missingAttribute","valueErrorColor","setStatusForNestedObjectOrArrayFields","attribute","disabled","accessory","createElement","isObject","attributes","length","values","rightAccessory","_attribute$attributes","nested","nestedAttribute","shareCredentialCardFromCredential","_credential$issuer","_credential$issuer2","issuer","text","selectiveDisclosureNotice","noticeIcon","cardTestId","displayedAttributes","index","selectCredentialCardAttributeFromClaim","selectCredentialCardFromCredential","_credential$issuer3","SelectedRadio","cardProps"],"sources":["credential-sharing.tsx"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React from 'react';\n\nimport {\n CredentialAttribute,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n Selector,\n SelectorStatus,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialNoticeWarningIcon, CredentialWarningIcon, RequiredAttributeIcon } from '../../ui-components/icons';\nimport { concatTestID } from '../testID';\nimport {\n CardLabels,\n detailsCardAttributeFromClaim,\n getCredentialCardPropsFromCredential,\n getValidityState,\n nestAttributes,\n supportsSelectiveDisclosure,\n ValidityState,\n} from './credential';\n\nexport const validityCheckedCardFromCredential = (\n credential: CredentialDetail,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID'> => {\n let credentialHeaderDetail:\n | Pick<\n CredentialHeaderProps,\n | 'credentialDetailPrimary'\n | 'credentialDetailSecondary'\n | 'credentialDetailErrorColor'\n | 'credentialDetailTestID'\n | 'statusIcon'\n >\n | undefined;\n if (invalidLVVC) {\n credentialHeaderDetail = {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.revoked,\n credentialDetailTestID: concatTestID(testID, 'header.invalid'),\n };\n } else if (!expanded && multipleCredentialsAvailable) {\n credentialHeaderDetail = {\n credentialDetailPrimary: labels.multipleCredentials,\n credentialDetailTestID: concatTestID(testID, 'header.multiple'),\n statusIcon: CredentialWarningIcon,\n };\n }\n\n const card = getCredentialCardPropsFromCredential(credential, credential.claims, config, notice, testID, labels);\n return {\n ...card,\n header: {\n ...card.header,\n ...credentialHeaderDetail,\n },\n };\n};\n\nexport const missingCredentialCardFromRequest = (\n request: PresentationDefinitionRequestedCredential,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n return {\n cardImage: undefined,\n color: undefined,\n testID,\n header: {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.missingCredential,\n credentialDetailTestID: concatTestID(testID, 'header.missing'),\n credentialName: request.name ?? request.id,\n statusIcon: CredentialWarningIcon,\n },\n ...notice,\n };\n};\n\ninterface DisplayedAttribute {\n claim?: Claim;\n field?: PresentationDefinitionField;\n id: string;\n selected?: boolean;\n status: SelectorStatus;\n}\n\nconst getAttributeSelectorStatus = (\n field: PresentationDefinitionField,\n validityState: ValidityState,\n credential?: CredentialDetail,\n claim?: Claim,\n selected?: boolean,\n): SelectorStatus => {\n if (!credential || validityState !== ValidityState.Valid) {\n return SelectorStatus.Rejected;\n }\n if (field.required) {\n if (claim) {\n return SelectorStatus.Required;\n } else {\n return SelectorStatus.Rejected;\n }\n }\n if (!claim) {\n return SelectorStatus.Disabled;\n }\n return selected ? SelectorStatus.SelectedCheckmark : SelectorStatus.Empty;\n};\n\n// Returns a spread list of all claims with their full JSON path as key, including all intermediate objects\nconst spreadClaims = (claims: Claim[], parentClaimPath = ''): Claim[] => {\n return claims.reduce((acc, claim) => {\n const result = [claim];\n if (Array.isArray(claim.value)) {\n const claimPath = parentClaimPath ? `${parentClaimPath}/${claim.key}` : claim.key;\n result.push(...spreadClaims(claim.value, claimPath));\n }\n return [...acc, ...result];\n }, [] as Claim[]);\n};\n\nconst getDisplayedAttributes = (\n request: PresentationDefinitionRequestedCredential,\n validityState: ValidityState,\n credential?: CredentialDetail,\n selectiveDisclosureSupported?: boolean,\n selectedFields?: string[],\n): DisplayedAttribute[] => {\n const claims = credential ? spreadClaims(credential.claims) : undefined;\n\n return request.fields.map((field) => {\n const selected = !field.required && selectedFields?.includes(field.id);\n const claim =\n credential ?\n claims?.find(({ key }) => {\n return key === field.keyMap[credential.id];\n }) : undefined;\n const status = selectiveDisclosureSupported === false ? SelectorStatus.Required : getAttributeSelectorStatus(field, validityState, credential, claim, selected);\n return { claim, field, id: field.id, selected, status };\n });\n};\n\nexport const shareCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n if (claim) {\n return { ...detailsCardAttributeFromClaim(claim, config, testID), id };\n }\n return {\n id,\n name: field?.name?.split('/').pop() ?? id,\n path: field?.name ?? id,\n value: labels.missingAttribute,\n valueErrorColor: true,\n };\n};\n\n// Will propagate the attribute status (right accessory + selected?) for all nested attributes\n// Note: This function MUTATES the input attribute\nconst setStatusForNestedObjectOrArrayFields = (\n attribute: CredentialAttribute,\n status?: SelectorStatus,\n disabled?: boolean,\n) => {\n const accessory = status && <Selector status={status} />;\n const isObject = attribute.attributes && attribute.attributes.length > 0;\n const isArray = attribute.values && attribute.values.length > 0;\n\n // If the attribute is not an object or array, we update the attribute and return\n if (!isObject && !isArray) {\n attribute.rightAccessory = accessory;\n attribute.disabled = disabled;\n return attribute;\n }\n\n // The object can be optional (tappable radio-checkmark), or required (checkmark)\n if (status === SelectorStatus.SelectedCheckmark || status === SelectorStatus.Empty) {\n // If it's a selectable object, the accessory is rendered next to the object title,\n // The nested attributes have no accessory, and can not be selected\n attribute.rightAccessory = accessory;\n setStatusForNestedObjectOrArrayFields(attribute, undefined, true);\n } else {\n const nested = attribute.attributes ?? attribute.values;\n // If the object is required / rejected, the accessory is rendered next to each nested attribute (except other object titles)\n // all fields are disabled\n for (const nestedAttribute of nested) {\n setStatusForNestedObjectOrArrayFields(nestedAttribute, status, true);\n }\n }\n};\n\nexport type ShareCredentialCardLabels = CardLabels & {\n selectiveDisclosureNotice: string;\n missingAttribute: string;\n missingCredential: string;\n multipleCredentials: string;\n};\n\nexport const shareCredentialCardFromCredential = (\n credential: CredentialDetail | undefined,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n request: PresentationDefinitionRequestedCredential,\n selectedFields: string[] | undefined,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuer: credential.issuer?.id } : undefined,\n config,\n );\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const cardTestId = concatTestID(testID, 'card');\n const card = credential\n ? validityCheckedCardFromCredential(\n credential,\n invalidLVVC,\n expanded,\n multipleCredentialsAvailable,\n config,\n notice,\n cardTestId,\n labels,\n )\n : missingCredentialCardFromRequest(request, notice, cardTestId, labels);\n const validityState = getValidityState(\n credential ? { ...credential, issuer: credential.issuer?.id } : undefined,\n );\n const displayedAttributes = getDisplayedAttributes(\n request,\n validityState,\n credential,\n selectiveDisclosureSupported,\n selectedFields,\n );\n\n const attributes: CredentialAttribute[] = displayedAttributes.map(({ claim, field, id, selected, status }, index) => {\n const disabled = !credential || !field || field.required || !claim;\n const attribute: CredentialAttribute = {\n ...shareCredentialCardAttributeFromClaim(\n id,\n config,\n concatTestID(testID, 'attribute', `${index}`),\n labels,\n claim,\n field,\n ),\n selected,\n };\n\n setStatusForNestedObjectOrArrayFields(attribute, status, disabled);\n return attribute;\n });\n return {\n attributes: nestAttributes(attributes),\n card,\n };\n};\n\nexport const selectCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n const attribute = shareCredentialCardAttributeFromClaim(id, config, testID, labels, claim, field);\n if (!claim) {\n return attribute;\n }\n return {\n ...attribute,\n rightAccessory: RequiredAttributeIcon,\n };\n};\n\nexport const selectCredentialCardFromCredential = (\n credential: CredentialDetail,\n selected: boolean,\n request: PresentationDefinitionRequestedCredential,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuer: credential.issuer?.id } : undefined,\n config,\n );\n const rightAccessory = <Selector status={selected ? SelectorStatus.SelectedRadio : SelectorStatus.Empty} />;\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const { header, ...cardProps } = getCredentialCardPropsFromCredential(\n credential,\n credential.claims,\n config,\n notice,\n testID,\n labels,\n );\n const card = {\n header: {\n ...header,\n accessory: rightAccessory,\n },\n ...cardProps,\n };\n const attributes: CredentialAttribute[] = request.fields.map((field) => {\n const claim = spreadClaims(credential.claims).find(({ key }) => {\n return key === field.keyMap[credential.id];\n });\n\n const attribute = selectCredentialCardAttributeFromClaim(field.id, config, testID, labels, claim, field);\n return {\n ...attribute,\n rightAccessory: (\n <Selector status={field.required && !claim ? SelectorStatus.Rejected : SelectorStatus.Required} />\n ),\n };\n });\n return {\n attributes: nestAttributes(attributes),\n card,\n };\n};\n"],"mappings":"AAOA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAKEC,QAAQ,EACRC,cAAc,QACT,gCAAgC;AAEvC,SAASC,2BAA2B,EAAEC,qBAAqB,EAAEC,qBAAqB,QAAQ,2BAA2B;AACrH,SAASC,YAAY,QAAQ,WAAW;AACxC,SAEEC,6BAA6B,EAC7BC,oCAAoC,EACpCC,gBAAgB,EAChBC,cAAc,EACdC,2BAA2B,EAC3BC,aAAa,QACR,cAAc;AAErB,OAAO,MAAMC,iCAAiC,GAAGA,CAC/CC,UAA4B,EAC5BC,WAAoB,EACpBC,QAAiB,EACjBC,4BAAqC,EACrCC,MAAc,EACdC,MAAwC,EACxCC,MAAc,EACdC,MAAiC,KACmC;EACpE,IAAIC,sBASS;EACb,IAAIP,WAAW,EAAE;IACfO,sBAAsB,GAAG;MACvBC,0BAA0B,EAAE,IAAI;MAChCC,uBAAuB,EAAEH,MAAM,CAACI,OAAO;MACvCC,sBAAsB,EAAEpB,YAAY,CAACc,MAAM,EAAE,gBAAgB;IAC/D,CAAC;EACH,CAAC,MAAM,IAAI,CAACJ,QAAQ,IAAIC,4BAA4B,EAAE;IAC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AQ,GAAG9C,cAAc,CAACgD;MAAS,CAAE;IAErG,CAAC;EACH,CAAC,CAAC;EACF,OAAO;IACLuC,UAAU,EAAE/E,cAAc,CAAC+E,UAAU,CAAC;IACtC5D;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ export const getQueryKeyFromHistoryListQueryParams = queryParams => {
|
|
|
20
20
|
}
|
|
21
21
|
const {
|
|
22
22
|
entityId,
|
|
23
|
-
|
|
23
|
+
actions,
|
|
24
24
|
entityTypes,
|
|
25
25
|
createdDateFrom,
|
|
26
26
|
createdDateTo,
|
|
@@ -31,7 +31,7 @@ export const getQueryKeyFromHistoryListQueryParams = queryParams => {
|
|
|
31
31
|
searchType,
|
|
32
32
|
proofSchemaId
|
|
33
33
|
} = queryParams;
|
|
34
|
-
return [entityId,
|
|
34
|
+
return [entityId, actions, entityTypes, createdDateFrom, createdDateTo, identifierId, credentialId, credentialSchemaId, searchText, searchType, proofSchemaId];
|
|
35
35
|
};
|
|
36
36
|
export const getQueryKeyFromCredentialSchemaListQueryParams = queryParams => {
|
|
37
37
|
if (!queryParams) {
|
|
@@ -89,4 +89,21 @@ export const getQueryKeyFromDidListQueryParams = queryParams => {
|
|
|
89
89
|
} = queryParams;
|
|
90
90
|
return [name, did, type, deactivated, keyAlgorithms, keyRoles];
|
|
91
91
|
};
|
|
92
|
+
export const getQueryKeyFromIdentifierListQueryParams = queryParams => {
|
|
93
|
+
if (!queryParams) {
|
|
94
|
+
return [];
|
|
95
|
+
}
|
|
96
|
+
const {
|
|
97
|
+
isRemote,
|
|
98
|
+
didMethods,
|
|
99
|
+
state,
|
|
100
|
+
keyStorages,
|
|
101
|
+
keyAlgorithms,
|
|
102
|
+
exact,
|
|
103
|
+
keyRoles,
|
|
104
|
+
types,
|
|
105
|
+
name
|
|
106
|
+
} = queryParams;
|
|
107
|
+
return [name, types, state, isRemote, didMethods, keyStorages, keyAlgorithms, exact, keyRoles];
|
|
108
|
+
};
|
|
92
109
|
//# sourceMappingURL=query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getQueryKeyFromCredentialListQueryParams","queryParams","name","sort","sortDirection","exact","role","ids","status","include","getQueryKeyFromHistoryListQueryParams","entityId","
|
|
1
|
+
{"version":3,"names":["getQueryKeyFromCredentialListQueryParams","queryParams","name","sort","sortDirection","exact","role","ids","status","include","getQueryKeyFromHistoryListQueryParams","entityId","actions","entityTypes","createdDateFrom","createdDateTo","identifierId","credentialId","credentialSchemaId","searchText","searchType","proofSchemaId","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","proofStates","proofSchemaIds","getQueryKeyFromDidListQueryParams","did","type","deactivated","keyAlgorithms","keyRoles","getQueryKeyFromIdentifierListQueryParams","isRemote","didMethods","state","keyStorages","types"],"sources":["query.tsx"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n IdentifierListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams?: Partial<CredentialListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, role, ids, status, include } = queryParams;\n return [name, sort, sortDirection, exact, role, ids, status, include];\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams?: Partial<HistoryListQuery>) => {\n if (!queryParams) {\n return [];\n }\n\n const {\n entityId,\n actions,\n entityTypes,\n createdDateFrom,\n createdDateTo,\n identifierId,\n credentialId,\n credentialSchemaId,\n searchText,\n searchType,\n proofSchemaId,\n } = queryParams;\n return [\n entityId,\n actions,\n entityTypes,\n createdDateFrom,\n createdDateTo,\n identifierId,\n credentialId,\n credentialSchemaId,\n searchText,\n searchType,\n proofSchemaId,\n ];\n};\n\nexport const getQueryKeyFromCredentialSchemaListQueryParams = (queryParams?: Partial<CredentialSchemaListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids, include } = queryParams;\n return [name, sort, sortDirection, exact, ids, include];\n};\n\nexport const getQueryKeyFromProofSchemaListQueryParams = (queryParams?: Partial<ProofSchemaListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids } = queryParams;\n return [name, sort, sortDirection, exact, ids];\n};\n\nexport const getQueryKeyFromProofListQueryParams = (queryParams?: Partial<ProofListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids, proofStates, proofSchemaIds } = queryParams;\n return [name, sort, sortDirection, exact, ids, proofStates, proofSchemaIds];\n};\n\nexport const getQueryKeyFromDidListQueryParams = (queryParams?: Partial<DidListQuery>) => {\n if (!queryParams) {\n return [];\n }\n\n const { name, did, type, deactivated, keyAlgorithms, keyRoles } = queryParams;\n return [name, did, type, deactivated, keyAlgorithms, keyRoles];\n};\n\nexport const getQueryKeyFromIdentifierListQueryParams = (queryParams?: Partial<IdentifierListQuery>) => {\n if (!queryParams) {\n return [];\n }\n\n const { isRemote, didMethods, state, keyStorages, keyAlgorithms, exact, keyRoles, types, name } = queryParams;\n return [name, types, state, isRemote, didMethods, keyStorages, keyAlgorithms, exact, keyRoles];\n};\n"],"mappings":"AAUA,OAAO,MAAMA,wCAAwC,GAAIC,WAA0C,IAAK;EACtG,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EACA,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC,aAAa;IAAEC,KAAK;IAAEC,IAAI;IAAEC,GAAG;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGR,WAAW;EACpF,OAAO,CAACC,IAAI,EAAEC,IAAI,EAAEC,aAAa,EAAEC,KAAK,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,CAAC;AACvE,CAAC;AAED,OAAO,MAAMC,qCAAqC,GAAIT,WAAuC,IAAK;EAChG,IAAI,CAACA,WA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AAEC,IAAI,EAAEC,aAAa,EAAEC,KAAK,EAAEE,GAAG,EAAEkB,WAAW,EAAEC,cAAc,CAAC;AAC7E,CAAC;AAED,OAAO,MAAMC,iCAAiC,GAAI1B,WAAmC,IAAK;EACxF,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EAEA,MAAM;IAAEC,IAAI;IAAE0B,GAAG;IAAEC,IAAI;IAAEC,WAAW;IAAEC,aAAa;IAAEC;EAAS,CAAC,GAAG/B,WAAW;EAC7E,OAAO,CAACC,IAAI,EAAE0B,GAAG,EAAEC,IAAI,EAAEC,WAAW,EAAEC,aAAa,EAAEC,QAAQ,CAAC;AAChE,CAAC;AAED,OAAO,MAAMC,wCAAwC,GAAIhC,WAA0C,IAAK;EACtG,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EAEA,MAAM;IAAEiC,QAAQ;IAAEC,UAAU;IAAEC,KAAK;IAAEC,WAAW;IAAEN,aAAa;IAAE1B,KAAK;IAAE2B,QAAQ;IAAEM,KAAK;IAAEpC;EAAK,CAAC,GAAGD,WAAW;EAC7G,OAAO,CAACC,IAAI,EAAEoC,KAAK,EAAEF,KAAK,EAAEF,QAAQ,EAAEC,UAAU,EAAEE,WAAW,EAAEN,aAAa,EAAE1B,KAAK,EAAE2B,QAAQ,CAAC;AAChG,CAAC","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@ import { TrustEntity } from '@procivis/react-native-one-core';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { AttributesLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
|
|
4
4
|
interface EntityAttributesProps {
|
|
5
|
+
certificate?: string;
|
|
5
6
|
did?: string;
|
|
6
7
|
trustEntity?: TrustEntity;
|
|
7
8
|
trusted: boolean;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { TrustEntityRoleEnum } from '@procivis/react-native-one-core';
|
|
2
|
-
import { IdentifierListItem } from '@procivis/react-native-one-core/dist/src/identifier';
|
|
1
|
+
import { IdentifierListItem, TrustEntityRoleEnum } from '@procivis/react-native-one-core';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
5
4
|
import { AttributesLabels, EntityLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { TrustEntity, TrustEntityRoleEnum } from '@procivis/react-native-one-core';
|
|
2
|
-
import { IdentifierListItem } from '@procivis/react-native-one-core/dist/src/identifier';
|
|
1
|
+
import { IdentifierListItem, TrustEntity, TrustEntityRoleEnum } from '@procivis/react-native-one-core';
|
|
3
2
|
import { FC, ReactNode } from 'react';
|
|
4
3
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
5
4
|
export type EntityDetailsLabels = {
|
|
@@ -10,6 +9,8 @@ export type EntityDetailsProps = {
|
|
|
10
9
|
renderMore?: (trustEntity: TrustEntity) => ReactNode;
|
|
11
10
|
role: Exclude<TrustEntityRoleEnum, TrustEntityRoleEnum.BOTH>;
|
|
12
11
|
style?: StyleProp<ViewStyle>;
|
|
12
|
+
sublineColor?: string;
|
|
13
|
+
textColor?: string;
|
|
13
14
|
testID?: string;
|
|
14
15
|
} & ({
|
|
15
16
|
identifier?: IdentifierListItem;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { EntityDetailsLabels, EntityDetailsProps } from './entity-details';
|
|
2
|
+
import EntityDetails from './entity-details';
|
|
2
3
|
export { EntityDetails, EntityDetailsLabels, EntityDetailsProps };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TouchableWithoutFeedbackProps } from 'react-native';
|
|
2
|
+
import { TouchableWithoutFeedbackProps, View } from 'react-native';
|
|
3
3
|
export interface HoldButtonProps extends Omit<TouchableWithoutFeedbackProps, 'children' | 'onLayout' | 'onPress' | 'onLongPress' | 'onPressIn' | 'onPressOut'> {
|
|
4
4
|
title: string;
|
|
5
5
|
subtitlePrefix: string;
|
|
@@ -12,5 +12,5 @@ export interface HoldButtonProps extends Omit<TouchableWithoutFeedbackProps, 'ch
|
|
|
12
12
|
*
|
|
13
13
|
* follows design: https://www.figma.com/design/cCmAyBQrQWCQZuDi85pJfe/Procivis-One-Wallet-Developments-2025?node-id=1-871
|
|
14
14
|
*/
|
|
15
|
-
declare const HoldButton: React.ForwardRefExoticComponent<HoldButtonProps & React.RefAttributes<import("react-native").
|
|
15
|
+
declare const HoldButton: React.ForwardRefExoticComponent<HoldButtonProps & React.RefAttributes<React.ForwardRefExoticComponent<import("react-native").TouchableOpacityProps & React.RefAttributes<View>>>>;
|
|
16
16
|
export default HoldButton;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { CheckboxProps } from './checkbox';
|
|
2
|
+
import { Checkbox } from './checkbox';
|
|
3
|
+
import type { SwitchProps } from './switch';
|
|
4
|
+
import { Switch } from './switch';
|
|
3
5
|
export { Checkbox, CheckboxProps, Switch, SwitchProps };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { AvatarProps } from './avatar';
|
|
2
|
+
import Avatar from './avatar';
|
|
3
|
+
import type { EntityClusterProps } from './entity-cluster';
|
|
4
|
+
import EntityCluster from './entity-cluster';
|
|
3
5
|
export { Avatar, AvatarProps };
|
|
4
6
|
export { EntityCluster, EntityClusterProps };
|
|
@@ -14,7 +14,10 @@ export type HistoryDetailsLabels = {
|
|
|
14
14
|
title: string;
|
|
15
15
|
};
|
|
16
16
|
type CredentialDetails = Omit<CredentialDetailsProps, 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'>;
|
|
17
|
-
type CredentialCard = Omit<CredentialDetailsCardListItemProps, 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'
|
|
17
|
+
type CredentialCard = Omit<CredentialDetailsCardListItemProps, 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'> & {
|
|
18
|
+
/** default: true */
|
|
19
|
+
headerPressable?: boolean;
|
|
20
|
+
};
|
|
18
21
|
export type HistoryDetailsViewProps = {
|
|
19
22
|
assets?: {
|
|
20
23
|
header?: CredentialHeaderProps & {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { DataItemProps } from './data-item';
|
|
2
|
+
import DataItem from './data-item';
|
|
3
|
+
import type { HistoryItemViewProps } from './history-item';
|
|
4
|
+
import HistoryItemView from './history-item';
|
|
3
5
|
import HistorySectionHeaderView from './history-section-header';
|
|
4
|
-
import
|
|
6
|
+
import type { HistorySectionListItemProps } from './history-section-list-item';
|
|
7
|
+
import HistorySectionListItem from './history-section-list-item';
|
|
5
8
|
export * from './history-details';
|
|
6
9
|
export { DataItem, DataItemProps };
|
|
7
10
|
export { HistoryItemView, HistoryItemViewProps };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import type { RadioGroupItem, RadioGroupProps } from './radio-group';
|
|
2
|
+
import RadioGroup from './radio-group';
|
|
3
|
+
import type { SelectionInputChoice, SelectionInputProps } from './selection-input';
|
|
4
|
+
import SelectionInput from './selection-input';
|
|
5
|
+
import type { TextInputProps } from './text-input';
|
|
6
|
+
import TextInput, { TextInputAccessory } from './text-input';
|
|
4
7
|
export { RadioGroup, RadioGroupItem, RadioGroupProps };
|
|
5
8
|
export { SelectionInput, SelectionInputChoice, SelectionInputProps };
|
|
6
9
|
export { TextInput, TextInputAccessory, TextInputProps };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { ListSectionHeaderProps } from './list-section-header';
|
|
2
|
+
import ListSectionHeader from './list-section-header';
|
|
3
|
+
import type { ListTitleHeaderProps } from './list-title-header';
|
|
4
|
+
import ListTitleHeader from './list-title-header';
|
|
3
5
|
export { ListSectionHeader, ListSectionHeaderProps };
|
|
4
6
|
export { ListTitleHeader, ListTitleHeaderProps };
|
|
5
7
|
export * from './wallet';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { LoaderViewProps } from './loader';
|
|
2
|
+
import LoaderView, { LoaderViewState } from './loader';
|
|
3
|
+
import type { LoadingResultScreenProps } from './loading-result';
|
|
4
|
+
import LoadingResultScreen from './loading-result';
|
|
3
5
|
export { LoaderView, LoaderViewProps, LoaderViewState };
|
|
4
6
|
export { LoadingResultScreen, LoadingResultScreenProps };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Biometry } from './keypad';
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
2
|
+
import type { PinCodeScreenActions, PinCodeScreenProps } from './pin-code-screen';
|
|
3
|
+
import { PinCodeScreen } from './pin-code-screen';
|
|
4
|
+
import type { PinLockModalLabels } from './pin-lock';
|
|
5
|
+
import PinLockModal from './pin-lock';
|
|
4
6
|
export { Biometry, PinCodeScreen, PinCodeScreenActions, PinCodeScreenProps, PinLockModal, PinLockModalLabels };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IdentifierListItem } from '@procivis/react-native-one-core
|
|
1
|
+
import { IdentifierListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import { FunctionComponent } from 'react';
|
|
3
3
|
import { ContextRole } from '../../components/entity/entity-details-with-buttons';
|
|
4
4
|
import SectionEntityCluster from '../entity/entity-cluster';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import type { AnimatedSearchBarProps } from './animated-search-bar';
|
|
2
|
+
import AnimatedSearchBar from './animated-search-bar';
|
|
3
|
+
import type { SearchBarProps } from './search-bar';
|
|
4
|
+
import SearchBar from './search-bar';
|
|
3
5
|
export { AnimatedSearchBar, AnimatedSearchBarProps };
|
|
4
6
|
export { SearchBar, SearchBarProps };
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import type { ButtonSettingProps } from './button-setting';
|
|
2
|
+
import ButtonSetting from './button-setting';
|
|
3
|
+
import type { SettingItemProps } from './setting-item';
|
|
4
|
+
import SettingItem from './setting-item';
|
|
5
|
+
import type { SettingItemSeparatorProps } from './setting-item-separator';
|
|
6
|
+
import SettingItemSeparator from './setting-item-separator';
|
|
7
|
+
import type { SettingsButtonProps } from './settings-button';
|
|
8
|
+
import SettingsButton from './settings-button';
|
|
9
|
+
import type { SwitchSettingProps } from './switch-setting';
|
|
10
|
+
import SwitchSetting from './switch-setting';
|
|
6
11
|
export { ButtonSetting, ButtonSettingProps };
|
|
7
12
|
export { SettingItem, SettingItemProps };
|
|
8
13
|
export { SettingItemSeparator, SettingItemSeparatorProps };
|
|
@@ -10,4 +10,9 @@ export declare const useUnpackBackup: () => import("react-query").UseMutationRes
|
|
|
10
10
|
}, unknown>;
|
|
11
11
|
export declare const useFinalizeImport: () => import("react-query").UseMutationResult<void, unknown, void, unknown>;
|
|
12
12
|
export declare const useRollbackImport: () => import("react-query").UseMutationResult<void, unknown, void, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Finalize backup import and extract/prepare identifiers
|
|
15
|
+
* @param {IdentifiersInitializationConfig} config Select desired keys/dids to be restored/created
|
|
16
|
+
* @returns [hwIdentifierId, swIdentifierId]
|
|
17
|
+
*/
|
|
13
18
|
export declare const useBackupFinalizeImportProcedure: ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => () => Promise<[string | null, string | undefined]>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { ONECore } from '@procivis/react-native-one-core';
|
|
1
2
|
export declare const SW_DID_NAME_PREFIX = "holder-did-sw-key";
|
|
2
3
|
export declare const HW_DID_NAME_PREFIX = "holder-did-hw-key";
|
|
4
|
+
export declare const generateHwIdentifier: (core: ONECore, organisationId: string) => Promise<string | null>;
|
|
5
|
+
export declare const generateSwIdentifier: (core: ONECore, organisationId: string) => Promise<string>;
|
|
3
6
|
export interface IdentifiersInitializationConfig {
|
|
4
7
|
generateHwKey: boolean;
|
|
5
8
|
generateSwKey: boolean;
|
|
@@ -7,6 +10,6 @@ export interface IdentifiersInitializationConfig {
|
|
|
7
10
|
/**
|
|
8
11
|
* Create base local identifiers
|
|
9
12
|
* @param {IdentifiersInitializationConfig} config Select desired keys/dids to be created
|
|
10
|
-
* @returns [
|
|
13
|
+
* @returns [hwIdentifierId, swIdentifierId]
|
|
11
14
|
*/
|
|
12
15
|
export declare const useInitializeONECoreIdentifiers: ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => () => Promise<[string | null, string | null]>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
+
import { IdentifierListQuery } from "@procivis/react-native-one-core";
|
|
1
2
|
export declare const IDENTIFIER_DETAIL_QUERY_KEY = "identifier-detail";
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const IDENTIFIER_LIST_QUERY_KEY = "identifier-list";
|
|
4
|
+
export declare const useIdentifierDetails: (identifierId: string | undefined) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").IdentifierDetail | undefined, unknown>;
|
|
5
|
+
export declare const useIdentifiers: (identifierFilter?: Partial<IdentifierListQuery>) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").ItemList<import("@procivis/react-native-one-core").IdentifierListItem>, unknown>;
|
|
@@ -37,6 +37,7 @@ export declare const useCleanupUnusedProofs: () => void;
|
|
|
37
37
|
export declare const useShareProof: (proofUrlProps: ProofUrlHookParams | undefined, enabled: boolean) => {
|
|
38
38
|
bleAdapterDisabled: boolean;
|
|
39
39
|
url?: string | undefined;
|
|
40
|
+
error?: unknown;
|
|
40
41
|
} | undefined;
|
|
41
42
|
export declare const useRetainProofCheck: (proofId?: string) => import("react-query").UseMutationResult<string, unknown, void, unknown>;
|
|
42
43
|
export declare const useDeleteProofData: (proofId: string) => import("react-query").UseMutationResult<void, unknown, void, unknown>;
|
|
@@ -3,9 +3,15 @@ export declare const TRUST_ENTITY_DETAIL_QUERY_KEY = "trust-entity-detail";
|
|
|
3
3
|
export declare const REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY = "remote-trust-entity-detail";
|
|
4
4
|
export declare const useCreateTrustAnchor: (publisherReference: string) => (core: ONECore) => Promise<void>;
|
|
5
5
|
export declare const useTrustEntity: (identifierId: string | undefined) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").TrustEntity | null | undefined, unknown>;
|
|
6
|
-
export declare const useRemoteTrustEntity: (
|
|
7
|
-
export declare const useCreateRemoteTrustEntity: () => import("react-query").UseMutationResult<string, unknown, CreateRemoteTrustEntityRequest,
|
|
8
|
-
|
|
6
|
+
export declare const useRemoteTrustEntity: (identifierId: string | undefined) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").RemoteTrustEntity | undefined, unknown>;
|
|
7
|
+
export declare const useCreateRemoteTrustEntity: () => import("react-query").UseMutationResult<string, unknown, Omit<CreateRemoteTrustEntityRequest, "didId"> & {
|
|
8
|
+
identifierId?: string | undefined;
|
|
9
|
+
didId?: string | undefined;
|
|
10
|
+
}, unknown>;
|
|
11
|
+
export declare const useUpdateRemoteTrustEntity: () => import("react-query").UseMutationResult<void, unknown, Omit<UpdateRemoteTrustEntityRequest, "didId"> & {
|
|
12
|
+
identifierId?: string | undefined;
|
|
13
|
+
didId?: string | undefined;
|
|
14
|
+
}, unknown>;
|
|
9
15
|
export declare enum TrustManagementEnum {
|
|
10
16
|
SimpleTrustList = "SIMPLE_TRUST_LIST"
|
|
11
17
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { CredentialListQuery, CredentialSchemaListQuery, DidListQuery, HistoryListQuery, ProofListQuery, ProofSchemaListQuery } from '@procivis/react-native-one-core';
|
|
1
|
+
import { CredentialListQuery, CredentialSchemaListQuery, DidListQuery, HistoryListQuery, IdentifierListQuery, ProofListQuery, ProofSchemaListQuery } from '@procivis/react-native-one-core';
|
|
2
2
|
export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<CredentialListQuery>) => (string | string[] | undefined)[];
|
|
3
|
-
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
|
|
3
|
+
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | import("@procivis/react-native-one-core").HistoryActionEnum[] | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
|
|
4
4
|
export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<CredentialSchemaListQuery>) => (string | string[] | undefined)[];
|
|
5
5
|
export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | string[] | undefined)[];
|
|
6
6
|
export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | string[] | undefined)[];
|
|
7
7
|
export declare const getQueryKeyFromDidListQueryParams: (queryParams?: Partial<DidListQuery>) => (string | boolean | string[] | undefined)[];
|
|
8
|
+
export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<IdentifierListQuery>) => (string | boolean | string[] | undefined)[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procivis/one-react-native-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.47",
|
|
4
4
|
"author": "Procivis AG (https://procivis.ch)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Common Procivis ONE UI components for react-native",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@babel/runtime": "^7.25.0",
|
|
52
52
|
"@commitlint/config-conventional": "^11.0.0",
|
|
53
53
|
"@gorhom/bottom-sheet": "^5.1.2",
|
|
54
|
-
"@procivis/react-native-one-core": "1.
|
|
54
|
+
"@procivis/react-native-one-core": "1.52216.0",
|
|
55
55
|
"@procivis/react-native-picker": "5.0.3",
|
|
56
56
|
"@react-native-async-storage/async-storage": "^1.17.3",
|
|
57
57
|
"@react-native-community/blur": "^4.4.0",
|
|
@@ -138,7 +138,7 @@
|
|
|
138
138
|
"vite": "^6.2.2"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
|
-
"@procivis/react-native-one-core": "^1.
|
|
141
|
+
"@procivis/react-native-one-core": "^1.52216.0",
|
|
142
142
|
"@procivis/react-native-picker": "*",
|
|
143
143
|
"@react-native-community/blur": "*",
|
|
144
144
|
"@react-native-community/netinfo": "^11.4.1",
|
|
@@ -277,5 +277,10 @@
|
|
|
277
277
|
]
|
|
278
278
|
]
|
|
279
279
|
},
|
|
280
|
-
"packageManager": "pnpm@10.5.2"
|
|
281
|
-
|
|
280
|
+
"packageManager": "pnpm@10.5.2",
|
|
281
|
+
"pnpm": {
|
|
282
|
+
"patchedDependencies": {
|
|
283
|
+
"react-native-web": "patches/react-native-web.patch"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { TrustEntity } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FC, memo } from 'react';
|
|
3
|
-
import { View } from 'react-native';
|
|
3
|
+
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
|
|
5
5
|
import { NerdModeItem } from '../../ui-components/nerd-view';
|
|
6
6
|
import { AttributesLabels, EntityType } from '../../ui-components/screens/nerd-mode-screen';
|
|
7
7
|
import { addElementIf } from '../../utils/array';
|
|
8
8
|
|
|
9
9
|
interface EntityAttributesProps {
|
|
10
|
+
certificate?: string;
|
|
10
11
|
did?: string;
|
|
11
12
|
trustEntity?: TrustEntity;
|
|
12
13
|
trusted: boolean;
|
|
@@ -16,6 +17,7 @@ interface EntityAttributesProps {
|
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
20
|
+
certificate,
|
|
19
21
|
did,
|
|
20
22
|
trustEntity,
|
|
21
23
|
trusted,
|
|
@@ -40,6 +42,12 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
|
40
42
|
highlightedText: didMethod,
|
|
41
43
|
testID: 'issuerDID',
|
|
42
44
|
}),
|
|
45
|
+
...addElementIf(Boolean(certificate), {
|
|
46
|
+
attributeKey: entityType === EntityType.CredentialEntity ? labels.issuerIdentifier : labels.entityIdentifier,
|
|
47
|
+
attributeText: certificate,
|
|
48
|
+
canBeCopied: true,
|
|
49
|
+
testID: 'issuerCertificate',
|
|
50
|
+
}),
|
|
43
51
|
...addElementIf(trusted && Boolean(trustEntity?.role), {
|
|
44
52
|
attributeKey: labels.role,
|
|
45
53
|
highlightedText: trustEntity?.role,
|
|
@@ -47,7 +55,7 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
|
47
55
|
}),
|
|
48
56
|
];
|
|
49
57
|
return (
|
|
50
|
-
<View>
|
|
58
|
+
<View style={styles.wrapper}>
|
|
51
59
|
{attributes.map((attribute) => (
|
|
52
60
|
<NerdModeItem
|
|
53
61
|
key={attribute.attributeKey}
|
|
@@ -60,4 +68,10 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
|
60
68
|
);
|
|
61
69
|
};
|
|
62
70
|
|
|
71
|
+
const styles = StyleSheet.create({
|
|
72
|
+
wrapper: {
|
|
73
|
+
marginBottom: 20,
|
|
74
|
+
}
|
|
75
|
+
})
|
|
76
|
+
|
|
63
77
|
export default memo(EntityAttributes);
|