@procivis/one-react-native-components 0.3.112 → 0.3.121

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 (114) hide show
  1. package/lib/commonjs/components/history/history-list-item-icon.js +6 -2
  2. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  3. package/lib/commonjs/components/index.js +11 -0
  4. package/lib/commonjs/components/index.js.map +1 -1
  5. package/lib/commonjs/components/trust-info/index.js +29 -0
  6. package/lib/commonjs/components/trust-info/index.js.map +1 -0
  7. package/lib/commonjs/components/trust-info/trust-info.js +79 -0
  8. package/lib/commonjs/components/trust-info/trust-info.js.map +1 -0
  9. package/lib/commonjs/ui-components/control/checkbox.js +1 -0
  10. package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
  11. package/lib/commonjs/ui-components/header/header.js +2 -0
  12. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  13. package/lib/commonjs/ui-components/icons/contact.js +45 -0
  14. package/lib/commonjs/ui-components/icons/contact.js.map +1 -0
  15. package/lib/commonjs/ui-components/icons/index.js +11 -0
  16. package/lib/commonjs/ui-components/icons/index.js.map +1 -1
  17. package/lib/commonjs/ui-components/screens/index.js +7 -0
  18. package/lib/commonjs/ui-components/screens/index.js.map +1 -1
  19. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +45 -15
  20. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  21. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js +384 -0
  22. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js.map +1 -0
  23. package/lib/commonjs/utils/hooks/core/cache.js +2 -1
  24. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  25. package/lib/commonjs/utils/hooks/core/core-init.js +4 -2
  26. package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
  27. package/lib/commonjs/utils/hooks/core/credentials.js +26 -1
  28. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  29. package/lib/commonjs/utils/hooks/core/index.js +11 -0
  30. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  31. package/lib/commonjs/utils/hooks/core/proofs.js +12 -1
  32. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  33. package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
  34. package/lib/commonjs/utils/hooks/core/verifier-instance.js +52 -0
  35. package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -0
  36. package/lib/commonjs/utils/hooks/core/wallet-unit.js +9 -2
  37. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  38. package/lib/commonjs/utils/parsers/query.js +2 -2
  39. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  40. package/lib/module/components/history/history-list-item-icon.js +6 -2
  41. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  42. package/lib/module/components/index.js +1 -0
  43. package/lib/module/components/index.js.map +1 -1
  44. package/lib/module/components/trust-info/index.js +4 -0
  45. package/lib/module/components/trust-info/index.js.map +1 -0
  46. package/lib/module/components/trust-info/trust-info.js +70 -0
  47. package/lib/module/components/trust-info/trust-info.js.map +1 -0
  48. package/lib/module/ui-components/control/checkbox.js +1 -0
  49. package/lib/module/ui-components/control/checkbox.js.map +1 -1
  50. package/lib/module/ui-components/header/header.js +2 -0
  51. package/lib/module/ui-components/header/header.js.map +1 -1
  52. package/lib/module/ui-components/icons/contact.js +34 -0
  53. package/lib/module/ui-components/icons/contact.js.map +1 -0
  54. package/lib/module/ui-components/icons/index.js +1 -0
  55. package/lib/module/ui-components/icons/index.js.map +1 -1
  56. package/lib/module/ui-components/screens/index.js +2 -0
  57. package/lib/module/ui-components/screens/index.js.map +1 -1
  58. package/lib/module/ui-components/screens/nerd-mode-screen.js +46 -16
  59. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  60. package/lib/module/ui-components/screens/trust-info-details-screen.js +375 -0
  61. package/lib/module/ui-components/screens/trust-info-details-screen.js.map +1 -0
  62. package/lib/module/utils/hooks/core/cache.js +2 -1
  63. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  64. package/lib/module/utils/hooks/core/core-init.js +4 -2
  65. package/lib/module/utils/hooks/core/core-init.js.map +1 -1
  66. package/lib/module/utils/hooks/core/credentials.js +24 -1
  67. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  68. package/lib/module/utils/hooks/core/index.js +1 -0
  69. package/lib/module/utils/hooks/core/index.js.map +1 -1
  70. package/lib/module/utils/hooks/core/proofs.js +10 -0
  71. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  72. package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
  73. package/lib/module/utils/hooks/core/verifier-instance.js +43 -0
  74. package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -0
  75. package/lib/module/utils/hooks/core/wallet-unit.js +9 -2
  76. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  77. package/lib/module/utils/parsers/query.js +2 -2
  78. package/lib/module/utils/parsers/query.js.map +1 -1
  79. package/lib/typescript/components/index.d.ts +1 -0
  80. package/lib/typescript/components/trust-info/index.d.ts +3 -0
  81. package/lib/typescript/components/trust-info/trust-info.d.ts +19 -0
  82. package/lib/typescript/ui-components/header/header.d.ts +2 -0
  83. package/lib/typescript/ui-components/icons/contact.d.ts +4 -0
  84. package/lib/typescript/ui-components/icons/index.d.ts +1 -0
  85. package/lib/typescript/ui-components/screens/index.d.ts +3 -0
  86. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +6 -1
  87. package/lib/typescript/ui-components/screens/trust-info-details-screen.d.ts +32 -0
  88. package/lib/typescript/utils/hooks/core/core-init.d.ts +1 -1
  89. package/lib/typescript/utils/hooks/core/credentials.d.ts +5 -9
  90. package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
  91. package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -0
  92. package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +8 -0
  93. package/lib/typescript/utils/parsers/query.d.ts +1 -1
  94. package/package.json +8 -8
  95. package/src/components/history/history-list-item-icon.tsx +4 -0
  96. package/src/components/index.ts +1 -0
  97. package/src/components/trust-info/index.ts +4 -0
  98. package/src/components/trust-info/trust-info.tsx +90 -0
  99. package/src/ui-components/control/checkbox.tsx +1 -1
  100. package/src/ui-components/header/header.tsx +9 -3
  101. package/src/ui-components/icons/contact.tsx +26 -0
  102. package/src/ui-components/icons/index.ts +1 -0
  103. package/src/ui-components/screens/index.ts +3 -0
  104. package/src/ui-components/screens/nerd-mode-screen.tsx +80 -22
  105. package/src/ui-components/screens/trust-info-details-screen.tsx +472 -0
  106. package/src/utils/hooks/core/cache.ts +2 -1
  107. package/src/utils/hooks/core/core-init.ts +3 -4
  108. package/src/utils/hooks/core/credentials.ts +32 -11
  109. package/src/utils/hooks/core/index.ts +1 -0
  110. package/src/utils/hooks/core/proofs.ts +14 -0
  111. package/src/utils/hooks/core/trust-list.ts +1 -1
  112. package/src/utils/hooks/core/verifier-instance.ts +54 -0
  113. package/src/utils/hooks/core/wallet-unit.ts +9 -2
  114. package/src/utils/parsers/query.ts +8 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeSafeAreaContext","_entityDetailsWithButtons","_interopRequireDefault","_contrastingStatusBar","_testID","_accessibilityHistoryWrappers","_entityCluster","_navigationHeader","_icons","_nerdModeItem","_typography","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityType","exports","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","Animated","createAnimatedComponent","SectionList","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","useSafeAreaInsets","colorScheme","useAppColorScheme","scrollOffset","useSharedValue","expandedAttributes","setExpandedAttributes","useState","onExpand","expanded","prev","onScroll","useAnimatedScrollHandler","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","TouchableOpacity","onPress","concatTestID","CloseIcon","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","View","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","StyleSheet","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity","_default"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { IdentifierListItem } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: IdentifierListItem;\n subline?: string;\n entityLabels: EntityLabels;\n role: ContextRole;\n testID?: string;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={\n entityCluster ? (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n ) : null\n }\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n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AiB,EAAE;EACrB;AACF,CAAC,CAAC;AAAC,IAAAK,QAAA,GAAArF,OAAA,CAAAzB,OAAA,GAEYkC,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeSafeAreaContext","_components","_entityDetailsWithButtons","_interopRequireDefault","_contrastingStatusBar","_testID","_accessibilityHistoryWrappers","_entityCluster","_navigationHeader","_icons","_nerdModeItem","_typography","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityType","exports","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","Animated","createAnimatedComponent","SectionList","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","onOpenTrustInfoDetails","entityCluster","testID","title","insets","useSafeAreaInsets","colorScheme","useAppColorScheme","scrollOffset","useSharedValue","expandedAttributes","setExpandedAttributes","useState","onExpand","expanded","prev","onScroll","useAnimatedScrollHandler","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","attributeKey","listHeader","useMemo","_entityCluster$testID2","_entityCluster$trustI","legacyTrustManagementEnabled","_entityCluster$testID","createElement","entityType","ProofEntity","entityLabels","attributesLabels","style","styles","backgroundColor","nerdView","background","concatTestID","textColor","white","TrustInfo","trustInfoLabels","onPress","trustInformation","eudiEcosystem","Fragment","leftItem","TouchableOpacity","CloseIcon","color","paddingTop","top","titleColor","ListHeaderComponent","renderItem","section","index","_item$testID","_item$testID2","_item$trustInformatio","CredentialEntity","toString","last","renderSectionHeader","View","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","StyleSheet","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity","_default"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { IdentifierListItem, TrustInformationDetail } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { TrustInfo, TrustInfoLabels } from '../../components';\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: IdentifierListItem;\n subline?: string;\n entityLabels: EntityLabels;\n legacyTrustManagementEnabled: boolean;\n role: ContextRole;\n testID?: string;\n trustInfoLabels: TrustInfoLabels;\n trustInformation?: TrustInformationDetail;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n onOpenTrustInfoDetails?: (trustInformation: TrustInformationDetail) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n onOpenTrustInfoDetails,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n const listHeader = useMemo(() => {\n if (!entityCluster) {\n return null;\n }\n if (entityCluster.legacyTrustManagementEnabled) {\n return (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n );\n }\n return (\n <TrustInfo\n labels={entityCluster.trustInfoLabels}\n onPress={\n onOpenTrustInfoDetails && entityCluster.trustInformation\n ? () => onOpenTrustInfoDetails(entityCluster.trustInformation!)\n : undefined\n }\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n testID={entityCluster.testID ?? concatTestID(testID, 'trustInfo')}\n textColor={colorScheme.white}\n trustInformation={entityCluster.trustInformation?.eudiEcosystem}\n />\n );\n }, [\n entityCluster,\n colorScheme.nerdView.background,\n colorScheme.white,\n labels,\n onCopyToClipboard,\n onOpenTrustInfoDetails,\n testID,\n ]);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={listHeader}\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return item.legacyTrustManagementEnabled ? (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n ) : (\n <TrustInfo\n labels={item.trustInfoLabels}\n onPress={\n onOpenTrustInfoDetails && item.trustInformation\n ? () => onOpenTrustInfoDetails(item.trustInformation!)\n : undefined\n }\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n testID={item.testID ?? concatTestID(testID, 'trustInfo')}\n textColor={colorScheme.white}\n trustInformation={item.trustInformation?.eudiEcosystem}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n});\n\nexport default NerdModeScreen;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,6BAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,iBAAA,GAAAL,sBAAA,CAAAN,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAP,sBAAA,CAAAN,OAAA;AACA,IAAAc,WAAA,GAAAR,sBAAA,CAAAN,OAAA;AACA,IAAAe,mBAAA,GAAAf,OAAA;AAAkE,SAAAM,uBAAAU,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,O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true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
10
+ var _trustInfo = _interopRequireDefault(require("../../components/trust-info/trust-info"));
11
+ var _utils = require("../../utils");
12
+ var _accessibility = require("../accessibility");
13
+ var _buttons = require("../buttons");
14
+ var _header = require("../header");
15
+ var _icons = require("../icons");
16
+ var _text = require("../text");
17
+ var _theme = require("../theme");
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
22
+ const Separator = ({
23
+ dark,
24
+ leadingItem
25
+ }) => {
26
+ const colorScheme = (0, _theme.useAppColorScheme)();
27
+ if ((leadingItem === null || leadingItem === void 0 ? void 0 : leadingItem.type) === 'subsection' || (leadingItem === null || leadingItem === void 0 ? void 0 : leadingItem.type) === 'item' && !(leadingItem !== null && leadingItem !== void 0 && leadingItem.value)) {
28
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
29
+ style: styles.emptyItem
30
+ });
31
+ }
32
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
33
+ style: {
34
+ backgroundColor: dark ? colorScheme.background : colorScheme.white
35
+ }
36
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
37
+ style: [styles.separator, {
38
+ backgroundColor: colorScheme.grayDark
39
+ }]
40
+ }));
41
+ };
42
+ const ListButton = ({
43
+ label,
44
+ onPress
45
+ }) => {
46
+ const colorScheme = (0, _theme.useAppColorScheme)();
47
+ return /*#__PURE__*/_react.default.createElement(_accessibility.TouchableOpacity, {
48
+ onPress: onPress,
49
+ style: [styles.button, styles.lastItem, {
50
+ backgroundColor: colorScheme.white
51
+ }]
52
+ }, /*#__PURE__*/_react.default.createElement(_text.Typography, {
53
+ align: "center",
54
+ color: colorScheme.text
55
+ }, label));
56
+ };
57
+ const ListItem = ({
58
+ action,
59
+ dark,
60
+ title,
61
+ value
62
+ }) => {
63
+ const colorScheme = (0, _theme.useAppColorScheme)();
64
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
65
+ style: [styles.item, {
66
+ backgroundColor: dark ? undefined : colorScheme.white
67
+ }]
68
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
69
+ style: styles.itemLabels
70
+ }, /*#__PURE__*/_react.default.createElement(_text.Typography, {
71
+ color: colorScheme.text,
72
+ numberOfLines: 1,
73
+ preset: "s/line-height-capped",
74
+ style: styles.itemTitleLabel
75
+ }, title), /*#__PURE__*/_react.default.createElement(_text.Typography, {
76
+ color: colorScheme.text,
77
+ numberOfLines: 1,
78
+ preset: "s/line-height-capped"
79
+ }, value)), action && /*#__PURE__*/_react.default.createElement(_accessibility.TouchableOpacity, {
80
+ onPress: action.onPress,
81
+ style: [styles.actionButton, {
82
+ backgroundColor: dark ? colorScheme.white : colorScheme.grayDark
83
+ }]
84
+ }, /*#__PURE__*/_react.default.createElement(action.icon, {
85
+ color: colorScheme.black
86
+ })));
87
+ };
88
+ const ContactItem = ({
89
+ email,
90
+ labels,
91
+ onPress,
92
+ phone,
93
+ website
94
+ }) => {
95
+ const colorScheme = (0, _theme.useAppColorScheme)();
96
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
97
+ style: [styles.contactItemWrapper, {
98
+ backgroundColor: colorScheme.white
99
+ }]
100
+ }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
101
+ style: [styles.contactItem, {
102
+ backgroundColor: colorScheme.background
103
+ }]
104
+ }, website && /*#__PURE__*/_react.default.createElement(ListItem, {
105
+ action: {
106
+ icon: _icons.LinkIcon,
107
+ onPress: onPress(website)
108
+ },
109
+ dark: true,
110
+ title: labels.website,
111
+ value: website
112
+ }), website && (email || phone) && /*#__PURE__*/_react.default.createElement(Separator, {
113
+ dark: true
114
+ }), email && /*#__PURE__*/_react.default.createElement(ListItem, {
115
+ action: {
116
+ icon: _icons.MailIcon,
117
+ onPress: onPress(`mailto:${email}`)
118
+ },
119
+ dark: true,
120
+ title: labels.email,
121
+ value: email
122
+ }), email && phone && /*#__PURE__*/_react.default.createElement(Separator, {
123
+ dark: true
124
+ }), phone && /*#__PURE__*/_react.default.createElement(ListItem, {
125
+ action: {
126
+ icon: _icons.PhoneIcon,
127
+ onPress: onPress(`tel:${phone}`)
128
+ },
129
+ dark: true,
130
+ title: labels.phone,
131
+ value: phone
132
+ })));
133
+ };
134
+ const TrustInfoDetailsScreen = ({
135
+ countries,
136
+ labels,
137
+ language,
138
+ onClose,
139
+ testID,
140
+ trustInformation
141
+ }) => {
142
+ var _countries$find, _countryDisplay$langu, _trustDetails$service, _trustDetails$interme;
143
+ const insets = (0, _reactNativeSafeAreaContext.useSafeAreaInsets)();
144
+ const colorScheme = (0, _theme.useAppColorScheme)();
145
+ const [expanded, setExpanded] = (0, _react.useState)(false);
146
+ const linkHandler = (0, _react.useCallback)(url => () => {
147
+ _reactNative.Linking.openURL(url).catch(e => {
148
+ (0, _utils.reportException)(e, `Error opening contact link ${url}`);
149
+ });
150
+ }, []);
151
+ const trustDetails = trustInformation.eudiEcosystem;
152
+ if (!trustDetails) {
153
+ return null;
154
+ }
155
+ const countryDisplay = (_countries$find = countries.find(c => c.value === trustDetails.country)) === null || _countries$find === void 0 ? void 0 : _countries$find.display;
156
+ const country = (_countryDisplay$langu = countryDisplay === null || countryDisplay === void 0 ? void 0 : countryDisplay[language]) !== null && _countryDisplay$langu !== void 0 ? _countryDisplay$langu : countryDisplay === null || countryDisplay === void 0 ? void 0 : countryDisplay.en;
157
+ const baseInfo = [{
158
+ name: trustDetails.name,
159
+ type: 'trustInfo'
160
+ }, {
161
+ title: labels.isPublicSector,
162
+ type: 'item',
163
+ value: trustDetails.isPublicSector ? labels.true : undefined
164
+ }, {
165
+ title: labels.serviceDescription,
166
+ type: 'item',
167
+ value: (_trustDetails$service = trustDetails.serviceDescription[0]) === null || _trustDetails$service === void 0 ? void 0 : _trustDetails$service[language]
168
+ }];
169
+ const expandItem = !expanded ? [{
170
+ type: 'expand'
171
+ }] : [];
172
+ const supervisoryAuthority = trustDetails.supervisoryAuthority ? [{
173
+ title: labels.supervisoryAuthority,
174
+ type: 'subsection'
175
+ }, {
176
+ ...trustDetails.supervisoryAuthority,
177
+ type: 'contact',
178
+ website: trustDetails.supervisoryAuthority.uri
179
+ }] : [];
180
+ const extraInfo = expanded ? [{
181
+ title: labels.country,
182
+ type: 'item',
183
+ value: country
184
+ }, {
185
+ title: labels.identifier,
186
+ type: 'item',
187
+ value: trustDetails.identifier
188
+ }, {
189
+ title: labels.support,
190
+ type: 'subsection'
191
+ }, {
192
+ type: 'contact',
193
+ ...trustDetails
194
+ }, ...supervisoryAuthority, {
195
+ type: 'collapse'
196
+ }] : [];
197
+ const trustDetailsSection = baseInfo.concat(expandItem).concat(extraInfo);
198
+ const intermediaryName = (_trustDetails$interme = trustDetails.intermediary) !== null && _trustDetails$interme !== void 0 && _trustDetails$interme.name ? [{
199
+ name: trustDetails.intermediary.name,
200
+ type: 'trustInfo'
201
+ }] : [];
202
+ const intermediarySection = trustDetails.intermediary ? [...intermediaryName, {
203
+ title: labels.country,
204
+ type: 'item',
205
+ value: trustDetails.intermediary.country
206
+ }, {
207
+ title: labels.identifier,
208
+ type: 'item',
209
+ value: trustDetails.intermediary.identifier
210
+ }, {
211
+ title: labels.support,
212
+ type: 'subsection'
213
+ }, {
214
+ type: 'contact',
215
+ ...trustDetails.intermediary
216
+ }] : [];
217
+ const sections = [{
218
+ ItemSeparatorComponent: Separator,
219
+ data: trustDetailsSection
220
+ }, intermediarySection.length ? {
221
+ ItemSeparatorComponent: Separator,
222
+ data: intermediarySection,
223
+ title: 'Intermediary'
224
+ } : undefined].filter(_utils.nonEmptyFilter);
225
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
226
+ style: styles.container
227
+ }, /*#__PURE__*/_react.default.createElement(_header.NavigationHeader, {
228
+ leftItem: /*#__PURE__*/_react.default.createElement(_buttons.BackButton, {
229
+ onPress: onClose
230
+ }),
231
+ style: {
232
+ paddingTop: insets.top
233
+ },
234
+ title: labels.title
235
+ }), /*#__PURE__*/_react.default.createElement(_reactNative.SectionList, {
236
+ contentInset: insets,
237
+ renderItem: ({
238
+ item,
239
+ section
240
+ }) => {
241
+ switch (item.type) {
242
+ case 'subsection':
243
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
244
+ style: [styles.subsection, {
245
+ backgroundColor: colorScheme.white
246
+ }],
247
+ testID: (0, _utils.concatTestID)(testID, section.title)
248
+ }, /*#__PURE__*/_react.default.createElement(_text.Typography, {
249
+ color: colorScheme.text,
250
+ preset: "m/heading"
251
+ }, item.title));
252
+ case 'trustInfo':
253
+ return /*#__PURE__*/_react.default.createElement(_trustInfo.default, {
254
+ labels: labels,
255
+ style: [styles.trustInfoItem, styles.firstItem, {
256
+ backgroundColor: colorScheme.white
257
+ }],
258
+ trustInformation: item
259
+ });
260
+ case 'item':
261
+ if (!item.value) {
262
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
263
+ style: styles.emptyItem
264
+ });
265
+ }
266
+ return /*#__PURE__*/_react.default.createElement(ListItem, _extends({}, item, {
267
+ value: item.value
268
+ }));
269
+ case 'contact':
270
+ if (!item.website && !item.phone && !item.email) {
271
+ return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
272
+ style: styles.emptyItem
273
+ });
274
+ }
275
+ return /*#__PURE__*/_react.default.createElement(ContactItem, _extends({
276
+ labels: labels,
277
+ onPress: linkHandler
278
+ }, item));
279
+ case 'expand':
280
+ return /*#__PURE__*/_react.default.createElement(ListButton, {
281
+ label: labels.expand,
282
+ onPress: () => setExpanded(true)
283
+ });
284
+ case 'collapse':
285
+ return /*#__PURE__*/_react.default.createElement(ListButton, {
286
+ label: labels.collapse,
287
+ onPress: () => setExpanded(false)
288
+ });
289
+ }
290
+ },
291
+ renderSectionHeader: ({
292
+ section
293
+ }) => {
294
+ return section.title ? /*#__PURE__*/_react.default.createElement(_reactNative.View, {
295
+ style: styles.sectionHeaderContainer,
296
+ testID: (0, _utils.concatTestID)(testID, section.title)
297
+ }, /*#__PURE__*/_react.default.createElement(_text.Typography, {
298
+ color: colorScheme.text,
299
+ preset: "m/heading",
300
+ style: styles.sectionHeaderText
301
+ }, section.title)) : null;
302
+ },
303
+ scrollEventThrottle: 16,
304
+ sections: sections,
305
+ showsVerticalScrollIndicator: false,
306
+ stickySectionHeadersEnabled: false,
307
+ style: styles.list,
308
+ testID: testID
309
+ }));
310
+ };
311
+ const styles = _reactNative.StyleSheet.create({
312
+ actionButton: {
313
+ alignItems: 'center',
314
+ borderRadius: 19,
315
+ height: 38,
316
+ justifyContent: 'center',
317
+ width: 38
318
+ },
319
+ button: {
320
+ height: 64,
321
+ justifyContent: 'center',
322
+ paddingBottom: 8,
323
+ width: '100%'
324
+ },
325
+ contactItem: {
326
+ borderRadius: 8
327
+ },
328
+ contactItemWrapper: {
329
+ padding: 12
330
+ },
331
+ container: {
332
+ flex: 1
333
+ },
334
+ emptyItem: {
335
+ height: 0
336
+ },
337
+ firstItem: {
338
+ borderTopLeftRadius: 8,
339
+ borderTopRightRadius: 8
340
+ },
341
+ item: {
342
+ alignItems: 'center',
343
+ flexDirection: 'row',
344
+ justifyContent: 'space-between',
345
+ padding: 12
346
+ },
347
+ itemLabels: {
348
+ flexDirection: 'column'
349
+ },
350
+ itemTitleLabel: {
351
+ opacity: 0.5
352
+ },
353
+ lastItem: {
354
+ borderBottomLeftRadius: 8,
355
+ borderBottomRightRadius: 8
356
+ },
357
+ list: {
358
+ marginHorizontal: 16
359
+ },
360
+ sectionHeaderContainer: {
361
+ justifyContent: 'center',
362
+ marginTop: 20,
363
+ paddingVertical: 16
364
+ },
365
+ sectionHeaderText: {
366
+ opacity: 0.7,
367
+ paddingHorizontal: 20
368
+ },
369
+ separator: {
370
+ height: 1,
371
+ marginHorizontal: 12,
372
+ opacity: 0.4
373
+ },
374
+ subsection: {
375
+ paddingBottom: 8,
376
+ paddingHorizontal: 12,
377
+ paddingTop: 22
378
+ },
379
+ trustInfoItem: {
380
+ padding: 8
381
+ }
382
+ });
383
+ var _default = exports.default = TrustInfoDetailsScreen;
384
+ //# sourceMappingURL=trust-info-details-screen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_trustInfo","_interopRequireDefault","_utils","_accessibility","_buttons","_header","_icons","_text","_theme","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","Separator","dark","leadingItem","colorScheme","useAppColorScheme","type","value","createElement","View","style","styles","emptyItem","backgroundColor","background","white","separator","grayDark","ListButton","label","onPress","TouchableOpacity","button","lastItem","Typography","align","color","text","ListItem","action","title","item","undefined","itemLabels","numberOfLines","preset","itemTitleLabel","actionButton","icon","black","ContactItem","email","labels","phone","website","contactItemWrapper","contactItem","LinkIcon","MailIcon","PhoneIcon","TrustInfoDetailsScreen","countries","language","onClose","testID","trustInformation","_countries$find","_countryDisplay$langu","_trustDetails$service","_trustDetails$interme","insets","useSafeAreaInsets","expanded","setExpanded","useState","linkHandler","useCallback","url","Linking","openURL","catch","reportException","trustDetails","eudiEcosystem","countryDisplay","find","c","country","display","en","baseInfo","name","isPublicSector","true","serviceDescription","expandItem","supervisoryAuthority","uri","extraInfo","identifier","support","trustDetailsSection","concat","intermediaryName","intermediary","intermediarySection","sections","ItemSeparatorComponent","data","filter","nonEmptyFilter","container","NavigationHeader","leftItem","BackButton","paddingTop","top","SectionList","contentInset","renderItem","section","subsection","concatTestID","trustInfoItem","firstItem","expand","collapse","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","showsVerticalScrollIndicator","stickySectionHeadersEnabled","list","StyleSheet","create","alignItems","borderRadius","height","justifyContent","width","paddingBottom","padding","flex","borderTopLeftRadius","borderTopRightRadius","flexDirection","opacity","borderBottomLeftRadius","borderBottomRightRadius","marginHorizontal","marginTop","paddingVertical","paddingHorizontal","_default","exports"],"sources":["trust-info-details-screen.tsx"],"sourcesContent":["import { TrustInformationDetail } from '@procivis/react-native-one-core';\nimport React, { FC, useCallback, useState } from 'react';\nimport { Linking, SectionList, SectionListData, StyleSheet, View } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\nimport { SvgProps } from 'react-native-svg';\n\nimport TrustInfo, { TrustInfoLabels } from '../../components/trust-info/trust-info';\nimport { concatTestID, nonEmptyFilter, reportException } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport { NavigationHeader } from '../header';\nimport { LinkIcon, MailIcon, PhoneIcon } from '../icons';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\ntype TrustInfoDetailItem =\n | {\n name: string;\n type: 'trustInfo';\n }\n | {\n title: string;\n type: 'subsection';\n }\n | {\n action?: {\n icon: FC<SvgProps>;\n onPress: () => void;\n };\n title: string;\n type: 'item';\n value?: string;\n }\n | {\n email?: string;\n phone?: string;\n type: 'contact';\n website?: string;\n }\n | {\n type: 'expand';\n }\n | {\n type: 'collapse';\n };\n\ntype TrustInfoDetailSection = {\n title?: string;\n};\n\nexport type TrustInfoDetailsScreenLabels = TrustInfoLabels & {\n collapse: string;\n country: string;\n email: string;\n expand: string;\n identifier: string;\n isPublicSector: string;\n phone: string;\n privacyPolicy: string;\n serviceDescription: string;\n supervisoryAuthority: string;\n support: string;\n title: string;\n true: string;\n website: string;\n};\n\ntype SeparatorProps = {\n dark?: boolean;\n leadingItem?: TrustInfoDetailItem;\n};\n\nconst Separator: FC<SeparatorProps> = ({ dark, leadingItem }) => {\n const colorScheme = useAppColorScheme();\n if (leadingItem?.type === 'subsection' || (leadingItem?.type === 'item' && !leadingItem?.value)) {\n return <View style={styles.emptyItem} />;\n }\n return (\n <View style={{ backgroundColor: dark ? colorScheme.background : colorScheme.white }}>\n <View style={[styles.separator, { backgroundColor: colorScheme.grayDark }]} />\n </View>\n );\n};\n\ntype ListButtonProps = {\n label: string;\n onPress: () => void;\n};\n\nconst ListButton: FC<ListButtonProps> = ({ label, onPress }) => {\n const colorScheme = useAppColorScheme();\n return (\n <TouchableOpacity\n onPress={onPress}\n style={[styles.button, styles.lastItem, { backgroundColor: colorScheme.white }]}>\n <Typography align=\"center\" color={colorScheme.text}>\n {label}\n </Typography>\n </TouchableOpacity>\n );\n};\n\ntype ListItemProps = {\n action?: {\n icon: FC<SvgProps>;\n onPress: () => void;\n };\n dark?: boolean;\n title: string;\n value: string;\n};\n\nconst ListItem: FC<ListItemProps> = ({ action, dark, title, value }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.item, { backgroundColor: dark ? undefined : colorScheme.white }]}>\n <View style={styles.itemLabels}>\n <Typography\n color={colorScheme.text}\n numberOfLines={1}\n preset=\"s/line-height-capped\"\n style={styles.itemTitleLabel}>\n {title}\n </Typography>\n <Typography color={colorScheme.text} numberOfLines={1} preset=\"s/line-height-capped\">\n {value}\n </Typography>\n </View>\n {action && (\n <TouchableOpacity\n onPress={action.onPress}\n style={[styles.actionButton, { backgroundColor: dark ? colorScheme.white : colorScheme.grayDark }]}>\n <action.icon color={colorScheme.black} />\n </TouchableOpacity>\n )}\n </View>\n );\n};\n\ntype ContactItemProps = {\n email?: string;\n labels: TrustInfoDetailsScreenLabels;\n onPress: (url: string) => () => void;\n phone?: string;\n website?: string;\n};\n\nconst ContactItem: FC<ContactItemProps> = ({ email, labels, onPress, phone, website }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.contactItemWrapper, { backgroundColor: colorScheme.white }]}>\n <View style={[styles.contactItem, { backgroundColor: colorScheme.background }]}>\n {website && (\n <ListItem\n action={{ icon: LinkIcon, onPress: onPress(website) }}\n dark\n title={labels.website}\n value={website}\n />\n )}\n {website && (email || phone) && <Separator dark />}\n {email && (\n <ListItem\n action={{ icon: MailIcon, onPress: onPress(`mailto:${email}`) }}\n dark\n title={labels.email}\n value={email}\n />\n )}\n {email && phone && <Separator dark />}\n {phone && (\n <ListItem\n action={{ icon: PhoneIcon, onPress: onPress(`tel:${phone}`) }}\n dark\n title={labels.phone}\n value={phone}\n />\n )}\n </View>\n </View>\n );\n};\n\nexport type TrustInfoDetailsScreenProps = {\n countries: {\n display: Record<string, string>;\n value: string;\n }[];\n labels: TrustInfoDetailsScreenLabels;\n language: string;\n onClose: () => void;\n testID: string;\n trustInformation: TrustInformationDetail;\n};\n\nconst TrustInfoDetailsScreen: FC<TrustInfoDetailsScreenProps> = ({\n countries,\n labels,\n language,\n onClose,\n testID,\n trustInformation,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [expanded, setExpanded] = useState(false);\n\n const linkHandler = useCallback(\n (url: string) => () => {\n Linking.openURL(url).catch((e) => {\n reportException(e, `Error opening contact link ${url}`);\n });\n },\n [],\n );\n\n const trustDetails = trustInformation.eudiEcosystem;\n if (!trustDetails) {\n return null;\n }\n\n const countryDisplay = countries.find((c) => c.value === trustDetails.country)?.display;\n const country = countryDisplay?.[language] ?? countryDisplay?.en;\n\n const baseInfo: TrustInfoDetailItem[] = [\n {\n name: trustDetails.name,\n type: 'trustInfo',\n },\n {\n title: labels.isPublicSector,\n type: 'item',\n value: trustDetails.isPublicSector ? labels.true : undefined,\n },\n {\n title: labels.serviceDescription,\n type: 'item',\n value: trustDetails.serviceDescription[0]?.[language],\n },\n ];\n\n const expandItem: TrustInfoDetailItem[] = !expanded ? [{ type: 'expand' }] : [];\n\n const supervisoryAuthority: TrustInfoDetailItem[] = trustDetails.supervisoryAuthority\n ? [\n {\n title: labels.supervisoryAuthority,\n type: 'subsection',\n },\n {\n ...trustDetails.supervisoryAuthority,\n type: 'contact',\n website: trustDetails.supervisoryAuthority.uri,\n },\n ]\n : [];\n\n const extraInfo: TrustInfoDetailItem[] = expanded\n ? [\n {\n title: labels.country,\n type: 'item',\n value: country,\n },\n {\n title: labels.identifier,\n type: 'item',\n value: trustDetails.identifier,\n },\n {\n title: labels.support,\n type: 'subsection',\n },\n {\n type: 'contact',\n ...trustDetails,\n },\n ...supervisoryAuthority,\n { type: 'collapse' },\n ]\n : [];\n\n const trustDetailsSection = baseInfo.concat(expandItem).concat(extraInfo);\n\n const intermediaryName: TrustInfoDetailItem[] = trustDetails.intermediary?.name\n ? [\n {\n name: trustDetails.intermediary.name,\n type: 'trustInfo',\n },\n ]\n : [];\n\n const intermediarySection: TrustInfoDetailItem[] = trustDetails.intermediary\n ? [\n ...intermediaryName,\n {\n title: labels.country,\n type: 'item',\n value: trustDetails.intermediary.country,\n },\n {\n title: labels.identifier,\n type: 'item',\n value: trustDetails.intermediary.identifier,\n },\n {\n title: labels.support,\n type: 'subsection',\n },\n {\n type: 'contact',\n ...trustDetails.intermediary,\n },\n ]\n : [];\n\n const sections: SectionListData<TrustInfoDetailItem, TrustInfoDetailSection>[] = [\n {\n ItemSeparatorComponent: Separator,\n data: trustDetailsSection,\n },\n intermediarySection.length\n ? {\n ItemSeparatorComponent: Separator,\n data: intermediarySection,\n title: 'Intermediary',\n }\n : undefined,\n ].filter(nonEmptyFilter);\n\n return (\n <View style={styles.container}>\n <NavigationHeader\n leftItem={<BackButton onPress={onClose} />}\n style={{\n paddingTop: insets.top,\n }}\n title={labels.title}\n />\n <SectionList<TrustInfoDetailItem, TrustInfoDetailSection>\n contentInset={insets}\n renderItem={({ item, section }) => {\n switch (item.type) {\n case 'subsection':\n return (\n <View\n style={[styles.subsection, { backgroundColor: colorScheme.white }]}\n testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.text} preset=\"m/heading\">\n {item.title}\n </Typography>\n </View>\n );\n case 'trustInfo':\n return (\n <TrustInfo\n labels={labels}\n style={[styles.trustInfoItem, styles.firstItem, { backgroundColor: colorScheme.white }]}\n trustInformation={item}\n />\n );\n case 'item':\n if (!item.value) {\n return <View style={styles.emptyItem} />;\n }\n return <ListItem {...item} value={item.value} />;\n case 'contact':\n if (!item.website && !item.phone && !item.email) {\n return <View style={styles.emptyItem} />;\n }\n return <ContactItem labels={labels} onPress={linkHandler} {...item} />;\n case 'expand':\n return <ListButton label={labels.expand} onPress={() => setExpanded(true)} />;\n case 'collapse':\n return <ListButton label={labels.collapse} onPress={() => setExpanded(false)} />;\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.text} preset=\"m/heading\" style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n showsVerticalScrollIndicator={false}\n stickySectionHeadersEnabled={false}\n style={styles.list}\n testID={testID}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n actionButton: {\n alignItems: 'center',\n borderRadius: 19,\n height: 38,\n justifyContent: 'center',\n width: 38,\n },\n button: {\n height: 64,\n justifyContent: 'center',\n paddingBottom: 8,\n width: '100%',\n },\n contactItem: {\n borderRadius: 8,\n },\n contactItemWrapper: {\n padding: 12,\n },\n container: {\n flex: 1,\n },\n emptyItem: {\n height: 0,\n },\n firstItem: {\n borderTopLeftRadius: 8,\n borderTopRightRadius: 8,\n },\n item: {\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n padding: 12,\n },\n itemLabels: {\n flexDirection: 'column',\n },\n itemTitleLabel: {\n opacity: 0.5,\n },\n lastItem: {\n borderBottomLeftRadius: 8,\n borderBottomRightRadius: 8,\n },\n list: {\n marginHorizontal: 16,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n separator: {\n height: 1,\n marginHorizontal: 12,\n opacity: 0.4,\n },\n subsection: {\n paddingBottom: 8,\n paddingHorizontal: 12,\n paddingTop: 22,\n },\n trustInfoItem: {\n padding: 8,\n },\n});\n\nexport default TrustInfoDetailsScreen;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAGA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,cAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,KAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAA6C,SAAAI,uBAAAQ,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,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S,EAAE;IACTgH,MAAM,EAAE,CAAC;IACTY,gBAAgB,EAAE,EAAE;IACpBH,OAAO,EAAE;EACX,CAAC;EACD1B,UAAU,EAAE;IACVoB,aAAa,EAAE,CAAC;IAChBY,iBAAiB,EAAE,EAAE;IACrBtC,UAAU,EAAE;EACd,CAAC;EACDQ,aAAa,EAAE;IACbmB,OAAO,EAAE;EACX;AACF,CAAC,CAAC;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAAxK,OAAA,GAEYyE,sBAAsB","ignoreList":[]}
@@ -22,7 +22,8 @@ const cacheTypeToQueryKeys = {
22
22
  [_reactNativeOneCore.CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
23
23
  [_reactNativeOneCore.CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
24
24
  [_reactNativeOneCore.CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
25
- [_reactNativeOneCore.CacheType.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS
25
+ [_reactNativeOneCore.CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,
26
+ [_reactNativeOneCore.CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS
26
27
  };
27
28
  const useCacheClear = () => {
28
29
  const queryClient = (0, _reactQuery.useQueryClient)();
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_reactQuery","_coreContext","_credentials","_trustEntity","CREDENTIAL_QUERY_KEYS","CREDENTIAL_LIST_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_DETAIL_QUERY_KEY","TRUST_ENTITY_QUERY_KEYS","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","cacheTypeToQueryKeys","CacheType","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","OPEN_ID_METADATA","useCacheClear","queryClient","useQueryClient","core","useONECore","useMutation","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries","exports"],"sources":["cache.ts"],"sourcesContent":["import { CacheType } from '@procivis/react-native-one-core';\nimport { useMutation, useQueryClient } from 'react-query';\n\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';\nimport { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];\n\n// Map each CacheType to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheType, string[]> = {\n [CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],\n [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS,\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheType[]) => {\n await core.deleteCache(cacheTypes);\n return cacheTypes;\n },\n {\n onSuccess: async (_, cacheTypes) => {\n const queryKeysToInvalidate = new Set<string>();\n\n cacheTypes.forEach((cacheType) => {\n const keys = cacheTypeToQueryKeys[cacheType] || [];\n keys.forEach((key) => queryKeysToInvalidate.add(key));\n });\n\n await Promise.all([...queryKeysToInvalidate].map((queryKey) => queryClient.invalidateQueries(queryKey)));\n },\n },\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,MAAMK,qBAAqB,GAAG,CAACC,sCAAyB,EAAEC,4CAA+B,EAAEC,wCAA2B,CAAC;AACvH,MAAMC,uBAAuB,GAAG,CAACC,0CAA6B,EAAEC,iDAAoC,CAAC;;AAErG;AACA,MAAMC,oBAAiD,GAAG;EACxD,CAACC,6BAAS,CAACC,YAAY,GAAGT,qBAAqB;EAC/C,CAACQ,6BAAS,CAACE,eAAe,GAAGV,qBAAqB;EAClD,CAACQ,6BAAS,CAACG,sBAAsB,GAAGX,qBAAqB;EACzD,CAACQ,6BAAS,CAACI,YAAY,GAAGZ,qBAAqB;EAC/C,CAACQ,6BAAS,CAACK,WAAW,GAAGb,qBAAqB;EAC9C,CAACQ,6BAAS,CAACM,UAAU,GAAG,CAAC,GAAGV,uBAAuB,EAAE,GAAGJ,qBAAqB,CAAC;EAC9E,CAACQ,6BAAS,CAACO,QAAQ,GAAGf,qBAAqB;EAC3C,CAACQ,6BAAS,CAACQ,uBAAuB,GAAGhB,qBAAqB;EAC1D,CAACQ,6BAAS,CAACS,gBAAgB,GAAGjB;AAChC,CAAC;AAEM,MAAMkB,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAMC,WAAW,GAAG,IAAAC,0BAAc,EAAC,CAAC;EACpC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IAAAC,uBAAW,EAChB,MAAOC,UAAuB,IAAK;IACjC,MAAMH,IAAI,CAACI,WAAW,CAACD,UAAU,CAAC;IAClC,OAAOA,UAAU;EACnB,CAAC,EACD;IACEE,SAAS,EAAE,MAAAA,CAAOC,CAAC,EAAEH,UAAU,KAAK;MAClC,MAAMI,qBAAqB,GAAG,IAAIC,GAAG,CAAS,CAAC;MAE/CL,UAAU,CAACM,OAAO,CAAEC,SAAS,IAAK;QAChC,MAAMC,IAAI,GAAGzB,oBAAoB,CAACwB,SAAS,CAAC,IAAI,EAAE;QAClDC,IAAI,CAACF,OAAO,CAAEG,GAAG,IAAKL,qBAAqB,CAACM,GAAG,CAACD,GAAG,CAAC,CAAC;MACvD,CAAC,CAAC;MAEF,MAAME,OAAO,CAACC,GAAG,CAAC,CAAC,GAAGR,qBAAqB,CAAC,CAACS,GAAG,CAAEC,QAAQ,IAAKnB,WAAW,CAACoB,iBAAiB,CAACD,QAAQ,CAAC,CAAC,CAAC;IAC1G;EACF,CACF,CAAC;AACH,CAAC;AAACE,OAAA,CAAAtB,aAAA,GAAAA,aAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_reactQuery","_coreContext","_credentials","_trustEntity","CREDENTIAL_QUERY_KEYS","CREDENTIAL_LIST_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_DETAIL_QUERY_KEY","TRUST_ENTITY_QUERY_KEYS","TRUST_ENTITY_DETAIL_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","cacheTypeToQueryKeys","CacheType","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","OPEN_ID_METADATA_HOLDER","OPEN_ID_METADATA_ISSUER","useCacheClear","queryClient","useQueryClient","core","useONECore","useMutation","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries","exports"],"sources":["cache.ts"],"sourcesContent":["import { CacheType } from '@procivis/react-native-one-core';\nimport { useMutation, useQueryClient } from 'react-query';\n\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';\nimport { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];\n\n// Map each CacheType to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheType, string[]> = {\n [CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],\n [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS,\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheType[]) => {\n await core.deleteCache(cacheTypes);\n return cacheTypes;\n },\n {\n onSuccess: async (_, cacheTypes) => {\n const queryKeysToInvalidate = new Set<string>();\n\n cacheTypes.forEach((cacheType) => {\n const keys = cacheTypeToQueryKeys[cacheType] || [];\n keys.forEach((key) => queryKeysToInvalidate.add(key));\n });\n\n await Promise.all([...queryKeysToInvalidate].map((queryKey) => queryClient.invalidateQueries(queryKey)));\n },\n },\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,MAAMK,qBAAqB,GAAG,CAACC,sCAAyB,EAAEC,4CAA+B,EAAEC,wCAA2B,CAAC;AACvH,MAAMC,uBAAuB,GAAG,CAACC,0CAA6B,EAAEC,iDAAoC,CAAC;;AAErG;AACA,MAAMC,oBAAiD,GAAG;EACxD,CAACC,6BAAS,CAACC,YAAY,GAAGT,qBAAqB;EAC/C,CAACQ,6BAAS,CAACE,eAAe,GAAGV,qBAAqB;EAClD,CAACQ,6BAAS,CAACG,sBAAsB,GAAGX,qBAAqB;EACzD,CAACQ,6BAAS,CAACI,YAAY,GAAGZ,qBAAqB;EAC/C,CAACQ,6BAAS,CAACK,WAAW,GAAGb,qBAAqB;EAC9C,CAACQ,6BAAS,CAACM,UAAU,GAAG,CAAC,GAAGV,uBAAuB,EAAE,GAAGJ,qBAAqB,CAAC;EAC9E,CAACQ,6BAAS,CAACO,QAAQ,GAAGf,qBAAqB;EAC3C,CAACQ,6BAAS,CAACQ,uBAAuB,GAAGhB,qBAAqB;EAC1D,CAACQ,6BAAS,CAACS,uBAAuB,GAAGjB,qBAAqB;EAC1D,CAACQ,6BAAS,CAACU,uBAAuB,GAAGlB;AACvC,CAAC;AAEM,MAAMmB,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAMC,WAAW,GAAG,IAAAC,0BAAc,EAAC,CAAC;EACpC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IAAAC,uBAAW,EAChB,MAAOC,UAAuB,IAAK;IACjC,MAAMH,IAAI,CAACI,WAAW,CAACD,UAAU,CAAC;IAClC,OAAOA,UAAU;EACnB,CAAC,EACD;IACEE,SAAS,EAAE,MAAAA,CAAOC,CAAC,EAAEH,UAAU,KAAK;MAClC,MAAMI,qBAAqB,GAAG,IAAIC,GAAG,CAAS,CAAC;MAE/CL,UAAU,CAACM,OAAO,CAAEC,SAAS,IAAK;QAChC,MAAMC,IAAI,GAAG1B,oBAAoB,CAACyB,SAAS,CAAC,IAAI,EAAE;QAClDC,IAAI,CAACF,OAAO,CAAEG,GAAG,IAAKL,qBAAqB,CAACM,GAAG,CAACD,GAAG,CAAC,CAAC;MACvD,CAAC,CAAC;MAEF,MAAME,OAAO,CAACC,GAAG,CAAC,CAAC,GAAGR,qBAAqB,CAAC,CAACS,GAAG,CAAEC,QAAQ,IAAKnB,WAAW,CAACoB,iBAAiB,CAACD,QAAQ,CAAC,CAAC,CAAC;IAC1G;EACF,CACF,CAAC;AACH,CAAC;AAACE,OAAA,CAAAtB,aAAA,GAAAA,aAAA","ignoreList":[]}
@@ -42,7 +42,8 @@ const generateHwIdentifier = async (core, organisationId) => {
42
42
  params: {}
43
43
  },
44
44
  name: HW_DID_NAME_PREFIX,
45
- organisationId
45
+ organisationId,
46
+ trustInformation: []
46
47
  });
47
48
  }
48
49
  return null;
@@ -71,7 +72,8 @@ const generateSwIdentifier = async (core, organisationId) => {
71
72
  params: {}
72
73
  },
73
74
  name: SW_DID_NAME_PREFIX,
74
- organisationId
75
+ organisationId,
76
+ trustInformation: []
75
77
  });
76
78
  };
77
79
  exports.generateSwIdentifier = generateSwIdentifier;
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNativeOneCore","require","_react","_reporting","_coreContext","_errorCode","SW_DID_NAME_PREFIX","exports","HW_DID_NAME_PREFIX","ATTESTATION_DID_NAME_PREFIX","generateHwIdentifier","core","organisationId","hwKeyId","generateKey","keyParams","keyType","name","storageParams","storageType","catch","e","OneError","code","OneErrorCode","KeyStorageNotSupported","createIdentifier","did","method","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","generateSwIdentifier","swKeyId","useInitializeONECoreIdentifiers","generateHwKey","generateSwKey","useONECore","useCallback","createOrganisation","id","OrganisationAlreadyExists","then","Promise","all","err","reportException"],"sources":["core-init.ts"],"sourcesContent":["import { ONECore, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\n\nexport const SW_DID_NAME_PREFIX = 'holder-did-sw-key';\nexport const HW_DID_NAME_PREFIX = 'holder-did-hw-key';\nexport const ATTESTATION_DID_NAME_PREFIX = 'holder-did-attestation-key';\n\nexport const generateHwIdentifier = async (core: ONECore, organisationId: string) => {\n const hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ECDSA',\n name: 'holder-key-hw',\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n\n if (hwKeyId) {\n return core.createIdentifier({\n did: {\n method: 'KEY',\n name: HW_DID_NAME_PREFIX,\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n params: {},\n },\n name: HW_DID_NAME_PREFIX,\n organisationId,\n });\n }\n\n return null;\n};\n\nexport const generateSwIdentifier = async (core: ONECore, organisationId: string) => {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'ECDSA',\n name: 'holder-key-sw',\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n\n return core.createIdentifier({\n did: {\n method: 'KEY',\n name: SW_DID_NAME_PREFIX,\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n params: {},\n },\n name: SW_DID_NAME_PREFIX,\n organisationId,\n });\n};\n\nexport interface IdentifiersInitializationConfig {\n generateHwKey: boolean;\n generateSwKey: boolean;\n}\n\n/**\n * Create base local identifiers\n * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be created\n * @returns [hwIdentifierId, swIdentifierId]\n */\nexport const useInitializeONECoreIdentifiers = ({\n generateHwKey,\n generateSwKey,\n}: IdentifiersInitializationConfig) => {\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n return await core\n .createOrganisation({ id: organisationId })\n .catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OrganisationAlreadyExists) {\n return;\n }\n throw e;\n })\n .then(() =>\n Promise.all([\n generateHwKey ? generateHwIdentifier(core, organisationId) : null,\n generateSwKey ? generateSwIdentifier(core, organisationId) : null,\n ]),\n )\n .catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [core, organisationId, generateHwKey, generateSwKey]);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAEO,MAAMK,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG,mBAAmB;AAC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,IAAI,EAAEC,cAAc,CAAC,GAAG,IAAI,EACjE4B,aAAa,GAAGJ,oBAAoB,CAACzB,IAAI,EAAEC,cAAc,CAAC,GAAG,IAAI,CAClE,CACH,CAAC,CACAQ,KAAK,CAAE6B,GAAG,IAAK;MACd,IAAAC,0BAAe,EAACD,GAAG,EAAE,mCAAmC,CAAC;MACzD,MAAMA,GAAG;IACX,CAAC,CAAC;EACN,CAAC,EAAE,CAACtC,IAAI,EAAEC,cAAc,EAAE2B,aAAa,EAAEC,aAAa,CAAC,CAAC;AAC1D,CAAC;AAACjC,OAAA,CAAA+B,+BAAA,GAAAA,+BAAA","ignoreList":[]}
1
+ {"version":3,"names":["_reactNativeOneCore","require","_react","_reporting","_coreContext","_errorCode","SW_DID_NAME_PREFIX","exports","HW_DID_NAME_PREFIX","ATTESTATION_DID_NAME_PREFIX","generateHwIdentifier","core","organisationId","hwKeyId","generateKey","keyParams","keyType","name","storageParams","storageType","catch","e","OneError","code","OneErrorCode","KeyStorageNotSupported","createIdentifier","did","method","keys","assertionMethod","authentication","capabilityDelegation","capabilityInvocation","keyAgreement","params","trustInformation","generateSwIdentifier","swKeyId","useInitializeONECoreIdentifiers","generateHwKey","generateSwKey","useONECore","useCallback","createOrganisation","id","OrganisationAlreadyExists","then","Promise","all","err","reportException"],"sources":["core-init.ts"],"sourcesContent":["import { ONECore, OneError } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport { OneErrorCode } from './error-code';\n\nexport const SW_DID_NAME_PREFIX = 'holder-did-sw-key';\nexport const HW_DID_NAME_PREFIX = 'holder-did-hw-key';\nexport const ATTESTATION_DID_NAME_PREFIX = 'holder-did-attestation-key';\n\nexport const generateHwIdentifier = async (core: ONECore, organisationId: string) => {\n const hwKeyId = await core\n .generateKey({\n keyParams: {},\n keyType: 'ECDSA',\n name: 'holder-key-hw',\n organisationId,\n storageParams: {},\n storageType: 'SECURE_ELEMENT',\n })\n .catch((e) => {\n // ignore if HW keys not supported by device\n if (e instanceof OneError && e.code === OneErrorCode.KeyStorageNotSupported) {\n return null;\n }\n throw e;\n });\n\n if (hwKeyId) {\n return core.createIdentifier({\n did: {\n method: 'KEY',\n name: HW_DID_NAME_PREFIX,\n keys: {\n assertionMethod: [hwKeyId],\n authentication: [hwKeyId],\n capabilityDelegation: [hwKeyId],\n capabilityInvocation: [hwKeyId],\n keyAgreement: [hwKeyId],\n },\n params: {},\n },\n name: HW_DID_NAME_PREFIX,\n organisationId,\n trustInformation: [],\n });\n }\n\n return null;\n};\n\nexport const generateSwIdentifier = async (core: ONECore, organisationId: string) => {\n const swKeyId = await core.generateKey({\n keyParams: {},\n keyType: 'ECDSA',\n name: 'holder-key-sw',\n organisationId,\n storageParams: {},\n storageType: 'INTERNAL',\n });\n\n return core.createIdentifier({\n did: {\n method: 'KEY',\n name: SW_DID_NAME_PREFIX,\n keys: {\n assertionMethod: [swKeyId],\n authentication: [swKeyId],\n capabilityDelegation: [swKeyId],\n capabilityInvocation: [swKeyId],\n keyAgreement: [swKeyId],\n },\n params: {},\n },\n name: SW_DID_NAME_PREFIX,\n organisationId,\n trustInformation: [],\n });\n};\n\nexport interface IdentifiersInitializationConfig {\n generateHwKey: boolean;\n generateSwKey: boolean;\n}\n\n/**\n * Create base local identifiers\n * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be created\n * @returns [hwIdentifierId, swIdentifierId]\n */\nexport const useInitializeONECoreIdentifiers = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n return await core\n .createOrganisation({ id: organisationId })\n .catch((e) => {\n if (e instanceof OneError && e.code === OneErrorCode.OrganisationAlreadyExists) {\n return;\n }\n throw e;\n })\n .then(() =>\n Promise.all([\n generateHwKey ? generateHwIdentifier(core, organisationId) : null,\n generateSwKey ? generateSwIdentifier(core, organisationId) : null,\n ]),\n )\n .catch((err) => {\n reportException(err, 'Failed to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