@procivis/one-react-native-components 0.3.115 → 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.
- package/lib/commonjs/components/history/history-list-item-icon.js +2 -1
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/trust-info/index.js +29 -0
- package/lib/commonjs/components/trust-info/index.js.map +1 -0
- package/lib/commonjs/components/trust-info/trust-info.js +79 -0
- package/lib/commonjs/components/trust-info/trust-info.js.map +1 -0
- package/lib/commonjs/ui-components/header/header.js +2 -0
- package/lib/commonjs/ui-components/header/header.js.map +1 -1
- package/lib/commonjs/ui-components/icons/contact.js +45 -0
- package/lib/commonjs/ui-components/icons/contact.js.map +1 -0
- package/lib/commonjs/ui-components/icons/index.js +11 -0
- package/lib/commonjs/ui-components/icons/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/index.js +7 -0
- package/lib/commonjs/ui-components/screens/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +45 -15
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/trust-info-details-screen.js +384 -0
- package/lib/commonjs/ui-components/screens/trust-info-details-screen.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/cache.js +2 -1
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +26 -1
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +12 -1
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +2 -1
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/trust-info/index.js +4 -0
- package/lib/module/components/trust-info/index.js.map +1 -0
- package/lib/module/components/trust-info/trust-info.js +70 -0
- package/lib/module/components/trust-info/trust-info.js.map +1 -0
- package/lib/module/ui-components/header/header.js +2 -0
- package/lib/module/ui-components/header/header.js.map +1 -1
- package/lib/module/ui-components/icons/contact.js +34 -0
- package/lib/module/ui-components/icons/contact.js.map +1 -0
- package/lib/module/ui-components/icons/index.js +1 -0
- package/lib/module/ui-components/icons/index.js.map +1 -1
- package/lib/module/ui-components/screens/index.js +2 -0
- package/lib/module/ui-components/screens/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js +46 -16
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/trust-info-details-screen.js +375 -0
- package/lib/module/ui-components/screens/trust-info-details-screen.js.map +1 -0
- package/lib/module/utils/hooks/core/cache.js +2 -1
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +24 -1
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +10 -0
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/components/trust-info/index.d.ts +3 -0
- package/lib/typescript/components/trust-info/trust-info.d.ts +19 -0
- package/lib/typescript/ui-components/header/header.d.ts +2 -0
- package/lib/typescript/ui-components/icons/contact.d.ts +4 -0
- package/lib/typescript/ui-components/icons/index.d.ts +1 -0
- package/lib/typescript/ui-components/screens/index.d.ts +3 -0
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +6 -1
- package/lib/typescript/ui-components/screens/trust-info-details-screen.d.ts +32 -0
- package/lib/typescript/utils/hooks/core/credentials.d.ts +3 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -0
- package/package.json +8 -8
- package/src/components/history/history-list-item-icon.tsx +1 -0
- package/src/components/index.ts +1 -0
- package/src/components/trust-info/index.ts +4 -0
- package/src/components/trust-info/trust-info.tsx +90 -0
- package/src/ui-components/header/header.tsx +9 -3
- package/src/ui-components/icons/contact.tsx +26 -0
- package/src/ui-components/icons/index.ts +1 -0
- package/src/ui-components/screens/index.ts +3 -0
- package/src/ui-components/screens/nerd-mode-screen.tsx +80 -22
- package/src/ui-components/screens/trust-info-details-screen.tsx +472 -0
- package/src/utils/hooks/core/cache.ts +2 -1
- package/src/utils/hooks/core/credentials.ts +30 -1
- package/src/utils/hooks/core/proofs.ts +14 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useMemo, useState } from 'react';
|
|
3
3
|
import { SectionList, StyleSheet, View } from 'react-native';
|
|
4
4
|
import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { TrustInfo } from '../../components';
|
|
6
7
|
import EntityDetailsWithButtons from '../../components/entity/entity-details-with-buttons';
|
|
7
8
|
import ContrastingStatusBar from '../../utils/contrasting-status-bar';
|
|
8
9
|
import { concatTestID } from '../../utils/testID';
|
|
@@ -27,11 +28,11 @@ const NerdModeScreen = ({
|
|
|
27
28
|
labels,
|
|
28
29
|
onClose,
|
|
29
30
|
onCopyToClipboard,
|
|
31
|
+
onOpenTrustInfoDetails,
|
|
30
32
|
entityCluster,
|
|
31
33
|
testID,
|
|
32
34
|
title
|
|
33
35
|
}) => {
|
|
34
|
-
var _entityCluster$testID;
|
|
35
36
|
const insets = useSafeAreaInsets();
|
|
36
37
|
const colorScheme = useAppColorScheme();
|
|
37
38
|
const scrollOffset = useSharedValue(0);
|
|
@@ -59,6 +60,36 @@ const NerdModeScreen = ({
|
|
|
59
60
|
[sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : ''
|
|
60
61
|
};
|
|
61
62
|
}, {});
|
|
63
|
+
const listHeader = useMemo(() => {
|
|
64
|
+
var _entityCluster$testID2, _entityCluster$trustI;
|
|
65
|
+
if (!entityCluster) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
if (entityCluster.legacyTrustManagementEnabled) {
|
|
69
|
+
var _entityCluster$testID;
|
|
70
|
+
return /*#__PURE__*/React.createElement(EntityDetailsWithButtons, _extends({}, entityCluster, {
|
|
71
|
+
entityType: EntityType.ProofEntity,
|
|
72
|
+
entityLabels: entityCluster.entityLabels,
|
|
73
|
+
attributesLabels: labels,
|
|
74
|
+
style: [styles.entityCluster, {
|
|
75
|
+
backgroundColor: colorScheme.nerdView.background
|
|
76
|
+
}],
|
|
77
|
+
onCopyToClipboard: onCopyToClipboard,
|
|
78
|
+
testID: (_entityCluster$testID = entityCluster.testID) !== null && _entityCluster$testID !== void 0 ? _entityCluster$testID : concatTestID(testID, 'entityCluster'),
|
|
79
|
+
textColor: colorScheme.white
|
|
80
|
+
}));
|
|
81
|
+
}
|
|
82
|
+
return /*#__PURE__*/React.createElement(TrustInfo, {
|
|
83
|
+
labels: entityCluster.trustInfoLabels,
|
|
84
|
+
onPress: onOpenTrustInfoDetails && entityCluster.trustInformation ? () => onOpenTrustInfoDetails(entityCluster.trustInformation) : undefined,
|
|
85
|
+
style: [styles.entityCluster, {
|
|
86
|
+
backgroundColor: colorScheme.nerdView.background
|
|
87
|
+
}],
|
|
88
|
+
testID: (_entityCluster$testID2 = entityCluster.testID) !== null && _entityCluster$testID2 !== void 0 ? _entityCluster$testID2 : concatTestID(testID, 'trustInfo'),
|
|
89
|
+
textColor: colorScheme.white,
|
|
90
|
+
trustInformation: (_entityCluster$trustI = entityCluster.trustInformation) === null || _entityCluster$trustI === void 0 ? void 0 : _entityCluster$trustI.eudiEcosystem
|
|
91
|
+
});
|
|
92
|
+
}, [entityCluster, colorScheme.nerdView.background, colorScheme.white, labels, onCopyToClipboard, onOpenTrustInfoDetails, testID]);
|
|
62
93
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ContrastingStatusBar, {
|
|
63
94
|
backgroundColor: colorScheme.nerdView.background
|
|
64
95
|
}), /*#__PURE__*/React.createElement(NavigationHeader, {
|
|
@@ -75,17 +106,7 @@ const NerdModeScreen = ({
|
|
|
75
106
|
title: title,
|
|
76
107
|
titleColor: colorScheme.white
|
|
77
108
|
}), /*#__PURE__*/React.createElement(AnimatedSectionList, {
|
|
78
|
-
ListHeaderComponent:
|
|
79
|
-
entityType: EntityType.ProofEntity,
|
|
80
|
-
entityLabels: entityCluster.entityLabels,
|
|
81
|
-
attributesLabels: labels,
|
|
82
|
-
style: [styles.entityCluster, {
|
|
83
|
-
backgroundColor: colorScheme.nerdView.background
|
|
84
|
-
}],
|
|
85
|
-
onCopyToClipboard: onCopyToClipboard,
|
|
86
|
-
testID: (_entityCluster$testID = entityCluster.testID) !== null && _entityCluster$testID !== void 0 ? _entityCluster$testID : concatTestID(testID, 'entityCluster'),
|
|
87
|
-
textColor: colorScheme.white
|
|
88
|
-
})) : null,
|
|
109
|
+
ListHeaderComponent: listHeader,
|
|
89
110
|
onScroll: onScroll,
|
|
90
111
|
renderItem: ({
|
|
91
112
|
item,
|
|
@@ -93,8 +114,8 @@ const NerdModeScreen = ({
|
|
|
93
114
|
index
|
|
94
115
|
}) => {
|
|
95
116
|
if (isSectionEntityCluster(item)) {
|
|
96
|
-
var _item$testID;
|
|
97
|
-
return /*#__PURE__*/React.createElement(EntityDetailsWithButtons, _extends({}, item, {
|
|
117
|
+
var _item$testID, _item$testID2, _item$trustInformatio;
|
|
118
|
+
return item.legacyTrustManagementEnabled ? /*#__PURE__*/React.createElement(EntityDetailsWithButtons, _extends({}, item, {
|
|
98
119
|
entityType: EntityType.CredentialEntity,
|
|
99
120
|
entityLabels: item.entityLabels,
|
|
100
121
|
attributesLabels: labels,
|
|
@@ -104,7 +125,16 @@ const NerdModeScreen = ({
|
|
|
104
125
|
onCopyToClipboard: onCopyToClipboard,
|
|
105
126
|
testID: (_item$testID = item.testID) !== null && _item$testID !== void 0 ? _item$testID : concatTestID(testID, 'sectionEntityCluster', index.toString()),
|
|
106
127
|
textColor: colorScheme.white
|
|
107
|
-
}))
|
|
128
|
+
})) : /*#__PURE__*/React.createElement(TrustInfo, {
|
|
129
|
+
labels: item.trustInfoLabels,
|
|
130
|
+
onPress: onOpenTrustInfoDetails && item.trustInformation ? () => onOpenTrustInfoDetails(item.trustInformation) : undefined,
|
|
131
|
+
style: [styles.entityCluster, {
|
|
132
|
+
backgroundColor: colorScheme.nerdView.background
|
|
133
|
+
}],
|
|
134
|
+
testID: (_item$testID2 = item.testID) !== null && _item$testID2 !== void 0 ? _item$testID2 : concatTestID(testID, 'trustInfo'),
|
|
135
|
+
textColor: colorScheme.white,
|
|
136
|
+
trustInformation: (_item$trustInformatio = item.trustInformation) === null || _item$trustInformatio === void 0 ? void 0 : _item$trustInformatio.eudiEcosystem
|
|
137
|
+
});
|
|
108
138
|
} else {
|
|
109
139
|
return /*#__PURE__*/React.createElement(NerdModeItem, _extends({}, item, {
|
|
110
140
|
expandedAttributes: expandedAttributes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","SectionList","StyleSheet","View","Animated","useAnimatedScrollHandler","useSharedValue","useSafeAreaInsets","EntityDetailsWithButtons","ContrastingStatusBar","concatTestID","TouchableOpacity","SectionEntityCluster","NavigationHeader","CloseIcon","NerdModeItem","Typography","useAppColorScheme","EntityType","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","createAnimatedComponent","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","entityCluster","testID","title","_entityCluster$testID","insets","colorScheme","scrollOffset","expandedAttributes","setExpandedAttributes","onExpand","expanded","prev","onScroll","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","length","attributeKey","createElement","Fragment","backgroundColor","nerdView","background","leftItem","onPress","color","white","style","paddingTop","top","titleColor","ListHeaderComponent","_extends","entityType","ProofEntity","entityLabels","attributesLabels","styles","textColor","renderItem","section","index","_item$testID","CredentialEntity","toString","last","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { IdentifierListItem } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: IdentifierListItem;\n subline?: string;\n entityLabels: EntityLabels;\n role: ContextRole;\n testID?: string;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={\n entityCluster ? (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n ) : null\n }\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n});\n\nexport default NerdModeScreen;\n"],"mappings":";AACA,OAAOA,KAAK,IAAuBC,QAAQ,QAAQ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AK,EAAE;MAAEP,eAAe,EAAErB,WAAW,CAACsB,QAAQ,CAACC;IAAW,CAAE;IAC5D3B,MAAM,EAAEA;EAAO,CAChB,CACD,CAAC;AAEP,CAAC;AAED,MAAM0C,MAAM,GAAGvE,UAAU,CAACqF,MAAM,CAAC;EAC/BzD,aAAa,EAAE;IACb0D,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDN,sBAAsB,EAAE;IACtBO,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDL,iBAAiB,EAAE;IACjBQ,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAe/D,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["React","useMemo","useState","SectionList","StyleSheet","View","Animated","useAnimatedScrollHandler","useSharedValue","useSafeAreaInsets","TrustInfo","EntityDetailsWithButtons","ContrastingStatusBar","concatTestID","TouchableOpacity","SectionEntityCluster","NavigationHeader","CloseIcon","NerdModeItem","Typography","useAppColorScheme","EntityType","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","createAnimatedComponent","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","onOpenTrustInfoDetails","entityCluster","testID","title","insets","colorScheme","scrollOffset","expandedAttributes","setExpandedAttributes","onExpand","expanded","prev","onScroll","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","length","attributeKey","listHeader","_entityCluster$testID2","_entityCluster$trustI","legacyTrustManagementEnabled","_entityCluster$testID","createElement","_extends","entityType","ProofEntity","entityLabels","attributesLabels","style","styles","backgroundColor","nerdView","background","textColor","white","trustInfoLabels","onPress","trustInformation","eudiEcosystem","Fragment","leftItem","color","paddingTop","top","titleColor","ListHeaderComponent","renderItem","section","index","_item$testID","_item$testID2","_item$trustInformatio","CredentialEntity","toString","last","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity"],"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,OAAOA,KAAK,IAAuBC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AACnE,SAASC,WAAW,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC5D,OAAOC,QAAQ,IAAIC,wBAAwB,EAAEC,cAAc,QAAQ,yBAAyB;AAC5F,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,SAAS,QAAyB,kBAAkB;AAC7D,OAAOC,wBAAwB,MAAuB,qDAAqD;AAC3G,OAAOC,oBAAoB,MAAM,oCAAoC;AACrE,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,gBAAgB,MAAM,6BAA6B;AAC1D,SAASC,SAAS,QAAQ,gBAAgB;AAC1C,OAAOC,YAAY,MAA6B,6BAA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AAe,EAAEhC,WAAW,CAACiC,QAAQ,CAACC;IAAW,CAAE;IAC5DrC,MAAM,EAAEA;EAAO,CAChB,CACD,CAAC;AAEP,CAAC;AAED,MAAMkC,MAAM,GAAGjE,UAAU,CAACgG,MAAM,CAAC;EAC/BlE,aAAa,EAAE;IACbmE,iBAAiB,EAAE,EAAE;IACrBC,eAAe,EAAE;EACnB,CAAC;EACDN,sBAAsB,EAAE;IACtBO,cAAc,EAAE,QAAQ;IACxBC,SAAS,EAAE,EAAE;IACbF,eAAe,EAAE;EACnB,CAAC;EACDL,iBAAiB,EAAE;IACjBQ,OAAO,EAAE,GAAG;IACZJ,iBAAiB,EAAE;EACrB;AACF,CAAC,CAAC;AAEF,eAAezE,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import { Linking, SectionList, StyleSheet, View } from 'react-native';
|
|
4
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
|
+
import TrustInfo from '../../components/trust-info/trust-info';
|
|
6
|
+
import { concatTestID, nonEmptyFilter, reportException } from '../../utils';
|
|
7
|
+
import { TouchableOpacity } from '../accessibility';
|
|
8
|
+
import { BackButton } from '../buttons';
|
|
9
|
+
import { NavigationHeader } from '../header';
|
|
10
|
+
import { LinkIcon, MailIcon, PhoneIcon } from '../icons';
|
|
11
|
+
import { Typography } from '../text';
|
|
12
|
+
import { useAppColorScheme } from '../theme';
|
|
13
|
+
const Separator = ({
|
|
14
|
+
dark,
|
|
15
|
+
leadingItem
|
|
16
|
+
}) => {
|
|
17
|
+
const colorScheme = useAppColorScheme();
|
|
18
|
+
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)) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
20
|
+
style: styles.emptyItem
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
24
|
+
style: {
|
|
25
|
+
backgroundColor: dark ? colorScheme.background : colorScheme.white
|
|
26
|
+
}
|
|
27
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: [styles.separator, {
|
|
29
|
+
backgroundColor: colorScheme.grayDark
|
|
30
|
+
}]
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
const ListButton = ({
|
|
34
|
+
label,
|
|
35
|
+
onPress
|
|
36
|
+
}) => {
|
|
37
|
+
const colorScheme = useAppColorScheme();
|
|
38
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
39
|
+
onPress: onPress,
|
|
40
|
+
style: [styles.button, styles.lastItem, {
|
|
41
|
+
backgroundColor: colorScheme.white
|
|
42
|
+
}]
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
44
|
+
align: "center",
|
|
45
|
+
color: colorScheme.text
|
|
46
|
+
}, label));
|
|
47
|
+
};
|
|
48
|
+
const ListItem = ({
|
|
49
|
+
action,
|
|
50
|
+
dark,
|
|
51
|
+
title,
|
|
52
|
+
value
|
|
53
|
+
}) => {
|
|
54
|
+
const colorScheme = useAppColorScheme();
|
|
55
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
56
|
+
style: [styles.item, {
|
|
57
|
+
backgroundColor: dark ? undefined : colorScheme.white
|
|
58
|
+
}]
|
|
59
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
60
|
+
style: styles.itemLabels
|
|
61
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
62
|
+
color: colorScheme.text,
|
|
63
|
+
numberOfLines: 1,
|
|
64
|
+
preset: "s/line-height-capped",
|
|
65
|
+
style: styles.itemTitleLabel
|
|
66
|
+
}, title), /*#__PURE__*/React.createElement(Typography, {
|
|
67
|
+
color: colorScheme.text,
|
|
68
|
+
numberOfLines: 1,
|
|
69
|
+
preset: "s/line-height-capped"
|
|
70
|
+
}, value)), action && /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
71
|
+
onPress: action.onPress,
|
|
72
|
+
style: [styles.actionButton, {
|
|
73
|
+
backgroundColor: dark ? colorScheme.white : colorScheme.grayDark
|
|
74
|
+
}]
|
|
75
|
+
}, /*#__PURE__*/React.createElement(action.icon, {
|
|
76
|
+
color: colorScheme.black
|
|
77
|
+
})));
|
|
78
|
+
};
|
|
79
|
+
const ContactItem = ({
|
|
80
|
+
email,
|
|
81
|
+
labels,
|
|
82
|
+
onPress,
|
|
83
|
+
phone,
|
|
84
|
+
website
|
|
85
|
+
}) => {
|
|
86
|
+
const colorScheme = useAppColorScheme();
|
|
87
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
88
|
+
style: [styles.contactItemWrapper, {
|
|
89
|
+
backgroundColor: colorScheme.white
|
|
90
|
+
}]
|
|
91
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
92
|
+
style: [styles.contactItem, {
|
|
93
|
+
backgroundColor: colorScheme.background
|
|
94
|
+
}]
|
|
95
|
+
}, website && /*#__PURE__*/React.createElement(ListItem, {
|
|
96
|
+
action: {
|
|
97
|
+
icon: LinkIcon,
|
|
98
|
+
onPress: onPress(website)
|
|
99
|
+
},
|
|
100
|
+
dark: true,
|
|
101
|
+
title: labels.website,
|
|
102
|
+
value: website
|
|
103
|
+
}), website && (email || phone) && /*#__PURE__*/React.createElement(Separator, {
|
|
104
|
+
dark: true
|
|
105
|
+
}), email && /*#__PURE__*/React.createElement(ListItem, {
|
|
106
|
+
action: {
|
|
107
|
+
icon: MailIcon,
|
|
108
|
+
onPress: onPress(`mailto:${email}`)
|
|
109
|
+
},
|
|
110
|
+
dark: true,
|
|
111
|
+
title: labels.email,
|
|
112
|
+
value: email
|
|
113
|
+
}), email && phone && /*#__PURE__*/React.createElement(Separator, {
|
|
114
|
+
dark: true
|
|
115
|
+
}), phone && /*#__PURE__*/React.createElement(ListItem, {
|
|
116
|
+
action: {
|
|
117
|
+
icon: PhoneIcon,
|
|
118
|
+
onPress: onPress(`tel:${phone}`)
|
|
119
|
+
},
|
|
120
|
+
dark: true,
|
|
121
|
+
title: labels.phone,
|
|
122
|
+
value: phone
|
|
123
|
+
})));
|
|
124
|
+
};
|
|
125
|
+
const TrustInfoDetailsScreen = ({
|
|
126
|
+
countries,
|
|
127
|
+
labels,
|
|
128
|
+
language,
|
|
129
|
+
onClose,
|
|
130
|
+
testID,
|
|
131
|
+
trustInformation
|
|
132
|
+
}) => {
|
|
133
|
+
var _countries$find, _countryDisplay$langu, _trustDetails$service, _trustDetails$interme;
|
|
134
|
+
const insets = useSafeAreaInsets();
|
|
135
|
+
const colorScheme = useAppColorScheme();
|
|
136
|
+
const [expanded, setExpanded] = useState(false);
|
|
137
|
+
const linkHandler = useCallback(url => () => {
|
|
138
|
+
Linking.openURL(url).catch(e => {
|
|
139
|
+
reportException(e, `Error opening contact link ${url}`);
|
|
140
|
+
});
|
|
141
|
+
}, []);
|
|
142
|
+
const trustDetails = trustInformation.eudiEcosystem;
|
|
143
|
+
if (!trustDetails) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
const countryDisplay = (_countries$find = countries.find(c => c.value === trustDetails.country)) === null || _countries$find === void 0 ? void 0 : _countries$find.display;
|
|
147
|
+
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;
|
|
148
|
+
const baseInfo = [{
|
|
149
|
+
name: trustDetails.name,
|
|
150
|
+
type: 'trustInfo'
|
|
151
|
+
}, {
|
|
152
|
+
title: labels.isPublicSector,
|
|
153
|
+
type: 'item',
|
|
154
|
+
value: trustDetails.isPublicSector ? labels.true : undefined
|
|
155
|
+
}, {
|
|
156
|
+
title: labels.serviceDescription,
|
|
157
|
+
type: 'item',
|
|
158
|
+
value: (_trustDetails$service = trustDetails.serviceDescription[0]) === null || _trustDetails$service === void 0 ? void 0 : _trustDetails$service[language]
|
|
159
|
+
}];
|
|
160
|
+
const expandItem = !expanded ? [{
|
|
161
|
+
type: 'expand'
|
|
162
|
+
}] : [];
|
|
163
|
+
const supervisoryAuthority = trustDetails.supervisoryAuthority ? [{
|
|
164
|
+
title: labels.supervisoryAuthority,
|
|
165
|
+
type: 'subsection'
|
|
166
|
+
}, {
|
|
167
|
+
...trustDetails.supervisoryAuthority,
|
|
168
|
+
type: 'contact',
|
|
169
|
+
website: trustDetails.supervisoryAuthority.uri
|
|
170
|
+
}] : [];
|
|
171
|
+
const extraInfo = expanded ? [{
|
|
172
|
+
title: labels.country,
|
|
173
|
+
type: 'item',
|
|
174
|
+
value: country
|
|
175
|
+
}, {
|
|
176
|
+
title: labels.identifier,
|
|
177
|
+
type: 'item',
|
|
178
|
+
value: trustDetails.identifier
|
|
179
|
+
}, {
|
|
180
|
+
title: labels.support,
|
|
181
|
+
type: 'subsection'
|
|
182
|
+
}, {
|
|
183
|
+
type: 'contact',
|
|
184
|
+
...trustDetails
|
|
185
|
+
}, ...supervisoryAuthority, {
|
|
186
|
+
type: 'collapse'
|
|
187
|
+
}] : [];
|
|
188
|
+
const trustDetailsSection = baseInfo.concat(expandItem).concat(extraInfo);
|
|
189
|
+
const intermediaryName = (_trustDetails$interme = trustDetails.intermediary) !== null && _trustDetails$interme !== void 0 && _trustDetails$interme.name ? [{
|
|
190
|
+
name: trustDetails.intermediary.name,
|
|
191
|
+
type: 'trustInfo'
|
|
192
|
+
}] : [];
|
|
193
|
+
const intermediarySection = trustDetails.intermediary ? [...intermediaryName, {
|
|
194
|
+
title: labels.country,
|
|
195
|
+
type: 'item',
|
|
196
|
+
value: trustDetails.intermediary.country
|
|
197
|
+
}, {
|
|
198
|
+
title: labels.identifier,
|
|
199
|
+
type: 'item',
|
|
200
|
+
value: trustDetails.intermediary.identifier
|
|
201
|
+
}, {
|
|
202
|
+
title: labels.support,
|
|
203
|
+
type: 'subsection'
|
|
204
|
+
}, {
|
|
205
|
+
type: 'contact',
|
|
206
|
+
...trustDetails.intermediary
|
|
207
|
+
}] : [];
|
|
208
|
+
const sections = [{
|
|
209
|
+
ItemSeparatorComponent: Separator,
|
|
210
|
+
data: trustDetailsSection
|
|
211
|
+
}, intermediarySection.length ? {
|
|
212
|
+
ItemSeparatorComponent: Separator,
|
|
213
|
+
data: intermediarySection,
|
|
214
|
+
title: 'Intermediary'
|
|
215
|
+
} : undefined].filter(nonEmptyFilter);
|
|
216
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
217
|
+
style: styles.container
|
|
218
|
+
}, /*#__PURE__*/React.createElement(NavigationHeader, {
|
|
219
|
+
leftItem: /*#__PURE__*/React.createElement(BackButton, {
|
|
220
|
+
onPress: onClose
|
|
221
|
+
}),
|
|
222
|
+
style: {
|
|
223
|
+
paddingTop: insets.top
|
|
224
|
+
},
|
|
225
|
+
title: labels.title
|
|
226
|
+
}), /*#__PURE__*/React.createElement(SectionList, {
|
|
227
|
+
contentInset: insets,
|
|
228
|
+
renderItem: ({
|
|
229
|
+
item,
|
|
230
|
+
section
|
|
231
|
+
}) => {
|
|
232
|
+
switch (item.type) {
|
|
233
|
+
case 'subsection':
|
|
234
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
235
|
+
style: [styles.subsection, {
|
|
236
|
+
backgroundColor: colorScheme.white
|
|
237
|
+
}],
|
|
238
|
+
testID: concatTestID(testID, section.title)
|
|
239
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
240
|
+
color: colorScheme.text,
|
|
241
|
+
preset: "m/heading"
|
|
242
|
+
}, item.title));
|
|
243
|
+
case 'trustInfo':
|
|
244
|
+
return /*#__PURE__*/React.createElement(TrustInfo, {
|
|
245
|
+
labels: labels,
|
|
246
|
+
style: [styles.trustInfoItem, styles.firstItem, {
|
|
247
|
+
backgroundColor: colorScheme.white
|
|
248
|
+
}],
|
|
249
|
+
trustInformation: item
|
|
250
|
+
});
|
|
251
|
+
case 'item':
|
|
252
|
+
if (!item.value) {
|
|
253
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
254
|
+
style: styles.emptyItem
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return /*#__PURE__*/React.createElement(ListItem, _extends({}, item, {
|
|
258
|
+
value: item.value
|
|
259
|
+
}));
|
|
260
|
+
case 'contact':
|
|
261
|
+
if (!item.website && !item.phone && !item.email) {
|
|
262
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
263
|
+
style: styles.emptyItem
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
return /*#__PURE__*/React.createElement(ContactItem, _extends({
|
|
267
|
+
labels: labels,
|
|
268
|
+
onPress: linkHandler
|
|
269
|
+
}, item));
|
|
270
|
+
case 'expand':
|
|
271
|
+
return /*#__PURE__*/React.createElement(ListButton, {
|
|
272
|
+
label: labels.expand,
|
|
273
|
+
onPress: () => setExpanded(true)
|
|
274
|
+
});
|
|
275
|
+
case 'collapse':
|
|
276
|
+
return /*#__PURE__*/React.createElement(ListButton, {
|
|
277
|
+
label: labels.collapse,
|
|
278
|
+
onPress: () => setExpanded(false)
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
renderSectionHeader: ({
|
|
283
|
+
section
|
|
284
|
+
}) => {
|
|
285
|
+
return section.title ? /*#__PURE__*/React.createElement(View, {
|
|
286
|
+
style: styles.sectionHeaderContainer,
|
|
287
|
+
testID: concatTestID(testID, section.title)
|
|
288
|
+
}, /*#__PURE__*/React.createElement(Typography, {
|
|
289
|
+
color: colorScheme.text,
|
|
290
|
+
preset: "m/heading",
|
|
291
|
+
style: styles.sectionHeaderText
|
|
292
|
+
}, section.title)) : null;
|
|
293
|
+
},
|
|
294
|
+
scrollEventThrottle: 16,
|
|
295
|
+
sections: sections,
|
|
296
|
+
showsVerticalScrollIndicator: false,
|
|
297
|
+
stickySectionHeadersEnabled: false,
|
|
298
|
+
style: styles.list,
|
|
299
|
+
testID: testID
|
|
300
|
+
}));
|
|
301
|
+
};
|
|
302
|
+
const styles = StyleSheet.create({
|
|
303
|
+
actionButton: {
|
|
304
|
+
alignItems: 'center',
|
|
305
|
+
borderRadius: 19,
|
|
306
|
+
height: 38,
|
|
307
|
+
justifyContent: 'center',
|
|
308
|
+
width: 38
|
|
309
|
+
},
|
|
310
|
+
button: {
|
|
311
|
+
height: 64,
|
|
312
|
+
justifyContent: 'center',
|
|
313
|
+
paddingBottom: 8,
|
|
314
|
+
width: '100%'
|
|
315
|
+
},
|
|
316
|
+
contactItem: {
|
|
317
|
+
borderRadius: 8
|
|
318
|
+
},
|
|
319
|
+
contactItemWrapper: {
|
|
320
|
+
padding: 12
|
|
321
|
+
},
|
|
322
|
+
container: {
|
|
323
|
+
flex: 1
|
|
324
|
+
},
|
|
325
|
+
emptyItem: {
|
|
326
|
+
height: 0
|
|
327
|
+
},
|
|
328
|
+
firstItem: {
|
|
329
|
+
borderTopLeftRadius: 8,
|
|
330
|
+
borderTopRightRadius: 8
|
|
331
|
+
},
|
|
332
|
+
item: {
|
|
333
|
+
alignItems: 'center',
|
|
334
|
+
flexDirection: 'row',
|
|
335
|
+
justifyContent: 'space-between',
|
|
336
|
+
padding: 12
|
|
337
|
+
},
|
|
338
|
+
itemLabels: {
|
|
339
|
+
flexDirection: 'column'
|
|
340
|
+
},
|
|
341
|
+
itemTitleLabel: {
|
|
342
|
+
opacity: 0.5
|
|
343
|
+
},
|
|
344
|
+
lastItem: {
|
|
345
|
+
borderBottomLeftRadius: 8,
|
|
346
|
+
borderBottomRightRadius: 8
|
|
347
|
+
},
|
|
348
|
+
list: {
|
|
349
|
+
marginHorizontal: 16
|
|
350
|
+
},
|
|
351
|
+
sectionHeaderContainer: {
|
|
352
|
+
justifyContent: 'center',
|
|
353
|
+
marginTop: 20,
|
|
354
|
+
paddingVertical: 16
|
|
355
|
+
},
|
|
356
|
+
sectionHeaderText: {
|
|
357
|
+
opacity: 0.7,
|
|
358
|
+
paddingHorizontal: 20
|
|
359
|
+
},
|
|
360
|
+
separator: {
|
|
361
|
+
height: 1,
|
|
362
|
+
marginHorizontal: 12,
|
|
363
|
+
opacity: 0.4
|
|
364
|
+
},
|
|
365
|
+
subsection: {
|
|
366
|
+
paddingBottom: 8,
|
|
367
|
+
paddingHorizontal: 12,
|
|
368
|
+
paddingTop: 22
|
|
369
|
+
},
|
|
370
|
+
trustInfoItem: {
|
|
371
|
+
padding: 8
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
export default TrustInfoDetailsScreen;
|
|
375
|
+
//# sourceMappingURL=trust-info-details-screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useState","Linking","SectionList","StyleSheet","View","useSafeAreaInsets","TrustInfo","concatTestID","nonEmptyFilter","reportException","TouchableOpacity","BackButton","NavigationHeader","LinkIcon","MailIcon","PhoneIcon","Typography","useAppColorScheme","Separator","dark","leadingItem","colorScheme","type","value","createElement","style","styles","emptyItem","backgroundColor","background","white","separator","grayDark","ListButton","label","onPress","button","lastItem","align","color","text","ListItem","action","title","item","undefined","itemLabels","numberOfLines","preset","itemTitleLabel","actionButton","icon","black","ContactItem","email","labels","phone","website","contactItemWrapper","contactItem","TrustInfoDetailsScreen","countries","language","onClose","testID","trustInformation","_countries$find","_countryDisplay$langu","_trustDetails$service","_trustDetails$interme","insets","expanded","setExpanded","linkHandler","url","openURL","catch","e","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","length","filter","container","leftItem","paddingTop","top","contentInset","renderItem","section","subsection","trustInfoItem","firstItem","_extends","expand","collapse","renderSectionHeader","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","showsVerticalScrollIndicator","stickySectionHeadersEnabled","list","create","alignItems","borderRadius","height","justifyContent","width","paddingBottom","padding","flex","borderTopLeftRadius","borderTopRightRadius","flexDirection","opacity","borderBottomLeftRadius","borderBottomRightRadius","marginHorizontal","marginTop","paddingVertical","paddingHorizontal"],"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,OAAOA,KAAK,IAAQC,WAAW,EAAEC,QAAQ,QAAQ,OAAO;AACxD,SAASC,OAAO,EAAEC,WAAW,EAAmBC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACtF,SAASC,iBAAiB,QAAQ,gCAAgC;AAGlE,OAAOC,SAAS,MAA2B,wCAAwC;AACnF,SAASC,YAAY,EAAEC,cAAc,EAAEC,eAAe,QAAQ,aAAa;AAC3E,SAASC,gBAAgB,QAAQ,kBAAkB;AACnD,SAASC,UAAU,QAAQ,YAAY;AACvC,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,QAAQ,UAAU;AACxD,SAASC,UAAU,QAAQ,SAAS;AACpC,SAASC,iBAAiB,QAAQ,UAAU;AA2D5C,MAAMC,SAA6B,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAAY,CAAC,KAAK;EAC/D,MAAMC,WAAW,GAAGJ,iBAAiB,CAAC,CAAC;EACvC,IAAI,CAAAG,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEE,IAAI,MAAK,YAAY,IAAK,CAAAF,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEE,IAAI,MAAK,MAAM,IAAI,EAACF,WAAW,aAAXA,WAAW,eAAXA,WAAW,CAAEG,KAAK,CAAC,EAAE;IAC/F,oBAAOzB,KAAA,CAAA0B,aAAA,CAACpB,IAAI;MAACqB,KAAK,EAAEC,MAAM,CAACC;IAAU,CAAE,CAAC;EAC1C;EACA,oBACE7B,KAAA,CAAA0B,aAAA,CAACpB,IAAI;IAACqB,KA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O,EAAE;EACX;AACF,CAAC,CAAC;AAEF,eAAe1E,sBAAsB","ignoreList":[]}
|
|
@@ -16,7 +16,8 @@ const cacheTypeToQueryKeys = {
|
|
|
16
16
|
[CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
|
|
17
17
|
[CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
18
18
|
[CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
19
|
-
[CacheType.
|
|
19
|
+
[CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,
|
|
20
|
+
[CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS
|
|
20
21
|
};
|
|
21
22
|
export const useCacheClear = () => {
|
|
22
23
|
const queryClient = useQueryClient();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CacheType","useMutation","useQueryClient","useONECore","CREDENTIAL_DETAIL_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_LIST_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","TRUST_ENTITY_DETAIL_QUERY_KEY","CREDENTIAL_QUERY_KEYS","TRUST_ENTITY_QUERY_KEYS","cacheTypeToQueryKeys","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","
|
|
1
|
+
{"version":3,"names":["CacheType","useMutation","useQueryClient","useONECore","CREDENTIAL_DETAIL_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_LIST_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","TRUST_ENTITY_DETAIL_QUERY_KEY","CREDENTIAL_QUERY_KEYS","TRUST_ENTITY_QUERY_KEYS","cacheTypeToQueryKeys","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","core","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries"],"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,SAASA,SAAS,QAAQ,iCAAiC;AAC3D,SAASC,WAAW,EAAEC,cAAc,QAAQ,aAAa;AAEzD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,2BAA2B,EAAEC,+BAA+B,EAAEC,yBAAyB,QAAQ,eAAe;AACvH,SAASC,oCAAoC,EAAEC,6BAA6B,QAAQ,gBAAgB;AAEpG,MAAMC,qBAAqB,GAAG,CAACH,yBAAyB,EAAED,+BAA+B,EAAED,2BAA2B,CAAC;AACvH,MAAMM,uBAAuB,GAAG,CAACF,6BAA6B,EAAED,oCAAoC,CAAC;;AAErG;AACA,MAAMI,oBAAiD,GAAG;EACxD,CAACX,SAAS,CAACY,YAAY,GAAGH,qBAAqB;EAC/C,CAACT,SAAS,CAACa,eAAe,GAAGJ,qBAAqB;EAClD,CAACT,SAAS,CAACc,sBAAsB,GAAGL,qBAAqB;EACzD,CAACT,SAAS,CAACe,YAAY,GAAGN,qBAAqB;EAC/C,CAACT,SAAS,CAACgB,WAAW,GAAGP,qBAAqB;EAC9C,CAACT,SAAS,CAACiB,UAAU,GAAG,CAAC,GAAGP,uBAAuB,EAAE,GAAG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