@procivis/one-react-native-components 0.3.142 → 0.3.147

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 (113) hide show
  1. package/lib/commonjs/components/proof-request/index.js +1 -12
  2. package/lib/commonjs/components/proof-request/index.js.map +1 -1
  3. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +6 -3
  4. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  5. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  6. package/lib/commonjs/ui-components/credential/card/credential-header.js +8 -38
  7. package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
  8. package/lib/commonjs/ui-components/credential/card/credential-logo.js +71 -0
  9. package/lib/commonjs/ui-components/credential/card/credential-logo.js.map +1 -0
  10. package/lib/commonjs/ui-components/credential/card/index.js +7 -0
  11. package/lib/commonjs/ui-components/credential/card/index.js.map +1 -1
  12. package/lib/commonjs/ui-components/input/selection-input.js +69 -53
  13. package/lib/commonjs/ui-components/input/selection-input.js.map +1 -1
  14. package/lib/commonjs/ui-components/text/index.js +1 -9
  15. package/lib/commonjs/ui-components/text/index.js.map +1 -1
  16. package/lib/commonjs/utils/hooks/core/proofs.js +1 -1
  17. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  18. package/lib/commonjs/utils/hooks/core/transaction.js +20 -0
  19. package/lib/commonjs/utils/hooks/core/transaction.js.map +1 -0
  20. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +34 -3
  21. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  22. package/lib/commonjs/utils/parsers/credential.js +22 -14
  23. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  24. package/lib/commonjs/utils/parsers/index.js +0 -11
  25. package/lib/commonjs/utils/parsers/index.js.map +1 -1
  26. package/lib/commonjs/utils/parsers/query.js +2 -2
  27. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  28. package/lib/module/components/proof-request/index.js +0 -1
  29. package/lib/module/components/proof-request/index.js.map +1 -1
  30. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +6 -3
  31. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  32. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  33. package/lib/module/ui-components/credential/card/credential-header.js +8 -38
  34. package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
  35. package/lib/module/ui-components/credential/card/credential-logo.js +64 -0
  36. package/lib/module/ui-components/credential/card/credential-logo.js.map +1 -0
  37. package/lib/module/ui-components/credential/card/index.js +2 -0
  38. package/lib/module/ui-components/credential/card/index.js.map +1 -1
  39. package/lib/module/ui-components/input/selection-input.js +70 -54
  40. package/lib/module/ui-components/input/selection-input.js.map +1 -1
  41. package/lib/module/ui-components/text/index.js +2 -2
  42. package/lib/module/ui-components/text/index.js.map +1 -1
  43. package/lib/module/utils/hooks/core/proofs.js +1 -1
  44. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  45. package/lib/module/utils/hooks/core/transaction.js +13 -0
  46. package/lib/module/utils/hooks/core/transaction.js.map +1 -0
  47. package/lib/module/utils/parsers/credential-sharing-v2.js +31 -1
  48. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  49. package/lib/module/utils/parsers/credential.js +20 -13
  50. package/lib/module/utils/parsers/credential.js.map +1 -1
  51. package/lib/module/utils/parsers/index.js +0 -1
  52. package/lib/module/utils/parsers/index.js.map +1 -1
  53. package/lib/module/utils/parsers/query.js +2 -2
  54. package/lib/module/utils/parsers/query.js.map +1 -1
  55. package/lib/typescript/components/proof-request/index.d.ts +0 -1
  56. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +8 -1
  57. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +1 -1
  58. package/lib/typescript/ui-components/credential/card/credential-logo.d.ts +17 -0
  59. package/lib/typescript/ui-components/credential/card/index.d.ts +3 -0
  60. package/lib/typescript/ui-components/input/selection-input.d.ts +3 -7
  61. package/lib/typescript/ui-components/text/index.d.ts +2 -1
  62. package/lib/typescript/ui-components/text/typography.d.ts +13 -13
  63. package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -2
  64. package/lib/typescript/utils/hooks/core/transaction.d.ts +2 -0
  65. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +10 -2
  66. package/lib/typescript/utils/parsers/credential.d.ts +2 -1
  67. package/lib/typescript/utils/parsers/index.d.ts +0 -1
  68. package/package.json +7 -4
  69. package/src/components/proof-request/index.ts +0 -1
  70. package/src/components/proof-request/v2/share-credential-v2-group.tsx +12 -2
  71. package/src/components/proof-request/v2/share-credential-v2.tsx +1 -1
  72. package/src/ui-components/credential/card/credential-header.tsx +9 -37
  73. package/src/ui-components/credential/card/credential-logo.stories.tsx +45 -0
  74. package/src/ui-components/credential/card/credential-logo.tsx +79 -0
  75. package/src/ui-components/credential/card/index.ts +5 -8
  76. package/src/ui-components/input/selection-input.tsx +85 -65
  77. package/src/ui-components/text/index.ts +2 -1
  78. package/src/utils/hooks/core/proofs.ts +3 -3
  79. package/src/utils/hooks/core/transaction.ts +18 -0
  80. package/src/utils/parsers/credential-sharing-v2.tsx +70 -1
  81. package/src/utils/parsers/credential.ts +27 -13
  82. package/src/utils/parsers/index.ts +0 -1
  83. package/src/utils/parsers/query.ts +1 -1
  84. package/lib/commonjs/components/proof-request/v1/group.js +0 -35
  85. package/lib/commonjs/components/proof-request/v1/group.js.map +0 -1
  86. package/lib/commonjs/components/proof-request/v1/index.js +0 -39
  87. package/lib/commonjs/components/proof-request/v1/index.js.map +0 -1
  88. package/lib/commonjs/components/proof-request/v1/select-credential.js +0 -53
  89. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +0 -1
  90. package/lib/commonjs/components/proof-request/v1/share-credential.js +0 -110
  91. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +0 -1
  92. package/lib/commonjs/utils/parsers/credential-sharing.js +0 -269
  93. package/lib/commonjs/utils/parsers/credential-sharing.js.map +0 -1
  94. package/lib/module/components/proof-request/v1/group.js +0 -27
  95. package/lib/module/components/proof-request/v1/group.js.map +0 -1
  96. package/lib/module/components/proof-request/v1/index.js +0 -4
  97. package/lib/module/components/proof-request/v1/index.js.map +0 -1
  98. package/lib/module/components/proof-request/v1/select-credential.js +0 -44
  99. package/lib/module/components/proof-request/v1/select-credential.js.map +0 -1
  100. package/lib/module/components/proof-request/v1/share-credential.js +0 -101
  101. package/lib/module/components/proof-request/v1/share-credential.js.map +0 -1
  102. package/lib/module/utils/parsers/credential-sharing.js +0 -256
  103. package/lib/module/utils/parsers/credential-sharing.js.map +0 -1
  104. package/lib/typescript/components/proof-request/v1/group.d.ts +0 -2
  105. package/lib/typescript/components/proof-request/v1/index.d.ts +0 -3
  106. package/lib/typescript/components/proof-request/v1/select-credential.d.ts +0 -15
  107. package/lib/typescript/components/proof-request/v1/share-credential.d.ts +0 -27
  108. package/lib/typescript/utils/parsers/credential-sharing.d.ts +0 -21
  109. package/src/components/proof-request/v1/group.tsx +0 -26
  110. package/src/components/proof-request/v1/index.ts +0 -3
  111. package/src/components/proof-request/v1/select-credential.tsx +0 -55
  112. package/src/components/proof-request/v1/share-credential.tsx +0 -159
  113. package/src/utils/parsers/credential-sharing.tsx +0 -415
@@ -1,11 +1,9 @@
1
- import Picker from '@procivis/react-native-picker';
2
- import React, { forwardRef, useCallback, useMemo, useState } from 'react';
3
- import type { TouchableOpacityProps } from 'react-native';
1
+ import WheelPicker from '@quidone/react-native-wheel-picker';
2
+ import React, { FC, memo, useCallback, useMemo, useState } from 'react';
3
+ import { Modal, StyleSheet, TouchableOpacityProps, View } from 'react-native';
4
4
 
5
- import { useForwardedRef } from '../../utils/ref';
6
- import { focusAccessibility } from '../accessibility/accessibility';
7
- import { TouchableOpacity, TouchableOpacityRef } from '../accessibility/accessibilityHistoryWrappers';
8
- import { useAccessibilityTranslation } from '../accessibility/accessibilityLanguage';
5
+ import { Typography } from '..';
6
+ import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
9
7
  import { useAppColorScheme } from '../theme';
10
8
  import TextInput, { TextInputAccessory } from './text-input';
11
9
 
@@ -28,12 +26,10 @@ export interface SelectionInputProps extends TouchableOpacityProps {
28
26
  */
29
27
  onChange?: (value: SelectionInputChoice) => boolean;
30
28
  pickerCancelLabel: string;
31
-
32
29
  pickerConfirmLabel: string;
33
30
  pickerTitle?: string;
34
31
  /** {@link SelectionInputChoice.label} of the selected choice */
35
32
  selectedValue?: string | number;
36
-
37
33
  values: SelectionInputChoice[];
38
34
  }
39
35
 
@@ -41,72 +37,96 @@ export interface SelectionInputProps extends TouchableOpacityProps {
41
37
  * Generic selection input component
42
38
  * @see https://www.figma.com/file/Gd0Tj0234hxtl3HMcCJThW/App-Component-Library-(Design)?node-id=4%3A127&t=B2Y3PtJHH22XDPkx-0
43
39
  */
44
- const SelectionInput = forwardRef<TouchableOpacityRef, SelectionInputProps>(
45
- (
46
- { selectedValue, values, label, pickerTitle, pickerConfirmLabel, pickerCancelLabel, onChange, error, ...props },
47
- ref,
48
- ) => {
49
- const t = useAccessibilityTranslation();
50
- const colorScheme = useAppColorScheme();
51
- const selectedChoice = useMemo(
52
- () => (selectedValue !== undefined ? values.find(({ value }) => value === selectedValue) : undefined),
53
- [selectedValue, values],
54
- );
55
40
 
56
- const [forwardedRef, refObject] = useForwardedRef(ref);
57
- const [pickerOpen, setPickerOpen] = useState(false);
41
+ const SelectionInput: FC<SelectionInputProps> = ({
42
+ selectedValue,
43
+ label,
44
+ values,
45
+ pickerCancelLabel,
46
+ pickerConfirmLabel,
47
+ onChange,
48
+ ...props
49
+ }) => {
50
+ const [modalVisible, setModalVisible] = useState(false);
51
+ const [wheelPickerValue, setWheelPickerValue] = useState(selectedValue);
52
+ const colorScheme = useAppColorScheme();
53
+
54
+ const selectedChoice = useMemo(
55
+ () => (selectedValue !== undefined ? values.find(({ value }) => value === selectedValue) : undefined),
56
+ [selectedValue, values],
57
+ );
58
+
59
+ const onCancel = useCallback(() => {
60
+ setModalVisible(false);
61
+ }, []);
62
+
63
+ const onConfirm = useCallback(() => {
64
+ const choice = values.find(({ value }) => value === wheelPickerValue);
65
+ if (choice && onChange) {
66
+ onChange(choice);
67
+ }
58
68
 
59
- const onOpen = useCallback(() => setPickerOpen(true), []);
60
- const onConfirm = useCallback(
61
- (valueLabel: any) => {
62
- setPickerOpen(false);
63
- const choice = values.find(({ label: choiceLabel }) => choiceLabel === valueLabel);
64
- if (!choice || !onChange?.(choice)) {
65
- setTimeout(() => focusAccessibility(refObject.current), 200);
66
- }
67
- },
68
- [onChange, refObject, values],
69
- );
70
- const onCancel = useCallback(() => {
71
- setPickerOpen(false);
72
- requestAnimationFrame(() => focusAccessibility(refObject.current));
73
- }, [refObject]);
69
+ setModalVisible(false);
70
+ }, [onChange, values, wheelPickerValue]);
74
71
 
75
- const accessibilityLabel = error ? `${label}, ${error}` : label;
76
- return (
77
- <TouchableOpacity
78
- accessibilityHint={t('accessibility.control.combobox.tapToSelect')}
79
- accessibilityLabel={accessibilityLabel}
80
- accessibilityRole="combobox"
81
- accessibilityValue={{ text: selectedChoice?.label }}
82
- onPress={onOpen}
83
- ref={forwardedRef}
84
- {...props}>
72
+ return (
73
+ <>
74
+ <TouchableOpacity onPress={() => setModalVisible(true)} {...props}>
85
75
  <TextInput
86
76
  accessory={TextInputAccessory.Dropdown}
87
77
  disabled={true}
88
- error={error}
89
78
  label={label}
90
79
  pointerEvents="none"
91
80
  value={selectedChoice?.shortLabel ?? selectedChoice?.label}
92
81
  />
93
- <Picker
94
- cancelText={pickerCancelLabel}
95
- confirmText={pickerConfirmLabel}
96
- items={values.map(({ label: itemLabel }) => itemLabel)}
97
- modal
98
- mode="list"
99
- onCancel={onCancel}
100
- onConfirm={onConfirm}
101
- open={pickerOpen}
102
- selectedValue={selectedChoice?.label}
103
- textColor={colorScheme.text}
104
- title={pickerTitle ?? label}
105
- />
106
82
  </TouchableOpacity>
107
- );
83
+ <Modal
84
+ animationType="fade"
85
+ backdropColor={'rgba(0,0,0,0.1)'}
86
+ onDismiss={() => setModalVisible(false)}
87
+ onRequestClose={onCancel}
88
+ style={styles.modal}
89
+ visible={modalVisible}>
90
+ <View style={styles.modalContent}>
91
+ <WheelPicker
92
+ data={values}
93
+ onValueChanged={({ item: { value } }: { item: { value?: string | number } }) => setWheelPickerValue(value)}
94
+ value={wheelPickerValue || ''}
95
+ visibleItemCount={5}
96
+ />
97
+ <View style={styles.buttons}>
98
+ <TouchableOpacity onPress={onCancel}>
99
+ <Typography color={colorScheme.black} preset="s">
100
+ {pickerCancelLabel}
101
+ </Typography>
102
+ </TouchableOpacity>
103
+ <TouchableOpacity onPress={onConfirm}>
104
+ <Typography color={colorScheme.black} preset="s">
105
+ {pickerConfirmLabel}
106
+ </Typography>
107
+ </TouchableOpacity>
108
+ </View>
109
+ </View>
110
+ </Modal>
111
+ </>
112
+ );
113
+ };
114
+
115
+ const styles = StyleSheet.create({
116
+ buttons: {
117
+ flexDirection: 'row',
118
+ gap: 20,
119
+ justifyContent: 'flex-end',
120
+ },
121
+
122
+ modal: {},
123
+ modalContent: {
124
+ backgroundColor: 'white',
125
+ borderRadius: 2,
126
+ margin: 'auto',
127
+ padding: 20,
128
+ width: '80%',
108
129
  },
109
- );
130
+ });
110
131
 
111
- SelectionInput.displayName = 'SelectionInput';
112
- export default SelectionInput;
132
+ export default memo(SelectionInput);
@@ -1,4 +1,5 @@
1
- import ExpandableTypography, { ExpandableTypographyProps } from './expandableTypography';
1
+ import type { ExpandableTypographyProps } from './expandableTypography';
2
+ import ExpandableTypography from './expandableTypography';
2
3
  import type { TypographyProps } from './typography';
3
4
  import Typography from './typography';
4
5
 
@@ -6,7 +6,7 @@ import {
6
6
  HistoryErrorMetadata,
7
7
  IdentifierListQuery,
8
8
  OneError,
9
- PresentationSubmitCredentialRequest,
9
+ PresentationSubmitV2CredentialRequest,
10
10
  ProofListQuery,
11
11
  ProofSchemaDetail,
12
12
  ProofState,
@@ -102,9 +102,9 @@ export const useProofAccept = () => {
102
102
  interactionId,
103
103
  credentials,
104
104
  }: {
105
- credentials: Record<string, PresentationSubmitCredentialRequest[]>;
105
+ credentials: Record<string, PresentationSubmitV2CredentialRequest[]>;
106
106
  interactionId: string;
107
- }) => core.holderSubmitProof(interactionId, credentials),
107
+ }) => core.holderSubmitProofV2(interactionId, credentials),
108
108
  {
109
109
  onError: async (err) => {
110
110
  reportException(err, 'Proof submission failure');
@@ -0,0 +1,18 @@
1
+ import { useQuery } from 'react-query';
2
+
3
+ import { useONECore } from './core-context';
4
+
5
+ export const TRANSACTION_DATA_QUERY_KEY = 'proof-detail';
6
+
7
+ export const useTransactionData = (proofId: string | undefined, transactionDataId: string | undefined) => {
8
+ const { core } = useONECore();
9
+
10
+ return useQuery(
11
+ [TRANSACTION_DATA_QUERY_KEY, proofId],
12
+ () => (proofId && transactionDataId ? core.holderGetTransactionData(proofId, transactionDataId) : undefined),
13
+ {
14
+ enabled: Boolean(proofId && transactionDataId),
15
+ keepPreviousData: true,
16
+ },
17
+ );
18
+ };
@@ -2,6 +2,7 @@ import {
2
2
  Claim,
3
3
  ClaimValue,
4
4
  CoreConfig,
5
+ CredentialDetail,
5
6
  CredentialQueryFailureHint,
6
7
  CredentialType,
7
8
  PresentationDefinitionV2Claim,
@@ -14,6 +15,7 @@ import {
14
15
  CredentialAttribute,
15
16
  CredentialCardNotice,
16
17
  CredentialCardProps,
18
+ CredentialHeaderProps,
17
19
  CredentialNoticeWarningIcon,
18
20
  CredentialWarningIcon,
19
21
  PurposeInfoIcon,
@@ -27,7 +29,74 @@ import {
27
29
  getCredentialCardPropsFromCredential,
28
30
  supportsSelectiveDisclosure,
29
31
  } from '.';
30
- import { ShareCredentialCardLabels, validityCheckedCardFromCredential } from './credential-sharing';
32
+ import { CardLabels, credentialDetailFromPresentationV2Credential } from './credential';
33
+
34
+ export type ShareCredentialCardLabels = CardLabels & {
35
+ selectiveDisclosure: string;
36
+ missingAttribute: string;
37
+ missingCredential: string;
38
+ multipleCredentials: string;
39
+ disclosurePolicyViolation: string;
40
+ };
41
+
42
+ export const validityCheckedCardFromCredential = (
43
+ credential: CredentialDetail | PresentationDefinitionV2Credential,
44
+ expanded: boolean,
45
+ selectiveDisclosureSupported: boolean | undefined,
46
+ multipleCredentialsAvailable: boolean,
47
+ config: CoreConfig,
48
+ notice: CredentialCardNotice | undefined,
49
+ testID: string,
50
+ labels: ShareCredentialCardLabels,
51
+ language: string | undefined,
52
+ ): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID' | 'width'> => {
53
+ let credentialHeaderDetail:
54
+ | Pick<
55
+ CredentialHeaderProps,
56
+ | 'credentialDetailPrimary'
57
+ | 'credentialDetailSecondary'
58
+ | 'credentialDetailErrorColor'
59
+ | 'credentialDetailTestID'
60
+ | 'statusIcon'
61
+ >
62
+ | undefined;
63
+ if (selectiveDisclosureSupported === false) {
64
+ credentialHeaderDetail = {
65
+ credentialDetailPrimary: labels.selectiveDisclosure,
66
+ credentialDetailTestID: concatTestID(testID, 'header.nonSelectiveDisclosure'),
67
+ statusIcon: CredentialWarningIcon,
68
+ };
69
+ } else if ('embeddedDisclosurePolicyViolation' in credential) {
70
+ credentialHeaderDetail = {
71
+ credentialDetailPrimary: labels.disclosurePolicyViolation,
72
+ credentialDetailTestID: concatTestID(testID, 'header.dislosurePolicyViolation'),
73
+ statusIcon: CredentialWarningIcon,
74
+ };
75
+ } else if (!expanded && multipleCredentialsAvailable) {
76
+ credentialHeaderDetail = {
77
+ credentialDetailPrimary: labels.multipleCredentials,
78
+ credentialDetailTestID: concatTestID(testID, 'header.multiple'),
79
+ statusIcon: CredentialWarningIcon,
80
+ };
81
+ }
82
+
83
+ const card = getCredentialCardPropsFromCredential(
84
+ credentialDetailFromPresentationV2Credential(credential),
85
+ credential.claims,
86
+ config,
87
+ notice,
88
+ testID,
89
+ labels,
90
+ language,
91
+ );
92
+ return {
93
+ ...card,
94
+ header: {
95
+ ...card.header,
96
+ ...credentialHeaderDetail,
97
+ },
98
+ };
99
+ };
31
100
 
32
101
  const v2ClaimValueToClaimValue = (value: PresentationDefinitionV2ClaimValue): ClaimValue => {
33
102
  if (value.type_ !== 'NESTED') {
@@ -19,6 +19,7 @@ import {
19
19
  CredentialCardProps,
20
20
  CredentialDetailsCardProps,
21
21
  CredentialHeaderProps,
22
+ CredentialLogoProps,
22
23
  } from '../../ui-components/credential';
23
24
  import { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';
24
25
  import {
@@ -86,6 +87,30 @@ const formatCredentialDetail = (
86
87
  return attributeValue.value ?? '';
87
88
  };
88
89
 
90
+ export const credentialLogoFromCredential = (
91
+ credential: CredentialDetail,
92
+ config: CoreConfig,
93
+ testID: string,
94
+ language: string | undefined,
95
+ ): Omit<CredentialLogoProps, 'size'> => {
96
+ const { layoutProperties } = credential.schema;
97
+ const defaultLanguage = config.globalSettings.defaultLanguage;
98
+ return {
99
+ color: layoutProperties?.logo?.backgroundColor,
100
+ credentialName:
101
+ getTranslatedLabel(credential.schema.translations?.name, language, defaultLanguage) ?? credential.schema.name,
102
+ icon: layoutProperties?.logo?.image
103
+ ? {
104
+ imageSource: {
105
+ uri: layoutProperties.logo.image,
106
+ },
107
+ }
108
+ : undefined,
109
+ iconLabelColor: layoutProperties?.logo?.fontColor,
110
+ testID,
111
+ };
112
+ };
113
+
89
114
  export const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {
90
115
  const mdocMsoValidityIssue = Boolean(
91
116
  credential.mdocMsoValidity?.nextUpdate && new Date(credential.mdocMsoValidity.nextUpdate) < new Date(),
@@ -174,6 +199,7 @@ export const cardHeaderFromCredential = (
174
199
  labels: CardHeaderLabels,
175
200
  language: string | undefined,
176
201
  ): Omit<CredentialHeaderProps, 'style'> => {
202
+ const logoProps = credentialLogoFromCredential(credential, config, '', language);
177
203
  const {
178
204
  credentialDetailPrimary,
179
205
  credentialDetailSecondary,
@@ -181,25 +207,13 @@ export const cardHeaderFromCredential = (
181
207
  credentialDetailTestID,
182
208
  statusIcon,
183
209
  } = credentialDetailFromCredential(credential, claims, config, testID, labels, language);
184
- const { layoutProperties } = credential.schema;
185
- const defaultLanguage = config.globalSettings.defaultLanguage;
186
210
 
187
211
  return {
188
- color: layoutProperties?.logo?.backgroundColor,
212
+ ...logoProps,
189
213
  credentialDetailErrorColor,
190
214
  credentialDetailPrimary,
191
215
  credentialDetailSecondary,
192
216
  credentialDetailTestID,
193
- credentialName:
194
- getTranslatedLabel(credential.schema.translations?.name, language, defaultLanguage) ?? credential.schema.name,
195
- icon: layoutProperties?.logo?.image
196
- ? {
197
- imageSource: {
198
- uri: layoutProperties.logo.image,
199
- },
200
- }
201
- : undefined,
202
- iconLabelColor: layoutProperties?.logo?.fontColor,
203
217
  statusIcon,
204
218
  testID,
205
219
  };
@@ -1,6 +1,5 @@
1
1
  export * from './credential';
2
2
  export * from './credential-images';
3
- export * from './credential-sharing';
4
3
  export * from './credential-sharing-v2';
5
4
  export * from './query';
6
5
  export * from './universal-links';
@@ -71,6 +71,7 @@ export const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<Histo
71
71
  'proofSchemaId',
72
72
  'search',
73
73
  'users',
74
+ 'trustCollectionId',
74
75
  ]);
75
76
  };
76
77
 
@@ -87,7 +88,6 @@ export const getQueryKeyFromCredentialSchemaListQueryParams = (
87
88
  'exact',
88
89
  'ids',
89
90
  'include',
90
- 'schemaId',
91
91
  'schemaIds',
92
92
  'formats',
93
93
  'usesBatchIssuance',
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ProofRequestGroup = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
- var _reactNative = require("react-native");
9
- var _theme = require("../../../ui-components/theme");
10
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- const ProofRequestGroup = ({
12
- children
13
- }) => {
14
- const colorScheme = (0, _theme.useAppColorScheme)();
15
- return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
16
- style: styles.group
17
- }, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
18
- style: [styles.separator, {
19
- backgroundColor: colorScheme.grayDark
20
- }]
21
- }), children);
22
- };
23
- exports.ProofRequestGroup = ProofRequestGroup;
24
- const styles = _reactNative.StyleSheet.create({
25
- group: {
26
- marginTop: 16
27
- },
28
- separator: {
29
- height: 1,
30
- marginBottom: 16,
31
- marginHorizontal: 4,
32
- opacity: 0.5
33
- }
34
- });
35
- //# sourceMappingURL=group.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_theme","e","__esModule","default","ProofRequestGroup","children","colorScheme","useAppColorScheme","createElement","View","style","styles","group","separator","backgroundColor","grayDark","exports","StyleSheet","create","marginTop","height","marginBottom","marginHorizontal","opacity"],"sources":["group.tsx"],"sourcesContent":["import React, { FunctionComponent, PropsWithChildren } from 'react';\nimport { StyleSheet, View } from 'react-native';\n\nimport { useAppColorScheme } from '../../../ui-components/theme';\n\nexport const ProofRequestGroup: FunctionComponent<PropsWithChildren> = ({ children }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={styles.group}>\n <View style={[styles.separator, { backgroundColor: colorScheme.grayDark }]} />\n {children}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n group: {\n marginTop: 16,\n },\n separator: {\n height: 1,\n marginBottom: 16,\n marginHorizontal: 4,\n opacity: 0.5,\n },\n});\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAAiE,SAAAD,uBAAAI,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1D,MAAMG,iBAAuD,GAAGA,CAAC;EAAEC;AAAS,CAAC,KAAK;EACvF,MAAMC,WAAW,GAAG,IAAAC,wBAAiB,EAAC,CAAC;EACvC,oBACEX,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAU,IAAI;IAACC,KAAK,EAAEC,MAAM,CAACC;EAAM,gBACxBhB,MAAA,CAAAO,OAAA,CAAAK,aAAA,CAACT,YAAA,CAAAU,IAAI;IAACC,KAAK,EAAE,CAACC,MAAM,CAACE,SAAS,EAAE;MAAEC,eAAe,EAAER,WAAW,CAACS;IAAS,CAAC;EAAE,CAAE,CAAC,EAC7EV,QACG,CAAC;AAEX,CAAC;AAACW,OAAA,CAAAZ,iBAAA,GAAAA,iBAAA;AAEF,MAAMO,MAAM,GAAGM,uBAAU,CAACC,MAAM,CAAC;EAC/BN,KAAK,EAAE;IACLO,SAAS,EAAE;EACb,CAAC;EACDN,SAAS,EAAE;IACTO,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,CAAC;IACnBC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _group = require("./group");
7
- Object.keys(_group).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _group[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _group[key];
14
- }
15
- });
16
- });
17
- var _selectCredential = require("./select-credential");
18
- Object.keys(_selectCredential).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _selectCredential[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _selectCredential[key];
25
- }
26
- });
27
- });
28
- var _shareCredential = require("./share-credential");
29
- Object.keys(_shareCredential).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _shareCredential[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _shareCredential[key];
36
- }
37
- });
38
- });
39
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_group","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_selectCredential","_shareCredential"],"sources":["index.ts"],"sourcesContent":["export * from './group';\nexport * from './select-credential';\nexport * from './share-credential';\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,MAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,MAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,MAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,iBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,iBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,iBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,iBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,gBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,gBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,gBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,gBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -1,53 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SelectCredential = void 0;
7
- var _react = _interopRequireWildcard(require("react"));
8
- var _reactNative = require("react-native");
9
- var _uiComponents = require("../../../ui-components");
10
- var _coreConfig = require("../../../utils/hooks/core/core-config");
11
- var _credentials = require("../../../utils/hooks/core/credentials");
12
- var _credentialSharing = require("../../../utils/parsers/credential-sharing");
13
- 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); }
14
- 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; }
15
- const SelectCredential = ({
16
- credentialId,
17
- labels,
18
- language,
19
- lastItem,
20
- onImagePreview,
21
- onPress,
22
- request,
23
- selected,
24
- testID
25
- }) => {
26
- const {
27
- data: credential
28
- } = (0, _credentials.useCredentialDetail)(credentialId);
29
- const {
30
- data: config
31
- } = (0, _coreConfig.useCoreConfig)();
32
- const cardWidth = (0, _react.useMemo)(() => _reactNative.Dimensions.get('window').width - 32, []);
33
- if (!credential || !config) {
34
- return null;
35
- }
36
- const {
37
- card,
38
- attributes
39
- } = (0, _credentialSharing.selectCredentialCardFromCredential)(credential, selected, request, config, testID, labels, language);
40
- return /*#__PURE__*/_react.default.createElement(_uiComponents.CredentialDetailsCardListItem, {
41
- attributes: attributes,
42
- card: {
43
- ...card,
44
- onHeaderPress: onPress,
45
- width: cardWidth
46
- },
47
- expanded: selected,
48
- lastItem: lastItem,
49
- onImagePreview: onImagePreview
50
- });
51
- };
52
- exports.SelectCredential = SelectCredential;
53
- //# sourceMappingURL=select-credential.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uiComponents","_coreConfig","_credentials","_credentialSharing","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","SelectCredential","credentialId","labels","language","lastItem","onImagePreview","onPress","request","selected","testID","data","credential","useCredentialDetail","config","useCoreConfig","cardWidth","useMemo","Dimensions","width","card","attributes","selectCredentialCardFromCredential","createElement","CredentialDetailsCardListItem","onHeaderPress","expanded","exports"],"sources":["select-credential.tsx"],"sourcesContent":["import { PresentationDefinitionRequestedCredential } from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType } from 'react-native';\n\nimport { CredentialDetailsCardListItem } from '../../../ui-components';\nimport { useCoreConfig } from '../../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../../utils/hooks/core/credentials';\nimport {\n selectCredentialCardFromCredential,\n ShareCredentialCardLabels,\n} from '../../../utils/parsers/credential-sharing';\n\nexport const SelectCredential: FC<{\n credentialId: string;\n labels: ShareCredentialCardLabels;\n language?: string;\n lastItem: boolean;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onPress?: () => void;\n request: PresentationDefinitionRequestedCredential;\n selected: boolean;\n testID: string;\n}> = ({ credentialId, labels, language, lastItem, onImagePreview, onPress, request, selected, testID }) => {\n const { data: credential } = useCredentialDetail(credentialId);\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n if (!credential || !config) {\n return null;\n }\n\n const { card, attributes } = selectCredentialCardFromCredential(\n credential,\n selected,\n request,\n config,\n testID,\n labels,\n language,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n onHeaderPress: onPress,\n width: cardWidth,\n }}\n expanded={selected}\n lastItem={lastItem}\n onImagePreview={onImagePreview}\n />\n );\n};\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AAGmD,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAe,GAAA,CAAAlB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAE5C,MAAMW,gBAUX,GAAGA,CAAC;EAAEC,YAAY;EAAEC,MAAM;EAAEC,QAAQ;EAAEC,QAAQ;EAAEC,cAAc;EAAEC,OAAO;EAAEC,OAAO;EAAEC,QAAQ;EAAEC;AAAO,CAAC,KAAK;EACzG,MAAM;IAAEC,IAAI,EAAEC;EAAW,CAAC,GAAG,IAAAC,gCAAmB,EAACX,YAAY,CAAC;EAC9D,MAAM;IAAES,IAAI,EAAEG;EAAO,CAAC,GAAG,IAAAC,yBAAa,EAAC,CAAC;EACxC,MAAMC,SAAS,GAAG,IAAAC,cAAO,EAAC,MAAMC,uBAAU,CAAC7B,GAAG,CAAC,QAAQ,CAAC,CAAC8B,KAAK,GAAG,EAAE,EAAE,EAAE,CAAC;EAExE,IAAI,CAACP,UAAU,IAAI,CAACE,MAAM,EAAE;IAC1B,OAAO,IAAI;EACb;EAEA,MAAM;IAAEM,IAAI;IAAEC;EAAW,CAAC,GAAG,IAAAC,qDAAkC,EAC7DV,UAAU,EACVH,QAAQ,EACRD,OAAO,EACPM,MAAM,EACNJ,MAAM,EACNP,MAAM,EACNC,QACF,CAAC;EAED,oBACE/B,MAAA,CAAAc,OAAA,CAAAoC,aAAA,CAAC9C,aAAA,CAAA+C,6BAA6B;IAC5BH,UAAU,EAAEA,UAAW;IACvBD,IAAI,EAAE;MACJ,GAAGA,IAAI;MACPK,aAAa,EAAElB,OAAO;MACtBY,KAAK,EAAEH;IACT,CAAE;IACFU,QAAQ,EAAEjB,QAAS;IACnBJ,QAAQ,EAAEA,QAAS;IACnBC,cAAc,EAAEA;EAAe,CAChC,CAAC;AAEN,CAAC;AAACqB,OAAA,CAAA1B,gBAAA,GAAAA,gBAAA","ignoreList":[]}