@procivis/one-react-native-components 0.3.47 → 0.3.53

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/lib/commonjs/components/entity/entity-details.js +2 -2
  2. package/lib/commonjs/components/entity/entity-details.js.map +1 -1
  3. package/lib/commonjs/components/history/history-list-screen.js +2 -1
  4. package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
  5. package/lib/commonjs/ui-components/icons/icons.js +32 -1
  6. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  7. package/lib/commonjs/utils/hooks/core/credentials.js +31 -1
  8. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  9. package/lib/commonjs/utils/hooks/core/trust-entity.js +3 -2
  10. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
  11. package/lib/commonjs/utils/parsers/credential.js +2 -2
  12. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  13. package/lib/commonjs/utils/parsers/query.js +20 -101
  14. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  15. package/lib/module/components/entity/entity-details.js +3 -3
  16. package/lib/module/components/entity/entity-details.js.map +1 -1
  17. package/lib/module/components/history/history-list-screen.js +2 -1
  18. package/lib/module/components/history/history-list-screen.js.map +1 -1
  19. package/lib/module/ui-components/icons/icons.js +30 -0
  20. package/lib/module/ui-components/icons/icons.js.map +1 -1
  21. package/lib/module/utils/hooks/core/credentials.js +28 -0
  22. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  23. package/lib/module/utils/hooks/core/trust-entity.js +4 -3
  24. package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
  25. package/lib/module/utils/parsers/credential.js +2 -2
  26. package/lib/module/utils/parsers/credential.js.map +1 -1
  27. package/lib/module/utils/parsers/query.js +20 -101
  28. package/lib/module/utils/parsers/query.js.map +1 -1
  29. package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
  30. package/lib/typescript/utils/hooks/core/credentials.d.ts +3 -1
  31. package/lib/typescript/utils/parsers/query.d.ts +7 -7
  32. package/package.json +3 -3
  33. package/src/components/entity/entity-details.tsx +50 -17
  34. package/src/components/history/history-list-screen.tsx +1 -1
  35. package/src/ui-components/icons/icons.tsx +13 -0
  36. package/src/utils/hooks/core/credentials.ts +35 -1
  37. package/src/utils/hooks/core/trust-entity.ts +64 -48
  38. package/src/utils/parsers/credential.ts +2 -1
  39. package/src/utils/parsers/query.ts +176 -0
  40. package/src/utils/parsers/query.tsx +0 -92
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_icons","_date","_testID","_credentialImages","ValidityState","exports","getValidityState","credential","state","CredentialStateEnum","REVOKED","Revoked","SUSPENDED","Suspended","Valid","supportsSelectiveDisclosure","config","_formatConfig$capabil","formatConfig","format","schema","Boolean","capabilities","features","includes","FormatFeatureEnum","SelectiveDisclosure","undefined","findClaimByPathParts","path","claims","length","first","second","rest","claim","find","c","key","dataType","DataTypeEnum","Object","value","findClaimByPath","split","formatCredentialDetail","testID","_attributeValue$value","attributeValue","detailsCardAttributeValueFromClaim","hasMsoValidityIssues","mdocMsoValidity","mdocMsoValidityIssue","nextUpdate","Date","cardHeaderFromCredential","labels","_formatDateTimeLocali","_layoutProperties$log","_layoutProperties$log2","_layoutProperties$log3","credentialDetailPrimary","formatDateTimeLocalized","issuanceDate","credentialDetailSecondary","credentialDetailErrorColor","credentialDetailTestID","statusIcon","layoutProperties","suspendEndDate","suspendedUntil","suspended","concatTestID","CredentialWarningIcon","revoked","CredentialErrorIcon","validityIssues","primary","primaryAttribute","secondary","secondaryAttribute","color","logo","backgroundColor","credentialName","name","icon","image","imageSource","uri","iconLabelColor","fontColor","getCredentialCardPropsFromCredential","notice","_layoutProperties$bac","_layoutProperties$bac2","text","validityIssuesNotice","noticeIcon","CredentialNoticeWarningIcon","result","cardCarouselImages","getCarouselImagesFromClaims","cardImage","background","header","detailsCardAttributeFromClaim","id","pop","typeConfig","datatype","array","values","map","arrayValue","index","toString","type","Array","isArray","attributes","nestedClaim","_formatDateLocalized","String","date","formatDateLocalized","File","_typeConfig$params","params","showAs","detailsCardFromCredential","detailsCardFromCredentialWithClaims","card","nestAttributes","attribute","attributePath","push","parent","a","insertAttributeInObject","join","nestAttributeInDummyObject","pathParts","disabled","object","_object$attributes","nextParent","_object$attributes2","parseBase64Image","getCredentialSchemaWithoutImages","credentialSchema","_credentialSchema$lay","_credentialSchema$lay2","_credentialSchema$lay3","_credentialSchema$lay4"],"sources":["credential.ts"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n CredentialListItem,\n CredentialSchema,\n CredentialStateEnum,\n DataTypeEnum,\n FormatFeatureEnum,\n} from '@procivis/react-native-one-core';\n\nimport {\n CredentialAttribute,\n CredentialAttributeValue,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialErrorIcon, CredentialNoticeWarningIcon, CredentialWarningIcon } from '../../ui-components/icons';\nimport { formatDateLocalized, formatDateTimeLocalized } from '../date';\nimport { concatTestID } from '../testID';\nimport { getCarouselImagesFromClaims } from './credential-images';\n\nexport enum ValidityState {\n Revoked = 'revoked',\n Suspended = 'suspended',\n Valid = 'valid',\n}\n\nexport const getValidityState = (credential: CredentialListItem | undefined) => {\n if (credential?.state === CredentialStateEnum.REVOKED) {\n return ValidityState.Revoked;\n }\n if (credential?.state === CredentialStateEnum.SUSPENDED) {\n return ValidityState.Suspended;\n }\n return ValidityState.Valid;\n};\n\nexport const supportsSelectiveDisclosure = (credential: CredentialListItem | undefined, config: Config | undefined) => {\n const formatConfig = credential && config?.format[credential.schema.format];\n return formatConfig\n ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))\n : undefined;\n};\n\nconst findClaimByPathParts = (path: string[], claims?: Claim[]): Claim | undefined => {\n if (!claims?.length) {\n return undefined;\n }\n const [first, second, ...rest] = path;\n const claim = claims.find((c) => c.key === first);\n if (claim === undefined || second === undefined || claim.dataType !== DataTypeEnum.Object) {\n return claim;\n }\n\n return findClaimByPathParts([`${first}/${second}`, ...rest], claim.value as Claim[]);\n};\n\nexport const findClaimByPath = (path: string | undefined, claims: Claim[] | undefined) =>\n path ? findClaimByPathParts(path.split('/'), claims) : undefined;\n\nconst formatCredentialDetail = (claim: Claim, config: Config, testID: string): string => {\n const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);\n return attributeValue.value ?? '';\n};\n\nexport const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {\n const mdocMsoValidity: { nextUpdate: string } | undefined =\n 'mdocMsoValidity' in credential ? (credential.mdocMsoValidity as { nextUpdate: string }) : undefined;\n\n const mdocMsoValidityIssue = Boolean(\n mdocMsoValidity?.nextUpdate && new Date(mdocMsoValidity.nextUpdate) < new Date(),\n );\n\n return mdocMsoValidityIssue;\n};\n\nexport type CardHeaderLabels = {\n validityIssues: string;\n revoked: string;\n suspended: string;\n suspendedUntil: (date: string) => string;\n};\n\nexport const cardHeaderFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): Omit<CredentialHeaderProps, 'style'> => {\n let credentialDetailPrimary = formatDateTimeLocalized(new Date(credential.issuanceDate)) ?? '';\n\n let credentialDetailSecondary: string | undefined;\n let credentialDetailErrorColor: boolean | undefined;\n let credentialDetailTestID: string | undefined;\n let statusIcon;\n\n const { layoutProperties } = credential.schema;\n\n switch (credential.state) {\n case CredentialStateEnum.SUSPENDED:\n credentialDetailPrimary = credential.suspendEndDate\n ? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)\n : labels.suspended;\n credentialDetailTestID = concatTestID(testID, 'suspended');\n statusIcon = CredentialWarningIcon;\n break;\n case CredentialStateEnum.REVOKED:\n credentialDetailPrimary = labels.revoked;\n credentialDetailErrorColor = true;\n credentialDetailTestID = concatTestID(testID, 'revoked');\n statusIcon = CredentialErrorIcon;\n break;\n default: {\n if (hasMsoValidityIssues(credential)) {\n credentialDetailPrimary = labels.validityIssues;\n credentialDetailTestID = concatTestID(testID, 'validity-issue');\n statusIcon = CredentialWarningIcon;\n } else {\n const primary = findClaimByPath(layoutProperties?.primaryAttribute, claims);\n\n if (primary) {\n credentialDetailPrimary = formatCredentialDetail(primary, config, concatTestID(testID, 'primary'));\n }\n\n const secondary = findClaimByPath(layoutProperties?.secondaryAttribute, claims);\n\n if (secondary) {\n credentialDetailSecondary = formatCredentialDetail(secondary, config, concatTestID(testID, 'secondary'));\n }\n\n credentialDetailTestID = concatTestID(testID, 'detail');\n }\n break;\n }\n }\n return {\n color: layoutProperties?.logo?.backgroundColor,\n credentialDetailErrorColor,\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialName: credential.schema.name,\n icon: layoutProperties?.logo?.image\n ? {\n imageSource: {\n uri: layoutProperties.logo.image,\n },\n }\n : undefined,\n iconLabelColor: layoutProperties?.logo?.fontColor,\n statusIcon,\n testID,\n };\n};\n\nexport type CardLabels = CardHeaderLabels & {\n validityIssuesNotice: string;\n};\n\nexport const getCredentialCardPropsFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n const { layoutProperties } = credential.schema;\n\n if (hasMsoValidityIssues(credential)) {\n notice = {\n text: labels.validityIssuesNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n };\n }\n\n const result: Omit<CredentialCardProps, 'onHeaderPress' | 'style'> = {\n cardCarouselImages: getCarouselImagesFromClaims(claims, layoutProperties, concatTestID(testID, 'carousel')),\n cardImage: layoutProperties?.background?.image\n ? { imageSource: { uri: layoutProperties.background.image } }\n : undefined,\n color: layoutProperties?.background?.color,\n header: cardHeaderFromCredential(credential, claims, config, concatTestID(testID, 'header'), labels),\n testID,\n notice,\n };\n\n return result;\n};\n\nexport const detailsCardAttributeFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttribute => {\n const value = detailsCardAttributeValueFromClaim(claim, config, testID);\n return {\n id: claim.id,\n name: claim.key.split('/').pop(),\n path: claim.key,\n ...value,\n };\n};\n\nconst detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttributeValue => {\n const typeConfig = config?.datatype[claim.dataType];\n\n if (claim.array) {\n return {\n values: (claim.value || []).map((arrayValue, index) => {\n return detailsCardAttributeFromClaim(\n {\n ...arrayValue,\n id: `${arrayValue.id}/${index}`,\n },\n config,\n concatTestID(testID, index.toString()),\n );\n }),\n };\n } else {\n switch (typeConfig?.type) {\n case DataTypeEnum.Object: {\n if (!Array.isArray(claim.value)) {\n return { attributes: [] };\n }\n return {\n attributes: (claim.value as Claim[]).map((nestedClaim, index) =>\n detailsCardAttributeFromClaim(nestedClaim, config, concatTestID(testID, index.toString())),\n ),\n };\n }\n case DataTypeEnum.Date: {\n if (!claim.value) {\n // Don't try to parse empty values (which will return \"Invalid Date\")\n return { testID: testID, value: String(claim.value) };\n }\n const date = claim.value as string;\n return {\n testID: testID,\n value: formatDateLocalized(new Date(date)) ?? date,\n };\n }\n case DataTypeEnum.File: {\n if (typeConfig.params?.showAs === 'IMAGE') {\n return { image: { uri: claim.value as string }, testID: testID };\n } else {\n return { testID: testID, value: claim.value as string };\n }\n }\n default:\n return { testID: testID, value: String(claim.value) };\n }\n }\n};\n\nexport const detailsCardFromCredential = (\n credential: CredentialDetail,\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n return detailsCardFromCredentialWithClaims(credential, credential.claims, config, testID, labels);\n};\n\nexport const detailsCardFromCredentialWithClaims = (\n credential: CredentialDetail,\n claims: Claim[],\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const attributes: CredentialAttribute[] = claims.map((claim, index) =>\n detailsCardAttributeFromClaim(claim, config, concatTestID(testID, 'attribute', index.toString())),\n );\n\n const card = getCredentialCardPropsFromCredential(\n credential,\n claims,\n config,\n undefined,\n concatTestID(testID, 'card'),\n labels,\n );\n\n return {\n attributes,\n card,\n };\n};\n\n// Converts a flat list of attributes into a nested structure\n// modifies the names to not include slashes\nexport const nestAttributes = (attributes: CredentialAttribute[]): CredentialAttribute[] => {\n const result: CredentialAttribute[] = [];\n\n for (const attribute of attributes) {\n const attributePath = attribute.path.split('/');\n if (attributePath.length === 0) {\n result.push(attribute);\n } else {\n const [first, ...rest] = attributePath;\n const parent = result.find((a) => a.name === first);\n if (parent) {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, parent);\n } else {\n result.push(nestAttributeInDummyObject(attribute));\n }\n }\n }\n\n return result;\n};\n\n// We nest the leaf node in a (one or more) nested object(s)\n// to make sure the tree structure is correctly rendered in proof request screens.\nconst nestAttributeInDummyObject = (attribute: CredentialAttribute): CredentialAttribute => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n if (!rest.length) {\n return attribute;\n }\n\n // The dummy object is not selectable, and contains a placeholder ID\n // the user can't interact with it.\n return {\n attributes: [nestAttributeInDummyObject({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: attribute.path,\n };\n};\n\n// Recursively insert an attribute into an object\n// Will create nested objects if necessary\nconst insertAttributeInObject = (attribute: CredentialAttribute, object: CredentialAttribute) => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n\n const nextParent = object.attributes?.find((a) => a.name === first);\n\n if (!nextParent) {\n object.attributes?.push(nestAttributeInDummyObject(attribute));\n } else {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, nextParent);\n }\n};\n\nfunction parseBase64Image(image: string | undefined) {\n return image ? '__BASE64IMAGE__' : '';\n}\n\nexport function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchema) {\n return {\n ...credentialSchema,\n layoutProperties: {\n ...credentialSchema.layoutProperties,\n background: {\n ...credentialSchema.layoutProperties?.background,\n image: parseBase64Image(credentialSchema.layoutProperties?.background?.image),\n },\n logo: {\n ...credentialSchema.layoutProperties?.logo,\n image: parseBase64Image(credentialSchema.layoutProperties?.logo?.image),\n },\n },\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAmBA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAAkE,IAEtDK,aAAa,GAAAC,OAAA,CAAAD,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAMlB,MAAME,gBAAgB,GAAIC,UAA0C,IAAK;EAC9E,IAAI,CAAAA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,KAAK,MAAKC,uCAAmB,CAACC,OAAO,EAAE;IACrD,OAAON,aAAa,CAACO,OAAO;EAC9B;EACA,IAAI,CAAAJ,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,KAAK,MAAKC,uCAAmB,CAACG,SAAS,EAAE;IACvD,OAAOR,aAAa,CAACS,SAAS;EAChC;EACA,OAAOT,aAAa,CAACU,KAAK;AAC5B,CAAC;AAACT,OAAA,CAAAC,gBAAA,GAAAA,gBAAA;AAEK,MAAMS,2BAA2B,GAAGA,CAACR,UAA0C,EAAES,MAA0B,KAAK;EAAA,IAAAC,qBAAA;EACrH,MAAMC,YAAY,GAAGX,UAAU,KAAIS,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEG,MAAM,CAACZ,UAAU,CAACa,MAAM,CAACD,MAAM,CAAC;EAC3E,OAAOD,YAAY,GACfG,OAAO,EAAAJ,qBAAA,GAACC,YAAY,CAACI,YAAY,cAAAL,qBAAA,gBAAAA,qBAAA,GAAzBA,qBAAA,C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GAAG,EAAE;AACvC;AAEO,SAAS8D,gCAAgCA,CAACC,gBAAkC,EAAE;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EACnF,OAAO;IACL,GAAGJ,gBAAgB;IACnBlF,gBAAgB,EAAE;MAChB,GAAGkF,gBAAgB,CAAClF,gBAAgB;MACpCoC,UAAU,EAAE;QACV,KAAA+C,qBAAA,GAAGD,gBAAgB,CAAClF,gBAAgB,cAAAmF,qBAAA,uBAAjCA,qBAAA,CAAmC/C,UAAU;QAChDjB,KAAK,EAAE6D,gBAAgB,EAAAI,sBAAA,GAACF,gBAAgB,CAAClF,gBAAgB,cAAAoF,sBAAA,gBAAAA,sBAAA,GAAjCA,sBAAA,CAAmChD,UAAU,cAAAgD,sBAAA,uBAA7CA,sBAAA,CAA+CjE,KAAK;MAC9E,CAAC;MACDL,IAAI,EAAE;QACJ,KAAAuE,sBAAA,GAAGH,gBAAgB,CAAClF,gBAAgB,cAAAqF,sBAAA,uBAAjCA,sBAAA,CAAmCvE,IAAI;QAC1CK,KAAK,EAAE6D,gBAAgB,EAAAM,sBAAA,GAACJ,gBAAgB,CAAClF,gBAAgB,cAAAsF,sBAAA,gBAAAA,sBAAA,GAAjCA,sBAAA,CAAmCxE,IAAI,cAAAwE,sBAAA,uBAAvCA,sBAAA,CAAyCnE,KAAK;MACxE;IACF;EACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_icons","_date","_testID","_credentialImages","ValidityState","exports","getValidityState","credential","state","CredentialStateEnum","REVOKED","Revoked","SUSPENDED","Suspended","Valid","supportsSelectiveDisclosure","config","_formatConfig$capabil","formatConfig","format","schema","Boolean","capabilities","features","includes","FormatFeatureEnum","SelectiveDisclosure","undefined","findClaimByPathParts","path","claims","length","first","second","rest","claim","find","c","key","dataType","DataTypeEnum","Object","value","findClaimByPath","split","formatCredentialDetail","testID","_attributeValue$value","attributeValue","detailsCardAttributeValueFromClaim","hasMsoValidityIssues","mdocMsoValidity","mdocMsoValidityIssue","nextUpdate","Date","cardHeaderFromCredential","labels","_formatDateTimeLocali","_credential$issuanceD","_layoutProperties$log","_layoutProperties$log2","_layoutProperties$log3","credentialDetailPrimary","formatDateTimeLocalized","issuanceDate","createdDate","credentialDetailSecondary","credentialDetailErrorColor","credentialDetailTestID","statusIcon","layoutProperties","suspendEndDate","suspendedUntil","suspended","concatTestID","CredentialWarningIcon","revoked","CredentialErrorIcon","validityIssues","primary","primaryAttribute","secondary","secondaryAttribute","color","logo","backgroundColor","credentialName","name","icon","image","imageSource","uri","iconLabelColor","fontColor","getCredentialCardPropsFromCredential","notice","_layoutProperties$bac","_layoutProperties$bac2","text","validityIssuesNotice","noticeIcon","CredentialNoticeWarningIcon","result","cardCarouselImages","getCarouselImagesFromClaims","cardImage","background","header","detailsCardAttributeFromClaim","id","pop","typeConfig","datatype","array","values","map","arrayValue","index","toString","type","Array","isArray","attributes","nestedClaim","_formatDateLocalized","String","date","formatDateLocalized","File","_typeConfig$params","params","showAs","detailsCardFromCredential","detailsCardFromCredentialWithClaims","card","nestAttributes","attribute","attributePath","push","parent","a","insertAttributeInObject","join","nestAttributeInDummyObject","pathParts","disabled","object","_object$attributes","nextParent","_object$attributes2","parseBase64Image","getCredentialSchemaWithoutImages","credentialSchema","_credentialSchema$lay","_credentialSchema$lay2","_credentialSchema$lay3","_credentialSchema$lay4"],"sources":["credential.ts"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n CredentialListItem,\n CredentialSchema,\n CredentialStateEnum,\n DataTypeEnum,\n FormatFeatureEnum,\n} from '@procivis/react-native-one-core';\n\nimport {\n CredentialAttribute,\n CredentialAttributeValue,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialErrorIcon, CredentialNoticeWarningIcon, CredentialWarningIcon } from '../../ui-components/icons';\nimport { formatDateLocalized, formatDateTimeLocalized } from '../date';\nimport { concatTestID } from '../testID';\nimport { getCarouselImagesFromClaims } from './credential-images';\n\nexport enum ValidityState {\n Revoked = 'revoked',\n Suspended = 'suspended',\n Valid = 'valid',\n}\n\nexport const getValidityState = (credential: CredentialListItem | undefined) => {\n if (credential?.state === CredentialStateEnum.REVOKED) {\n return ValidityState.Revoked;\n }\n if (credential?.state === CredentialStateEnum.SUSPENDED) {\n return ValidityState.Suspended;\n }\n return ValidityState.Valid;\n};\n\nexport const supportsSelectiveDisclosure = (credential: CredentialListItem | undefined, config: Config | undefined) => {\n const formatConfig = credential && config?.format[credential.schema.format];\n return formatConfig\n ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))\n : undefined;\n};\n\nconst findClaimByPathParts = (path: string[], claims?: Claim[]): Claim | undefined => {\n if (!claims?.length) {\n return undefined;\n }\n const [first, second, ...rest] = path;\n const claim = claims.find((c) => c.key === first);\n if (claim === undefined || second === undefined || claim.dataType !== DataTypeEnum.Object) {\n return claim;\n }\n\n return findClaimByPathParts([`${first}/${second}`, ...rest], claim.value as Claim[]);\n};\n\nexport const findClaimByPath = (path: string | undefined, claims: Claim[] | undefined) =>\n path ? findClaimByPathParts(path.split('/'), claims) : undefined;\n\nconst formatCredentialDetail = (claim: Claim, config: Config, testID: string): string => {\n const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);\n return attributeValue.value ?? '';\n};\n\nexport const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {\n const mdocMsoValidity: { nextUpdate: string } | undefined =\n 'mdocMsoValidity' in credential ? (credential.mdocMsoValidity as { nextUpdate: string }) : undefined;\n\n const mdocMsoValidityIssue = Boolean(\n mdocMsoValidity?.nextUpdate && new Date(mdocMsoValidity.nextUpdate) < new Date(),\n );\n\n return mdocMsoValidityIssue;\n};\n\nexport type CardHeaderLabels = {\n validityIssues: string;\n revoked: string;\n suspended: string;\n suspendedUntil: (date: string) => string;\n};\n\nexport const cardHeaderFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): Omit<CredentialHeaderProps, 'style'> => {\n let credentialDetailPrimary =\n formatDateTimeLocalized(new Date(credential.issuanceDate ?? credential.createdDate)) ?? '';\n\n let credentialDetailSecondary: string | undefined;\n let credentialDetailErrorColor: boolean | undefined;\n let credentialDetailTestID: string | undefined;\n let statusIcon;\n\n const { layoutProperties } = credential.schema;\n\n switch (credential.state) {\n case CredentialStateEnum.SUSPENDED:\n credentialDetailPrimary = credential.suspendEndDate\n ? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)\n : labels.suspended;\n credentialDetailTestID = concatTestID(testID, 'suspended');\n statusIcon = CredentialWarningIcon;\n break;\n case CredentialStateEnum.REVOKED:\n credentialDetailPrimary = labels.revoked;\n credentialDetailErrorColor = true;\n credentialDetailTestID = concatTestID(testID, 'revoked');\n statusIcon = CredentialErrorIcon;\n break;\n default: {\n if (hasMsoValidityIssues(credential)) {\n credentialDetailPrimary = labels.validityIssues;\n credentialDetailTestID = concatTestID(testID, 'validity-issue');\n statusIcon = CredentialWarningIcon;\n } else {\n const primary = findClaimByPath(layoutProperties?.primaryAttribute, claims);\n\n if (primary) {\n credentialDetailPrimary = formatCredentialDetail(primary, config, concatTestID(testID, 'primary'));\n }\n\n const secondary = findClaimByPath(layoutProperties?.secondaryAttribute, claims);\n\n if (secondary) {\n credentialDetailSecondary = formatCredentialDetail(secondary, config, concatTestID(testID, 'secondary'));\n }\n\n credentialDetailTestID = concatTestID(testID, 'detail');\n }\n break;\n }\n }\n return {\n color: layoutProperties?.logo?.backgroundColor,\n credentialDetailErrorColor,\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialName: credential.schema.name,\n icon: layoutProperties?.logo?.image\n ? {\n imageSource: {\n uri: layoutProperties.logo.image,\n },\n }\n : undefined,\n iconLabelColor: layoutProperties?.logo?.fontColor,\n statusIcon,\n testID,\n };\n};\n\nexport type CardLabels = CardHeaderLabels & {\n validityIssuesNotice: string;\n};\n\nexport const getCredentialCardPropsFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n const { layoutProperties } = credential.schema;\n\n if (hasMsoValidityIssues(credential)) {\n notice = {\n text: labels.validityIssuesNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n };\n }\n\n const result: Omit<CredentialCardProps, 'onHeaderPress' | 'style'> = {\n cardCarouselImages: getCarouselImagesFromClaims(claims, layoutProperties, concatTestID(testID, 'carousel')),\n cardImage: layoutProperties?.background?.image\n ? { imageSource: { uri: layoutProperties.background.image } }\n : undefined,\n color: layoutProperties?.background?.color,\n header: cardHeaderFromCredential(credential, claims, config, concatTestID(testID, 'header'), labels),\n testID,\n notice,\n };\n\n return result;\n};\n\nexport const detailsCardAttributeFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttribute => {\n const value = detailsCardAttributeValueFromClaim(claim, config, testID);\n return {\n id: claim.id,\n name: claim.key.split('/').pop(),\n path: claim.key,\n ...value,\n };\n};\n\nconst detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttributeValue => {\n const typeConfig = config?.datatype[claim.dataType];\n\n if (claim.array) {\n return {\n values: (claim.value || []).map((arrayValue, index) => {\n return detailsCardAttributeFromClaim(\n {\n ...arrayValue,\n id: `${arrayValue.id}/${index}`,\n },\n config,\n concatTestID(testID, index.toString()),\n );\n }),\n };\n } else {\n switch (typeConfig?.type) {\n case DataTypeEnum.Object: {\n if (!Array.isArray(claim.value)) {\n return { attributes: [] };\n }\n return {\n attributes: (claim.value as Claim[]).map((nestedClaim, index) =>\n detailsCardAttributeFromClaim(nestedClaim, config, concatTestID(testID, index.toString())),\n ),\n };\n }\n case DataTypeEnum.Date: {\n if (!claim.value) {\n // Don't try to parse empty values (which will return \"Invalid Date\")\n return { testID: testID, value: String(claim.value) };\n }\n const date = claim.value as string;\n return {\n testID: testID,\n value: formatDateLocalized(new Date(date)) ?? date,\n };\n }\n case DataTypeEnum.File: {\n if (typeConfig.params?.showAs === 'IMAGE') {\n return { image: { uri: claim.value as string }, testID: testID };\n } else {\n return { testID: testID, value: claim.value as string };\n }\n }\n default:\n return { testID: testID, value: String(claim.value) };\n }\n }\n};\n\nexport const detailsCardFromCredential = (\n credential: CredentialDetail,\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n return detailsCardFromCredentialWithClaims(credential, credential.claims, config, testID, labels);\n};\n\nexport const detailsCardFromCredentialWithClaims = (\n credential: CredentialDetail,\n claims: Claim[],\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const attributes: CredentialAttribute[] = claims.map((claim, index) =>\n detailsCardAttributeFromClaim(claim, config, concatTestID(testID, 'attribute', index.toString())),\n );\n\n const card = getCredentialCardPropsFromCredential(\n credential,\n claims,\n config,\n undefined,\n concatTestID(testID, 'card'),\n labels,\n );\n\n return {\n attributes,\n card,\n };\n};\n\n// Converts a flat list of attributes into a nested structure\n// modifies the names to not include slashes\nexport const nestAttributes = (attributes: CredentialAttribute[]): CredentialAttribute[] => {\n const result: CredentialAttribute[] = [];\n\n for (const attribute of attributes) {\n const attributePath = attribute.path.split('/');\n if (attributePath.length === 0) {\n result.push(attribute);\n } else {\n const [first, ...rest] = attributePath;\n const parent = result.find((a) => a.name === first);\n if (parent) {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, parent);\n } else {\n result.push(nestAttributeInDummyObject(attribute));\n }\n }\n }\n\n return result;\n};\n\n// We nest the leaf node in a (one or more) nested object(s)\n// to make sure the tree structure is correctly rendered in proof request screens.\nconst nestAttributeInDummyObject = (attribute: CredentialAttribute): CredentialAttribute => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n if (!rest.length) {\n return attribute;\n }\n\n // The dummy object is not selectable, and contains a placeholder ID\n // the user can't interact with it.\n return {\n attributes: [nestAttributeInDummyObject({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: attribute.path,\n };\n};\n\n// Recursively insert an attribute into an object\n// Will create nested objects if necessary\nconst insertAttributeInObject = (attribute: CredentialAttribute, object: CredentialAttribute) => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n\n const nextParent = object.attributes?.find((a) => a.name === first);\n\n if (!nextParent) {\n object.attributes?.push(nestAttributeInDummyObject(attribute));\n } else {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, nextParent);\n }\n};\n\nfunction parseBase64Image(image: string | undefined) {\n return image ? '__BASE64IMAGE__' : '';\n}\n\nexport function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchema) {\n return {\n ...credentialSchema,\n layoutProperties: {\n ...credentialSchema.layoutProperties,\n background: {\n ...credentialSchema.layoutProperties?.background,\n image: parseBase64Image(credentialSchema.layoutProperties?.background?.image),\n },\n logo: {\n ...credentialSchema.layoutProperties?.logo,\n image: parseBase64Image(credentialSchema.layoutProperties?.logo?.image),\n },\n },\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAmBA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAAkE,IAEtDK,aAAa,GAAAC,OAAA,CAAAD,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAMlB,MAAME,gBAAgB,GAAIC,UAA0C,IAAK;EAC9E,IAAI,CAAAA,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAEC,KAAK,MAAKC,uCAAmB,CAACC,OAAO,EAAE;IACrD,O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AE;QACJ,KAAAuE,sBAAA,GAAGH,gBAAgB,CAAClF,gBAAgB,cAAAqF,sBAAA,uBAAjCA,sBAAA,CAAmCvE,IAAI;QAC1CK,KAAK,EAAE6D,gBAAgB,EAAAM,sBAAA,GAACJ,gBAAgB,CAAClF,gBAAgB,cAAAsF,sBAAA,gBAAAA,sBAAA,GAAjCA,sBAAA,CAAmCxE,IAAI,cAAAwE,sBAAA,uBAAvCA,sBAAA,CAAyCnE,KAAK;MACxE;IACF;EACF,CAAC;AACH","ignoreList":[]}
@@ -4,119 +4,38 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getQueryKeyFromProofSchemaListQueryParams = exports.getQueryKeyFromProofListQueryParams = exports.getQueryKeyFromIdentifierListQueryParams = exports.getQueryKeyFromHistoryListQueryParams = exports.getQueryKeyFromDidListQueryParams = exports.getQueryKeyFromCredentialSchemaListQueryParams = exports.getQueryKeyFromCredentialListQueryParams = void 0;
7
- const getQueryKeyFromCredentialListQueryParams = queryParams => {
8
- if (!queryParams) {
9
- return [];
10
- }
11
- const {
12
- name,
13
- sort,
14
- sortDirection,
15
- exact,
16
- role,
17
- ids,
18
- status,
19
- include
20
- } = queryParams;
21
- return [name, sort, sortDirection, exact, role, ids, status, include];
7
+ // otherwise produce a wrong return type which should trigger compilation error
8
+
9
+ /** Typecheck that all query params are included in the query key */
10
+ function getQueryKey(queryParams, params) {
11
+ return params.map(param => queryParams[param]);
12
+ }
13
+ const getQueryKeyFromCredentialListQueryParams = (queryParams = {}) => {
14
+ return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'name', 'searchText', 'searchType', 'sort', 'sortDirection', 'exact', 'role', 'ids', 'status', 'include', 'profile', 'createdDateAfter', 'createdDateBefore', 'lastModifiedAfter', 'lastModifiedBefore', 'issuanceDateAfter', 'issuanceDateBefore', 'revocationDateAfter', 'revocationDateBefore']);
22
15
  };
23
16
  exports.getQueryKeyFromCredentialListQueryParams = getQueryKeyFromCredentialListQueryParams;
24
- const getQueryKeyFromHistoryListQueryParams = queryParams => {
25
- if (!queryParams) {
26
- return [];
27
- }
28
- const {
29
- entityId,
30
- actions,
31
- entityTypes,
32
- createdDateFrom,
33
- createdDateTo,
34
- identifierId,
35
- credentialId,
36
- credentialSchemaId,
37
- searchText,
38
- searchType,
39
- proofSchemaId
40
- } = queryParams;
41
- return [entityId, actions, entityTypes, createdDateFrom, createdDateTo, identifierId, credentialId, credentialSchemaId, searchText, searchType, proofSchemaId];
17
+ const getQueryKeyFromHistoryListQueryParams = (queryParams = {}) => {
18
+ return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'entityId', 'actions', 'entityTypes', 'createdDateAfter', 'createdDateBefore', 'identifierId', 'credentialId', 'credentialSchemaId', 'proofSchemaId', 'search']);
42
19
  };
43
20
  exports.getQueryKeyFromHistoryListQueryParams = getQueryKeyFromHistoryListQueryParams;
44
- const getQueryKeyFromCredentialSchemaListQueryParams = queryParams => {
45
- if (!queryParams) {
46
- return [];
47
- }
48
- const {
49
- name,
50
- sort,
51
- sortDirection,
52
- exact,
53
- ids,
54
- include
55
- } = queryParams;
56
- return [name, sort, sortDirection, exact, ids, include];
21
+ const getQueryKeyFromCredentialSchemaListQueryParams = (queryParams = {}) => {
22
+ return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'name', 'sort', 'sortDirection', 'exact', 'ids', 'include', 'schemaId', 'formats', 'createdDateAfter', 'createdDateBefore', 'lastModifiedAfter', 'lastModifiedBefore']);
57
23
  };
58
24
  exports.getQueryKeyFromCredentialSchemaListQueryParams = getQueryKeyFromCredentialSchemaListQueryParams;
59
- const getQueryKeyFromProofSchemaListQueryParams = queryParams => {
60
- if (!queryParams) {
61
- return [];
62
- }
63
- const {
64
- name,
65
- sort,
66
- sortDirection,
67
- exact,
68
- ids
69
- } = queryParams;
70
- return [name, sort, sortDirection, exact, ids];
25
+ const getQueryKeyFromProofSchemaListQueryParams = (queryParams = {}) => {
26
+ return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'name', 'sort', 'sortDirection', 'exact', 'ids', 'formats', 'createdDateAfter', 'createdDateBefore', 'lastModifiedAfter', 'lastModifiedBefore']);
71
27
  };
72
28
  exports.getQueryKeyFromProofSchemaListQueryParams = getQueryKeyFromProofSchemaListQueryParams;
73
- const getQueryKeyFromProofListQueryParams = queryParams => {
74
- if (!queryParams) {
75
- return [];
76
- }
77
- const {
78
- name,
79
- sort,
80
- sortDirection,
81
- exact,
82
- ids,
83
- proofStates,
84
- proofSchemaIds
85
- } = queryParams;
86
- return [name, sort, sortDirection, exact, ids, proofStates, proofSchemaIds];
29
+ const getQueryKeyFromProofListQueryParams = (queryParams = {}) => {
30
+ return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'sort', 'sortDirection', 'name', 'ids', 'proofStates', 'proofRoles', 'proofSchemaIds', 'exact', 'profile', 'createdDateAfter', 'createdDateBefore', 'lastModifiedAfter', 'lastModifiedBefore', 'requestedDateAfter', 'requestedDateBefore', 'completedDateAfter', 'completedDateBefore']);
87
31
  };
88
32
  exports.getQueryKeyFromProofListQueryParams = getQueryKeyFromProofListQueryParams;
89
- const getQueryKeyFromDidListQueryParams = queryParams => {
90
- if (!queryParams) {
91
- return [];
92
- }
93
- const {
94
- name,
95
- did,
96
- type,
97
- deactivated,
98
- keyAlgorithms,
99
- keyRoles
100
- } = queryParams;
101
- return [name, did, type, deactivated, keyAlgorithms, keyRoles];
33
+ const getQueryKeyFromDidListQueryParams = (queryParams = {}) => {
34
+ return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'sort', 'sortDirection', 'name', 'did', 'type', 'deactivated', 'exact', 'keyAlgorithms', 'keyRoles', 'keyStorages', 'keyIds', 'didMethods']);
102
35
  };
103
36
  exports.getQueryKeyFromDidListQueryParams = getQueryKeyFromDidListQueryParams;
104
- const getQueryKeyFromIdentifierListQueryParams = queryParams => {
105
- if (!queryParams) {
106
- return [];
107
- }
108
- const {
109
- isRemote,
110
- didMethods,
111
- state,
112
- keyStorages,
113
- keyAlgorithms,
114
- exact,
115
- keyRoles,
116
- types,
117
- name
118
- } = queryParams;
119
- return [name, types, state, isRemote, didMethods, keyStorages, keyAlgorithms, exact, keyRoles];
37
+ const getQueryKeyFromIdentifierListQueryParams = (queryParams = {}) => {
38
+ return getQueryKey(queryParams, ['page', 'pageSize', 'organisationId', 'sort', 'sortDirection', 'name', 'types', 'state', 'exact', 'didMethods', 'isRemote', 'keyAlgorithms', 'keyRoles', 'keyStorages', 'createdDateAfter', 'createdDateBefore', 'lastModifiedAfter', 'lastModifiedBefore']);
120
39
  };
121
40
  exports.getQueryKeyFromIdentifierListQueryParams = getQueryKeyFromIdentifierListQueryParams;
122
41
  //# sourceMappingURL=query.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getQueryKeyFromCredentialListQueryParams","queryParams","name","sort","sortDirection","exact","role","ids","status","include","exports","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":";;;;;;AAUO,MAAMA,wCAAwC,GAAIC,WAA0C,IAAK;EACtG,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EACA,MAAM;IAAEC,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AAO,CAACC,IAAI,EAAEqC,KAAK,EAAEF,KAAK,EAAEF,QAAQ,EAAEC,UAAU,EAAEE,WAAW,EAAEN,aAAa,EAAE3B,KAAK,EAAE4B,QAAQ,CAAC;AAChG,CAAC;AAACvB,OAAA,CAAAwB,wCAAA,GAAAA,wCAAA","ignoreList":[]}
1
+ {"version":3,"names":["getQueryKey","queryParams","params","map","param","getQueryKeyFromCredentialListQueryParams","exports","getQueryKeyFromHistoryListQueryParams","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","getQueryKeyFromDidListQueryParams","getQueryKeyFromIdentifierListQueryParams"],"sources":["query.ts"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n IdentifierListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\ntype QueryKey<ListQuery, ParamList> = ParamList extends ReadonlyArray<keyof ListQuery> // all params are inside the ListQuery\n ? keyof ListQuery extends ParamList[number] // all ListQuery fields are in the params\n ? Array<ListQuery[keyof ListQuery]>\n : void\n : void; // otherwise produce a wrong return type which should trigger compilation error\n\n/** Typecheck that all query params are included in the query key */\nfunction getQueryKey<ListQuery extends {}, ParamList extends ReadonlyArray<keyof ListQuery>>(\n queryParams: ListQuery,\n params: ParamList,\n): QueryKey<ListQuery, ParamList> {\n return params.map((param) => queryParams[param]) as QueryKey<ListQuery, ParamList>;\n}\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<CredentialListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'searchText',\n 'searchType',\n 'sort',\n 'sortDirection',\n 'exact',\n 'role',\n 'ids',\n 'status',\n 'include',\n 'profile',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'issuanceDateAfter',\n 'issuanceDateBefore',\n 'revocationDateAfter',\n 'revocationDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<HistoryListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'entityId',\n 'actions',\n 'entityTypes',\n 'createdDateAfter',\n 'createdDateBefore',\n 'identifierId',\n 'credentialId',\n 'credentialSchemaId',\n 'proofSchemaId',\n 'search',\n ]);\n};\n\nexport const getQueryKeyFromCredentialSchemaListQueryParams = (\n queryParams: Partial<CredentialSchemaListQuery> = {},\n) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'include',\n 'schemaId',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofSchemaListQueryParams = (queryParams: Partial<ProofSchemaListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofListQueryParams = (queryParams: Partial<ProofListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'ids',\n 'proofStates',\n 'proofRoles',\n 'proofSchemaIds',\n 'exact',\n 'profile',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'requestedDateAfter',\n 'requestedDateBefore',\n 'completedDateAfter',\n 'completedDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromDidListQueryParams = (queryParams: Partial<DidListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'did',\n 'type',\n 'deactivated',\n 'exact',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'keyIds',\n 'didMethods',\n ]);\n};\n\nexport const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<IdentifierListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'types',\n 'state',\n 'exact',\n 'didMethods',\n 'isRemote',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n"],"mappings":";;;;;;AAcU;;AAEV;AACA,SAASA,WAAWA,CAClBC,WAAsB,EACtBC,MAAiB,EACe;EAChC,OAAOA,MAAM,CAACC,GAAG,CAAEC,KAAK,IAAKH,WAAW,CAACG,KAAK,CAAC,CAAC;AAClD;AAEO,MAAMC,wCAAwC,GAAGA,CAACJ,WAAyC,GAAG,CAAC,CAAC,KAAK;EAC1G,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,CACvB,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAD,wCAAA,GAAAA,wCAAA;AAEK,MAAME,qCAAqC,GAAGA,CAACN,WAAsC,GAAG,CAAC,CAAC,KAAK;EACpG,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,mBA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;AAEK,MAAMC,iCAAiC,GAAGA,CAACV,WAAkC,GAAG,CAAC,CAAC,KAAK;EAC5F,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAa,EACb,OAAO,EACP,eAAe,EACf,UAAU,EACV,aAAa,EACb,QAAQ,EACR,YAAY,CACb,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAK,iCAAA,GAAAA,iCAAA;AAEK,MAAMC,wCAAwC,GAAGA,CAACX,WAAyC,GAAG,CAAC,CAAC,KAAK;EAC1G,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,UAAU,EACV,eAAe,EACf,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,CACrB,CAAC;AACJ,CAAC;AAACK,OAAA,CAAAM,wCAAA,GAAAA,wCAAA","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import { TrustEntityRoleEnum, TrustEntityStateEnum } from '@procivis/react-native-one-core';
1
+ import { IdentifierTypeEnum, TrustEntityRoleEnum, TrustEntityStateEnum } 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';
@@ -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) === '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';
43
+ const placeholderText = (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === IdentifierTypeEnum.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) === 'CERTIFICATE' && (_identifierDetail$cer2 = identifierDetail.certificates) !== null && _identifierDetail$cer2 !== void 0 && _identifierDetail$cer2[0]) {
67
+ if ((identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === IdentifierTypeEnum.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":["TrustEntityRoleEnum","TrustEntityStateEnum","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","certificates","substring","statusIcon","createElement","name","trustEntityName","_identifierDetail$cer2","_identifierDetail$did","commonName","did","unknown","Fragment","entityName"],"sources":["entity-details.tsx"],"sourcesContent":["import { IdentifierCertificateDetail, IdentifierListItem,TrustEntity, TrustEntityRoleEnum, TrustEntityStateEnum } 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: TrustEntity) => ReactNode;\n role: Exclude<TrustEntityRoleEnum, TrustEntityRoleEnum.BOTH>;\n style?: StyleProp<ViewStyle>;\n sublineColor?: string;\n textColor?: string;\n testID?: string;\n} & (\n | {\n identifier?: IdentifierListItem;\n }\n | {\n entity: TrustEntity;\n }\n );\n\nconst getCertificateCommonName = (certificate: IdentifierCertificateDetail): string | undefined => {\n return certificate.x509Attributes.subject.split(', ').find((s) => s.startsWith('CN'))?.split('=')?.pop();\n}\n\nconst EntityDetails: FC<EntityDetailsProps> = ({ labels, renderMore, role, style, testID, sublineColor, textColor, ...props }) => {\n const { data, isLoading: isLoadingTrustEntity } = useTrustEntity('identifier' in props ? props.identifier?.id : undefined);\n const trustEntity: TrustEntity | undefined = 'entity' in props ? props.entity : data ?? undefined;\n const { data: identifierDetail, isLoading: isLoadingIdentifier } = useIdentifierDetails('identifier' in props ? props.identifier?.id : undefined);\n\n const trusted =\n trustEntity &&\n trustEntity.state === TrustEntityStateEnum.ACTIVE &&\n (trustEntity.role === TrustEntityRoleEnum.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 = trusted && identifierDetail?.type === 'DID' && trustEntity.logo ? { imageSource: { uri: trustEntity.logo } } : undefined;\n\n const placeholderText = identifierDetail?.type === 'CERTIFICATE' && identifierDetail.certificates?.[0] ? getCertificateCommonName(identifierDetail.certificates[0])?.substring(0, 1) : 'D';\n\n const statusIcon = trusted ? \n <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} /> :\n <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />;\n\n if (trustEntity) {\n return {\n avatar,\n placeholderText: 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 === '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,SAAsEA,mBAAmB,EAAEC,oBAAoB,QAAQ,iCA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B,GAAG,cAAAF,qBAAA,eAArBA,qBAAA,CAAuBE,GAAG,EAAE;MAC9B,OAAOxD,sBAAsB,CAACgC,gBAAgB,CAACwB,GAAG,CAACA,GAAG,CAAC;IACzD;IAEA,OAAO1C,MAAM,CAAC2C,OAAO;EACvB,CAAC,EAAE,CAAC3C,MAAM,CAAC2C,OAAO,EAAE3B,WAAW,EAAEE,gBAAgB,EAAEP,SAAS,CAAC,CAAC;EAE9D,oBACE/B,KAAA,CAAAwD,aAAA,CAAAxD,KAAA,CAAAgE,QAAA,qBACEhE,KAAA,CAAAwD,aAAA,CAACtD,aAAa;IACZ6C,MAAM,EAAEH,WAAY;IACpBqB,UAAU,EAAEP,eAAgB;IAC5BnC,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
+ {"version":3,"names":["IdentifierTypeEnum","TrustEntityRoleEnum","TrustEntityStateEnum","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 IdentifierCertificateDetail,\n IdentifierListItem,\n IdentifierTypeEnum,\n TrustEntity,\n TrustEntityRoleEnum,\n TrustEntityStateEnum,\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: TrustEntity) => ReactNode;\n role: Exclude<TrustEntityRoleEnum, TrustEntityRoleEnum.BOTH>;\n style?: StyleProp<ViewStyle>;\n sublineColor?: string;\n textColor?: string;\n testID?: string;\n} & (\n | {\n identifier?: IdentifierListItem;\n }\n | {\n entity: TrustEntity;\n }\n);\n\nconst getCertificateCommonName = (certificate: IdentifierCertificateDetail): 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: TrustEntity | undefined = '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 === TrustEntityStateEnum.ACTIVE &&\n (trustEntity.role === TrustEntityRoleEnum.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 === IdentifierTypeEnum.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 === IdentifierTypeEnum.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,SAGEA,kBAAkB,EAElBC,mBAAmB,EACnBC,oBAAoB,QACf,iCAAiC;AACxC,OAAOC,KAAK,IAAmBC,OAAO,QAAQ,OAAO;AAIrD,OAAOC,aAAa,MAAM,2C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9B,OAAOzD,sBAAsB,CAACgC,gBAAgB,CAACyB,GAAG,CAACA,GAAG,CAAC;IACzD;IAEA,OAAO3C,MAAM,CAAC4C,OAAO;EACvB,CAAC,EAAE,CAAC5C,MAAM,CAAC4C,OAAO,EAAE5B,WAAW,EAAEE,gBAAgB,EAAEP,SAAS,CAAC,CAAC;EAE9D,oBACE/B,KAAA,CAAAyD,aAAA,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":[]}
@@ -16,11 +16,12 @@ export const HistoryListScreen = ({
16
16
  queryParams,
17
17
  testID = 'HistoryScreen'
18
18
  }) => {
19
+ var _queryParams$search;
19
20
  const colorScheme = useAppColorScheme();
20
21
  const [empty, setEmpty] = useState(false);
21
22
  const [scrollOffset] = useState(() => new Animated.Value(0));
22
23
  const [searchPhrase, setSearchPhrase] = useState('');
23
- const searchBarVisible = !empty || Boolean(queryParams.searchText);
24
+ const searchBarVisible = !empty || Boolean((_queryParams$search = queryParams.search) === null || _queryParams$search === void 0 ? void 0 : _queryParams$search.text);
24
25
  const handleSearchPhraseChange = useMemo(() => debounce(onSearchPhraseChange, 500), [onSearchPhraseChange]);
25
26
  useEffect(() => {
26
27
  handleSearchPhraseChange(searchPhrase || undefined);
@@ -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","colorScheme","empty","setEmpty","scrollOffset","Value","searchPhrase","setSearchPhrase","searchBarVisible","Boolean","searchText","handleSearchPhraseChange","undefined","headerHeight","insets","additionalBottomPadding","createElement","style","styles","container","backgroundColor","background","emptyNotice","white","marginTop","paddingTop","align","color","text","preset","emptyTitle","shaded","emptySubtitle","contentContainerStyle","itemProps","infoLabelMode","onPress","onEmpty","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","query","list","header","leftItem","title","searchBar","rightButton","active","credentialSchemaId","rightButtonAlwaysVisible","searchBarProps","placeholder","search","staticHeader","create","flex","borderRadius","marginHorizontal","paddingBottom","paddingHorizontal","opacity"],"sources":["history-list-screen.tsx"],"sourcesContent":["import { HistoryListItem, HistoryListQuery } 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: HistoryListItem[]) => HistoryGroupByDaySection[];\n itemInfoLabelMode?: HistoryListItemViewProps['infoLabelMode'];\n labels: HistoryListScreenLabels;\n onBackPressed: () => void;\n onHistoryItemPressed: (historyItem: HistoryListItem) => void;\n onOpenFilter?: () => void;\n onSearchPhraseChange: (searchPhrase: string | undefined) => void;\n queryParams: Partial<HistoryListQuery>;\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.searchText);\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 rightButton: onOpenFilter ? (\n <FilterButton\n active={Boolean(queryParams.credentialSchemaId)}\n onPress={onOpenFilter}\n testID={concatTestID(testID, 'filter')}\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;EAC5BC,MAAM;EACNC,aAAa;EACbC,oBAAoB;EACpBC,YAAY;EACZC,oBAAoB;EACpBC,WAAW;EACXC,MAAM,GAAG;AACX,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGhB,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACiB,KAAK,EAAEC,QAAQ,CAAC,GAAG3B,QAAQ,CAAU,KAAK,CAAC;EAClD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AY;QACXsE,MAAM,EAAE1C,OAAO,CAACV,WAAW,CAACqD,kBAAkB,CAAE;QAChDhB,OAAO,EAAEvC,YAAa;QACtBG,MAAM,EAAEd,YAAY,CAACc,MAAM,EAAE,QAAQ;MAAE,CACxC,CAAC,GACAY,SAAS;MACbyC,wBAAwB,EAAE,IAAI;MAC9BC,cAAc,EAAE;QACdxD,oBAAoB,EAAES,eAAe;QACrCgD,WAAW,EAAE7D,MAAM,CAAC8D,MAAM;QAC1BlD,YAAY;QACZN,MAAM,EAAEd,YAAY,CAACc,MAAM,EAAE,QAAQ;MACvC;IACF,CACL;IACDyD,YAAY,EAAE,CAACjD;EAAiB,CACjC,CACG,CAAC;AAEX,CAAC;AAED,MAAMU,MAAM,GAAGxC,UAAU,CAACgF,MAAM,CAAC;EAC/BvC,SAAS,EAAE;IACTwC,IAAI,EAAE;EACR,CAAC;EACDrC,WAAW,EAAE;IACXsC,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,aAAa,EAAE,EAAE;IACjBC,iBAAiB,EAAE,EAAE;IACrBtC,UAAU,EAAE;EACd,CAAC;EACDM,MAAM,EAAE;IACNiC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
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","rightButton","active","credentialSchemaId","rightButtonAlwaysVisible","searchBarProps","placeholder","staticHeader","create","flex","borderRadius","marginHorizontal","paddingBottom","paddingHorizontal","opacity"],"sources":["history-list-screen.tsx"],"sourcesContent":["import { HistoryListItem, HistoryListQuery } 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: HistoryListItem[]) => HistoryGroupByDaySection[];\n itemInfoLabelMode?: HistoryListItemViewProps['infoLabelMode'];\n labels: HistoryListScreenLabels;\n onBackPressed: () => void;\n onHistoryItemPressed: (historyItem: HistoryListItem) => void;\n onOpenFilter?: () => void;\n onSearchPhraseChange: (searchPhrase: string | undefined) => void;\n queryParams: Partial<HistoryListQuery>;\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 rightButton: onOpenFilter ? (\n <FilterButton\n active={Boolean(queryParams.credentialSchemaId)}\n onPress={onOpenFilter}\n testID={concatTestID(testID, 'filter')}\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;EAC5BC,MAAM;EACNC,aAAa;EACbC,oBAAoB;EACpBC,YAAY;EACZC,oBAAoB;EACpBC,WAAW;EACXC,MAAM,GAAG;AACX,CAAC,KAAK;EAAA,IAAAC,mBAAA;EACJ,MAAMC,WAAW,GAAGjB,iBAAiB,CAAC,CAAC;EACvC,MAAM,CAACkB,KAAK,EAAEC,QAAQ,CAAC,GAAG5B,QAAQ,CAAU,KAAK,CAAC;EAClD,MAAM,CAAC6B,YAAY,CAAC,GAAG7B,QAAQ,CAAC,MAAM,IAAIC,QAAQ,CAAC6B,KAAK,CAAC,CAAC,CAAC,CAAC;EAE5D,MAAM,CAACC,YAAY,EAAEC,eAAe,CAAC,GAAGhC,QAAQ,CAAS,EAAE,CAAC;EAC5D,MAAMiC,gBAAgB,GAAG,CAACN,KAAK,IAAIO,OAAO,EAAAT,mBAAA,GAACF,WAAW,CAACY,MAAM,cAAAV,mBAAA,uBAAlBA,mBAAA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;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":[]}
@@ -211,4 +211,34 @@ export const FilterIcon = ({
211
211
  y: 16
212
212
  }));
213
213
  };
214
+
215
+ // https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=3436-22561
216
+ export const PlusIcon = ({
217
+ color,
218
+ ...props
219
+ }) => {
220
+ const colorScheme = useAppColorScheme();
221
+ const iconColor = color !== null && color !== void 0 ? color : colorScheme.text;
222
+ return /*#__PURE__*/React.createElement(Svg, _extends({
223
+ fill: "none",
224
+ height: 24,
225
+ viewBox: "0 0 24 24",
226
+ width: 24
227
+ }, props), /*#__PURE__*/React.createElement(Rect, {
228
+ fill: iconColor,
229
+ height: 2,
230
+ rx: 0.5,
231
+ width: 14,
232
+ x: 5,
233
+ y: 11
234
+ }), /*#__PURE__*/React.createElement(Rect, {
235
+ fill: iconColor,
236
+ height: 2,
237
+ rx: 0.5,
238
+ transform: "rotate(90 13 5)",
239
+ width: 14,
240
+ x: 13,
241
+ y: 5
242
+ }));
243
+ };
214
244
  //# sourceMappingURL=icons.js.map