@procivis/one-react-native-components 0.3.71 → 0.3.86
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/credential/credential.js +8 -2
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/index.js +23 -12
- package/lib/commonjs/components/proof-request/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/select-share-credential-card-notice.js +37 -0
- package/lib/commonjs/components/proof-request/select-share-credential-card-notice.js.map +1 -0
- package/lib/commonjs/components/proof-request/share-credential-card-notice.js +36 -0
- package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -0
- package/lib/commonjs/components/proof-request/{group.js → v1/group.js} +1 -1
- package/lib/commonjs/components/proof-request/v1/group.js.map +1 -0
- package/lib/commonjs/components/proof-request/v1/index.js +39 -0
- package/lib/commonjs/components/proof-request/v1/index.js.map +1 -0
- package/lib/commonjs/components/proof-request/{select-credential.js → v1/select-credential.js} +12 -6
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -0
- package/lib/commonjs/components/proof-request/{share-credential.js → v1/share-credential.js} +33 -62
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/index.js +39 -0
- package/lib/commonjs/components/proof-request/v2/index.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +55 -0
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +164 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +135 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -0
- package/lib/commonjs/ui-components/buttons/share-button.js +1 -1
- package/lib/commonjs/ui-components/buttons/share-button.js.map +1 -1
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js +5 -1
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +16 -42
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +3 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/group/credential-group-header.js +72 -0
- package/lib/commonjs/ui-components/credential/group/credential-group-header.js.map +1 -0
- package/lib/commonjs/ui-components/credential/group/index.js +14 -0
- package/lib/commonjs/ui-components/credential/group/index.js.map +1 -0
- package/lib/commonjs/ui-components/credential/index.js +12 -0
- package/lib/commonjs/ui-components/credential/index.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js +29 -17
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/index.js +11 -0
- package/lib/commonjs/ui-components/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js +477 -475
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/commonjs/ui-components/proof-request/index.js +13 -0
- package/lib/commonjs/ui-components/proof-request/index.js.map +1 -0
- package/lib/commonjs/ui-components/proof-request/proof-request-set.js +47 -0
- package/lib/commonjs/ui-components/proof-request/proof-request-set.js.map +1 -0
- package/lib/commonjs/ui-components/screens/section-list-screen.js +17 -3
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/utils/array.js.map +1 -1
- package/lib/commonjs/utils/hooks/app-state.js +33 -0
- package/lib/commonjs/utils/hooks/app-state.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/backup.js +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +10 -3
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- 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 +39 -10
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +85 -0
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -0
- package/lib/commonjs/utils/hooks/index.js +11 -0
- package/lib/commonjs/utils/hooks/index.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/index.js +16 -4
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +190 -0
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -0
- package/lib/commonjs/utils/parsers/credential-sharing.js +31 -18
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +111 -63
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/index.js +11 -0
- package/lib/commonjs/utils/parsers/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +4 -4
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/wallet-unit.js +30 -0
- package/lib/commonjs/utils/wallet-unit.js.map +1 -0
- package/lib/module/components/credential/credential.js +8 -2
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/proof-request/index.js +4 -3
- package/lib/module/components/proof-request/index.js.map +1 -1
- package/lib/module/components/proof-request/select-share-credential-card-notice.js +29 -0
- package/lib/module/components/proof-request/select-share-credential-card-notice.js.map +1 -0
- package/lib/module/components/proof-request/share-credential-card-notice.js +28 -0
- package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -0
- package/lib/module/components/proof-request/{group.js → v1/group.js} +1 -1
- package/lib/module/components/proof-request/v1/group.js.map +1 -0
- package/lib/module/components/proof-request/v1/index.js +4 -0
- package/lib/module/components/proof-request/v1/index.js.map +1 -0
- package/lib/module/components/proof-request/{select-credential.js → v1/select-credential.js} +12 -6
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -0
- package/lib/module/components/proof-request/v1/share-credential.js +118 -0
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -0
- package/lib/module/components/proof-request/v2/index.js +4 -0
- package/lib/module/components/proof-request/v2/index.js.map +1 -0
- package/lib/module/components/proof-request/v2/select-credential-v2.js +46 -0
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -0
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +154 -0
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -0
- package/lib/module/components/proof-request/v2/share-credential-v2.js +126 -0
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -0
- package/lib/module/ui-components/buttons/share-button.js +1 -1
- package/lib/module/ui-components/buttons/share-button.js.map +1 -1
- package/lib/module/ui-components/camera/qr-code-scanner.js +5 -1
- package/lib/module/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-list-item.js +19 -45
- package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js +3 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/module/ui-components/credential/group/credential-group-header.js +64 -0
- package/lib/module/ui-components/credential/group/credential-group-header.js.map +1 -0
- package/lib/module/ui-components/credential/group/index.js +3 -0
- package/lib/module/ui-components/credential/group/index.js.map +1 -0
- package/lib/module/ui-components/credential/index.js +1 -0
- package/lib/module/ui-components/credential/index.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js +29 -17
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/index.js +1 -0
- package/lib/module/ui-components/index.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +1 -1
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/pin/pin-lock-animation.js +477 -475
- package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/module/ui-components/proof-request/index.js +3 -0
- package/lib/module/ui-components/proof-request/index.js.map +1 -0
- package/lib/module/ui-components/proof-request/proof-request-set.js +39 -0
- package/lib/module/ui-components/proof-request/proof-request-set.js.map +1 -0
- package/lib/module/ui-components/screens/section-list-screen.js +15 -3
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/utils/array.js.map +1 -1
- package/lib/module/utils/hooks/app-state.js +27 -0
- package/lib/module/utils/hooks/app-state.js.map +1 -0
- package/lib/module/utils/hooks/core/backup.js +1 -1
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +11 -4
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +5 -5
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- 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 +40 -11
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +75 -0
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -0
- package/lib/module/utils/hooks/index.js +1 -0
- package/lib/module/utils/hooks/index.js.map +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +177 -0
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -0
- package/lib/module/utils/parsers/credential-sharing.js +31 -18
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +112 -64
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/index.js +1 -0
- package/lib/module/utils/parsers/index.js.map +1 -1
- package/lib/module/utils/parsers/query.js +4 -4
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/wallet-unit.js +22 -0
- package/lib/module/utils/wallet-unit.js.map +1 -0
- package/lib/typescript/components/proof-request/index.d.ts +4 -3
- package/lib/typescript/components/proof-request/select-share-credential-card-notice.d.ts +7 -0
- package/lib/typescript/components/proof-request/share-credential-card-notice.d.ts +6 -0
- package/lib/typescript/components/proof-request/v1/index.d.ts +3 -0
- package/lib/typescript/components/proof-request/{select-credential.d.ts → v1/select-credential.d.ts} +1 -1
- package/lib/typescript/components/proof-request/{share-credential.d.ts → v1/share-credential.d.ts} +1 -1
- package/lib/typescript/components/proof-request/v2/index.d.ts +3 -0
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +14 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +24 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +23 -0
- package/lib/typescript/ui-components/credential/group/credential-group-header.d.ts +10 -0
- package/lib/typescript/ui-components/credential/group/index.d.ts +3 -0
- package/lib/typescript/ui-components/credential/index.d.ts +1 -0
- package/lib/typescript/ui-components/header/foldable-header.d.ts +1 -0
- package/lib/typescript/ui-components/index.d.ts +1 -0
- package/lib/typescript/ui-components/loader/loading-result.d.ts +1 -1
- package/lib/typescript/ui-components/pin/pin-lock-animation.d.ts +311 -311
- package/lib/typescript/ui-components/proof-request/index.d.ts +3 -0
- package/lib/typescript/ui-components/proof-request/proof-request-set.d.ts +7 -0
- package/lib/typescript/ui-components/screens/section-list-screen.d.ts +4 -2
- package/lib/typescript/utils/array.d.ts +1 -0
- package/lib/typescript/utils/hooks/app-state.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/backup.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +6 -7
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +9 -0
- package/lib/typescript/utils/hooks/index.d.ts +1 -0
- package/lib/typescript/utils/index.d.ts +2 -1
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +11 -0
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +11 -5
- package/lib/typescript/utils/parsers/credential.d.ts +9 -6
- package/lib/typescript/utils/parsers/index.d.ts +1 -0
- package/lib/typescript/utils/parsers/query.d.ts +2 -2
- package/lib/typescript/utils/wallet-unit.d.ts +8 -0
- package/package.json +12 -6
- package/src/components/credential/credential.tsx +5 -1
- package/src/components/proof-request/index.ts +4 -3
- package/src/components/proof-request/select-share-credential-card-notice.tsx +37 -0
- package/src/components/proof-request/share-credential-card-notice.tsx +33 -0
- package/src/components/proof-request/{group.tsx → v1/group.tsx} +1 -1
- package/src/components/proof-request/v1/index.ts +3 -0
- package/src/components/proof-request/{select-credential.tsx → v1/select-credential.tsx} +12 -5
- package/src/components/proof-request/{share-credential.tsx → v1/share-credential.tsx} +35 -52
- package/src/components/proof-request/v2/index.ts +3 -0
- package/src/components/proof-request/v2/select-credential-v2.tsx +59 -0
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +258 -0
- package/src/components/proof-request/v2/share-credential-v2.tsx +211 -0
- package/src/ui-components/buttons/share-button.tsx +1 -1
- package/src/ui-components/camera/qr-code-scanner.tsx +11 -2
- package/src/ui-components/credential/card/credential-details-list-item.tsx +27 -49
- package/src/ui-components/credential/credential-attribute-item.tsx +2 -0
- package/src/ui-components/credential/group/credential-group-header.tsx +70 -0
- package/src/ui-components/credential/group/index.ts +4 -0
- package/src/ui-components/credential/index.ts +1 -0
- package/src/ui-components/header/foldable-header.tsx +31 -16
- package/src/ui-components/index.ts +1 -0
- package/src/ui-components/loader/loading-result.tsx +1 -1
- package/src/ui-components/pin/pin-lock-animation.tsx +240 -278
- package/src/ui-components/proof-request/index.ts +4 -0
- package/src/ui-components/proof-request/proof-request-set.tsx +46 -0
- package/src/ui-components/screens/section-list-screen.tsx +18 -4
- package/src/utils/array.ts +4 -0
- package/src/utils/hooks/app-state.ts +29 -0
- package/src/utils/hooks/core/backup.ts +2 -5
- package/src/utils/hooks/core/credentials.ts +11 -4
- package/src/utils/hooks/core/identifiers.ts +15 -14
- package/src/utils/hooks/core/index.ts +2 -1
- package/src/utils/hooks/core/proofs.ts +36 -12
- package/src/utils/hooks/core/wallet-unit.ts +77 -0
- package/src/utils/hooks/index.ts +1 -0
- package/src/utils/hooks/revocation/credential-status.ts +1 -1
- package/src/utils/index.ts +2 -1
- package/src/utils/parsers/credential-sharing-v2.tsx +283 -0
- package/src/utils/parsers/credential-sharing.tsx +40 -16
- package/src/utils/parsers/credential.ts +129 -59
- package/src/utils/parsers/index.ts +1 -0
- package/src/utils/parsers/query.ts +6 -5
- package/src/utils/wallet-unit.ts +30 -0
- package/lib/commonjs/components/proof-request/group.js.map +0 -1
- package/lib/commonjs/components/proof-request/select-credential.js.map +0 -1
- package/lib/commonjs/components/proof-request/share-credential.js.map +0 -1
- package/lib/module/components/proof-request/group.js.map +0 -1
- package/lib/module/components/proof-request/select-credential.js.map +0 -1
- package/lib/module/components/proof-request/share-credential.js +0 -147
- package/lib/module/components/proof-request/share-credential.js.map +0 -1
- /package/lib/typescript/components/proof-request/{group.d.ts → v1/group.d.ts} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FunctionComponent, PropsWithChildren } from 'react';
|
|
2
|
+
export type ProofRequestSetProps = {
|
|
3
|
+
headerLabel?: string;
|
|
4
|
+
showHeader?: boolean;
|
|
5
|
+
showSeparator?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const ProofRequestSet: FunctionComponent<PropsWithChildren<ProofRequestSetProps>>;
|
|
@@ -6,8 +6,10 @@ export type SectionListScreenProps<ItemT, SectionT> = ViewProps & {
|
|
|
6
6
|
static?: boolean;
|
|
7
7
|
title: string;
|
|
8
8
|
};
|
|
9
|
-
list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'
|
|
9
|
+
list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'> & {
|
|
10
|
+
header?: React.ComponentType<any> | React.ReactElement;
|
|
11
|
+
};
|
|
10
12
|
modalPresentation?: boolean;
|
|
11
13
|
};
|
|
12
|
-
declare const SectionListScreen: <ItemT, SectionT>({ header, list: { contentContainerStyle, stickySectionHeadersEnabled, ...listProps }, modalPresentation, style, ...viewProps }: SectionListScreenProps<ItemT, SectionT>) => React.JSX.Element;
|
|
14
|
+
declare const SectionListScreen: <ItemT, SectionT>({ header, list: { contentContainerStyle, header: listHeader, stickySectionHeadersEnabled, ...listProps }, modalPresentation, style, ...viewProps }: SectionListScreenProps<ItemT, SectionT>) => React.JSX.Element;
|
|
13
15
|
export default SectionListScreen;
|
|
@@ -15,4 +15,4 @@ export declare const useRollbackImport: () => import("react-query").UseMutationR
|
|
|
15
15
|
* @param {IdentifiersInitializationConfig} config Select desired keys/dids to be restored/created
|
|
16
16
|
* @returns [hwIdentifierId, swIdentifierId]
|
|
17
17
|
*/
|
|
18
|
-
export declare const useBackupFinalizeImportProcedure: ({ generateHwKey, generateSwKey
|
|
18
|
+
export declare const useBackupFinalizeImportProcedure: ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => () => Promise<[string | null, string | undefined]>;
|
|
@@ -6,7 +6,7 @@ export declare const useCredentials: (queryParams?: Partial<CredentialListQuery>
|
|
|
6
6
|
export declare const usePagedCredentials: (queryParams?: Partial<CredentialListQuery>) => import("react-query").UseInfiniteQueryResult<import("@procivis/react-native-one-core").ItemList<import("@procivis/react-native-one-core").CredentialListItem>, unknown>;
|
|
7
7
|
export declare const useCredentialDetail: (credentialId: string | undefined, active?: boolean) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").CredentialDetail | undefined, unknown>;
|
|
8
8
|
export declare const useInvitationHandler: () => import("react-query").UseMutationResult<InvitationResult, unknown, Omit<HandleInvitationRequest, "organisationId">, unknown>;
|
|
9
|
-
export declare const useCredentialAccept: () => import("react-query").UseMutationResult<
|
|
9
|
+
export declare const useCredentialAccept: () => import("react-query").UseMutationResult<string, unknown, {
|
|
10
10
|
didId?: string | undefined;
|
|
11
11
|
identifierId?: string | undefined;
|
|
12
12
|
interactionId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IdentifierListQuery } from
|
|
1
|
+
import { IdentifierListQuery } from '@procivis/react-native-one-core';
|
|
2
2
|
export declare const IDENTIFIER_DETAIL_QUERY_KEY = "identifier-detail";
|
|
3
3
|
export declare const IDENTIFIER_LIST_QUERY_KEY = "identifier-list";
|
|
4
4
|
export declare const useIdentifierDetails: (identifierId: string | undefined) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").IdentifierDetail | undefined, unknown>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { CreateProofRequest, PresentationSubmitCredentialRequest, ProofListQuery, ProofStateEnum, ShareProofRequest } from '@procivis/react-native-one-core';
|
|
1
|
+
import { CreateProofRequest, HistoryErrorMetadata, PresentationSubmitCredentialRequest, ProofListQuery, ProofStateEnum, ProposeProofRequest, ShareProofRequest } from '@procivis/react-native-one-core';
|
|
2
2
|
import { Transport } from '../connectivity/connectivity';
|
|
3
3
|
export declare const PROOF_DETAIL_QUERY_KEY = "proof-detail";
|
|
4
4
|
export declare const PROOF_STATE_QUERY_KEY = "proof-state";
|
|
5
5
|
export declare const PROOF_LIST_QUERY_KEY = "proof-list";
|
|
6
6
|
export declare const useProofDetail: (proofId: string | undefined) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").ProofDetail | undefined, unknown>;
|
|
7
|
-
export declare const useProofState: (proofId: string | undefined, isPolling: boolean) => import("react-query").UseQueryResult<
|
|
7
|
+
export declare const useProofState: (proofId: string | undefined, isPolling: boolean) => import("react-query").UseQueryResult<{
|
|
8
|
+
state: ProofStateEnum;
|
|
9
|
+
metadata: HistoryErrorMetadata | undefined;
|
|
10
|
+
} | undefined, unknown>;
|
|
8
11
|
type ProofUrlHookParams = {
|
|
9
12
|
proofId: string;
|
|
10
13
|
request?: ShareProofRequest;
|
|
@@ -32,11 +35,7 @@ export declare enum VerificationEngagement {
|
|
|
32
35
|
QR_CODE = "QR_CODE",
|
|
33
36
|
NFC = "NFC"
|
|
34
37
|
}
|
|
35
|
-
export
|
|
36
|
-
exchange: VerificationProtocol;
|
|
37
|
-
engagement: VerificationEngagement[];
|
|
38
|
-
}
|
|
39
|
-
export declare const useProposeProof: () => import("react-query").UseMutationResult<import("@procivis/react-native-one-core").ProposeProofResponse, unknown, ProposeProofRequest, unknown>;
|
|
38
|
+
export declare const useProposeProof: () => import("react-query").UseMutationResult<import("@procivis/react-native-one-core").ProposeProofResponse, unknown, Omit<ProposeProofRequest, "organisationId">, unknown>;
|
|
40
39
|
export declare const useProofDelete: () => import("react-query").UseMutationResult<void, unknown, string, unknown>;
|
|
41
40
|
export declare const useProofs: (queryParams?: Partial<ProofListQuery>) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").ItemList<import("@procivis/react-native-one-core").ProofListItem>, unknown>;
|
|
42
41
|
export declare const useProofCreate: () => import("react-query").UseMutationResult<string, unknown, CreateProofRequest, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WalletProvider } from '@procivis/react-native-one-core';
|
|
2
|
+
export declare const ATTESTATION_QUERY_KEY = "wallet-unit-attestation";
|
|
3
|
+
export declare const useWalletUnitAttestation: (active?: boolean) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").HolderAttestationWalletUnitResponse, unknown>;
|
|
4
|
+
export declare const useRegisterWalletUnit: () => import("react-query").UseMutationResult<import("@procivis/react-native-one-core").HolderRegisterWalletUnitResponse, unknown, WalletProvider, unknown>;
|
|
5
|
+
export declare const useRefreshWalletUnit: () => import("react-query").UseMutationResult<void, unknown, boolean, unknown>;
|
|
6
|
+
export declare const useWalletUnitCheck: (appIntegrityCheckRequired: boolean) => {
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
walletUnitAttestation: import("@procivis/react-native-one-core").HolderAttestationWalletUnitResponse | undefined;
|
|
9
|
+
};
|
|
@@ -13,6 +13,7 @@ export * from './parsers';
|
|
|
13
13
|
export * from './ref';
|
|
14
14
|
export * from './reporting';
|
|
15
15
|
export * from './string';
|
|
16
|
+
export * from './url';
|
|
16
17
|
export * from './useMemoAsync';
|
|
17
18
|
export * from './uuid';
|
|
18
|
-
export * from './
|
|
19
|
+
export * from './wallet-unit';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Config, FailureHint, PresentationDefinitionV2CredentialClaim, PresentationDefinitionV2CredentialDetail } from '@procivis/react-native-one-core';
|
|
2
|
+
import { CredentialAttribute, CredentialCardNotice, CredentialCardProps } from '../../ui-components';
|
|
3
|
+
import { WUAState } from '../wallet-unit';
|
|
4
|
+
import { CredentialDetailsCardPropsWithoutWidth } from '.';
|
|
5
|
+
import { ShareCredentialCardLabels } from './credential-sharing';
|
|
6
|
+
export declare const shareCredentialCardAttributeFromV2Claim: (claim: PresentationDefinitionV2CredentialClaim, selection: string[] | undefined, parentShared: boolean, parentUserSelected: boolean, config: Config, testID: string, nested?: boolean, listValue?: boolean) => CredentialAttribute;
|
|
7
|
+
export declare const missingCredentialCardFromFailureHint: (failureHint: FailureHint['failureHint'] | undefined, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
8
|
+
export declare const shareCredentialCardFromV2PresentationCredential: (credential: PresentationDefinitionV2CredentialDetail | undefined, failureHint: FailureHint['failureHint'] | undefined, expanded: boolean, multipleCredentialsAvailable: boolean, selectedFields: string[] | undefined, config: Config, wuaState: WUAState | undefined, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
9
|
+
export declare const selectCredentialCardFromV2Credential: (credential: PresentationDefinitionV2CredentialDetail, selected: boolean, multiple: boolean, config: Config, wuaState: WUAState | undefined, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
10
|
+
export declare const getV2CredentialClaimAllSubpaths: (claim: PresentationDefinitionV2CredentialClaim) => string[];
|
|
11
|
+
export declare const getV2CredentialAvailablePaths: (credential: PresentationDefinitionV2CredentialDetail) => string[];
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
import { Claim, Config, CredentialDetail, PresentationDefinitionField, PresentationDefinitionRequestedCredential } from '@procivis/react-native-one-core';
|
|
2
2
|
import { CredentialAttribute, CredentialCardProps } from '../../ui-components/credential';
|
|
3
3
|
import { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';
|
|
4
|
+
import { WUAState } from '../wallet-unit';
|
|
4
5
|
import { CardLabels, CredentialDetailsCardPropsWithoutWidth } from './credential';
|
|
5
|
-
export declare const validityCheckedCardFromCredential: (credential: CredentialDetail, invalidLVVC: boolean, expanded: boolean, multipleCredentialsAvailable: boolean, config: Config, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID' | 'width'>;
|
|
6
|
+
export declare const validityCheckedCardFromCredential: (credential: CredentialDetail, invalidLVVC: boolean, expanded: boolean, multipleCredentialsAvailable: boolean, config: Config, wuaState: WUAState | undefined, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID' | 'width'>;
|
|
6
7
|
export declare const missingCredentialCardFromRequest: (request: PresentationDefinitionRequestedCredential, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
7
|
-
|
|
8
|
+
type FlatClaim = Claim & {
|
|
9
|
+
path: string;
|
|
10
|
+
isArrayElement?: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare const shareCredentialCardAttributeFromClaim: (id: string, config: Config, testID: string, labels: ShareCredentialCardLabels, claim?: FlatClaim, field?: PresentationDefinitionField) => CredentialAttribute;
|
|
8
13
|
export type ShareCredentialCardLabels = CardLabels & {
|
|
9
14
|
selectiveDisclosureNotice: string;
|
|
10
15
|
missingAttribute: string;
|
|
11
16
|
missingCredential: string;
|
|
12
17
|
multipleCredentials: string;
|
|
13
18
|
};
|
|
14
|
-
export declare const shareCredentialCardFromCredential: (credential: CredentialDetail | undefined, invalidLVVC: boolean, expanded: boolean, multipleCredentialsAvailable: boolean, request: PresentationDefinitionRequestedCredential, selectedFields: string[] | undefined, config: Config, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
15
|
-
export declare const selectCredentialCardAttributeFromClaim: (id: string, config: Config, testID: string, labels: ShareCredentialCardLabels, claim?:
|
|
16
|
-
export declare const selectCredentialCardFromCredential: (credential: CredentialDetail, selected: boolean, request: PresentationDefinitionRequestedCredential, config: Config, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
19
|
+
export declare const shareCredentialCardFromCredential: (credential: CredentialDetail | undefined, invalidLVVC: boolean, expanded: boolean, multipleCredentialsAvailable: boolean, request: PresentationDefinitionRequestedCredential, selectedFields: string[] | undefined, config: Config, wuaState: WUAState | undefined, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
20
|
+
export declare const selectCredentialCardAttributeFromClaim: (id: string, config: Config, testID: string, labels: ShareCredentialCardLabels, claim?: FlatClaim, field?: PresentationDefinitionField) => CredentialAttribute;
|
|
21
|
+
export declare const selectCredentialCardFromCredential: (credential: CredentialDetail, selected: boolean, request: PresentationDefinitionRequestedCredential, config: Config, wuaState: WUAState | undefined, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
22
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Claim, Config, CredentialDetail, CredentialListItem, CredentialSchema, DataTypeEnum } from '@procivis/react-native-one-core';
|
|
1
|
+
import { Claim, Config, CredentialDetail, CredentialListItem, CredentialSchema, DataTypeEnum, WalletStorageType } 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
|
+
import { WUAState } from '../wallet-unit';
|
|
4
5
|
export declare enum ValidityState {
|
|
5
6
|
Revoked = "revoked",
|
|
6
7
|
Suspended = "suspended",
|
|
@@ -36,18 +37,20 @@ export type CardHeaderLabels = {
|
|
|
36
37
|
revoked: string;
|
|
37
38
|
suspended: string;
|
|
38
39
|
suspendedUntil: (date: string) => string;
|
|
40
|
+
wuaExpired: string;
|
|
41
|
+
wuaRevoked: string;
|
|
39
42
|
};
|
|
40
|
-
export declare const cardHeaderFromCredential: (credential: CredentialDetail, claims: Claim[] | undefined, config: Config, testID: string, labels: CardHeaderLabels) => Omit<CredentialHeaderProps, 'style'>;
|
|
43
|
+
export declare const cardHeaderFromCredential: (credential: CredentialDetail, claims: Claim[] | undefined, config: Config, wuaState: WUAState | undefined, testID: string, labels: CardHeaderLabels) => Omit<CredentialHeaderProps, 'style'>;
|
|
41
44
|
export type CardLabels = CardHeaderLabels & {
|
|
42
45
|
validityIssuesNotice: string;
|
|
43
46
|
};
|
|
44
|
-
export declare const getCredentialCardPropsFromCredential: (credential: CredentialDetail, claims: Claim[] | undefined, config: Config, notice: CredentialCardNotice | undefined, testID: string, labels: CardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
47
|
+
export declare const getCredentialCardPropsFromCredential: (credential: CredentialDetail, claims: Claim[] | undefined, config: Config, wuaState: WUAState | undefined, notice: CredentialCardNotice | undefined, testID: string, labels: CardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
45
48
|
export declare const detailsCardAttributeFromClaim: (claim: Claim, config: Config, testID: string) => CredentialAttribute;
|
|
46
49
|
export type CredentialDetailsCardPropsWithoutWidth = Omit<CredentialDetailsCardProps, 'expanded' | 'card'> & {
|
|
47
50
|
card: Omit<CredentialCardProps, 'width'>;
|
|
48
51
|
};
|
|
49
|
-
export declare const detailsCardFromCredential: (credential: CredentialDetail, config: Config, testID: string, labels: CardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
50
|
-
export declare const detailsCardFromCredentialWithClaims: (credential: CredentialDetail, claims: Claim[], config: Config, testID: string, labels: CardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
52
|
+
export declare const detailsCardFromCredential: (credential: CredentialDetail, config: Config, wuaState: WUAState | undefined, testID: string, labels: CardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
53
|
+
export declare const detailsCardFromCredentialWithClaims: (credential: CredentialDetail, claims: Claim[], config: Config, wuaState: WUAState | undefined, testID: string, labels: CardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
51
54
|
export declare const nestAttributes: (attributes: CredentialAttribute[]) => CredentialAttribute[];
|
|
52
55
|
export declare function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchema): {
|
|
53
56
|
layoutProperties: {
|
|
@@ -71,7 +74,7 @@ export declare function getCredentialSchemaWithoutImages(credentialSchema: Crede
|
|
|
71
74
|
name: string;
|
|
72
75
|
format: string;
|
|
73
76
|
revocationMethod: string;
|
|
74
|
-
walletStorageType?:
|
|
77
|
+
walletStorageType?: WalletStorageType | undefined;
|
|
75
78
|
schemaId: string;
|
|
76
79
|
importedSourceUrl: string;
|
|
77
80
|
schemaType: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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").CredentialListQueryExactColumnEnum[] | import("@procivis/react-native-one-core").CredentialStateEnum[] | import("@procivis/react-native-one-core").CredentialListIncludeEntityType[] | import("@procivis/react-native-one-core").CredentialListSearchType[] | undefined)[];
|
|
2
|
+
export declare const getQueryKeyFromCredentialListQueryParams: (queryParams?: Partial<CredentialListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").CredentialListQueryExactColumnEnum[] | import("@procivis/react-native-one-core").CredentialRoleEnum[] | import("@procivis/react-native-one-core").CredentialStateEnum[] | import("@procivis/react-native-one-core").CredentialListIncludeEntityType[] | import("@procivis/react-native-one-core").CredentialListSearchType[] | undefined)[];
|
|
3
3
|
export declare const getQueryKeyFromHistoryListQueryParams: (queryParams?: Partial<HistoryListQuery>) => (string | number | import("@procivis/react-native-one-core").HistoryListSearch | import("@procivis/react-native-one-core").HistoryActionEnum[] | import("@procivis/react-native-one-core").HistoryEntityTypeEnum[] | undefined)[];
|
|
4
4
|
export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParams?: Partial<CredentialSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactCredentialSchemaFilterColumnEnum[] | import("@procivis/react-native-one-core").CredentialSchemaListIncludeEntityType[] | undefined)[];
|
|
5
5
|
export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofSchemaFilterColumnEnum[] | undefined)[];
|
|
6
6
|
export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ExactProofFilterColumnEnum[] | import("@procivis/react-native-one-core").ProofStateEnum[] | import("@procivis/react-native-one-core").ProofRoleEnum[] | undefined)[];
|
|
7
7
|
export declare const getQueryKeyFromDidListQueryParams: (queryParams?: Partial<DidListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").ExactDidFilterColumnEnum[] | import("@procivis/react-native-one-core").KeyRoleEnum[] | undefined)[];
|
|
8
|
-
export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<IdentifierListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").KeyRoleEnum[] | import("@procivis/react-native-one-core").ExactIdentifierFilterColumnEnum[] | import("@procivis/react-native-one-core").IdentifierTypeEnum[] | undefined)[];
|
|
8
|
+
export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<IdentifierListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").KeyRoleEnum[] | import("@procivis/react-native-one-core").ExactIdentifierFilterColumnEnum[] | import("@procivis/react-native-one-core").IdentifierStateEnum[] | import("@procivis/react-native-one-core").IdentifierTypeEnum[] | undefined)[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HolderAttestationWalletUnitResponse } from '@procivis/react-native-one-core';
|
|
2
|
+
export declare const isWalletAttestationExpired: (walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined) => boolean | "" | undefined;
|
|
3
|
+
export declare enum WUAState {
|
|
4
|
+
Revoked = "revoked",
|
|
5
|
+
Expired = "expired",
|
|
6
|
+
Valid = "valid"
|
|
7
|
+
}
|
|
8
|
+
export declare const walletUnitAttestationState: (walletUnitAttestation: HolderAttestationWalletUnitResponse | undefined) => WUAState | 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.86",
|
|
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",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@babel/runtime": "^7.25.0",
|
|
52
52
|
"@commitlint/config-conventional": "^11.0.0",
|
|
53
53
|
"@gorhom/bottom-sheet": "^5.1.2",
|
|
54
|
-
"@procivis/react-native-one-core": "1.
|
|
54
|
+
"@procivis/react-native-one-core": "1.67952.1",
|
|
55
55
|
"@procivis/react-native-picker": "5.0.3",
|
|
56
56
|
"@react-native-async-storage/async-storage": "^1.17.3",
|
|
57
57
|
"@react-native-community/blur": "^4.4.0",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"@types/react": "^18.2.6",
|
|
92
92
|
"@typescript-eslint/eslint-plugin": "^5.17.0",
|
|
93
93
|
"@typescript-eslint/parser": "^5.17.0",
|
|
94
|
-
"apisauce": "2.0
|
|
94
|
+
"apisauce": "3.2.0",
|
|
95
95
|
"babel-jest": "^29.6.3",
|
|
96
96
|
"babel-loader": "^8.2.4",
|
|
97
97
|
"babel-plugin-react-native-web": "^0.19.13",
|
|
@@ -140,14 +140,14 @@
|
|
|
140
140
|
"vite": "^6.2.2"
|
|
141
141
|
},
|
|
142
142
|
"peerDependencies": {
|
|
143
|
-
"@procivis/react-native-one-core": "^1.
|
|
143
|
+
"@procivis/react-native-one-core": "^1.67952.1",
|
|
144
144
|
"@procivis/react-native-picker": "*",
|
|
145
145
|
"@react-native-community/blur": "*",
|
|
146
146
|
"@react-native-community/netinfo": "^11.4.1",
|
|
147
147
|
"@react-native/normalize-color": "*",
|
|
148
148
|
"@react-navigation/native": "*",
|
|
149
149
|
"@sentry/react-native": "^5.24.1",
|
|
150
|
-
"apisauce": "2.0
|
|
150
|
+
"apisauce": "3.2.0",
|
|
151
151
|
"lodash": "^4.17.21",
|
|
152
152
|
"lottie-react-native": "^7.2.2",
|
|
153
153
|
"moment": "^2.29.4",
|
|
@@ -259,7 +259,13 @@
|
|
|
259
259
|
"import/newline-after-import": "warn",
|
|
260
260
|
"import/no-duplicates": "warn",
|
|
261
261
|
"import/no-absolute-path": "warn",
|
|
262
|
-
"no-console": "error"
|
|
262
|
+
"no-console": "error",
|
|
263
|
+
"no-void": [
|
|
264
|
+
"error",
|
|
265
|
+
{
|
|
266
|
+
"allowAsStatement": true
|
|
267
|
+
}
|
|
268
|
+
]
|
|
263
269
|
}
|
|
264
270
|
},
|
|
265
271
|
"eslintIgnore": [
|
|
@@ -6,7 +6,9 @@ import { CredentialDetailsCardListItem, CredentialHeaderProps } from '../../ui-c
|
|
|
6
6
|
import { concatTestID } from '../../utils';
|
|
7
7
|
import { useCoreConfig } from '../../utils/hooks/core/core-config';
|
|
8
8
|
import { useCredentialDetail } from '../../utils/hooks/core/credentials';
|
|
9
|
+
import { useWalletUnitAttestation } from '../../utils/hooks/core/wallet-unit';
|
|
9
10
|
import { CardLabels, detailsCardFromCredentialWithClaims } from '../../utils/parsers/credential';
|
|
11
|
+
import { walletUnitAttestationState } from '../../utils/wallet-unit';
|
|
10
12
|
|
|
11
13
|
export interface CredentialDetailsProps {
|
|
12
14
|
claims?: Claim[];
|
|
@@ -31,9 +33,10 @@ export const CredentialDetails: FC<CredentialDetailsProps> = ({
|
|
|
31
33
|
}) => {
|
|
32
34
|
const { data: credential } = useCredentialDetail(credentialId);
|
|
33
35
|
const { data: config } = useCoreConfig();
|
|
36
|
+
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
34
37
|
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
35
38
|
|
|
36
|
-
if (!credential || !config) {
|
|
39
|
+
if (!credential || !config || isLoadingWUA) {
|
|
37
40
|
return null;
|
|
38
41
|
}
|
|
39
42
|
const testID = concatTestID('Credential.credential', credential.id);
|
|
@@ -42,6 +45,7 @@ export const CredentialDetails: FC<CredentialDetailsProps> = ({
|
|
|
42
45
|
credential,
|
|
43
46
|
claims ?? credential.claims,
|
|
44
47
|
config,
|
|
48
|
+
walletUnitAttestationState(walletUnitAttestation),
|
|
45
49
|
testID,
|
|
46
50
|
labels,
|
|
47
51
|
);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
1
|
+
export * from './select-share-credential-card-notice';
|
|
2
|
+
export * from './share-credential-card-notice';
|
|
3
|
+
export * from './v1';
|
|
4
|
+
export * from './v2';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { StyleSheet } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Button, ButtonType } from '../../ui-components';
|
|
5
|
+
import { concatTestID } from '../../utils';
|
|
6
|
+
import { ShareCredentialCardNotice, ShareCredentialCardNoticeProps } from './share-credential-card-notice';
|
|
7
|
+
|
|
8
|
+
export type SelectShareCredentialCardNoticeProps = ShareCredentialCardNoticeProps & {
|
|
9
|
+
buttonTitle: string;
|
|
10
|
+
onPress?: () => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const SelectShareCredentialCardNotice: FC<SelectShareCredentialCardNoticeProps> = ({
|
|
14
|
+
buttonTitle,
|
|
15
|
+
onPress,
|
|
16
|
+
testID,
|
|
17
|
+
text,
|
|
18
|
+
}) => {
|
|
19
|
+
return (
|
|
20
|
+
<ShareCredentialCardNotice testID={testID} text={text}>
|
|
21
|
+
<Button
|
|
22
|
+
onPress={onPress}
|
|
23
|
+
style={styles.noticeButton}
|
|
24
|
+
testID={concatTestID(testID, 'button')}
|
|
25
|
+
title={buttonTitle}
|
|
26
|
+
type={ButtonType.Secondary}
|
|
27
|
+
/>
|
|
28
|
+
</ShareCredentialCardNotice>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const styles = StyleSheet.create({
|
|
33
|
+
noticeButton: {
|
|
34
|
+
marginTop: 24,
|
|
35
|
+
paddingVertical: 11,
|
|
36
|
+
},
|
|
37
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { FC, PropsWithChildren } from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { Typography,useAppColorScheme } from '../../ui-components';
|
|
5
|
+
|
|
6
|
+
export type ShareCredentialCardNoticeProps = {
|
|
7
|
+
testID: string;
|
|
8
|
+
text: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const ShareCredentialCardNotice: FC<PropsWithChildren<ShareCredentialCardNoticeProps>> = ({
|
|
12
|
+
children,
|
|
13
|
+
testID,
|
|
14
|
+
text,
|
|
15
|
+
}) => {
|
|
16
|
+
const colorScheme = useAppColorScheme();
|
|
17
|
+
return (
|
|
18
|
+
<View style={[styles.notice, { backgroundColor: colorScheme.background }]} testID={testID}>
|
|
19
|
+
<Typography align="center" color={colorScheme.text} preset="s/line-height-capped">
|
|
20
|
+
{text}
|
|
21
|
+
</Typography>
|
|
22
|
+
{children}
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const styles = StyleSheet.create({
|
|
28
|
+
notice: {
|
|
29
|
+
marginBottom: 22,
|
|
30
|
+
marginHorizontal: 12,
|
|
31
|
+
padding: 12,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { FunctionComponent, PropsWithChildren } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
|
|
4
|
-
import { useAppColorScheme } from '
|
|
4
|
+
import { useAppColorScheme } from '../../../ui-components/theme';
|
|
5
5
|
|
|
6
6
|
export const ProofRequestGroup: FunctionComponent<PropsWithChildren> = ({ children }) => {
|
|
7
7
|
const colorScheme = useAppColorScheme();
|
|
@@ -2,10 +2,15 @@ import { PresentationDefinitionRequestedCredential } from '@procivis/react-nativ
|
|
|
2
2
|
import React, { FC, useMemo } from 'react';
|
|
3
3
|
import { Dimensions, ImageSourcePropType } from 'react-native';
|
|
4
4
|
|
|
5
|
-
import { CredentialDetailsCardListItem } from '
|
|
6
|
-
import { useCoreConfig } from '
|
|
7
|
-
import { useCredentialDetail } from '
|
|
8
|
-
import {
|
|
5
|
+
import { CredentialDetailsCardListItem } from '../../../ui-components';
|
|
6
|
+
import { useCoreConfig } from '../../../utils/hooks/core/core-config';
|
|
7
|
+
import { useCredentialDetail } from '../../../utils/hooks/core/credentials';
|
|
8
|
+
import { useWalletUnitAttestation } from '../../../utils/hooks/core/wallet-unit';
|
|
9
|
+
import {
|
|
10
|
+
selectCredentialCardFromCredential,
|
|
11
|
+
ShareCredentialCardLabels,
|
|
12
|
+
} from '../../../utils/parsers/credential-sharing';
|
|
13
|
+
import { walletUnitAttestationState } from '../../../utils/wallet-unit';
|
|
9
14
|
|
|
10
15
|
export const SelectCredential: FC<{
|
|
11
16
|
credentialId: string;
|
|
@@ -19,9 +24,10 @@ export const SelectCredential: FC<{
|
|
|
19
24
|
}> = ({ credentialId, labels, lastItem, onImagePreview, onPress, request, selected, testID }) => {
|
|
20
25
|
const { data: credential } = useCredentialDetail(credentialId);
|
|
21
26
|
const { data: config } = useCoreConfig();
|
|
27
|
+
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
22
28
|
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
23
29
|
|
|
24
|
-
if (!credential || !config) {
|
|
30
|
+
if (!credential || !config || isLoadingWUA) {
|
|
25
31
|
return null;
|
|
26
32
|
}
|
|
27
33
|
|
|
@@ -30,6 +36,7 @@ export const SelectCredential: FC<{
|
|
|
30
36
|
selected,
|
|
31
37
|
request,
|
|
32
38
|
config,
|
|
39
|
+
walletUnitAttestationState(walletUnitAttestation),
|
|
33
40
|
testID,
|
|
34
41
|
labels,
|
|
35
42
|
);
|
|
@@ -6,13 +6,20 @@ import {
|
|
|
6
6
|
PresentationDefinitionRequestedCredential,
|
|
7
7
|
} from '@procivis/react-native-one-core';
|
|
8
8
|
import React, { FunctionComponent, useMemo } from 'react';
|
|
9
|
-
import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet,
|
|
9
|
+
import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { concatTestID } from '
|
|
13
|
-
import { useCoreConfig } from '
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
11
|
+
import { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';
|
|
12
|
+
import { concatTestID } from '../../../utils';
|
|
13
|
+
import { useCoreConfig } from '../../../utils/hooks/core/core-config';
|
|
14
|
+
import { useWalletUnitAttestation } from '../../../utils/hooks/core/wallet-unit';
|
|
15
|
+
import { getValidityState, ValidityState } from '../../../utils/parsers/credential';
|
|
16
|
+
import {
|
|
17
|
+
shareCredentialCardFromCredential,
|
|
18
|
+
ShareCredentialCardLabels,
|
|
19
|
+
} from '../../../utils/parsers/credential-sharing';
|
|
20
|
+
import { walletUnitAttestationState } from '../../../utils/wallet-unit';
|
|
21
|
+
import { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';
|
|
22
|
+
import { ShareCredentialCardNotice } from '../share-credential-card-notice';
|
|
16
23
|
|
|
17
24
|
export type ShareCredentialLabels = ShareCredentialCardLabels & {
|
|
18
25
|
invalidCredentialNotice: string;
|
|
@@ -54,6 +61,7 @@ export const ShareCredential: FunctionComponent<{
|
|
|
54
61
|
const colorScheme = useAppColorScheme();
|
|
55
62
|
const credential = allCredentials.find((c) => c.id === selectedCredentialId);
|
|
56
63
|
const { data: config } = useCoreConfig();
|
|
64
|
+
const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
|
|
57
65
|
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
58
66
|
|
|
59
67
|
const selectionOptions = useMemo(
|
|
@@ -87,60 +95,43 @@ export const ShareCredential: FunctionComponent<{
|
|
|
87
95
|
}
|
|
88
96
|
if (validityState === ValidityState.Revoked) {
|
|
89
97
|
return (
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{labels.revokedCredentialNotice}
|
|
95
|
-
</Typography>
|
|
96
|
-
</View>
|
|
98
|
+
<ShareCredentialCardNotice
|
|
99
|
+
testID={concatTestID(testID, 'notice.revoked')}
|
|
100
|
+
text={labels.revokedCredentialNotice}
|
|
101
|
+
/>
|
|
97
102
|
);
|
|
98
103
|
}
|
|
99
104
|
if (validityState === ValidityState.Suspended) {
|
|
100
105
|
return (
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{labels.suspendedCredentialNotice}
|
|
106
|
-
</Typography>
|
|
107
|
-
</View>
|
|
106
|
+
<ShareCredentialCardNotice
|
|
107
|
+
testID={concatTestID(testID, 'notice.suspended')}
|
|
108
|
+
text={labels.suspendedCredentialNotice}
|
|
109
|
+
/>
|
|
108
110
|
);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
if (invalid) {
|
|
112
114
|
return (
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{labels.invalidCredentialNotice}
|
|
118
|
-
</Typography>
|
|
119
|
-
</View>
|
|
115
|
+
<ShareCredentialCardNotice
|
|
116
|
+
testID={concatTestID(testID, 'notice.invalid')}
|
|
117
|
+
text={labels.invalidCredentialNotice}
|
|
118
|
+
/>
|
|
120
119
|
);
|
|
121
120
|
}
|
|
122
121
|
|
|
123
122
|
if (multipleCredentialsAvailable) {
|
|
124
123
|
return (
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
<Button
|
|
132
|
-
onPress={onSelectCredential}
|
|
133
|
-
style={styles.noticeButton}
|
|
134
|
-
testID={concatTestID(testID, 'notice.multiple.button')}
|
|
135
|
-
title={labels.multipleCredentialsSelect}
|
|
136
|
-
type={ButtonType.Secondary}
|
|
137
|
-
/>
|
|
138
|
-
</View>
|
|
124
|
+
<SelectShareCredentialCardNotice
|
|
125
|
+
buttonTitle={labels.multipleCredentialsSelect}
|
|
126
|
+
onPress={onSelectCredential}
|
|
127
|
+
testID={concatTestID(testID, 'notice.multiple')}
|
|
128
|
+
text={labels.multipleCredentialsNotice}
|
|
129
|
+
/>
|
|
139
130
|
);
|
|
140
131
|
}
|
|
141
|
-
}, [
|
|
132
|
+
}, [expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);
|
|
142
133
|
|
|
143
|
-
if (!config) {
|
|
134
|
+
if (!config || isLoadingWUA) {
|
|
144
135
|
return null;
|
|
145
136
|
}
|
|
146
137
|
|
|
@@ -152,6 +143,7 @@ export const ShareCredential: FunctionComponent<{
|
|
|
152
143
|
request,
|
|
153
144
|
selectedFields,
|
|
154
145
|
config,
|
|
146
|
+
walletUnitAttestationState(walletUnitAttestation),
|
|
155
147
|
testID,
|
|
156
148
|
labels,
|
|
157
149
|
);
|
|
@@ -182,13 +174,4 @@ const styles = StyleSheet.create({
|
|
|
182
174
|
borderWidth: 1,
|
|
183
175
|
marginBottom: 8,
|
|
184
176
|
},
|
|
185
|
-
notice: {
|
|
186
|
-
marginBottom: 22,
|
|
187
|
-
marginHorizontal: 12,
|
|
188
|
-
padding: 12,
|
|
189
|
-
},
|
|
190
|
-
noticeButton: {
|
|
191
|
-
marginTop: 24,
|
|
192
|
-
paddingVertical: 11,
|
|
193
|
-
},
|
|
194
177
|
});
|