@procivis/one-react-native-components 0.3.132 → 0.3.142
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 -0
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/scan-button.js +122 -27
- package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +37 -18
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +13 -4
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +36 -2
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/list/wallet/empty-list.js +2 -1
- package/lib/commonjs/ui-components/list/wallet/empty-list.js.map +1 -1
- package/lib/commonjs/ui-components/notice/wallet-notice.js +4 -2
- package/lib/commonjs/ui-components/notice/wallet-notice.js.map +1 -1
- package/lib/commonjs/ui-components/text/expandableTypography.js +64 -0
- package/lib/commonjs/ui-components/text/expandableTypography.js.map +1 -0
- package/lib/commonjs/ui-components/text/index.js +15 -0
- package/lib/commonjs/ui-components/text/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js +24 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +20 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +1 -5
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +17 -11
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +12 -4
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +2 -0
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/ui-components/buttons/scan-button.js +124 -29
- package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +37 -18
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js +13 -4
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +32 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/list/wallet/empty-list.js +2 -1
- package/lib/module/ui-components/list/wallet/empty-list.js.map +1 -1
- package/lib/module/ui-components/notice/wallet-notice.js +4 -2
- package/lib/module/ui-components/notice/wallet-notice.js.map +1 -1
- package/lib/module/ui-components/text/expandableTypography.js +55 -0
- package/lib/module/ui-components/text/expandableTypography.js.map +1 -0
- package/lib/module/ui-components/text/index.js +2 -1
- package/lib/module/ui-components/text/index.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js +24 -1
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +18 -0
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +1 -5
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +18 -12
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +10 -4
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/typescript/ui-components/buttons/scan-button.d.ts +9 -3
- package/lib/typescript/ui-components/credential/card/credential-details-card.d.ts +3 -0
- package/lib/typescript/ui-components/credential/credential-attribute-item.d.ts +3 -0
- package/lib/typescript/ui-components/icons/icons.d.ts +2 -0
- package/lib/typescript/ui-components/list/wallet/empty-list.d.ts +2 -2
- package/lib/typescript/ui-components/text/expandableTypography.d.ts +10 -0
- package/lib/typescript/ui-components/text/index.d.ts +2 -1
- package/lib/typescript/ui-components/text/typography.d.ts +14 -14
- package/lib/typescript/utils/hooks/app-state.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -1
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +4 -3
- package/lib/typescript/utils/parsers/credential.d.ts +2 -1
- package/package.json +3 -3
- package/src/components/history/history-list-item-icon.tsx +2 -0
- package/src/ui-components/buttons/scan-button.tsx +130 -38
- package/src/ui-components/credential/card/credential-details-card.tsx +46 -19
- package/src/ui-components/credential/credential-attribute-item.tsx +15 -3
- package/src/ui-components/icons/icons.tsx +24 -0
- package/src/ui-components/list/wallet/empty-list.tsx +11 -8
- package/src/ui-components/notice/wallet-notice.tsx +4 -2
- package/src/ui-components/text/expandableTypography.tsx +71 -0
- package/src/ui-components/text/index.ts +2 -1
- package/src/utils/hooks/core/credential-schemas.ts +23 -1
- package/src/utils/hooks/core/wallet-unit.ts +21 -0
- package/src/utils/parsers/credential-sharing-v2.tsx +1 -5
- package/src/utils/parsers/credential-sharing.tsx +20 -9
- package/src/utils/parsers/credential.ts +14 -3
|
@@ -2,8 +2,11 @@ import {
|
|
|
2
2
|
Claim,
|
|
3
3
|
CoreConfig,
|
|
4
4
|
CredentialDetail,
|
|
5
|
+
CredentialListItem,
|
|
6
|
+
CredentialType,
|
|
5
7
|
PresentationDefinitionField,
|
|
6
8
|
PresentationDefinitionRequestedCredential,
|
|
9
|
+
PresentationDefinitionV2Credential,
|
|
7
10
|
} from '@procivis/react-native-one-core';
|
|
8
11
|
import React from 'react';
|
|
9
12
|
|
|
@@ -19,6 +22,7 @@ import { CredentialNoticeWarningIcon, CredentialWarningIcon, RequiredAttributeIc
|
|
|
19
22
|
import { concatTestID } from '../testID';
|
|
20
23
|
import {
|
|
21
24
|
CardLabels,
|
|
25
|
+
credentialDetailFromPresentationV2Credential,
|
|
22
26
|
CredentialDetailsCardPropsWithoutWidth,
|
|
23
27
|
detailsCardAttributeFromClaim,
|
|
24
28
|
getCredentialCardPropsFromCredential,
|
|
@@ -29,7 +33,7 @@ import {
|
|
|
29
33
|
} from './credential';
|
|
30
34
|
|
|
31
35
|
export const validityCheckedCardFromCredential = (
|
|
32
|
-
credential: CredentialDetail,
|
|
36
|
+
credential: CredentialDetail | PresentationDefinitionV2Credential,
|
|
33
37
|
expanded: boolean,
|
|
34
38
|
selectiveDisclosureSupported: boolean | undefined,
|
|
35
39
|
multipleCredentialsAvailable: boolean,
|
|
@@ -55,6 +59,12 @@ export const validityCheckedCardFromCredential = (
|
|
|
55
59
|
credentialDetailTestID: concatTestID(testID, 'header.nonSelectiveDisclosure'),
|
|
56
60
|
statusIcon: CredentialWarningIcon,
|
|
57
61
|
};
|
|
62
|
+
} else if ('embeddedDisclosurePolicyViolation' in credential) {
|
|
63
|
+
credentialHeaderDetail = {
|
|
64
|
+
credentialDetailPrimary: labels.disclosurePolicyViolation,
|
|
65
|
+
credentialDetailTestID: concatTestID(testID, 'header.dislosurePolicyViolation'),
|
|
66
|
+
statusIcon: CredentialWarningIcon,
|
|
67
|
+
};
|
|
58
68
|
} else if (!expanded && multipleCredentialsAvailable) {
|
|
59
69
|
credentialHeaderDetail = {
|
|
60
70
|
credentialDetailPrimary: labels.multipleCredentials,
|
|
@@ -64,7 +74,7 @@ export const validityCheckedCardFromCredential = (
|
|
|
64
74
|
}
|
|
65
75
|
|
|
66
76
|
const card = getCredentialCardPropsFromCredential(
|
|
67
|
-
credential,
|
|
77
|
+
credentialDetailFromPresentationV2Credential(credential),
|
|
68
78
|
credential.claims,
|
|
69
79
|
config,
|
|
70
80
|
notice,
|
|
@@ -264,10 +274,11 @@ export type ShareCredentialCardLabels = CardLabels & {
|
|
|
264
274
|
missingAttribute: string;
|
|
265
275
|
missingCredential: string;
|
|
266
276
|
multipleCredentials: string;
|
|
277
|
+
disclosurePolicyViolation: string;
|
|
267
278
|
};
|
|
268
279
|
|
|
269
280
|
export const shareCredentialCardFromCredential = (
|
|
270
|
-
credential: CredentialDetail | undefined,
|
|
281
|
+
credential: CredentialDetail | PresentationDefinitionV2Credential | undefined,
|
|
271
282
|
expanded: boolean,
|
|
272
283
|
multipleCredentialsAvailable: boolean,
|
|
273
284
|
request: PresentationDefinitionRequestedCredential,
|
|
@@ -277,10 +288,10 @@ export const shareCredentialCardFromCredential = (
|
|
|
277
288
|
labels: ShareCredentialCardLabels,
|
|
278
289
|
language: string | undefined,
|
|
279
290
|
): CredentialDetailsCardPropsWithoutWidth => {
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
);
|
|
291
|
+
const credentialAsListItem: CredentialListItem | undefined = credential
|
|
292
|
+
? { type: CredentialType.SINGLE, ...credential, issuer: credential.issuer?.id }
|
|
293
|
+
: undefined;
|
|
294
|
+
const selectiveDisclosureSupported = supportsSelectiveDisclosure(credentialAsListItem, config);
|
|
284
295
|
const cardTestId = concatTestID(testID, 'card');
|
|
285
296
|
const card = credential
|
|
286
297
|
? validityCheckedCardFromCredential(
|
|
@@ -295,11 +306,11 @@ export const shareCredentialCardFromCredential = (
|
|
|
295
306
|
language,
|
|
296
307
|
)
|
|
297
308
|
: missingCredentialCardFromRequest(request, undefined, cardTestId, labels);
|
|
298
|
-
const validityState = getValidityState(
|
|
309
|
+
const validityState = getValidityState(credentialAsListItem);
|
|
299
310
|
const displayedAttributes = getDisplayedAttributes(
|
|
300
311
|
request,
|
|
301
312
|
validityState,
|
|
302
|
-
credential,
|
|
313
|
+
credential ? credentialDetailFromPresentationV2Credential(credential) : undefined,
|
|
303
314
|
selectiveDisclosureSupported,
|
|
304
315
|
selectedFields,
|
|
305
316
|
);
|
|
@@ -5,8 +5,10 @@ import {
|
|
|
5
5
|
CredentialListItem,
|
|
6
6
|
CredentialSchemaListItem,
|
|
7
7
|
CredentialState,
|
|
8
|
+
CredentialType,
|
|
8
9
|
DataType,
|
|
9
10
|
FormatFeature,
|
|
11
|
+
PresentationDefinitionV2Credential,
|
|
10
12
|
} from '@procivis/react-native-one-core';
|
|
11
13
|
import { FC } from 'react';
|
|
12
14
|
import { SvgProps } from 'react-native-svg';
|
|
@@ -180,7 +182,7 @@ export const cardHeaderFromCredential = (
|
|
|
180
182
|
statusIcon,
|
|
181
183
|
} = credentialDetailFromCredential(credential, claims, config, testID, labels, language);
|
|
182
184
|
const { layoutProperties } = credential.schema;
|
|
183
|
-
const defaultLanguage = config.defaultLanguage;
|
|
185
|
+
const defaultLanguage = config.globalSettings.defaultLanguage;
|
|
184
186
|
|
|
185
187
|
return {
|
|
186
188
|
color: layoutProperties?.logo?.backgroundColor,
|
|
@@ -217,7 +219,7 @@ export const getCredentialCardPropsFromCredential = (
|
|
|
217
219
|
language: string | undefined,
|
|
218
220
|
): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'> => {
|
|
219
221
|
const { layoutProperties } = credential.schema;
|
|
220
|
-
const defaultLanguage = config.defaultLanguage;
|
|
222
|
+
const defaultLanguage = config.globalSettings.defaultLanguage;
|
|
221
223
|
|
|
222
224
|
if (hasMsoValidityIssues(credential)) {
|
|
223
225
|
notice = {
|
|
@@ -255,7 +257,7 @@ export const detailsCardAttributeFromClaim = (
|
|
|
255
257
|
language: string | undefined,
|
|
256
258
|
): CredentialAttribute => {
|
|
257
259
|
const value = detailsCardAttributeValueFromClaim(claim, config, testID, language);
|
|
258
|
-
const defaultLanguage = config.defaultLanguage;
|
|
260
|
+
const defaultLanguage = config.globalSettings.defaultLanguage;
|
|
259
261
|
return {
|
|
260
262
|
id: claim.path,
|
|
261
263
|
name: getTranslatedLabel(claim.schema.translations.name, language, defaultLanguage) ?? claim.path.split('/').pop(),
|
|
@@ -449,3 +451,12 @@ export function getCredentialSchemaWithoutImages<T extends CredentialSchemaListI
|
|
|
449
451
|
},
|
|
450
452
|
};
|
|
451
453
|
}
|
|
454
|
+
|
|
455
|
+
export function credentialDetailFromPresentationV2Credential(
|
|
456
|
+
presentationCredential: CredentialDetail | PresentationDefinitionV2Credential,
|
|
457
|
+
): CredentialDetail {
|
|
458
|
+
return {
|
|
459
|
+
type: CredentialType.SINGLE,
|
|
460
|
+
...presentationCredential,
|
|
461
|
+
};
|
|
462
|
+
}
|