@procivis/one-react-native-components 0.3.106 → 0.3.115
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/backup/preview-credentials.js.map +1 -1
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -2
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +3 -3
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/history/history-details-screen.js +10 -10
- package/lib/commonjs/components/history/history-details-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +14 -8
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js.map +1 -1
- package/lib/commonjs/components/history/history-list.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/ui-components/control/checkbox.js +2 -1
- package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
- package/lib/commonjs/ui-components/control/switch.js +2 -2
- package/lib/commonjs/ui-components/control/switch.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/utils/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +2 -2
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +10 -10
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +4 -2
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +4 -4
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js +2 -2
- package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/history.js +1 -1
- package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +2 -2
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +22 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +11 -11
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-list.js +32 -0
- package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/verifier-instance.js +52 -0
- package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +38 -3
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +3 -3
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +9 -9
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +2 -2
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/backup/preview-credentials.js.map +1 -1
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/entity/EntityButtons.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +3 -3
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +4 -4
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/history/history-details-screen.js +11 -11
- package/lib/module/components/history/history-details-screen.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +15 -9
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/history/history-list-section-header.js +1 -1
- package/lib/module/components/history/history-list-section-header.js.map +1 -1
- package/lib/module/components/history/history-list.js.map +1 -1
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -2
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/ui-components/control/checkbox.js +2 -1
- package/lib/module/ui-components/control/checkbox.js.map +1 -1
- package/lib/module/ui-components/control/switch.js +3 -3
- package/lib/module/ui-components/control/switch.js.map +1 -1
- package/lib/module/ui-components/history/history-section-header.js +1 -1
- package/lib/module/ui-components/history/history-section-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/utils/history.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +3 -3
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +11 -11
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/core-config.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +4 -2
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +5 -5
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/dids.js +3 -3
- package/lib/module/utils/hooks/core/dids.js.map +1 -1
- package/lib/module/utils/hooks/core/history.js +1 -1
- package/lib/module/utils/hooks/core/history.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +3 -3
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +2 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +12 -12
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +2 -2
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-list.js +24 -0
- package/lib/module/utils/hooks/core/trust-list.js.map +1 -0
- package/lib/module/utils/hooks/core/verifier-instance.js +43 -0
- package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -0
- package/lib/module/utils/hooks/core/wallet-unit.js +36 -3
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js +2 -2
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/parsers/credential-images.js +4 -4
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +10 -10
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +2 -2
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/components/backup/preview-credentials.d.ts +2 -2
- package/lib/typescript/components/credential/credential.d.ts +2 -2
- package/lib/typescript/components/entity/EntityButtons.d.ts +2 -2
- package/lib/typescript/components/entity/entity-attributes.d.ts +2 -2
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -3
- package/lib/typescript/components/entity/entity-details.d.ts +5 -5
- package/lib/typescript/components/history/history-details-screen.d.ts +2 -2
- package/lib/typescript/components/history/history-list-item-icon.d.ts +3 -3
- package/lib/typescript/components/history/history-list-item.d.ts +5 -5
- package/lib/typescript/components/history/history-list-screen.d.ts +4 -4
- package/lib/typescript/components/history/history-list.d.ts +5 -5
- package/lib/typescript/components/proof-request/v1/select-credential.d.ts +2 -2
- package/lib/typescript/components/proof-request/v1/share-credential.d.ts +6 -6
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +3 -3
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +4 -4
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +5 -5
- package/lib/typescript/ui-components/control/checkbox.d.ts +1 -1
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
- package/lib/typescript/utils/history.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/backup.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/cache.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/core-config.d.ts +4 -4
- package/lib/typescript/utils/hooks/core/core-init.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +6 -6
- package/lib/typescript/utils/hooks/core/credentials.d.ts +9 -16
- package/lib/typescript/utils/hooks/core/dids.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/history.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/index.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
- package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -9
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +5 -5
- package/lib/typescript/utils/hooks/core/trust-list.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +8 -0
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +11 -5
- package/lib/typescript/utils/parsers/credential-images.d.ts +2 -2
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +7 -7
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +8 -8
- package/lib/typescript/utils/parsers/credential.d.ts +11 -11
- package/lib/typescript/utils/parsers/query.d.ts +8 -8
- package/package.json +3 -3
- package/src/components/backup/preview-credentials.tsx +2 -2
- package/src/components/credential/credential.tsx +2 -2
- package/src/components/entity/EntityButtons.tsx +2 -2
- package/src/components/entity/entity-attributes.tsx +2 -2
- package/src/components/entity/entity-details-with-buttons.tsx +6 -11
- package/src/components/entity/entity-details.tsx +16 -17
- package/src/components/history/history-details-screen.tsx +13 -13
- package/src/components/history/history-list-item-icon.tsx +17 -15
- package/src/components/history/history-list-item.tsx +5 -9
- package/src/components/history/history-list-screen.tsx +4 -4
- package/src/components/history/history-list-section-header.tsx +1 -1
- package/src/components/history/history-list.tsx +6 -6
- package/src/components/proof-request/v1/select-credential.tsx +2 -2
- package/src/components/proof-request/v1/share-credential.tsx +11 -13
- package/src/components/proof-request/v2/select-credential-v2.tsx +3 -6
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +10 -10
- package/src/components/proof-request/v2/share-credential-v2.tsx +9 -9
- package/src/ui-components/control/checkbox.tsx +13 -11
- package/src/ui-components/control/switch.tsx +23 -21
- package/src/ui-components/detail/detail.stories.tsx +1 -1
- package/src/ui-components/history/history-section-header.tsx +1 -1
- package/src/ui-components/history/history-section-list-item.tsx +1 -1
- package/src/ui-components/screens/nerd-mode-screen.tsx +2 -2
- package/src/utils/history.ts +4 -4
- package/src/utils/hooks/core/backup.ts +3 -3
- package/src/utils/hooks/core/cache.ts +13 -13
- package/src/utils/hooks/core/core-config.ts +3 -3
- package/src/utils/hooks/core/core-init.ts +3 -4
- package/src/utils/hooks/core/credential-schemas.ts +5 -8
- package/src/utils/hooks/core/credentials.ts +16 -32
- package/src/utils/hooks/core/dids.ts +4 -4
- package/src/utils/hooks/core/history.ts +3 -3
- package/src/utils/hooks/core/identifiers.ts +4 -8
- package/src/utils/hooks/core/index.ts +2 -0
- package/src/utils/hooks/core/proof-schemas.ts +16 -22
- package/src/utils/hooks/core/proofs.ts +33 -34
- package/src/utils/hooks/core/trust-entity.ts +8 -10
- package/src/utils/hooks/core/trust-list.ts +29 -0
- package/src/utils/hooks/core/verifier-instance.ts +54 -0
- package/src/utils/hooks/core/wallet-unit.ts +47 -14
- package/src/utils/hooks/revocation/credential-status.ts +2 -2
- package/src/utils/parsers/credential-images.tsx +6 -10
- package/src/utils/parsers/credential-sharing-v2.tsx +20 -22
- package/src/utils/parsers/credential-sharing.tsx +28 -28
- package/src/utils/parsers/credential.ts +43 -43
- package/src/utils/parsers/query.ts +22 -16
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Claim, CoreConfig, CredentialDetail, CredentialListItem, CredentialSchemaListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import { CredentialAttribute, CredentialCardProps, CredentialDetailsCardProps, CredentialHeaderProps } from '../../ui-components/credential';
|
|
3
3
|
import { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';
|
|
4
4
|
export declare enum ValidityState {
|
|
@@ -6,26 +6,26 @@ export declare enum ValidityState {
|
|
|
6
6
|
Suspended = "suspended",
|
|
7
7
|
Valid = "valid"
|
|
8
8
|
}
|
|
9
|
-
export declare const getValidityState: (credential:
|
|
10
|
-
export declare const supportsSelectiveDisclosure: (credential:
|
|
11
|
-
export declare const findClaimByPath: (path: string | undefined, claims:
|
|
12
|
-
export declare const hasMsoValidityIssues: (credential:
|
|
9
|
+
export declare const getValidityState: (credential: CredentialListItem | undefined) => ValidityState;
|
|
10
|
+
export declare const supportsSelectiveDisclosure: (credential: CredentialListItem | undefined, config: CoreConfig | undefined) => boolean | undefined;
|
|
11
|
+
export declare const findClaimByPath: (path: string | undefined, claims: Claim[]) => Claim | undefined;
|
|
12
|
+
export declare const hasMsoValidityIssues: (credential: CredentialDetail) => boolean;
|
|
13
13
|
export type CardHeaderLabels = {
|
|
14
14
|
validityIssues: string;
|
|
15
15
|
revoked: string;
|
|
16
16
|
suspended: string;
|
|
17
17
|
suspendedUntil: (date: string) => string;
|
|
18
18
|
};
|
|
19
|
-
export declare const cardHeaderFromCredential: (credential:
|
|
19
|
+
export declare const cardHeaderFromCredential: (credential: CredentialDetail, claims: Claim[] | undefined, config: CoreConfig, testID: string, labels: CardHeaderLabels) => Omit<CredentialHeaderProps, 'style'>;
|
|
20
20
|
export type CardLabels = CardHeaderLabels & {
|
|
21
21
|
validityIssuesNotice: string;
|
|
22
22
|
};
|
|
23
|
-
export declare const getCredentialCardPropsFromCredential: (credential:
|
|
24
|
-
export declare const detailsCardAttributeFromClaim: (claim:
|
|
23
|
+
export declare const getCredentialCardPropsFromCredential: (credential: CredentialDetail, claims: Claim[] | undefined, config: CoreConfig, notice: CredentialCardNotice | undefined, testID: string, labels: CardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
24
|
+
export declare const detailsCardAttributeFromClaim: (claim: Claim, config: CoreConfig, testID: string) => CredentialAttribute;
|
|
25
25
|
export type CredentialDetailsCardPropsWithoutWidth = Omit<CredentialDetailsCardProps, 'expanded' | 'card'> & {
|
|
26
26
|
card: Omit<CredentialCardProps, 'width'>;
|
|
27
27
|
};
|
|
28
|
-
export declare const detailsCardFromCredential: (credential:
|
|
29
|
-
export declare const detailsCardFromCredentialWithClaims: (credential:
|
|
28
|
+
export declare const detailsCardFromCredential: (credential: CredentialDetail, config: CoreConfig, testID: string, labels: CardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
29
|
+
export declare const detailsCardFromCredentialWithClaims: (credential: CredentialDetail, claims: Claim[], config: CoreConfig, testID: string, labels: CardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
30
30
|
export declare const nestAttributes: (attributes: CredentialAttribute[]) => CredentialAttribute[];
|
|
31
|
-
export declare function getCredentialSchemaWithoutImages<T extends
|
|
31
|
+
export declare function getCredentialSchemaWithoutImages<T extends CredentialSchemaListItem>(credentialSchema: T): T;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<
|
|
3
|
-
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<
|
|
4
|
-
export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<
|
|
5
|
-
export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<
|
|
6
|
-
export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<
|
|
7
|
-
export declare const getQueryKeyFromDidListQueryParams: (queryParams?: Partial<
|
|
8
|
-
export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<
|
|
1
|
+
import { CredentialListQuery, CredentialSchemaListQuery, DidListQuery, HistoryListQuery, IdentifierListQuery, ProofListQuery, ProofSchemaListQuery } from '@procivis/react-native-one-core';
|
|
2
|
+
export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<CredentialListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").CredentialListQuerySearchType[] | import("@procivis/react-native-one-core").CredentialListQueryExactColumn[] | import("@procivis/react-native-one-core").CredentialRole[] | import("@procivis/react-native-one-core").CredentialState[] | import("@procivis/react-native-one-core").CredentialListIncludeEntityType[] | undefined)[];
|
|
3
|
+
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").HistorySearch | import("@procivis/react-native-one-core").HistoryEntityType[] | import("@procivis/react-native-one-core").HistoryAction[] | undefined)[];
|
|
4
|
+
export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<CredentialSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").CredentialSchemaListQueryExactColumn[] | import("@procivis/react-native-one-core").CredentialSchemaListIncludeEntityType[] | undefined)[];
|
|
5
|
+
export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ProofSchemaListQueryExactColumn[] | undefined)[];
|
|
6
|
+
export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ProofListQueryExactColumn[] | import("@procivis/react-native-one-core").ProofState[] | import("@procivis/react-native-one-core").ProofRole[] | undefined)[];
|
|
7
|
+
export declare const getQueryKeyFromDidListQueryParams: (queryParams?: Partial<DidListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").DidListQueryExactColumn[] | import("@procivis/react-native-one-core").KeyRole[] | undefined)[];
|
|
8
|
+
export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<IdentifierListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").KeyRole[] | import("@procivis/react-native-one-core").IdentifierListQueryExactColumn[] | import("@procivis/react-native-one-core").IdentifierState[] | import("@procivis/react-native-one-core").IdentifierType[] | import("@procivis/react-native-one-core").CertificateRole[] | undefined)[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procivis/one-react-native-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.115",
|
|
4
4
|
"author": "Procivis AG (https://procivis.ch)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Common Procivis ONE UI components for react-native",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@babel/runtime": "^7.25.0",
|
|
54
54
|
"@commitlint/config-conventional": "^11.0.0",
|
|
55
55
|
"@gorhom/bottom-sheet": "^5.1.2",
|
|
56
|
-
"@procivis/react-native-one-core": "1.
|
|
56
|
+
"@procivis/react-native-one-core": "1.98296.0",
|
|
57
57
|
"@procivis/react-native-picker": "5.0.3",
|
|
58
58
|
"@react-native-async-storage/async-storage": "^1.17.3",
|
|
59
59
|
"@react-native-community/blur": "^4.4.0",
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
"vite": "^6.2.2"
|
|
143
143
|
},
|
|
144
144
|
"peerDependencies": {
|
|
145
|
-
"@procivis/react-native-one-core": "^1.
|
|
145
|
+
"@procivis/react-native-one-core": "^1.98296.0",
|
|
146
146
|
"@procivis/react-native-picker": "*",
|
|
147
147
|
"@react-native-community/blur": "*",
|
|
148
148
|
"@react-native-community/netinfo": "^11.4.1",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CredentialListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FC } from 'react';
|
|
3
3
|
import { ImageSourcePropType, View } from 'react-native';
|
|
4
4
|
|
|
@@ -7,7 +7,7 @@ import { CardLabels } from '../../utils/parsers/credential';
|
|
|
7
7
|
import { CredentialDetails } from '../credential/credential';
|
|
8
8
|
|
|
9
9
|
interface PreviewCredentialsProps {
|
|
10
|
-
credentials:
|
|
10
|
+
credentials: CredentialListItem[] | undefined;
|
|
11
11
|
labels: CardLabels;
|
|
12
12
|
onImagePreview: (title: string, image: ImageSourcePropType) => void;
|
|
13
13
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Claim } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FC, useMemo } from 'react';
|
|
3
3
|
import { Dimensions, ImageSourcePropType, StyleSheet } from 'react-native';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ import { useCredentialDetail } from '../../utils/hooks/core/credentials';
|
|
|
9
9
|
import { CardLabels, detailsCardFromCredentialWithClaims } from '../../utils/parsers/credential';
|
|
10
10
|
|
|
11
11
|
export interface CredentialDetailsProps {
|
|
12
|
-
claims?:
|
|
12
|
+
claims?: Claim[];
|
|
13
13
|
credentialId: string;
|
|
14
14
|
expanded?: boolean;
|
|
15
15
|
headerAccessory?: CredentialHeaderProps['accessory'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TrustEntityDetail } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FC, memo, useCallback, useMemo } from 'react';
|
|
3
3
|
import { Linking, StyleSheet, View } from 'react-native';
|
|
4
4
|
|
|
@@ -12,7 +12,7 @@ export interface EntityButton {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
interface EntityButtonsProps {
|
|
15
|
-
entity?:
|
|
15
|
+
entity?: TrustEntityDetail;
|
|
16
16
|
labels: EntityLabels;
|
|
17
17
|
testID?: string;
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TrustEntityDetail, TrustEntityListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FC, memo } from 'react';
|
|
3
3
|
import { StyleSheet, View } from 'react-native';
|
|
4
4
|
|
|
@@ -9,7 +9,7 @@ import { addElementIf } from '../../utils/array';
|
|
|
9
9
|
interface EntityAttributesProps {
|
|
10
10
|
certificate?: string;
|
|
11
11
|
did?: string;
|
|
12
|
-
trustEntity?:
|
|
12
|
+
trustEntity?: TrustEntityDetail | TrustEntityListItem;
|
|
13
13
|
trusted: boolean;
|
|
14
14
|
labels: AttributesLabels;
|
|
15
15
|
onCopyToClipboard: (value: string) => void;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetIdentifierListItemBindingDto,
|
|
3
|
-
TrustEntityRoleBindingEnum,
|
|
4
|
-
TrustEntityStateBindingEnum,
|
|
5
|
-
} from '@procivis/react-native-one-core';
|
|
1
|
+
import { IdentifierListItem, TrustEntityRole, TrustEntityState } from '@procivis/react-native-one-core';
|
|
6
2
|
import React, { FC, memo } from 'react';
|
|
7
3
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
8
4
|
|
|
@@ -14,10 +10,10 @@ import EntityAttributes from './entity-attributes';
|
|
|
14
10
|
import EntityDetails from './entity-details';
|
|
15
11
|
import EntityButtons from './EntityButtons';
|
|
16
12
|
|
|
17
|
-
export type ContextRole = Exclude<
|
|
13
|
+
export type ContextRole = Exclude<TrustEntityRole, TrustEntityRole.BOTH>;
|
|
18
14
|
|
|
19
15
|
interface EntityDetailsWithButtonsProps {
|
|
20
|
-
identifier?:
|
|
16
|
+
identifier?: IdentifierListItem;
|
|
21
17
|
entityLabels: EntityLabels;
|
|
22
18
|
attributesLabels: AttributesLabels;
|
|
23
19
|
style?: StyleProp<ViewStyle>;
|
|
@@ -46,8 +42,8 @@ const EntityDetailsWithButtons: FC<EntityDetailsWithButtonsProps> = ({
|
|
|
46
42
|
|
|
47
43
|
const trusted = Boolean(
|
|
48
44
|
trustEntity &&
|
|
49
|
-
trustEntity.state ===
|
|
50
|
-
(trustEntity.role ===
|
|
45
|
+
trustEntity.state === TrustEntityState.ACTIVE &&
|
|
46
|
+
(trustEntity.role === TrustEntityRole.BOTH || trustEntity.role === role),
|
|
51
47
|
);
|
|
52
48
|
|
|
53
49
|
return (
|
|
@@ -55,8 +51,7 @@ const EntityDetailsWithButtons: FC<EntityDetailsWithButtonsProps> = ({
|
|
|
55
51
|
<EntityDetails
|
|
56
52
|
identifier={identifier}
|
|
57
53
|
labels={{
|
|
58
|
-
unknown:
|
|
59
|
-
role === TrustEntityRoleBindingEnum.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier,
|
|
54
|
+
unknown: role === TrustEntityRole.ISSUER ? entityLabels.unknownIssuer : entityLabels.unknownVerifier,
|
|
60
55
|
}}
|
|
61
56
|
role={role}
|
|
62
57
|
testID={testID}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
CertificateDetail,
|
|
3
|
+
IdentifierListItem,
|
|
4
|
+
IdentifierType,
|
|
5
|
+
TrustEntityDetail,
|
|
6
|
+
TrustEntityRole,
|
|
7
|
+
TrustEntityState,
|
|
8
8
|
} from '@procivis/react-native-one-core';
|
|
9
9
|
import React, { FC, ReactNode, useMemo } from 'react';
|
|
10
10
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
@@ -21,22 +21,22 @@ export type EntityDetailsLabels = {
|
|
|
21
21
|
|
|
22
22
|
export type EntityDetailsProps = {
|
|
23
23
|
labels: EntityDetailsLabels;
|
|
24
|
-
renderMore?: (trustEntity:
|
|
25
|
-
role: Exclude<
|
|
24
|
+
renderMore?: (trustEntity: TrustEntityDetail) => ReactNode;
|
|
25
|
+
role: Exclude<TrustEntityRole, TrustEntityRole.BOTH>;
|
|
26
26
|
style?: StyleProp<ViewStyle>;
|
|
27
27
|
sublineColor?: string;
|
|
28
28
|
textColor?: string;
|
|
29
29
|
testID?: string;
|
|
30
30
|
} & (
|
|
31
31
|
| {
|
|
32
|
-
identifier?:
|
|
32
|
+
identifier?: IdentifierListItem;
|
|
33
33
|
}
|
|
34
34
|
| {
|
|
35
|
-
entity:
|
|
35
|
+
entity: TrustEntityDetail;
|
|
36
36
|
}
|
|
37
37
|
);
|
|
38
38
|
|
|
39
|
-
const getCertificateCommonName = (certificate:
|
|
39
|
+
const getCertificateCommonName = (certificate: CertificateDetail): string | undefined => {
|
|
40
40
|
return certificate.x509Attributes.subject
|
|
41
41
|
.split(', ')
|
|
42
42
|
.find((s) => s.startsWith('CN'))
|
|
@@ -57,16 +57,15 @@ const EntityDetails: FC<EntityDetailsProps> = ({
|
|
|
57
57
|
const { data, isLoading: isLoadingTrustEntity } = useTrustEntity(
|
|
58
58
|
'identifier' in props ? props.identifier?.id : undefined,
|
|
59
59
|
);
|
|
60
|
-
const trustEntity:
|
|
61
|
-
'entity' in props ? props.entity : data ?? undefined;
|
|
60
|
+
const trustEntity = 'entity' in props ? props.entity : data ?? undefined;
|
|
62
61
|
const { data: identifierDetail, isLoading: isLoadingIdentifier } = useIdentifierDetails(
|
|
63
62
|
'identifier' in props ? props.identifier?.id : undefined,
|
|
64
63
|
);
|
|
65
64
|
|
|
66
65
|
const trusted =
|
|
67
66
|
trustEntity &&
|
|
68
|
-
trustEntity.state ===
|
|
69
|
-
(trustEntity.role ===
|
|
67
|
+
trustEntity.state === TrustEntityState.ACTIVE &&
|
|
68
|
+
(trustEntity.role === TrustEntityRole.BOTH || trustEntity.role === role);
|
|
70
69
|
|
|
71
70
|
const isLoading = isLoadingIdentifier || isLoadingTrustEntity;
|
|
72
71
|
|
|
@@ -81,7 +80,7 @@ const EntityDetails: FC<EntityDetailsProps> = ({
|
|
|
81
80
|
: undefined;
|
|
82
81
|
|
|
83
82
|
const placeholderText =
|
|
84
|
-
identifierDetail?.type ===
|
|
83
|
+
identifierDetail?.type === IdentifierType.CERTIFICATE && identifierDetail.certificates?.[0]
|
|
85
84
|
? getCertificateCommonName(identifierDetail.certificates[0])?.substring(0, 1)
|
|
86
85
|
: 'D';
|
|
87
86
|
|
|
@@ -111,7 +110,7 @@ const EntityDetails: FC<EntityDetailsProps> = ({
|
|
|
111
110
|
if (isLoading) {
|
|
112
111
|
return '';
|
|
113
112
|
}
|
|
114
|
-
if (identifierDetail?.type ===
|
|
113
|
+
if (identifierDetail?.type === IdentifierType.CERTIFICATE && identifierDetail.certificates?.[0]) {
|
|
115
114
|
const commonName = getCertificateCommonName(identifierDetail.certificates[0]);
|
|
116
115
|
if (commonName) {
|
|
117
116
|
return commonName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryAction, HistoryListItem } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FC, ReactElement } from 'react';
|
|
3
3
|
import { ImageSourcePropType } from 'react-native';
|
|
4
4
|
|
|
@@ -12,19 +12,19 @@ import { capitalizeFirstLetter, concatTestID, formatDateTimeLocalized } from '..
|
|
|
12
12
|
import { HistoryListItemLabels } from './history-list-item';
|
|
13
13
|
import { getHistoryItemActionIcon } from './history-list-item-icon';
|
|
14
14
|
|
|
15
|
-
const getStatusTextColor = (action:
|
|
15
|
+
const getStatusTextColor = (action: HistoryAction, colorScheme: Readonly<ColorScheme>) => {
|
|
16
16
|
switch (action) {
|
|
17
|
-
case
|
|
18
|
-
case
|
|
19
|
-
case
|
|
20
|
-
case
|
|
21
|
-
case
|
|
22
|
-
case
|
|
17
|
+
case HistoryAction.CLAIMS_REMOVED:
|
|
18
|
+
case HistoryAction.DEACTIVATED:
|
|
19
|
+
case HistoryAction.DELETED:
|
|
20
|
+
case HistoryAction.REJECTED:
|
|
21
|
+
case HistoryAction.REVOKED:
|
|
22
|
+
case HistoryAction.ERRORED:
|
|
23
23
|
return colorScheme.errorText;
|
|
24
|
-
case
|
|
25
|
-
case
|
|
26
|
-
case
|
|
27
|
-
case
|
|
24
|
+
case HistoryAction.SUSPENDED:
|
|
25
|
+
case HistoryAction.OFFERED:
|
|
26
|
+
case HistoryAction.PENDING:
|
|
27
|
+
case HistoryAction.REQUESTED:
|
|
28
28
|
return colorScheme.text;
|
|
29
29
|
default:
|
|
30
30
|
return colorScheme.successText;
|
|
@@ -39,7 +39,7 @@ export type HistoryDetailsScreenProps = {
|
|
|
39
39
|
assets: HistoryDetailsViewProps['assets'];
|
|
40
40
|
dataHeader: HistoryDetailsViewProps['data']['header'];
|
|
41
41
|
headerButton?: ReactElement;
|
|
42
|
-
item:
|
|
42
|
+
item: HistoryListItem;
|
|
43
43
|
labels: HistoryDetailsScreenLabels;
|
|
44
44
|
onBackPressed: () => void;
|
|
45
45
|
onInfoPressed?: () => void;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HistoryActionBindingEnum,
|
|
3
|
-
HistoryEntityTypeBindingEnum,
|
|
4
|
-
HistoryListItemBindingDto,
|
|
5
|
-
} from '@procivis/react-native-one-core';
|
|
1
|
+
import { HistoryAction, HistoryEntityType, HistoryListItem } from '@procivis/react-native-one-core';
|
|
6
2
|
import React, { FC, useMemo } from 'react';
|
|
7
3
|
import { SvgProps } from 'react-native-svg';
|
|
8
4
|
|
|
@@ -30,8 +26,8 @@ import {
|
|
|
30
26
|
} from '../../ui-components';
|
|
31
27
|
|
|
32
28
|
const defaultIcons: {
|
|
33
|
-
actions: { [key in keyof typeof
|
|
34
|
-
entityTypes: { [key in keyof typeof
|
|
29
|
+
actions: { [key in keyof typeof HistoryAction]: FC<SvgProps> };
|
|
30
|
+
entityTypes: { [key in keyof typeof HistoryEntityType]: FC<SvgProps> };
|
|
35
31
|
} = {
|
|
36
32
|
actions: {
|
|
37
33
|
ACCEPTED: HistoryStatusAcceptedIcon,
|
|
@@ -62,6 +58,8 @@ const defaultIcons: {
|
|
|
62
58
|
INTERACTION_ERRORED: HistoryStatusErrorIcon,
|
|
63
59
|
INTERACTION_EXPIRED: HistoryStatusErrorIcon,
|
|
64
60
|
DELIVERED: HistoryStatusAcceptedIcon,
|
|
61
|
+
WRP_AC_RECEIVED: HistoryStatusAcceptedIcon,
|
|
62
|
+
WRP_RC_RECEIVED: HistoryStatusAcceptedIcon,
|
|
65
63
|
},
|
|
66
64
|
entityTypes: {
|
|
67
65
|
BACKUP: HistoryRevokeIcon,
|
|
@@ -88,36 +86,40 @@ const defaultIcons: {
|
|
|
88
86
|
STS_SESSION: HistoryIdentifierIcon,
|
|
89
87
|
NOTIFICATION: HistoryCredentialIcon,
|
|
90
88
|
SUPERVISORY_AUTHORITY: HistoryCertificateIcon,
|
|
89
|
+
TRUST_LIST_PUBLICATION: HistoryTrustAnchorIcon,
|
|
90
|
+
TRUST_COLLECTION: HistoryTrustAnchorIcon,
|
|
91
|
+
TRUST_LIST_SUBSCRIPTION: HistoryTrustAnchorIcon,
|
|
92
|
+
VERIFIER_INSTANCE: HistoryTrustedEntityIcon,
|
|
91
93
|
},
|
|
92
94
|
};
|
|
93
95
|
|
|
94
|
-
export const getHistoryItemActionIcon = (action:
|
|
96
|
+
export const getHistoryItemActionIcon = (action: HistoryAction) => {
|
|
95
97
|
return defaultIcons.actions[action] ?? HistoryStatusAcceptedIcon;
|
|
96
98
|
};
|
|
97
99
|
|
|
98
100
|
export type HistoryListItemIconProps = {
|
|
99
|
-
item:
|
|
101
|
+
item: HistoryListItem;
|
|
100
102
|
};
|
|
101
103
|
|
|
102
104
|
export const HistoryListItemIcon: FC<HistoryListItemIconProps> = ({ item }) => {
|
|
103
105
|
const statusIcon = getHistoryItemActionIcon(item.action);
|
|
104
106
|
const typeIcon = useMemo(() => {
|
|
105
107
|
switch (item.entityType) {
|
|
106
|
-
case
|
|
108
|
+
case HistoryEntityType.BACKUP:
|
|
107
109
|
switch (item.action) {
|
|
108
|
-
case
|
|
110
|
+
case HistoryAction.CREATED:
|
|
109
111
|
return HistoryBackupCreatedIcon;
|
|
110
|
-
case
|
|
112
|
+
case HistoryAction.RESTORED:
|
|
111
113
|
return HistoryBackupRestoredIcon;
|
|
112
114
|
default:
|
|
113
115
|
break;
|
|
114
116
|
}
|
|
115
117
|
break;
|
|
116
|
-
case
|
|
118
|
+
case HistoryEntityType.CREDENTIAL:
|
|
117
119
|
switch (item.action) {
|
|
118
|
-
case
|
|
120
|
+
case HistoryAction.REVOKED:
|
|
119
121
|
return HistoryRevokeIcon;
|
|
120
|
-
case
|
|
122
|
+
case HistoryAction.SUSPENDED:
|
|
121
123
|
return HistorySuspendIcon;
|
|
122
124
|
default:
|
|
123
125
|
break;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
HistoryActionBindingEnum,
|
|
3
|
-
HistoryEntityTypeBindingEnum,
|
|
4
|
-
HistoryListItemBindingDto,
|
|
5
|
-
} from '@procivis/react-native-one-core';
|
|
1
|
+
import { HistoryAction, HistoryEntityType, HistoryListItem } from '@procivis/react-native-one-core';
|
|
6
2
|
import React, { FC, useCallback, useMemo } from 'react';
|
|
7
3
|
|
|
8
4
|
import { HistoryItemView } from '../../ui-components';
|
|
@@ -10,18 +6,18 @@ import { formatTime, useTrustEntity } from '../../utils';
|
|
|
10
6
|
import { HistoryListItemIcon } from './history-list-item-icon';
|
|
11
7
|
|
|
12
8
|
export type HistoryListItemLabels = {
|
|
13
|
-
actions: { [key in keyof typeof
|
|
14
|
-
entityTypes: { [key in keyof typeof
|
|
9
|
+
actions: { [key in keyof typeof HistoryAction]: string };
|
|
10
|
+
entityTypes: { [key in keyof typeof HistoryEntityType]: string };
|
|
15
11
|
};
|
|
16
12
|
|
|
17
13
|
export interface HistoryListItemViewProps {
|
|
18
14
|
dateFormatter?: (date: Date) => string;
|
|
19
15
|
first?: boolean;
|
|
20
16
|
infoLabelMode?: 'entity' | 'associatedLabel' | 'none';
|
|
21
|
-
item:
|
|
17
|
+
item: HistoryListItem;
|
|
22
18
|
labels: HistoryListItemLabels;
|
|
23
19
|
last?: boolean;
|
|
24
|
-
onPress?: (item:
|
|
20
|
+
onPress?: (item: HistoryListItem) => void;
|
|
25
21
|
testID?: string;
|
|
26
22
|
}
|
|
27
23
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryListItem, HistoryListQuery } from '@procivis/react-native-one-core';
|
|
2
2
|
import { debounce } from 'lodash';
|
|
3
3
|
import React, { FC, PropsWithChildren, useEffect, useMemo, useState } from 'react';
|
|
4
4
|
import { Animated, StyleSheet, View } from 'react-native';
|
|
@@ -24,14 +24,14 @@ export type HistoryListScreenLabels = {
|
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export type HistoryListScreenProps = {
|
|
27
|
-
groupItems?: (entries:
|
|
27
|
+
groupItems?: (entries: HistoryListItem[]) => HistoryGroupByDaySection[];
|
|
28
28
|
itemInfoLabelMode?: HistoryListItemViewProps['infoLabelMode'];
|
|
29
29
|
labels: HistoryListScreenLabels;
|
|
30
30
|
onBackPressed: () => void;
|
|
31
|
-
onHistoryItemPressed: (historyItem:
|
|
31
|
+
onHistoryItemPressed: (historyItem: HistoryListItem) => void;
|
|
32
32
|
onOpenFilter?: () => void;
|
|
33
33
|
onSearchPhraseChange: (searchPhrase: string | undefined) => void;
|
|
34
|
-
queryParams: Partial<
|
|
34
|
+
queryParams: Partial<HistoryListQuery>;
|
|
35
35
|
testID?: string;
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -15,7 +15,7 @@ export type HistoryListSectionHeaderViewProps = {
|
|
|
15
15
|
testID?: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
// components used on the history section lists (Settings->History,
|
|
18
|
+
// components used on the history section lists (Settings->History, CredentialDetail->History)
|
|
19
19
|
// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=1246-51813&mode=dev
|
|
20
20
|
|
|
21
21
|
export const HistoryListSectionHeaderView: FC<HistoryListSectionHeaderViewProps> = ({
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HistoryListItem, HistoryListQuery } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useIsFocused } from '@react-navigation/native';
|
|
3
3
|
import React, { FC, useCallback, useMemo } from 'react';
|
|
4
4
|
import { Animated, SectionListProps, StyleSheet } from 'react-native';
|
|
@@ -16,15 +16,15 @@ export type HistoryListLabels = {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export interface HistoryListViewProps
|
|
19
|
-
extends Omit<SectionListProps<
|
|
19
|
+
extends Omit<SectionListProps<HistoryListItem, HistoryGroupByDaySection>, 'sections'> {
|
|
20
20
|
// optional customization of item props
|
|
21
|
-
getItemProps?: (item:
|
|
22
|
-
groupItems?: (entries:
|
|
21
|
+
getItemProps?: (item: HistoryListItem) => Partial<HistoryListItemViewProps> | undefined;
|
|
22
|
+
groupItems?: (entries: HistoryListItem[]) => HistoryGroupByDaySection[];
|
|
23
23
|
itemProps?: Partial<HistoryListItemViewProps>;
|
|
24
24
|
labels: HistoryListLabels;
|
|
25
25
|
// callback when empty list displayed
|
|
26
26
|
onEmpty?: (empty: boolean) => void;
|
|
27
|
-
query: Partial<
|
|
27
|
+
query: Partial<HistoryListQuery>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
export const HistoryListView: FC<HistoryListViewProps> = ({
|
|
@@ -72,7 +72,7 @@ export const HistoryListView: FC<HistoryListViewProps> = ({
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
return (
|
|
75
|
-
<Animated.SectionList<
|
|
75
|
+
<Animated.SectionList<HistoryListItem, HistoryGroupByDaySection>
|
|
76
76
|
ListFooterComponent={
|
|
77
77
|
isLoading ? <ListPageLoadingIndicator color={colorScheme.accent} style={styles.footer} /> : undefined
|
|
78
78
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PresentationDefinitionRequestedCredential } from '@procivis/react-native-one-core';
|
|
2
2
|
import React, { FC, useMemo } from 'react';
|
|
3
3
|
import { Dimensions, ImageSourcePropType } from 'react-native';
|
|
4
4
|
|
|
@@ -16,7 +16,7 @@ export const SelectCredential: FC<{
|
|
|
16
16
|
lastItem: boolean;
|
|
17
17
|
onImagePreview: (title: string, image: ImageSourcePropType) => void;
|
|
18
18
|
onPress?: () => void;
|
|
19
|
-
request:
|
|
19
|
+
request: PresentationDefinitionRequestedCredential;
|
|
20
20
|
selected: boolean;
|
|
21
21
|
testID: string;
|
|
22
22
|
}> = ({ credentialId, labels, lastItem, onImagePreview, onPress, request, selected, testID }) => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
CredentialDetail,
|
|
3
|
+
CredentialListItem,
|
|
4
|
+
CredentialState,
|
|
5
|
+
PresentationDefinitionField,
|
|
6
|
+
PresentationDefinitionRequestedCredential,
|
|
7
7
|
} from '@procivis/react-native-one-core';
|
|
8
8
|
import React, { FunctionComponent, useMemo } from 'react';
|
|
9
9
|
import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
|
|
@@ -28,17 +28,17 @@ export type ShareCredentialLabels = ShareCredentialCardLabels & {
|
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
export const ShareCredential: FunctionComponent<{
|
|
31
|
-
allCredentials:
|
|
31
|
+
allCredentials: CredentialDetail[];
|
|
32
32
|
expanded?: boolean;
|
|
33
33
|
labels: ShareCredentialLabels;
|
|
34
34
|
lastItem?: boolean;
|
|
35
35
|
onHeaderPress?: (_credentialId?: string) => void;
|
|
36
36
|
onImagePreview: (title: string, image: ImageSourcePropType) => void;
|
|
37
37
|
onSelectCredential?: () => void;
|
|
38
|
-
onSelectField: (_id:
|
|
39
|
-
request:
|
|
40
|
-
selectedCredentialId?:
|
|
41
|
-
selectedFields?: Array<
|
|
38
|
+
onSelectField: (_id: PresentationDefinitionField['id'], _selected: boolean) => void;
|
|
39
|
+
request: PresentationDefinitionRequestedCredential;
|
|
40
|
+
selectedCredentialId?: CredentialListItem['id'];
|
|
41
|
+
selectedFields?: Array<PresentationDefinitionField['id']>;
|
|
42
42
|
style?: StyleProp<ViewStyle>;
|
|
43
43
|
testID: string;
|
|
44
44
|
}> = ({
|
|
@@ -64,9 +64,7 @@ export const ShareCredential: FunctionComponent<{
|
|
|
64
64
|
const selectionOptions = useMemo(
|
|
65
65
|
() =>
|
|
66
66
|
request.applicableCredentials.filter((applicableCredentialId) =>
|
|
67
|
-
allCredentials.some(
|
|
68
|
-
({ id, state }) => id === applicableCredentialId && state === CredentialStateBindingEnum.ACCEPTED,
|
|
69
|
-
),
|
|
67
|
+
allCredentials.some(({ id, state }) => id === applicableCredentialId && state === CredentialState.ACCEPTED),
|
|
70
68
|
),
|
|
71
69
|
[allCredentials, request],
|
|
72
70
|
);
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CredentialListItemBindingDto,
|
|
3
|
-
PresentationDefinitionV2CredentialDetailBindingDto,
|
|
4
|
-
} from '@procivis/react-native-one-core';
|
|
1
|
+
import { CredentialListItem, PresentationDefinitionV2Credential } from '@procivis/react-native-one-core';
|
|
5
2
|
import React, { FC, useCallback, useMemo } from 'react';
|
|
6
3
|
import { Dimensions, ImageSourcePropType } from 'react-native';
|
|
7
4
|
|
|
@@ -10,12 +7,12 @@ import { ShareCredentialCardLabels, useCoreConfig } from '../../../utils';
|
|
|
10
7
|
import { selectCredentialCardFromV2Credential } from '../../../utils/parsers/credential-sharing-v2';
|
|
11
8
|
|
|
12
9
|
export const SelectCredentialV2: FC<{
|
|
13
|
-
credential:
|
|
10
|
+
credential: PresentationDefinitionV2Credential;
|
|
14
11
|
labels: ShareCredentialCardLabels;
|
|
15
12
|
lastItem: boolean;
|
|
16
13
|
multiple: boolean;
|
|
17
14
|
onImagePreview: (title: string, image: ImageSourcePropType) => void;
|
|
18
|
-
onSelected?: (credentialId:
|
|
15
|
+
onSelected?: (credentialId: CredentialListItem['id'], selected: boolean) => void;
|
|
19
16
|
selected: boolean;
|
|
20
17
|
testID: string;
|
|
21
18
|
}> = ({ credential, labels, lastItem, multiple, onImagePreview, onSelected, selected, testID }) => {
|