@procivis/one-react-native-components 0.3.22 → 0.3.47
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/entity/entity-attributes.js +15 -2
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +14 -38
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +63 -34
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/entity/index.js +2 -15
- package/lib/commonjs/components/entity/index.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +4 -1
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js +15 -3
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js +2 -0
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +2 -2
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/ui-components/blur/index.js +2 -9
- package/lib/commonjs/ui-components/blur/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/hold-button.js +3 -2
- package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/commonjs/ui-components/camera/index.js +2 -9
- package/lib/commonjs/ui-components/camera/index.js.map +1 -1
- package/lib/commonjs/ui-components/control/index.js +0 -12
- package/lib/commonjs/ui-components/control/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js +51 -3
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/entity/index.js +3 -16
- package/lib/commonjs/ui-components/entity/index.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +1 -1
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/history/index.js +4 -27
- package/lib/commonjs/ui-components/history/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js +26 -1
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/icons/history.js +3 -1
- package/lib/commonjs/ui-components/icons/history.js.map +1 -1
- package/lib/commonjs/ui-components/input/index.js +3 -32
- package/lib/commonjs/ui-components/input/index.js.map +1 -1
- package/lib/commonjs/ui-components/list/index.js +4 -19
- package/lib/commonjs/ui-components/list/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/index.js +2 -13
- package/lib/commonjs/ui-components/loader/index.js.map +1 -1
- package/lib/commonjs/ui-components/pin/index.js +2 -21
- package/lib/commonjs/ui-components/pin/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/index.js +3 -16
- package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
- package/lib/commonjs/ui-components/settings/index.js +6 -37
- package/lib/commonjs/ui-components/settings/index.js.map +1 -1
- package/lib/commonjs/ui-components/state/index.js +2 -15
- package/lib/commonjs/ui-components/state/index.js.map +1 -1
- package/lib/commonjs/utils/date.js +1 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +22 -66
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +33 -25
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +2 -1
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +42 -0
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/index.js +11 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +26 -15
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +60 -13
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +9 -15
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +7 -0
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +22 -4
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js +16 -3
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +16 -40
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +65 -36
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/entity/index.js +2 -2
- package/lib/module/components/entity/index.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +5 -2
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-item.js +16 -4
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js +2 -0
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +2 -2
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/ui-components/blur/index.js +2 -2
- package/lib/module/ui-components/blur/index.js.map +1 -1
- package/lib/module/ui-components/buttons/hold-button.js +4 -3
- package/lib/module/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/module/ui-components/camera/index.js +2 -2
- package/lib/module/ui-components/camera/index.js.map +1 -1
- package/lib/module/ui-components/control/index.js +3 -3
- package/lib/module/ui-components/control/index.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js +52 -4
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/entity/index.js +4 -4
- package/lib/module/ui-components/entity/index.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +1 -1
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/history/index.js +6 -6
- package/lib/module/ui-components/history/index.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js +24 -0
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/icons/history.js +2 -0
- package/lib/module/ui-components/icons/history.js.map +1 -1
- package/lib/module/ui-components/input/index.js +6 -6
- package/lib/module/ui-components/input/index.js.map +1 -1
- package/lib/module/ui-components/list/index.js +4 -4
- package/lib/module/ui-components/list/index.js.map +1 -1
- package/lib/module/ui-components/loader/index.js +4 -4
- package/lib/module/ui-components/loader/index.js.map +1 -1
- package/lib/module/ui-components/pin/index.js +3 -3
- package/lib/module/ui-components/pin/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/index.js +4 -4
- package/lib/module/ui-components/searchbar/index.js.map +1 -1
- package/lib/module/ui-components/settings/index.js +10 -10
- package/lib/module/ui-components/settings/index.js.map +1 -1
- package/lib/module/ui-components/state/index.js +2 -2
- package/lib/module/ui-components/state/index.js.map +1 -1
- package/lib/module/utils/date.js +1 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +24 -68
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +30 -24
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +2 -1
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +34 -0
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -0
- package/lib/module/utils/hooks/core/index.js +1 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +26 -15
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +60 -13
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +9 -15
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +7 -0
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +20 -3
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +2 -2
- package/lib/typescript/components/entity/entity-details.d.ts +4 -2
- package/lib/typescript/components/entity/index.d.ts +2 -1
- package/lib/typescript/components/history/history-list-item.d.ts +1 -0
- package/lib/typescript/components/history/history-list-screen.d.ts +2 -0
- package/lib/typescript/ui-components/blur/index.d.ts +2 -1
- package/lib/typescript/ui-components/buttons/hold-button.d.ts +2 -2
- package/lib/typescript/ui-components/camera/index.d.ts +2 -1
- package/lib/typescript/ui-components/control/index.d.ts +4 -2
- package/lib/typescript/ui-components/credential/credential-carousel-images.d.ts +1 -0
- package/lib/typescript/ui-components/entity/entity-cluster.d.ts +1 -0
- package/lib/typescript/ui-components/entity/index.d.ts +4 -2
- package/lib/typescript/ui-components/history/history-details.d.ts +4 -1
- package/lib/typescript/ui-components/history/index.d.ts +6 -3
- package/lib/typescript/ui-components/icons/entity.d.ts +1 -0
- package/lib/typescript/ui-components/icons/history.d.ts +2 -0
- package/lib/typescript/ui-components/input/index.d.ts +6 -3
- package/lib/typescript/ui-components/list/index.d.ts +4 -2
- package/lib/typescript/ui-components/loader/index.d.ts +4 -2
- package/lib/typescript/ui-components/pin/index.d.ts +4 -2
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +4 -4
- package/lib/typescript/ui-components/searchbar/index.d.ts +4 -2
- package/lib/typescript/ui-components/settings/index.d.ts +10 -5
- package/lib/typescript/ui-components/state/index.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/backup.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/core-init.d.ts +4 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +3 -1
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +10 -4
- package/lib/typescript/utils/parsers/query.d.ts +3 -2
- package/package.json +9 -4
- package/src/components/entity/entity-attributes.tsx +17 -3
- package/src/components/entity/entity-details-with-buttons.tsx +17 -42
- package/src/components/entity/entity-details.tsx +64 -37
- package/src/components/entity/index.ts +2 -1
- package/src/components/history/history-list-item-icon.tsx +5 -0
- package/src/components/history/history-list-item.tsx +19 -4
- package/src/components/history/history-list-screen.tsx +4 -1
- package/src/components/proof-request/share-credential.tsx +1 -1
- package/src/ui-components/blur/index.ts +2 -1
- package/src/ui-components/buttons/hold-button.tsx +6 -5
- package/src/ui-components/camera/index.tsx +2 -1
- package/src/ui-components/control/index.ts +4 -2
- package/src/ui-components/credential/card/credential-details-card.tsx +1 -1
- package/src/ui-components/credential/credential-carousel-images.tsx +15 -8
- package/src/ui-components/entity/entity-cluster.tsx +63 -10
- package/src/ui-components/entity/index.ts +4 -2
- package/src/ui-components/history/history-details.tsx +5 -2
- package/src/ui-components/history/index.ts +6 -3
- package/src/ui-components/icons/entity.tsx +23 -0
- package/src/ui-components/icons/history.tsx +2 -0
- package/src/ui-components/input/index.ts +6 -3
- package/src/ui-components/list/index.ts +4 -2
- package/src/ui-components/loader/index.ts +4 -2
- package/src/ui-components/pin/index.ts +4 -2
- package/src/ui-components/screens/nerd-mode-screen.tsx +5 -5
- package/src/ui-components/searchbar/index.ts +4 -2
- package/src/ui-components/settings/index.ts +10 -5
- package/src/ui-components/state/index.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/hooks/connectivity/connectivity.test.ts +7 -2
- package/src/utils/hooks/core/backup.ts +30 -72
- package/src/utils/hooks/core/core-init.ts +29 -23
- package/src/utils/hooks/core/credentials.ts +9 -3
- package/src/utils/hooks/core/identifiers.ts +39 -0
- package/src/utils/hooks/core/index.ts +2 -1
- package/src/utils/hooks/core/proofs.ts +31 -18
- package/src/utils/hooks/core/trust-entity.ts +55 -17
- package/src/utils/parsers/credential-sharing.tsx +30 -36
- package/src/utils/parsers/credential.ts +4 -0
- package/src/utils/parsers/query.tsx +14 -4
|
@@ -1,62 +1,91 @@
|
|
|
1
1
|
import { TrustEntityRoleEnum, TrustEntityStateEnum } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import EntityCluster from '../../ui-components/entity/entity-cluster';
|
|
4
|
-
import { EntityTrustedIcon } from '../../ui-components/icons';
|
|
5
|
-
import { concatTestID, replaceBreakingHyphens } from '../../utils';
|
|
4
|
+
import { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';
|
|
5
|
+
import { concatTestID, replaceBreakingHyphens, useIdentifierDetails } from '../../utils';
|
|
6
6
|
import { useTrustEntity } from '../../utils/hooks/core/trust-entity';
|
|
7
|
+
const getCertificateCommonName = certificate => {
|
|
8
|
+
var _certificate$x509Attr;
|
|
9
|
+
return (_certificate$x509Attr = certificate.x509Attributes.subject.split(', ').find(s => s.startsWith('CN'))) === null || _certificate$x509Attr === void 0 || (_certificate$x509Attr = _certificate$x509Attr.split('=')) === null || _certificate$x509Attr === void 0 ? void 0 : _certificate$x509Attr.pop();
|
|
10
|
+
};
|
|
7
11
|
const EntityDetails = ({
|
|
8
12
|
labels,
|
|
9
13
|
renderMore,
|
|
10
14
|
role,
|
|
11
15
|
style,
|
|
12
16
|
testID,
|
|
17
|
+
sublineColor,
|
|
18
|
+
textColor,
|
|
13
19
|
...props
|
|
14
20
|
}) => {
|
|
15
|
-
var _props$
|
|
21
|
+
var _props$identifier, _props$identifier2;
|
|
16
22
|
const {
|
|
17
|
-
data
|
|
18
|
-
|
|
23
|
+
data,
|
|
24
|
+
isLoading: isLoadingTrustEntity
|
|
25
|
+
} = useTrustEntity('identifier' in props ? (_props$identifier = props.identifier) === null || _props$identifier === void 0 ? void 0 : _props$identifier.id : undefined);
|
|
19
26
|
const trustEntity = 'entity' in props ? props.entity : data !== null && data !== void 0 ? data : undefined;
|
|
27
|
+
const {
|
|
28
|
+
data: identifierDetail,
|
|
29
|
+
isLoading: isLoadingIdentifier
|
|
30
|
+
} = useIdentifierDetails('identifier' in props ? (_props$identifier2 = props.identifier) === null || _props$identifier2 === void 0 ? void 0 : _props$identifier2.id : undefined);
|
|
20
31
|
const trusted = trustEntity && trustEntity.state === TrustEntityStateEnum.ACTIVE && (trustEntity.role === TrustEntityRoleEnum.BOTH || trustEntity.role === role);
|
|
32
|
+
const isLoading = isLoadingIdentifier || isLoadingTrustEntity;
|
|
33
|
+
const avatarProps = useMemo(() => {
|
|
34
|
+
var _identifierDetail$cer, _getCertificateCommon;
|
|
35
|
+
if (isLoading) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
const avatar = trusted && (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === 'DID' && trustEntity.logo ? {
|
|
39
|
+
imageSource: {
|
|
40
|
+
uri: trustEntity.logo
|
|
41
|
+
}
|
|
42
|
+
} : undefined;
|
|
43
|
+
const placeholderText = (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === 'CERTIFICATE' && (_identifierDetail$cer = identifierDetail.certificates) !== null && _identifierDetail$cer !== void 0 && _identifierDetail$cer[0] ? (_getCertificateCommon = getCertificateCommonName(identifierDetail.certificates[0])) === null || _getCertificateCommon === void 0 ? void 0 : _getCertificateCommon.substring(0, 1) : 'D';
|
|
44
|
+
const statusIcon = trusted ? /*#__PURE__*/React.createElement(EntityTrustedIcon, {
|
|
45
|
+
testID: concatTestID(testID, 'statusIcon', 'trusted')
|
|
46
|
+
}) : /*#__PURE__*/React.createElement(EntityNotTrustedIcon, {
|
|
47
|
+
testID: concatTestID(testID, 'statusIcon', 'notTrusted')
|
|
48
|
+
});
|
|
49
|
+
if (trustEntity) {
|
|
50
|
+
return {
|
|
51
|
+
avatar,
|
|
52
|
+
placeholderText: trusted && (identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === 'DID' ? trustEntity.name.substring(0, 1) : placeholderText,
|
|
53
|
+
statusIcon,
|
|
54
|
+
testID: concatTestID(testID, 'avatar')
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
placeholderText,
|
|
59
|
+
statusIcon
|
|
60
|
+
};
|
|
61
|
+
}, [trustEntity, trusted, identifierDetail, isLoading, testID]);
|
|
21
62
|
const trustEntityName = useMemo(() => {
|
|
22
|
-
|
|
23
|
-
|
|
63
|
+
var _identifierDetail$cer2, _identifierDetail$did;
|
|
64
|
+
if (isLoading) {
|
|
65
|
+
return '';
|
|
24
66
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return 'did' in props ? (_props$did2 = props.did) !== null && _props$did2 !== void 0 && _props$did2.did ? replaceBreakingHyphens(props.did.did) : undefined : undefined;
|
|
67
|
+
if ((identifierDetail === null || identifierDetail === void 0 ? void 0 : identifierDetail.type) === 'CERTIFICATE' && (_identifierDetail$cer2 = identifierDetail.certificates) !== null && _identifierDetail$cer2 !== void 0 && _identifierDetail$cer2[0]) {
|
|
68
|
+
const commonName = getCertificateCommonName(identifierDetail.certificates[0]);
|
|
69
|
+
if (commonName) {
|
|
70
|
+
return commonName;
|
|
71
|
+
}
|
|
31
72
|
}
|
|
32
|
-
if (
|
|
33
|
-
return
|
|
73
|
+
if (trustEntity) {
|
|
74
|
+
return trustEntity.name;
|
|
34
75
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const trustEntityStatusIcon = useMemo(() => {
|
|
38
|
-
if (!trusted) {
|
|
39
|
-
return undefined;
|
|
76
|
+
if (identifierDetail !== null && identifierDetail !== void 0 && (_identifierDetail$did = identifierDetail.did) !== null && _identifierDetail$did !== void 0 && _identifierDetail$did.did) {
|
|
77
|
+
return replaceBreakingHyphens(identifierDetail.did.did);
|
|
40
78
|
}
|
|
41
|
-
return
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
}, [testID, trusted]);
|
|
79
|
+
return labels.unknown;
|
|
80
|
+
}, [labels.unknown, trustEntity, identifierDetail, isLoading]);
|
|
45
81
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EntityCluster, {
|
|
46
|
-
avatar:
|
|
47
|
-
avatar: trusted && trustEntity.logo ? {
|
|
48
|
-
imageSource: {
|
|
49
|
-
uri: trustEntity.logo
|
|
50
|
-
}
|
|
51
|
-
} : undefined,
|
|
52
|
-
placeholderText: trustEntity.name.substring(0, 1),
|
|
53
|
-
statusIcon: trustEntityStatusIcon,
|
|
54
|
-
testID: concatTestID(testID, 'avatar')
|
|
55
|
-
} : undefined,
|
|
82
|
+
avatar: avatarProps,
|
|
56
83
|
entityName: trustEntityName,
|
|
57
84
|
style: style,
|
|
58
|
-
|
|
59
|
-
|
|
85
|
+
testID: testID,
|
|
86
|
+
textColor: textColor,
|
|
87
|
+
sublineColor: sublineColor,
|
|
88
|
+
isLoading: isLoading
|
|
60
89
|
}), trustEntity && renderMore && renderMore(trustEntity));
|
|
61
90
|
};
|
|
62
91
|
export default EntityDetails;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TrustEntityRoleEnum","TrustEntityStateEnum","React","useMemo","EntityCluster","EntityTrustedIcon","concatTestID","replaceBreakingHyphens","useTrustEntity","EntityDetails","labels","renderMore","role","style","testID","props","_props$
|
|
1
|
+
{"version":3,"names":["TrustEntityRoleEnum","TrustEntityStateEnum","React","useMemo","EntityCluster","EntityNotTrustedIcon","EntityTrustedIcon","concatTestID","replaceBreakingHyphens","useIdentifierDetails","useTrustEntity","getCertificateCommonName","certificate","_certificate$x509Attr","x509Attributes","subject","split","find","s","startsWith","pop","EntityDetails","labels","renderMore","role","style","testID","sublineColor","textColor","props","_props$identifier","_props$identifier2","data","isLoading","isLoadingTrustEntity","identifier","id","undefined","trustEntity","entity","identifierDetail","isLoadingIdentifier","trusted","state","ACTIVE","BOTH","avatarProps","_identifierDetail$cer","_getCertificateCommon","avatar","type","logo","imageSource","uri","placeholderText","certificates","substring","statusIcon","createElement","name","trustEntityName","_identifierDetail$cer2","_identifierDetail$did","commonName","did","unknown","Fragment","entityName"],"sources":["entity-details.tsx"],"sourcesContent":["import { IdentifierCertificateDetail, IdentifierListItem,TrustEntity, TrustEntityRoleEnum, TrustEntityStateEnum } from '@procivis/react-native-one-core';\nimport React, { FC, ReactNode, useMemo } from 'react';\nimport { StyleProp, ViewStyle } from 'react-native';\n\nimport { AvatarProps } from '../../ui-components';\nimport EntityCluster from '../../ui-components/entity/entity-cluster';\nimport { EntityNotTrustedIcon, EntityTrustedIcon } from '../../ui-components/icons';\nimport { concatTestID, replaceBreakingHyphens, useIdentifierDetails } from '../../utils';\nimport { useTrustEntity } from '../../utils/hooks/core/trust-entity';\n\nexport type EntityDetailsLabels = {\n unknown: string;\n};\n\nexport type EntityDetailsProps = {\n labels: EntityDetailsLabels;\n renderMore?: (trustEntity: TrustEntity) => ReactNode;\n role: Exclude<TrustEntityRoleEnum, TrustEntityRoleEnum.BOTH>;\n style?: StyleProp<ViewStyle>;\n sublineColor?: string;\n textColor?: string;\n testID?: string;\n} & (\n | {\n identifier?: IdentifierListItem;\n }\n | {\n entity: TrustEntity;\n }\n );\n\nconst getCertificateCommonName = (certificate: IdentifierCertificateDetail): string | undefined => {\n return certificate.x509Attributes.subject.split(', ').find((s) => s.startsWith('CN'))?.split('=')?.pop();\n}\n\nconst EntityDetails: FC<EntityDetailsProps> = ({ labels, renderMore, role, style, testID, sublineColor, textColor, ...props }) => {\n const { data, isLoading: isLoadingTrustEntity } = useTrustEntity('identifier' in props ? props.identifier?.id : undefined);\n const trustEntity: TrustEntity | undefined = 'entity' in props ? props.entity : data ?? undefined;\n const { data: identifierDetail, isLoading: isLoadingIdentifier } = useIdentifierDetails('identifier' in props ? props.identifier?.id : undefined);\n\n const trusted =\n trustEntity &&\n trustEntity.state === TrustEntityStateEnum.ACTIVE &&\n (trustEntity.role === TrustEntityRoleEnum.BOTH || trustEntity.role === role);\n\n const isLoading = isLoadingIdentifier || isLoadingTrustEntity;\n\n const avatarProps: AvatarProps | undefined = useMemo(() => {\n if (isLoading) {\n return undefined;\n }\n\n const avatar = trusted && identifierDetail?.type === 'DID' && trustEntity.logo ? { imageSource: { uri: trustEntity.logo } } : undefined;\n\n const placeholderText = identifierDetail?.type === 'CERTIFICATE' && identifierDetail.certificates?.[0] ? getCertificateCommonName(identifierDetail.certificates[0])?.substring(0, 1) : 'D';\n\n const statusIcon = trusted ? \n <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} /> :\n <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />;\n\n if (trustEntity) {\n return {\n avatar,\n placeholderText: trusted && identifierDetail?.type === 'DID' ? trustEntity.name.substring(0, 1) : placeholderText,\n statusIcon,\n testID: concatTestID(testID, 'avatar'),\n };\n }\n\n return {\n placeholderText,\n statusIcon,\n }\n }, [trustEntity, trusted, identifierDetail, isLoading, testID]);\n\n const trustEntityName = useMemo(() => {\n if (isLoading) {\n return '';\n }\n if (identifierDetail?.type === 'CERTIFICATE' && identifierDetail.certificates?.[0]) {\n const commonName = getCertificateCommonName(identifierDetail.certificates[0]);\n if (commonName) {\n return commonName;\n }\n }\n if (trustEntity) {\n return trustEntity.name;\n }\n if (identifierDetail?.did?.did) {\n return replaceBreakingHyphens(identifierDetail.did.did);\n }\n\n return labels.unknown;\n }, [labels.unknown, trustEntity, identifierDetail, isLoading]);\n\n return (\n <>\n <EntityCluster\n avatar={avatarProps}\n entityName={trustEntityName}\n style={style}\n testID={testID}\n textColor={textColor}\n sublineColor={sublineColor}\n isLoading={isLoading}\n />\n {trustEntity && renderMore && renderMore(trustEntity)}\n </>\n );\n};\n\nexport default EntityDetails;\n"],"mappings":"AAAA,SAAsEA,mBAAmB,EAAEC,oBAAoB,QAAQ,iCAAiC;AACxJ,OAAOC,KAAK,IAAmBC,OAAO,QAAQ,OAAO;AAIrD,OAAOC,aAAa,MAAM,2CAA2C;AACrE,SAASC,oBAAoB,EAAEC,iBAAiB,QAAQ,2BAA2B;AACnF,SAASC,YAAY,EAAEC,sBAAsB,EAAEC,oBAAoB,QAAQ,aAAa;AACxF,SAASC,cAAc,QAAQ,qCAAqC;AAuBpE,MAAMC,wBAAwB,GAAIC,WAAwC,IAAyB;EAAA,IAAAC,qBAAA;EACjG,QAAAA,qBAAA,GAAOD,WAAW,CAACE,cAAc,CAACC,OAAO,CAACC,KAAK,CAAC,IAAI,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACC,UAAU,CAAC,IAAI,CAAC,CAAC,cAAAN,qBAAA,gBAAAA,qBAAA,GAA9EA,qBAAA,CAAgFG,KAAK,CAAC,GAAG,CAAC,cAAAH,qBAAA,uBA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A;EAAU,CACtB,CAAC,EACDK,WAAW,IAAIf,UAAU,IAAIA,UAAU,CAACe,WAAW,CACpD,CAAC;AAEP,CAAC;AAED,eAAejB,aAAa","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import EntityDetails
|
|
2
|
-
export { EntityDetails
|
|
1
|
+
import EntityDetails from './entity-details';
|
|
2
|
+
export { EntityDetails };
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EntityDetails"
|
|
1
|
+
{"version":3,"names":["EntityDetails"],"sources":["index.ts"],"sourcesContent":["import type { EntityDetailsLabels, EntityDetailsProps } from './entity-details';\nimport EntityDetails from './entity-details';\n\nexport { EntityDetails, EntityDetailsLabels, EntityDetailsProps };\n"],"mappings":"AACA,OAAOA,aAAa,MAAM,kBAAkB;AAE5C,SAASA,aAAa","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HistoryActionEnum, HistoryEntityTypeEnum } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import { HistoryBackupCreatedIcon, HistoryBackupRestoredIcon, HistoryCredentialIcon, HistoryDidIcon, HistoryIssueIcon, HistoryItemIcon, HistoryKeyIcon, HistoryOrganisationIcon, HistoryProofRequestIcon, HistoryRevokeIcon, HistorySchemaIcon, HistoryStatusAcceptedIcon, HistoryStatusDeleteIcon, HistoryStatusErrorIcon, HistoryStatusSuspendIcon, HistorySuspendIcon, HistoryTrustAnchorIcon, HistoryTrustedEntityIcon } from '../../ui-components';
|
|
3
|
+
import { HistoryBackupCreatedIcon, HistoryBackupRestoredIcon, HistoryCertificateIcon, HistoryCredentialIcon, HistoryDidIcon, HistoryIdentifierIcon, HistoryIssueIcon, HistoryItemIcon, HistoryKeyIcon, HistoryOrganisationIcon, HistoryProofRequestIcon, HistoryRevokeIcon, HistorySchemaIcon, HistoryStatusAcceptedIcon, HistoryStatusDeleteIcon, HistoryStatusErrorIcon, HistoryStatusSuspendIcon, HistorySuspendIcon, HistoryTrustAnchorIcon, HistoryTrustedEntityIcon } from '../../ui-components';
|
|
4
4
|
const defaultIcons = {
|
|
5
5
|
actions: {
|
|
6
6
|
ACCEPTED: HistoryStatusAcceptedIcon,
|
|
@@ -25,13 +25,16 @@ const defaultIcons = {
|
|
|
25
25
|
UPDATED: HistoryStatusAcceptedIcon,
|
|
26
26
|
WITHDRAWN: HistoryStatusErrorIcon,
|
|
27
27
|
REACTIVATED: HistoryStatusAcceptedIcon,
|
|
28
|
-
CSR_GENERATED: HistoryStatusAcceptedIcon
|
|
28
|
+
CSR_GENERATED: HistoryStatusAcceptedIcon,
|
|
29
|
+
EXPIRED: HistoryStatusErrorIcon
|
|
29
30
|
},
|
|
30
31
|
entityTypes: {
|
|
31
32
|
BACKUP: HistoryRevokeIcon,
|
|
33
|
+
CERTIFICATE: HistoryCertificateIcon,
|
|
32
34
|
CREDENTIAL: HistoryCredentialIcon,
|
|
33
35
|
CREDENTIAL_SCHEMA: HistorySchemaIcon,
|
|
34
36
|
DID: HistoryDidIcon,
|
|
37
|
+
IDENTIFIER: HistoryIdentifierIcon,
|
|
35
38
|
KEY: HistoryKeyIcon,
|
|
36
39
|
ORGANISATION: HistoryOrganisationIcon,
|
|
37
40
|
PROOF: HistoryProofRequestIcon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["HistoryActionEnum","HistoryEntityTypeEnum","React","useMemo","HistoryBackupCreatedIcon","HistoryBackupRestoredIcon","HistoryCredentialIcon","HistoryDidIcon","HistoryIssueIcon","HistoryItemIcon","HistoryKeyIcon","HistoryOrganisationIcon","HistoryProofRequestIcon","HistoryRevokeIcon","HistorySchemaIcon","HistoryStatusAcceptedIcon","HistoryStatusDeleteIcon","HistoryStatusErrorIcon","HistoryStatusSuspendIcon","HistorySuspendIcon","HistoryTrustAnchorIcon","HistoryTrustedEntityIcon","defaultIcons","actions","ACCEPTED","ACTIVATED","CLAIMS_REMOVED","CREATED","DEACTIVATED","DELETED","ERRORED","IMPORTED","ISSUED","OFFERED","PENDING","REJECTED","REMOVED","REQUESTED","RESTORED","RETRACTED","REVOKED","SHARED","SUSPENDED","UPDATED","WITHDRAWN","REACTIVATED","CSR_GENERATED","entityTypes","BACKUP","CREDENTIAL","CREDENTIAL_SCHEMA","DID","KEY","ORGANISATION","PROOF","PROOF_SCHEMA","TRUST_ANCHOR","TRUST_ENTITY","getHistoryItemActionIcon","action","_defaultIcons$actions","HistoryListItemIcon","item","statusIcon","typeIcon","_defaultIcons$entityT","entityType","createElement","StatusIcon","TypeIcon"],"sources":["history-list-item-icon.tsx"],"sourcesContent":["import { HistoryActionEnum, HistoryEntityTypeEnum, HistoryListItem } from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { SvgProps } from 'react-native-svg';\n\nimport {\n HistoryBackupCreatedIcon,\n HistoryBackupRestoredIcon,\n HistoryCredentialIcon,\n HistoryDidIcon,\n HistoryIssueIcon,\n HistoryItemIcon,\n HistoryKeyIcon,\n HistoryOrganisationIcon,\n HistoryProofRequestIcon,\n HistoryRevokeIcon,\n HistorySchemaIcon,\n HistoryStatusAcceptedIcon,\n HistoryStatusDeleteIcon,\n HistoryStatusErrorIcon,\n HistoryStatusSuspendIcon,\n HistorySuspendIcon,\n HistoryTrustAnchorIcon,\n HistoryTrustedEntityIcon,\n} from '../../ui-components';\n\nconst defaultIcons: {\n actions: { [key in keyof typeof HistoryActionEnum]: FC<SvgProps> };\n entityTypes: { [key in keyof typeof HistoryEntityTypeEnum]: FC<SvgProps> };\n} = {\n actions: {\n ACCEPTED: HistoryStatusAcceptedIcon,\n ACTIVATED: HistoryStatusAcceptedIcon,\n CLAIMS_REMOVED: HistoryStatusDeleteIcon,\n CREATED: HistoryStatusAcceptedIcon,\n DEACTIVATED: HistoryStatusErrorIcon,\n DELETED: HistoryStatusDeleteIcon,\n ERRORED: HistoryStatusErrorIcon,\n IMPORTED: HistoryStatusAcceptedIcon,\n ISSUED: HistoryStatusAcceptedIcon,\n OFFERED: HistoryStatusAcceptedIcon,\n PENDING: HistoryStatusAcceptedIcon,\n REJECTED: HistoryStatusErrorIcon,\n REMOVED: HistoryStatusDeleteIcon,\n REQUESTED: HistoryStatusAcceptedIcon,\n RESTORED: HistoryStatusAcceptedIcon,\n RETRACTED: HistoryStatusErrorIcon,\n REVOKED: HistoryStatusErrorIcon,\n SHARED: HistoryStatusAcceptedIcon,\n SUSPENDED: HistoryStatusSuspendIcon,\n UPDATED: HistoryStatusAcceptedIcon,\n WITHDRAWN: HistoryStatusErrorIcon,\n REACTIVATED: HistoryStatusAcceptedIcon,\n CSR_GENERATED: HistoryStatusAcceptedIcon,\n },\n entityTypes: {\n BACKUP: HistoryRevokeIcon,\n CREDENTIAL: HistoryCredentialIcon,\n CREDENTIAL_SCHEMA: HistorySchemaIcon,\n DID: HistoryDidIcon,\n KEY: HistoryKeyIcon,\n ORGANISATION: HistoryOrganisationIcon,\n PROOF: HistoryProofRequestIcon,\n PROOF_SCHEMA: HistorySchemaIcon,\n TRUST_ANCHOR: HistoryTrustAnchorIcon,\n TRUST_ENTITY: HistoryTrustedEntityIcon,\n },\n};\n\nexport const getHistoryItemActionIcon = (action: HistoryActionEnum) => {\n return defaultIcons.actions[action] ?? HistoryStatusAcceptedIcon;\n};\n\nexport type HistoryListItemIconProps = {\n item: HistoryListItem;\n};\n\nexport const HistoryListItemIcon: FC<HistoryListItemIconProps> = ({ item }) => {\n const statusIcon = getHistoryItemActionIcon(item.action);\n const typeIcon = useMemo(() => {\n switch (item.entityType) {\n case HistoryEntityTypeEnum.BACKUP:\n switch (item.action) {\n case HistoryActionEnum.CREATED:\n return HistoryBackupCreatedIcon;\n case HistoryActionEnum.RESTORED:\n return HistoryBackupRestoredIcon;\n default:\n break;\n }\n break;\n case HistoryEntityTypeEnum.CREDENTIAL:\n switch (item.action) {\n case HistoryActionEnum.REVOKED:\n return HistoryRevokeIcon;\n case HistoryActionEnum.SUSPENDED:\n return HistorySuspendIcon;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return defaultIcons.entityTypes[item.entityType] ?? HistoryIssueIcon;\n }, [item.action, item.entityType]);\n return <HistoryItemIcon StatusIcon={statusIcon} TypeIcon={typeIcon} />;\n};\n"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,qBAAqB,QAAyB,iCAAiC;AAC3G,OAAOC,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAG1C,SACEC,wBAAwB,EACxBC,yBAAyB,EACzBC,qBAAqB,EACrBC,cAAc,EACdC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,uBAAuB,EACvBC,uBAAuB,EACvBC,iBAAiB,EACjBC,iBAAiB,EACjBC,yBAAyB,EACzBC,uBAAuB,EACvBC,sBAAsB,EACtBC,wBAAwB,EACxBC,kBAAkB,EAClBC,sBAAsB,EACtBC,wBAAwB,QACnB,qBAAqB;AAE5B,MAAMC,YAGL,GAAG;EACFC,OAAO,EAAE;IACPC,QAAQ,EAAET,yBAAyB;IACnCU,SAAS,EAAEV,yBAAyB;IACpCW,cAAc,EAAEV,uBAAuB;IACvCW,OAAO,EAAEZ,yBAAyB;IAClCa,WAAW,EAAEX,sBAAsB;IACnCY,OAAO,EAAEb,uBAAuB;IAChCc,OAAO,EAAEb,sBAAsB;IAC/Bc,QAAQ,EAAEhB,yBAAyB;IACnCiB,MAAM,EAAEjB,yBAAyB;IACjCkB,OAAO,EAAElB,yBAAyB;IAClCmB,OAAO,EAAEnB,yBAAyB;IAClCoB,QAAQ,EAAElB,sBAAsB;IAChCmB,OAAO,EAAEpB,uBAAuB;IAChCqB,SAAS,EAAEtB,yBAAyB;IACpCuB,QAAQ,EAAEvB,yBAAyB;IACnCwB,SAAS,EAAEtB,sBAAsB;IACjCuB,OAAO,EAAEvB,sBAAsB;IAC/BwB,MAAM,EAAE1B,yBAAyB;IACjC2B,SAAS,EAAExB,wBAAwB;IACnCyB,OAAO,EAAE5B,yBAAyB;IAClC6B,SAAS,EAAE3B,sBAAsB;IACjC4B,WAAW,EAAE9B,yBAAyB;IACtC+B,aAAa,EAAE/B;
|
|
1
|
+
{"version":3,"names":["HistoryActionEnum","HistoryEntityTypeEnum","React","useMemo","HistoryBackupCreatedIcon","HistoryBackupRestoredIcon","HistoryCertificateIcon","HistoryCredentialIcon","HistoryDidIcon","HistoryIdentifierIcon","HistoryIssueIcon","HistoryItemIcon","HistoryKeyIcon","HistoryOrganisationIcon","HistoryProofRequestIcon","HistoryRevokeIcon","HistorySchemaIcon","HistoryStatusAcceptedIcon","HistoryStatusDeleteIcon","HistoryStatusErrorIcon","HistoryStatusSuspendIcon","HistorySuspendIcon","HistoryTrustAnchorIcon","HistoryTrustedEntityIcon","defaultIcons","actions","ACCEPTED","ACTIVATED","CLAIMS_REMOVED","CREATED","DEACTIVATED","DELETED","ERRORED","IMPORTED","ISSUED","OFFERED","PENDING","REJECTED","REMOVED","REQUESTED","RESTORED","RETRACTED","REVOKED","SHARED","SUSPENDED","UPDATED","WITHDRAWN","REACTIVATED","CSR_GENERATED","EXPIRED","entityTypes","BACKUP","CERTIFICATE","CREDENTIAL","CREDENTIAL_SCHEMA","DID","IDENTIFIER","KEY","ORGANISATION","PROOF","PROOF_SCHEMA","TRUST_ANCHOR","TRUST_ENTITY","getHistoryItemActionIcon","action","_defaultIcons$actions","HistoryListItemIcon","item","statusIcon","typeIcon","_defaultIcons$entityT","entityType","createElement","StatusIcon","TypeIcon"],"sources":["history-list-item-icon.tsx"],"sourcesContent":["import { HistoryActionEnum, HistoryEntityTypeEnum, HistoryListItem } from '@procivis/react-native-one-core';\nimport React, { FC, useMemo } from 'react';\nimport { SvgProps } from 'react-native-svg';\n\nimport {\n HistoryBackupCreatedIcon,\n HistoryBackupRestoredIcon,\n HistoryCertificateIcon,\n HistoryCredentialIcon,\n HistoryDidIcon,\n HistoryIdentifierIcon,\n HistoryIssueIcon,\n HistoryItemIcon,\n HistoryKeyIcon,\n HistoryOrganisationIcon,\n HistoryProofRequestIcon,\n HistoryRevokeIcon,\n HistorySchemaIcon,\n HistoryStatusAcceptedIcon,\n HistoryStatusDeleteIcon,\n HistoryStatusErrorIcon,\n HistoryStatusSuspendIcon,\n HistorySuspendIcon,\n HistoryTrustAnchorIcon,\n HistoryTrustedEntityIcon,\n} from '../../ui-components';\n\nconst defaultIcons: {\n actions: { [key in keyof typeof HistoryActionEnum]: FC<SvgProps> };\n entityTypes: { [key in keyof typeof HistoryEntityTypeEnum]: FC<SvgProps> };\n} = {\n actions: {\n ACCEPTED: HistoryStatusAcceptedIcon,\n ACTIVATED: HistoryStatusAcceptedIcon,\n CLAIMS_REMOVED: HistoryStatusDeleteIcon,\n CREATED: HistoryStatusAcceptedIcon,\n DEACTIVATED: HistoryStatusErrorIcon,\n DELETED: HistoryStatusDeleteIcon,\n ERRORED: HistoryStatusErrorIcon,\n IMPORTED: HistoryStatusAcceptedIcon,\n ISSUED: HistoryStatusAcceptedIcon,\n OFFERED: HistoryStatusAcceptedIcon,\n PENDING: HistoryStatusAcceptedIcon,\n REJECTED: HistoryStatusErrorIcon,\n REMOVED: HistoryStatusDeleteIcon,\n REQUESTED: HistoryStatusAcceptedIcon,\n RESTORED: HistoryStatusAcceptedIcon,\n RETRACTED: HistoryStatusErrorIcon,\n REVOKED: HistoryStatusErrorIcon,\n SHARED: HistoryStatusAcceptedIcon,\n SUSPENDED: HistoryStatusSuspendIcon,\n UPDATED: HistoryStatusAcceptedIcon,\n WITHDRAWN: HistoryStatusErrorIcon,\n REACTIVATED: HistoryStatusAcceptedIcon,\n CSR_GENERATED: HistoryStatusAcceptedIcon,\n EXPIRED: HistoryStatusErrorIcon,\n },\n entityTypes: {\n BACKUP: HistoryRevokeIcon,\n CERTIFICATE: HistoryCertificateIcon,\n CREDENTIAL: HistoryCredentialIcon,\n CREDENTIAL_SCHEMA: HistorySchemaIcon,\n DID: HistoryDidIcon,\n IDENTIFIER: HistoryIdentifierIcon,\n KEY: HistoryKeyIcon,\n ORGANISATION: HistoryOrganisationIcon,\n PROOF: HistoryProofRequestIcon,\n PROOF_SCHEMA: HistorySchemaIcon,\n TRUST_ANCHOR: HistoryTrustAnchorIcon,\n TRUST_ENTITY: HistoryTrustedEntityIcon,\n },\n};\n\nexport const getHistoryItemActionIcon = (action: HistoryActionEnum) => {\n return defaultIcons.actions[action] ?? HistoryStatusAcceptedIcon;\n};\n\nexport type HistoryListItemIconProps = {\n item: HistoryListItem;\n};\n\nexport const HistoryListItemIcon: FC<HistoryListItemIconProps> = ({ item }) => {\n const statusIcon = getHistoryItemActionIcon(item.action);\n const typeIcon = useMemo(() => {\n switch (item.entityType) {\n case HistoryEntityTypeEnum.BACKUP:\n switch (item.action) {\n case HistoryActionEnum.CREATED:\n return HistoryBackupCreatedIcon;\n case HistoryActionEnum.RESTORED:\n return HistoryBackupRestoredIcon;\n default:\n break;\n }\n break;\n case HistoryEntityTypeEnum.CREDENTIAL:\n switch (item.action) {\n case HistoryActionEnum.REVOKED:\n return HistoryRevokeIcon;\n case HistoryActionEnum.SUSPENDED:\n return HistorySuspendIcon;\n default:\n break;\n }\n break;\n default:\n break;\n }\n\n return defaultIcons.entityTypes[item.entityType] ?? HistoryIssueIcon;\n }, [item.action, item.entityType]);\n return <HistoryItemIcon StatusIcon={statusIcon} TypeIcon={typeIcon} />;\n};\n"],"mappings":"AAAA,SAASA,iBAAiB,EAAEC,qBAAqB,QAAyB,iCAAiC;AAC3G,OAAOC,KAAK,IAAQC,OAAO,QAAQ,OAAO;AAG1C,SACEC,wBAAwB,EACxBC,yBAAyB,EACzBC,sBAAsB,EACtBC,qBAAqB,EACrBC,cAAc,EACdC,qBAAqB,EACrBC,gBAAgB,EAChBC,eAAe,EACfC,cAAc,EACdC,uBAAuB,EACvBC,uBAAuB,EACvBC,iBAAiB,EACjBC,iBAAiB,EACjBC,yBAAyB,EACzBC,uBAAuB,EACvBC,sBAAsB,EACtBC,wBAAwB,EACxBC,kBAAkB,EAClBC,sBAAsB,E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|
-
import React, { useCallback } from 'react';
|
|
1
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
2
|
import { HistoryItemView } from '../../ui-components';
|
|
3
3
|
import { formatTime, useTrustEntity } from '../../utils';
|
|
4
4
|
import { HistoryListItemIcon } from './history-list-item-icon';
|
|
5
5
|
export const HistoryListItemView = ({
|
|
6
6
|
dateFormatter = formatTime,
|
|
7
7
|
first,
|
|
8
|
+
infoLabelMode = 'entity',
|
|
8
9
|
item,
|
|
9
10
|
labels,
|
|
10
11
|
last,
|
|
@@ -12,10 +13,21 @@ export const HistoryListItemView = ({
|
|
|
12
13
|
testID
|
|
13
14
|
}) => {
|
|
14
15
|
var _dateFormatter;
|
|
16
|
+
const identifierId = infoLabelMode === 'entity' ? item.target : undefined;
|
|
15
17
|
const {
|
|
16
|
-
data:
|
|
17
|
-
} = useTrustEntity(
|
|
18
|
+
data: trustEntity
|
|
19
|
+
} = useTrustEntity(identifierId);
|
|
18
20
|
const label = `${labels.entityTypes[item.entityType]} ${labels.actions[item.action]}`;
|
|
21
|
+
const info = useMemo(() => {
|
|
22
|
+
switch (infoLabelMode) {
|
|
23
|
+
case 'entity':
|
|
24
|
+
return trustEntity === null || trustEntity === void 0 ? void 0 : trustEntity.name;
|
|
25
|
+
case 'associatedLabel':
|
|
26
|
+
return item.name;
|
|
27
|
+
case 'none':
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
}, [infoLabelMode, item, trustEntity]);
|
|
19
31
|
const icon = /*#__PURE__*/React.createElement(HistoryListItemIcon, {
|
|
20
32
|
item: item
|
|
21
33
|
});
|
|
@@ -25,7 +37,7 @@ export const HistoryListItemView = ({
|
|
|
25
37
|
return /*#__PURE__*/React.createElement(HistoryItemView, {
|
|
26
38
|
first: first,
|
|
27
39
|
icon: icon,
|
|
28
|
-
info:
|
|
40
|
+
info: info,
|
|
29
41
|
label: label,
|
|
30
42
|
last: last,
|
|
31
43
|
onPress: pressHandler,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","HistoryItemView","formatTime","useTrustEntity","HistoryListItemIcon","HistoryListItemView","dateFormatter","first","item","labels","last","onPress","testID","_dateFormatter","
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","HistoryItemView","formatTime","useTrustEntity","HistoryListItemIcon","HistoryListItemView","dateFormatter","first","infoLabelMode","item","labels","last","onPress","testID","_dateFormatter","identifierId","target","undefined","data","trustEntity","label","entityTypes","entityType","actions","action","info","name","icon","createElement","pressHandler","time","Date","createdDate"],"sources":["history-list-item.tsx"],"sourcesContent":["import { HistoryActionEnum, HistoryEntityTypeEnum, HistoryListItem } from '@procivis/react-native-one-core';\nimport React, { FC, useCallback, useMemo } from 'react';\n\nimport { HistoryItemView } from '../../ui-components';\nimport { formatTime, useTrustEntity } from '../../utils';\nimport { HistoryListItemIcon } from './history-list-item-icon';\n\nexport type HistoryListItemLabels = {\n actions: { [key in keyof typeof HistoryActionEnum]: string };\n entityTypes: { [key in keyof typeof HistoryEntityTypeEnum]: string };\n};\n\nexport interface HistoryListItemViewProps {\n dateFormatter?: (date: Date) => string;\n first?: boolean;\n infoLabelMode?: 'entity' | 'associatedLabel' | 'none';\n item: HistoryListItem;\n labels: HistoryListItemLabels;\n last?: boolean;\n onPress?: (item: HistoryListItem) => void;\n testID?: string;\n}\n\nexport const HistoryListItemView: FC<HistoryListItemViewProps> = ({\n dateFormatter = formatTime,\n first,\n infoLabelMode = 'entity',\n item,\n labels,\n last,\n onPress,\n testID,\n}) => {\n const identifierId = infoLabelMode === 'entity' ? item.target : undefined;\n const { data: trustEntity } = useTrustEntity(identifierId);\n\n const label = `${labels.entityTypes[item.entityType]} ${labels.actions[item.action]}`;\n\n const info = useMemo(() => {\n switch (infoLabelMode) {\n case 'entity':\n return trustEntity?.name;\n case 'associatedLabel':\n return item.name;\n case 'none':\n return undefined;\n }\n }, [infoLabelMode, item, trustEntity]);\n\n const icon = <HistoryListItemIcon item={item} />;\n\n const pressHandler = useCallback(() => {\n onPress?.(item);\n }, [onPress, item]);\n\n return (\n <HistoryItemView\n first={first}\n icon={icon}\n info={info}\n label={label}\n last={last}\n onPress={pressHandler}\n testID={testID}\n time={dateFormatter(new Date(item.createdDate)) ?? ''}\n />\n );\n};\n"],"mappings":"AACA,OAAOA,KAAK,IAAQC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAEvD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,UAAU,EAAEC,cAAc,QAAQ,aAAa;AACxD,SAASC,mBAAmB,QAAQ,0BAA0B;AAkB9D,OAAO,MAAMC,mBAAiD,GAAGA,CAAC;EAChEC,aAAa,GAAGJ,UAAU;EAC1BK,KAAK;EACLC,aAAa,GAAG,QAAQ;EACxBC,IAAI;EACJC,MAAM;EACNC,IAAI;EACJC,OAAO;EACPC;AACF,CAAC,KAAK;EAAA,IAAAC,cAAA;EACJ,MAAMC,YAAY,GAAGP,aAAa,KAAK,QAAQ,GAAGC,IAAI,CAACO,MAAM,GAAGC,SAAS;EACzE,MAAM;IAAEC,IAAI,EAAEC;EAAY,CAAC,GAAGhB,cAAc,CAACY,YAAY,CAAC;EAE1D,MAAMK,KAAK,GAAG,GAAGV,MAAM,CAACW,WAAW,CAACZ,IAAI,CAACa,UAAU,CAAC,IAAIZ,MAAM,CAACa,OAAO,CAACd,IAAI,CAACe,MAAM,CAAC,EAAE;EAErF,MAAMC,IAAI,GAAGzB,OAAO,CAAC,MAAM;IACzB,QAAQQ,aAAa;MACnB,KAAK,QAAQ;QACX,OAAOW,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAEO,IAAI;MAC1B,KAAK,iBAAiB;QACpB,OAAOjB,IAAI,CAACiB,IAAI;MAClB,KAAK,MAAM;QACT,OAAOT,SAAS;IACpB;EACF,CAAC,EAAE,CAACT,aAAa,EAAEC,IAAI,EAAEU,WAAW,CAAC,CAAC;EAEtC,MAAMQ,IAAI,gBAAG7B,KAAA,CAAA8B,aAAA,CAACxB,mBAAmB;IAACK,IAAI,EAAEA;EAAK,CAAE,CAAC;EAEhD,MAAMoB,YAAY,GAAG9B,WAAW,CAAC,MAAM;IACrCa,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAGH,IAAI,CAAC;EACjB,CAAC,EAAE,CAACG,OAAO,EAAEH,IAAI,CAAC,CAAC;EAEnB,oBACEX,KAAA,CAAA8B,aAAA,CAAC3B,eAAe;IACdM,KAAK,EAAEA,KAAM;IACboB,IAAI,EAAEA,IAAK;IACXF,IAAI,EAAEA,IAAK;IACXL,KAAK,EAAEA,KAAM;IACbT,IAAI,EAAEA,IAAK;IACXC,OAAO,EAAEiB,YAAa;IACtBhB,MAAM,EAAEA,MAAO;IACfiB,IAAI,GAAAhB,cAAA,GAAER,aAAa,CAAC,IAAIyB,IAAI,CAACtB,IAAI,CAACuB,WAAW,CAAC,CAAC,cAAAlB,cAAA,cAAAA,cAAA,GAAI;EAAG,CACvD,CAAC;AAEN,CAAC","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ import { HistoryListView } from './history-list';
|
|
|
7
7
|
export const HistoryListScreen = ({
|
|
8
8
|
children,
|
|
9
9
|
groupItems = groupEntriesByDay,
|
|
10
|
+
itemInfoLabelMode = 'entity',
|
|
10
11
|
labels,
|
|
11
12
|
onBackPressed,
|
|
12
13
|
onHistoryItemPressed,
|
|
@@ -52,6 +53,7 @@ export const HistoryListScreen = ({
|
|
|
52
53
|
contentContainerStyle: insets,
|
|
53
54
|
groupItems: groupItems,
|
|
54
55
|
itemProps: {
|
|
56
|
+
infoLabelMode: itemInfoLabelMode,
|
|
55
57
|
onPress: onHistoryItemPressed
|
|
56
58
|
},
|
|
57
59
|
onEmpty: setEmpty,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["debounce","React","useEffect","useMemo","useState","Animated","StyleSheet","View","BackButton","FilterButton","FoldableHeader","NavigationHeader","Typography","useAppColorScheme","concatTestID","groupEntriesByDay","useListContentInset","HistoryListView","HistoryListScreen","children","groupItems","labels","onBackPressed","onHistoryItemPressed","onOpenFilter","onSearchPhraseChange","queryParams","testID","colorScheme","empty","setEmpty","scrollOffset","Value","searchPhrase","setSearchPhrase","searchBarVisible","Boolean","searchText","handleSearchPhraseChange","undefined","headerHeight","insets","additionalBottomPadding","createElement","style","styles","container","backgroundColor","background","emptyNotice","white","marginTop","paddingTop","align","color","text","preset","emptyTitle","shaded","emptySubtitle","contentContainerStyle","itemProps","onPress","onEmpty","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","query","list","header","leftItem","title","searchBar","rightButton","active","credentialSchemaId","rightButtonAlwaysVisible","searchBarProps","placeholder","search","staticHeader","create","flex","borderRadius","marginHorizontal","paddingBottom","paddingHorizontal","opacity"],"sources":["history-list-screen.tsx"],"sourcesContent":["import { HistoryListItem, HistoryListQuery } from '@procivis/react-native-one-core';\nimport { debounce } from 'lodash';\nimport React, { FC, PropsWithChildren, useEffect, useMemo, useState } from 'react';\nimport { Animated, StyleSheet, View } from 'react-native';\n\nimport {\n BackButton,\n FilterButton,\n FoldableHeader,\n NavigationHeader,\n Typography,\n useAppColorScheme,\n} from '../../ui-components';\nimport { concatTestID, groupEntriesByDay, HistoryGroupByDaySection, useListContentInset } from '../../utils';\nimport { HistoryListLabels, HistoryListView } from './history-list';\n\nexport type HistoryListScreenLabels = {\n emptyTitle: string;\n emptySubtitle: string;\n list: HistoryListLabels;\n title: string;\n search: string;\n};\n\nexport type HistoryListScreenProps = {\n groupItems?: (entries: HistoryListItem[]) => HistoryGroupByDaySection[];\n labels: HistoryListScreenLabels;\n onBackPressed: () => void;\n onHistoryItemPressed: (historyItem: HistoryListItem) => void;\n onOpenFilter?: () => void;\n onSearchPhraseChange: (searchPhrase: string | undefined) => void;\n queryParams: Partial<HistoryListQuery>;\n testID?: string;\n};\n\nexport const HistoryListScreen: FC<PropsWithChildren<HistoryListScreenProps>> = ({\n children,\n groupItems = groupEntriesByDay,\n labels,\n onBackPressed,\n onHistoryItemPressed,\n onOpenFilter,\n onSearchPhraseChange,\n queryParams,\n testID = 'HistoryScreen',\n}) => {\n const colorScheme = useAppColorScheme();\n const [empty, setEmpty] = useState<boolean>(false);\n const [scrollOffset] = useState(() => new Animated.Value(0));\n\n const [searchPhrase, setSearchPhrase] = useState<string>('');\n const searchBarVisible = !empty || Boolean(queryParams.searchText);\n\n const handleSearchPhraseChange = useMemo(() => debounce(onSearchPhraseChange, 500), [onSearchPhraseChange]);\n useEffect(() => {\n handleSearchPhraseChange(searchPhrase || undefined);\n }, [searchPhrase, handleSearchPhraseChange]);\n\n const headerHeight = searchBarVisible ? 112 : 70;\n\n const insets = useListContentInset({\n additionalBottomPadding: 24,\n headerHeight,\n });\n\n return (\n <View\n style={[\n styles.container,\n {\n backgroundColor: colorScheme.background,\n },\n ]}\n testID={testID}>\n {empty && (\n <View\n style={[\n styles.emptyNotice,\n {\n backgroundColor: colorScheme.white,\n marginTop: insets.paddingTop,\n },\n ]}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s\">\n {labels.emptyTitle}\n </Typography>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-small\" style={styles.shaded}>\n {labels.emptySubtitle}\n </Typography>\n </View>\n )}\n <HistoryListView\n contentContainerStyle={insets}\n groupItems={groupItems}\n itemProps={{ onPress: onHistoryItemPressed }}\n onEmpty={setEmpty}\n onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: scrollOffset } } }], {\n useNativeDriver: true,\n })}\n query={queryParams}\n testID={concatTestID(testID, 'list')}\n labels={labels.list}\n />\n {children}\n <FoldableHeader\n header={\n <NavigationHeader\n backgroundColor={'transparent'}\n leftItem={<BackButton onPress={onBackPressed} testID={concatTestID(testID, 'back')} />}\n title={labels.title}\n />\n }\n scrollOffset={scrollOffset}\n searchBar={\n !searchBarVisible\n ? undefined\n : {\n rightButton: onOpenFilter ? (\n <FilterButton\n active={Boolean(queryParams.credentialSchemaId)}\n onPress={onOpenFilter}\n testID={concatTestID(testID, 'filter')}\n />\n ) : undefined,\n rightButtonAlwaysVisible: true,\n searchBarProps: {\n onSearchPhraseChange: setSearchPhrase,\n placeholder: labels.search,\n searchPhrase,\n testID: concatTestID(testID, 'search'),\n },\n }\n }\n staticHeader={!searchBarVisible}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n emptyNotice: {\n borderRadius: 12,\n marginHorizontal: 16,\n paddingBottom: 20,\n paddingHorizontal: 12,\n paddingTop: 16,\n },\n shaded: {\n opacity: 0.7,\n },\n});\n"],"mappings":"AACA,SAASA,QAAQ,QAAQ,QAAQ;AACjC,OAAOC,KAAK,IAA2BC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,OAAO;AAClF,SAASC,QAAQ,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAEzD,SACEC,UAAU,EACVC,YAAY,EACZC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,iBAAiB,QACZ,qBAAqB;AAC5B,SAASC,YAAY,EAAEC,iBAAiB,EAA4BC,mBAAmB,QAAQ,aAAa;AAC5G,SAA4BC,eAAe,QAAQ,gBAAgB;
|
|
1
|
+
{"version":3,"names":["debounce","React","useEffect","useMemo","useState","Animated","StyleSheet","View","BackButton","FilterButton","FoldableHeader","NavigationHeader","Typography","useAppColorScheme","concatTestID","groupEntriesByDay","useListContentInset","HistoryListView","HistoryListScreen","children","groupItems","itemInfoLabelMode","labels","onBackPressed","onHistoryItemPressed","onOpenFilter","onSearchPhraseChange","queryParams","testID","colorScheme","empty","setEmpty","scrollOffset","Value","searchPhrase","setSearchPhrase","searchBarVisible","Boolean","searchText","handleSearchPhraseChange","undefined","headerHeight","insets","additionalBottomPadding","createElement","style","styles","container","backgroundColor","background","emptyNotice","white","marginTop","paddingTop","align","color","text","preset","emptyTitle","shaded","emptySubtitle","contentContainerStyle","itemProps","infoLabelMode","onPress","onEmpty","onScroll","event","nativeEvent","contentOffset","y","useNativeDriver","query","list","header","leftItem","title","searchBar","rightButton","active","credentialSchemaId","rightButtonAlwaysVisible","searchBarProps","placeholder","search","staticHeader","create","flex","borderRadius","marginHorizontal","paddingBottom","paddingHorizontal","opacity"],"sources":["history-list-screen.tsx"],"sourcesContent":["import { HistoryListItem, HistoryListQuery } from '@procivis/react-native-one-core';\nimport { debounce } from 'lodash';\nimport React, { FC, PropsWithChildren, useEffect, useMemo, useState } from 'react';\nimport { Animated, StyleSheet, View } from 'react-native';\n\nimport {\n BackButton,\n FilterButton,\n FoldableHeader,\n NavigationHeader,\n Typography,\n useAppColorScheme,\n} from '../../ui-components';\nimport { concatTestID, groupEntriesByDay, HistoryGroupByDaySection, useListContentInset } from '../../utils';\nimport { HistoryListLabels, HistoryListView } from './history-list';\nimport { HistoryListItemViewProps } from './history-list-item';\n\nexport type HistoryListScreenLabels = {\n emptyTitle: string;\n emptySubtitle: string;\n list: HistoryListLabels;\n title: string;\n search: string;\n};\n\nexport type HistoryListScreenProps = {\n groupItems?: (entries: HistoryListItem[]) => HistoryGroupByDaySection[];\n itemInfoLabelMode?: HistoryListItemViewProps['infoLabelMode'];\n labels: HistoryListScreenLabels;\n onBackPressed: () => void;\n onHistoryItemPressed: (historyItem: HistoryListItem) => void;\n onOpenFilter?: () => void;\n onSearchPhraseChange: (searchPhrase: string | undefined) => void;\n queryParams: Partial<HistoryListQuery>;\n testID?: string;\n};\n\nexport const HistoryListScreen: FC<PropsWithChildren<HistoryListScreenProps>> = ({\n children,\n groupItems = groupEntriesByDay,\n itemInfoLabelMode = 'entity',\n labels,\n onBackPressed,\n onHistoryItemPressed,\n onOpenFilter,\n onSearchPhraseChange,\n queryParams,\n testID = 'HistoryScreen',\n}) => {\n const colorScheme = useAppColorScheme();\n const [empty, setEmpty] = useState<boolean>(false);\n const [scrollOffset] = useState(() => new Animated.Value(0));\n\n const [searchPhrase, setSearchPhrase] = useState<string>('');\n const searchBarVisible = !empty || Boolean(queryParams.searchText);\n\n const handleSearchPhraseChange = useMemo(() => debounce(onSearchPhraseChange, 500), [onSearchPhraseChange]);\n useEffect(() => {\n handleSearchPhraseChange(searchPhrase || undefined);\n }, [searchPhrase, handleSearchPhraseChange]);\n\n const headerHeight = searchBarVisible ? 112 : 70;\n\n const insets = useListContentInset({\n additionalBottomPadding: 24,\n headerHeight,\n });\n\n return (\n <View\n style={[\n styles.container,\n {\n backgroundColor: colorScheme.background,\n },\n ]}\n testID={testID}>\n {empty && (\n <View\n style={[\n styles.emptyNotice,\n {\n backgroundColor: colorScheme.white,\n marginTop: insets.paddingTop,\n },\n ]}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s\">\n {labels.emptyTitle}\n </Typography>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-small\" style={styles.shaded}>\n {labels.emptySubtitle}\n </Typography>\n </View>\n )}\n <HistoryListView\n contentContainerStyle={insets}\n groupItems={groupItems}\n itemProps={{ infoLabelMode: itemInfoLabelMode, onPress: onHistoryItemPressed }}\n onEmpty={setEmpty}\n onScroll={Animated.event([{ nativeEvent: { contentOffset: { y: scrollOffset } } }], {\n useNativeDriver: true,\n })}\n query={queryParams}\n testID={concatTestID(testID, 'list')}\n labels={labels.list}\n />\n {children}\n <FoldableHeader\n header={\n <NavigationHeader\n backgroundColor={'transparent'}\n leftItem={<BackButton onPress={onBackPressed} testID={concatTestID(testID, 'back')} />}\n title={labels.title}\n />\n }\n scrollOffset={scrollOffset}\n searchBar={\n !searchBarVisible\n ? undefined\n : {\n rightButton: onOpenFilter ? (\n <FilterButton\n active={Boolean(queryParams.credentialSchemaId)}\n onPress={onOpenFilter}\n testID={concatTestID(testID, 'filter')}\n />\n ) : undefined,\n rightButtonAlwaysVisible: true,\n searchBarProps: {\n onSearchPhraseChange: setSearchPhrase,\n placeholder: labels.search,\n searchPhrase,\n testID: concatTestID(testID, 'search'),\n },\n }\n }\n staticHeader={!searchBarVisible}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n emptyNotice: {\n borderRadius: 12,\n marginHorizontal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AAiB,CACjC,CACG,CAAC;AAEX,CAAC;AAED,MAAMU,MAAM,GAAGxC,UAAU,CAACgF,MAAM,CAAC;EAC/BvC,SAAS,EAAE;IACTwC,IAAI,EAAE;EACR,CAAC;EACDrC,WAAW,EAAE;IACXsC,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,aAAa,EAAE,EAAE;IACjBC,iBAAiB,EAAE,EAAE;IACrBtC,UAAU,EAAE;EACd,CAAC;EACDM,MAAM,EAAE;IACNiC,OAAO,EAAE;EACX;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -23,7 +23,7 @@ export const ShareCredential = ({
|
|
|
23
23
|
style,
|
|
24
24
|
testID
|
|
25
25
|
}) => {
|
|
26
|
-
var _credential$
|
|
26
|
+
var _credential$issuer;
|
|
27
27
|
const colorScheme = useAppColorScheme();
|
|
28
28
|
const {
|
|
29
29
|
data: credential,
|
|
@@ -39,7 +39,7 @@ export const ShareCredential = ({
|
|
|
39
39
|
const multipleCredentialsAvailable = selectionOptions.length > 1;
|
|
40
40
|
const validityState = getValidityState(credential ? {
|
|
41
41
|
...credential,
|
|
42
|
-
|
|
42
|
+
issuer: credential === null || credential === void 0 || (_credential$issuer = credential.issuer) === null || _credential$issuer === void 0 ? void 0 : _credential$issuer.id
|
|
43
43
|
} : undefined);
|
|
44
44
|
const invalid = useMemo(() => {
|
|
45
45
|
if (!(credential !== null && credential !== void 0 && credential.lvvcIssuanceDate) || !request.validityCredentialNbf) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CredentialStateEnum","React","useMemo","StyleSheet","View","Button","ButtonType","CredentialDetailsCardListItem","Typography","useAppColorScheme","concatTestID","useCoreConfig","useCredentialDetail","getValidityState","ValidityState","shareCredentialCardFromCredential","ShareCredential","allCredentials","credentialId","expanded","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","request","selectedCredentialId","selectedFields","style","testID","_credential$issuerDid","colorScheme","data","credential","isLoading","config","selectionOptions","applicableCredentials","filter","applicableCredentialId","some","id","state","ACCEPTED","multipleCredentialsAvailable","length","validityState","issuerDid","did","undefined","invalid","lvvcIssuanceDate","validityCredentialNbf","Date","footer","Revoked","createElement","styles","notice","backgroundColor","background","align","color","text","preset","revokedCredentialNotice","Suspended","suspendedCredentialNotice","invalidCredentialNotice","multipleCredentialsNotice","onPress","noticeButton","title","multipleCredentialsSelect","type","Secondary","card","attributes","Boolean","onAttributeSelected","borderColor","create","borderRadius","borderWidth","marginBottom","marginHorizontal","padding","marginTop","paddingVertical"],"sources":["share-credential.tsx"],"sourcesContent":["import {\n CredentialListItem,\n CredentialStateEnum,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo } from 'react';\nimport { ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';\nimport { concatTestID } from '../../utils';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { getValidityState, ValidityState } from '../../utils/parsers/credential';\nimport { shareCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport type ShareCredentialLabels = ShareCredentialCardLabels & {\n revokedCredentialNotice: string;\n suspendedCredentialNotice: string;\n invalidCredentialNotice: string;\n multipleCredentialsNotice: string;\n multipleCredentialsSelect: string;\n};\n\nexport const ShareCredential: FunctionComponent<{\n allCredentials: CredentialListItem[];\n credentialId: string;\n expanded?: boolean;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (_id: PresentationDefinitionField['id'], _selected: boolean) => void;\n request: PresentationDefinitionRequestedCredential;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionField['id']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}> = ({\n allCredentials,\n credentialId,\n expanded,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n request,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { data: credential, isLoading } = useCredentialDetail(selectedCredentialId);\n const { data: config } = useCoreConfig();\n\n const selectionOptions = useMemo(\n () =>\n request.applicableCredentials.filter((applicableCredentialId) =>\n allCredentials.some(({ id, state }) => id === applicableCredentialId && state === CredentialStateEnum.ACCEPTED),\n ),\n [allCredentials, request],\n );\n const multipleCredentialsAvailable = selectionOptions.length > 1;\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuerDid: credential?.issuerDid?.did,\n }\n : undefined,\n );\n\n const invalid = useMemo(() => {\n if (!credential?.lvvcIssuanceDate || !request.validityCredentialNbf) {\n return false;\n }\n return new Date(credential.lvvcIssuanceDate) < new Date(request.validityCredentialNbf);\n }, [credential, request]);\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.revoked')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.revokedCredentialNotice}\n </Typography>\n </View>\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.suspended')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.suspendedCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (invalid) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.invalid')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.invalidCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.multiple')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.multipleCredentialsNotice}\n </Typography>\n <Button\n onPress={onSelectCredential}\n style={styles.noticeButton}\n testID={concatTestID(testID, 'notice.multiple.button')}\n title={labels.multipleCredentialsSelect}\n type={ButtonType.Secondary}\n />\n </View>\n );\n }\n }, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);\n\n if (isLoading || !config) {\n return null;\n }\n\n const { card, attributes } = shareCredentialCardFromCredential(\n credential,\n invalid,\n Boolean(expanded),\n multipleCredentialsAvailable,\n request,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId,\n onHeaderPress,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onSelectField}\n onImagePreview={onImagePreview}\n style={[styles.credential, { borderColor: colorScheme.background }, style]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n credential: {\n borderRadius: 10,\n borderWidth: 1,\n marginBottom: 8,\n },\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n noticeButton: {\n marginTop: 24,\n paddingVertical: 11,\n },\n});\n"],"mappings":"AAAA,SAEEA,mBAAmB,QAGd,iCAAiC;AACxC,OAAOC,KAAK,IAAuBC,OAAO,QAAQ,OAAO;AACzD,SAAyCC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAE1F,SAASC,MAAM,EAAEC,UAAU,EAAEC,6BAA6B,EAAEC,UAAU,EAAEC,iBAAiB,QAAQ,qBAAqB;AACtH,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,aAAa,QAAQ,oCAAoC;AAClE,SAASC,mBAAmB,QAAQ,oCAAo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A4B,EAAErB,kBAAkB,EAAEM,MAAM,EAAEiB,aAAa,CAAC,CAAC;EAErH,IAAIZ,SAAS,IAAI,CAACC,MAAM,EAAE;IACxB,OAAO,IAAI;EACb;EAEA,MAAM;IAAEyC,IAAI;IAAEC;EAAW,CAAC,GAAG/D,iCAAiC,CAC5DmB,UAAU,EACViB,OAAO,EACP4B,OAAO,CAAC5D,QAAQ,CAAC,EACjB0B,4BAA4B,EAC5BnB,OAAO,EACPE,cAAc,EACdQ,MAAM,EACNN,MAAM,EACNV,MACF,CAAC;EAED,oBACEnB,KAAA,CAAAwD,aAAA,CAAClD,6BAA6B;IAC5BuE,UAAU,EAAEA,UAAW;IACvBD,IAAI,EAAE;MACJ,GAAGA,IAAI;MACP3D,YAAY;MACZI;IACF,CAAE;IACFH,QAAQ,EAAEA,QAAS;IACnBoC,MAAM,EAAEA,MAAO;IACflC,QAAQ,EAAEA,QAAS;IACnB2D,mBAAmB,EAAEvD,aAAc;IACnCF,cAAc,EAAEA,cAAe;IAC/BM,KAAK,EAAE,CAAC6B,MAAM,CAACxB,UAAU,EAAE;MAAE+C,WAAW,EAAEjD,WAAW,CAAC6B;IAAW,CAAC,EAAEhC,KAAK,CAAE;IAC3EC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAED,MAAM4B,MAAM,GAAGvD,UAAU,CAAC+E,MAAM,CAAC;EAC/BhD,UAAU,EAAE;IACViD,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,YAAY,EAAE;EAChB,CAAC;EACD1B,MAAM,EAAE;IACN0B,YAAY,EAAE,EAAE;IAChBC,gBAAgB,EAAE,EAAE;IACpBC,OAAO,EAAE;EACX,CAAC;EACDf,YAAY,EAAE;IACZgB,SAAS,EAAE,EAAE;IACbC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["CredentialStateEnum","React","useMemo","StyleSheet","View","Button","ButtonType","CredentialDetailsCardListItem","Typography","useAppColorScheme","concatTestID","useCoreConfig","useCredentialDetail","getValidityState","ValidityState","shareCredentialCardFromCredential","ShareCredential","allCredentials","credentialId","expanded","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","request","selectedCredentialId","selectedFields","style","testID","_credential$issuer","colorScheme","data","credential","isLoading","config","selectionOptions","applicableCredentials","filter","applicableCredentialId","some","id","state","ACCEPTED","multipleCredentialsAvailable","length","validityState","issuer","undefined","invalid","lvvcIssuanceDate","validityCredentialNbf","Date","footer","Revoked","createElement","styles","notice","backgroundColor","background","align","color","text","preset","revokedCredentialNotice","Suspended","suspendedCredentialNotice","invalidCredentialNotice","multipleCredentialsNotice","onPress","noticeButton","title","multipleCredentialsSelect","type","Secondary","card","attributes","Boolean","onAttributeSelected","borderColor","create","borderRadius","borderWidth","marginBottom","marginHorizontal","padding","marginTop","paddingVertical"],"sources":["share-credential.tsx"],"sourcesContent":["import {\n CredentialListItem,\n CredentialStateEnum,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo } from 'react';\nimport { ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';\nimport { concatTestID } from '../../utils';\nimport { useCoreConfig } from '../../utils/hooks/core/core-config';\nimport { useCredentialDetail } from '../../utils/hooks/core/credentials';\nimport { getValidityState, ValidityState } from '../../utils/parsers/credential';\nimport { shareCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';\n\nexport type ShareCredentialLabels = ShareCredentialCardLabels & {\n revokedCredentialNotice: string;\n suspendedCredentialNotice: string;\n invalidCredentialNotice: string;\n multipleCredentialsNotice: string;\n multipleCredentialsSelect: string;\n};\n\nexport const ShareCredential: FunctionComponent<{\n allCredentials: CredentialListItem[];\n credentialId: string;\n expanded?: boolean;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (_id: PresentationDefinitionField['id'], _selected: boolean) => void;\n request: PresentationDefinitionRequestedCredential;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionField['id']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n}> = ({\n allCredentials,\n credentialId,\n expanded,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n request,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { data: credential, isLoading } = useCredentialDetail(selectedCredentialId);\n const { data: config } = useCoreConfig();\n\n const selectionOptions = useMemo(\n () =>\n request.applicableCredentials.filter((applicableCredentialId) =>\n allCredentials.some(({ id, state }) => id === applicableCredentialId && state === CredentialStateEnum.ACCEPTED),\n ),\n [allCredentials, request],\n );\n const multipleCredentialsAvailable = selectionOptions.length > 1;\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const invalid = useMemo(() => {\n if (!credential?.lvvcIssuanceDate || !request.validityCredentialNbf) {\n return false;\n }\n return new Date(credential.lvvcIssuanceDate) < new Date(request.validityCredentialNbf);\n }, [credential, request]);\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.revoked')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.revokedCredentialNotice}\n </Typography>\n </View>\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.suspended')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.suspendedCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (invalid) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.invalid')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.invalidCredentialNotice}\n </Typography>\n </View>\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <View\n style={[styles.notice, { backgroundColor: colorScheme.background }]}\n testID={concatTestID(testID, 'notice.multiple')}>\n <Typography align=\"center\" color={colorScheme.text} preset=\"s/line-height-capped\">\n {labels.multipleCredentialsNotice}\n </Typography>\n <Button\n onPress={onSelectCredential}\n style={styles.noticeButton}\n testID={concatTestID(testID, 'notice.multiple.button')}\n title={labels.multipleCredentialsSelect}\n type={ButtonType.Secondary}\n />\n </View>\n );\n }\n }, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);\n\n if (isLoading || !config) {\n return null;\n }\n\n const { card, attributes } = shareCredentialCardFromCredential(\n credential,\n invalid,\n Boolean(expanded),\n multipleCredentialsAvailable,\n request,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId,\n onHeaderPress,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onSelectField}\n onImagePreview={onImagePreview}\n style={[styles.credential, { borderColor: colorScheme.background }, style]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n credential: {\n borderRadius: 10,\n borderWidth: 1,\n marginBottom: 8,\n },\n notice: {\n marginBottom: 22,\n marginHorizontal: 12,\n padding: 12,\n },\n noticeButton: {\n marginTop: 24,\n paddingVertical: 11,\n },\n});\n"],"mappings":"AAAA,SAEEA,mBAAmB,QAGd,iCAAiC;AACxC,OAAOC,KAAK,IAAuBC,OAAO,QAAQ,OAAO;AACzD,SAAyCC,UAAU,EAAEC,IAAI,QAAmB,cAAc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AE;IACpBC,OAAO,EAAE;EACX,CAAC;EACDf,YAAY,EAAE;IACZgB,SAAS,EAAE,EAAE;IACbC,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import BlurView
|
|
2
|
-
export { BlurView
|
|
1
|
+
import BlurView from './blur-view';
|
|
2
|
+
export { BlurView };
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BlurView"
|
|
1
|
+
{"version":3,"names":["BlurView"],"sources":["index.ts"],"sourcesContent":["import type { BlurViewProps } from './blur-view';\nimport BlurView from './blur-view';\n\nexport { BlurView, BlurViewProps };\n"],"mappings":"AACA,OAAOA,QAAQ,MAAM,aAAa;AAElC,SAASA,QAAQ","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
import Animated, { cancelAnimation, Easing, runOnJS, useAnimatedStyle, useDerivedValue, useSharedValue, withTiming } from 'react-native-reanimated';
|
|
5
|
-
import {
|
|
5
|
+
import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
|
|
6
6
|
import { Typography } from '../text';
|
|
7
7
|
import { useAppColorScheme } from '../theme';
|
|
8
8
|
const Content = ({
|
|
@@ -144,13 +144,14 @@ const HoldButtonLayouted = ({
|
|
|
144
144
|
textColor: colorScheme.accentText
|
|
145
145
|
}, contentProps)))), /*#__PURE__*/React.createElement(View, {
|
|
146
146
|
style: styles.pressableLayer
|
|
147
|
-
}, /*#__PURE__*/React.createElement(
|
|
147
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, _extends({
|
|
148
148
|
accessibilityRole: "button",
|
|
149
149
|
ref: ref,
|
|
150
150
|
disabled: isFinished || disabled,
|
|
151
151
|
onLongPress: onLongPress,
|
|
152
152
|
onPressIn: isFinished ? undefined : onPressIn,
|
|
153
|
-
onPressOut: isFinished ? undefined : onPressOut
|
|
153
|
+
onPressOut: isFinished ? undefined : onPressOut,
|
|
154
|
+
activeOpacity: 1
|
|
154
155
|
}, props), /*#__PURE__*/React.createElement(View, {
|
|
155
156
|
style: {
|
|
156
157
|
width,
|