@procivis/one-react-native-components 0.3.71 → 0.3.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/entity/entity-attributes.js +3 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.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} +4 -4
- 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} +25 -60
- 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 +51 -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 +131 -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/cache.js +4 -1
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +11 -10
- 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 +41 -15
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +76 -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 +12 -12
- 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 +25 -12
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +89 -57
- 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/module/components/entity/entity-attributes.js +3 -1
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +2 -1
- package/lib/module/components/entity/entity-details-with-buttons.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} +4 -4
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -0
- package/lib/module/components/proof-request/{share-credential.js → v1/share-credential.js} +26 -61
- 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 +42 -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 +122 -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/cache.js +4 -1
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +12 -11
- 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 +42 -16
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +66 -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 +1 -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 +25 -12
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +89 -57
- 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/typescript/components/entity/entity-attributes.d.ts +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 +2 -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 -10
- 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 +1 -1
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +10 -0
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +7 -2
- package/lib/typescript/utils/parsers/credential.d.ts +1 -2
- package/lib/typescript/utils/parsers/index.d.ts +1 -0
- package/lib/typescript/utils/parsers/query.d.ts +2 -2
- package/package.json +13 -7
- package/src/components/entity/entity-attributes.tsx +3 -0
- package/src/components/entity/entity-details-with-buttons.tsx +1 -0
- 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} +7 -4
- package/src/components/proof-request/{share-credential.tsx → v1/share-credential.tsx} +30 -51
- package/src/components/proof-request/v2/index.ts +3 -0
- package/src/components/proof-request/v2/select-credential-v2.tsx +52 -0
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +258 -0
- package/src/components/proof-request/v2/share-credential-v2.tsx +202 -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/cache.ts +3 -0
- package/src/utils/hooks/core/credentials.ts +14 -6
- 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 +40 -22
- package/src/utils/hooks/core/wallet-unit.ts +71 -0
- package/src/utils/hooks/index.ts +1 -0
- package/src/utils/hooks/revocation/credential-status.ts +1 -1
- package/src/utils/index.ts +1 -1
- package/src/utils/parsers/credential-sharing-v2.tsx +278 -0
- package/src/utils/parsers/credential-sharing.tsx +63 -40
- package/src/utils/parsers/credential.ts +100 -57
- package/src/utils/parsers/index.ts +1 -0
- package/src/utils/parsers/query.ts +6 -5
- 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.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,12 +6,13 @@ 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;
|
|
13
13
|
keyId?: string | undefined;
|
|
14
14
|
txCode?: string | undefined;
|
|
15
|
+
holderWalletUnitId?: string | undefined;
|
|
15
16
|
}, unknown>;
|
|
16
17
|
export declare const useCredentialReject: () => import("react-query").UseMutationResult<void, unknown, string, unknown>;
|
|
17
18
|
export declare const useCredentialRevocationCheck: (forceRefresh: boolean) => import("react-query").UseMutationResult<import("@procivis/react-native-one-core").CredentialRevocationCheckResponse[], unknown, string[], unknown>;
|
|
@@ -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;
|
|
@@ -12,10 +15,7 @@ type ProofUrlHookParams = {
|
|
|
12
15
|
export declare const useProofUrl: () => import("react-query").UseMutationResult<string, unknown, ProofUrlHookParams, unknown>;
|
|
13
16
|
export declare const useProofAccept: () => import("react-query").UseMutationResult<void, unknown, {
|
|
14
17
|
credentials: Record<string, PresentationSubmitCredentialRequest>;
|
|
15
|
-
didId?: string | undefined;
|
|
16
|
-
identifierId?: string | undefined;
|
|
17
18
|
interactionId: string;
|
|
18
|
-
keyId?: string | undefined;
|
|
19
19
|
}, unknown>;
|
|
20
20
|
export declare const useProofReject: () => import("react-query").UseMutationResult<void, unknown, string, unknown>;
|
|
21
21
|
export declare enum IssuanceProtocol {
|
|
@@ -32,11 +32,7 @@ export declare enum VerificationEngagement {
|
|
|
32
32
|
QR_CODE = "QR_CODE",
|
|
33
33
|
NFC = "NFC"
|
|
34
34
|
}
|
|
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>;
|
|
35
|
+
export declare const useProposeProof: () => import("react-query").UseMutationResult<import("@procivis/react-native-one-core").ProposeProofResponse, unknown, Omit<ProposeProofRequest, "organisationId">, unknown>;
|
|
40
36
|
export declare const useProofDelete: () => import("react-query").UseMutationResult<void, unknown, string, unknown>;
|
|
41
37
|
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
38
|
export declare const useProofCreate: () => import("react-query").UseMutationResult<string, unknown, CreateProofRequest, unknown>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HolderWalletUnitDetail, WalletProvider } from '@procivis/react-native-one-core';
|
|
2
|
+
export declare const WALLET_UNIT_QUERY_KEY = "wallet-unit";
|
|
3
|
+
export declare const useWalletUnitDetail: (walletUnitId: HolderWalletUnitDetail['id'] | undefined, active?: boolean) => import("react-query").UseQueryResult<HolderWalletUnitDetail | undefined, unknown>;
|
|
4
|
+
export declare const useRegisterWalletUnit: () => import("react-query").UseMutationResult<string, unknown, WalletProvider, unknown>;
|
|
5
|
+
export declare const useWalletUnitStatus: () => import("react-query").UseMutationResult<void, unknown, string, unknown>;
|
|
6
|
+
export declare const useWalletUnitCheck: (walletUnitId: HolderWalletUnitDetail['id'] | undefined) => {
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
walletUnitDetail: HolderWalletUnitDetail | undefined;
|
|
9
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Config, FailureHint, PresentationDefinitionV2CredentialClaim, PresentationDefinitionV2CredentialDetail } from '@procivis/react-native-one-core';
|
|
2
|
+
import { CredentialAttribute, CredentialCardNotice, CredentialCardProps } from '../../ui-components';
|
|
3
|
+
import { CredentialDetailsCardPropsWithoutWidth } from '.';
|
|
4
|
+
import { ShareCredentialCardLabels } from './credential-sharing';
|
|
5
|
+
export declare const shareCredentialCardAttributeFromV2Claim: (claim: PresentationDefinitionV2CredentialClaim, selection: string[] | undefined, parentShared: boolean, parentUserSelected: boolean, config: Config, testID: string, nested?: boolean, listValue?: boolean) => CredentialAttribute;
|
|
6
|
+
export declare const missingCredentialCardFromFailureHint: (failureHint: FailureHint['failureHint'] | undefined, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
7
|
+
export declare const shareCredentialCardFromV2PresentationCredential: (credential: PresentationDefinitionV2CredentialDetail | undefined, failureHint: FailureHint['failureHint'] | undefined, expanded: boolean, multipleCredentialsAvailable: boolean, selectedFields: string[] | undefined, config: Config, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
8
|
+
export declare const selectCredentialCardFromV2Credential: (credential: PresentationDefinitionV2CredentialDetail, selected: boolean, multiple: boolean, config: Config, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
9
|
+
export declare const getV2CredentialClaimAllSubpaths: (claim: PresentationDefinitionV2CredentialClaim) => string[];
|
|
10
|
+
export declare const getV2CredentialAvailablePaths: (credential: PresentationDefinitionV2CredentialDetail) => string[];
|
|
@@ -4,7 +4,11 @@ import { CredentialCardNotice } from '../../ui-components/credential/card/creden
|
|
|
4
4
|
import { CardLabels, CredentialDetailsCardPropsWithoutWidth } from './credential';
|
|
5
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
6
|
export declare const missingCredentialCardFromRequest: (request: PresentationDefinitionRequestedCredential, notice: CredentialCardNotice | undefined, testID: string, labels: ShareCredentialCardLabels) => Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'width'>;
|
|
7
|
-
|
|
7
|
+
type FlatClaim = Claim & {
|
|
8
|
+
path: string;
|
|
9
|
+
isArrayElement?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const shareCredentialCardAttributeFromClaim: (id: string, config: Config, testID: string, labels: ShareCredentialCardLabels, claim?: FlatClaim, field?: PresentationDefinitionField) => CredentialAttribute;
|
|
8
12
|
export type ShareCredentialCardLabels = CardLabels & {
|
|
9
13
|
selectiveDisclosureNotice: string;
|
|
10
14
|
missingAttribute: string;
|
|
@@ -12,5 +16,6 @@ export type ShareCredentialCardLabels = CardLabels & {
|
|
|
12
16
|
multipleCredentials: string;
|
|
13
17
|
};
|
|
14
18
|
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?:
|
|
19
|
+
export declare const selectCredentialCardAttributeFromClaim: (id: string, config: Config, testID: string, labels: ShareCredentialCardLabels, claim?: FlatClaim, field?: PresentationDefinitionField) => CredentialAttribute;
|
|
16
20
|
export declare const selectCredentialCardFromCredential: (credential: CredentialDetail, selected: boolean, request: PresentationDefinitionRequestedCredential, config: Config, testID: string, labels: ShareCredentialCardLabels) => CredentialDetailsCardPropsWithoutWidth;
|
|
21
|
+
export {};
|
|
@@ -71,9 +71,8 @@ export declare function getCredentialSchemaWithoutImages(credentialSchema: Crede
|
|
|
71
71
|
name: string;
|
|
72
72
|
format: string;
|
|
73
73
|
revocationMethod: string;
|
|
74
|
-
|
|
74
|
+
keyStorageSecurity?: import("@procivis/react-native-one-core").KeyStorageSecurity | undefined;
|
|
75
75
|
schemaId: string;
|
|
76
76
|
importedSourceUrl: string;
|
|
77
|
-
schemaType: string;
|
|
78
77
|
layoutType?: import("@procivis/react-native-one-core").LayoutType | undefined;
|
|
79
78
|
};
|
|
@@ -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)[];
|
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.91",
|
|
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.72811.0",
|
|
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.72811.0",
|
|
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": [
|
|
@@ -287,4 +293,4 @@
|
|
|
287
293
|
"react-native-web": "patches/react-native-web.patch"
|
|
288
294
|
}
|
|
289
295
|
}
|
|
290
|
-
}
|
|
296
|
+
}
|
|
@@ -14,6 +14,7 @@ interface EntityAttributesProps {
|
|
|
14
14
|
labels: AttributesLabels;
|
|
15
15
|
onCopyToClipboard: (value: string) => void;
|
|
16
16
|
entityType: EntityType;
|
|
17
|
+
testID?: string;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
@@ -23,6 +24,7 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
|
23
24
|
trusted,
|
|
24
25
|
labels,
|
|
25
26
|
entityType,
|
|
27
|
+
testID,
|
|
26
28
|
onCopyToClipboard,
|
|
27
29
|
}) => {
|
|
28
30
|
const didSections = did?.split(':') ?? [];
|
|
@@ -62,6 +64,7 @@ const EntityAttributes: FC<EntityAttributesProps> = ({
|
|
|
62
64
|
{...attribute}
|
|
63
65
|
labels={labels}
|
|
64
66
|
onCopyToClipboard={onCopyToClipboard}
|
|
67
|
+
testID={testID}
|
|
65
68
|
/>
|
|
66
69
|
))}
|
|
67
70
|
</View>
|
|
@@ -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,13 @@ 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 {
|
|
9
|
+
selectCredentialCardFromCredential,
|
|
10
|
+
ShareCredentialCardLabels,
|
|
11
|
+
} from '../../../utils/parsers/credential-sharing';
|
|
9
12
|
|
|
10
13
|
export const SelectCredential: FC<{
|
|
11
14
|
credentialId: string;
|
|
@@ -6,13 +6,18 @@ 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 { getValidityState, ValidityState } from '
|
|
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 { getValidityState, ValidityState } from '../../../utils/parsers/credential';
|
|
15
|
+
import {
|
|
16
|
+
shareCredentialCardFromCredential,
|
|
17
|
+
ShareCredentialCardLabels,
|
|
18
|
+
} from '../../../utils/parsers/credential-sharing';
|
|
19
|
+
import { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';
|
|
20
|
+
import { ShareCredentialCardNotice } from '../share-credential-card-notice';
|
|
16
21
|
|
|
17
22
|
export type ShareCredentialLabels = ShareCredentialCardLabels & {
|
|
18
23
|
invalidCredentialNotice: string;
|
|
@@ -87,58 +92,41 @@ export const ShareCredential: FunctionComponent<{
|
|
|
87
92
|
}
|
|
88
93
|
if (validityState === ValidityState.Revoked) {
|
|
89
94
|
return (
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{labels.revokedCredentialNotice}
|
|
95
|
-
</Typography>
|
|
96
|
-
</View>
|
|
95
|
+
<ShareCredentialCardNotice
|
|
96
|
+
testID={concatTestID(testID, 'notice.revoked')}
|
|
97
|
+
text={labels.revokedCredentialNotice}
|
|
98
|
+
/>
|
|
97
99
|
);
|
|
98
100
|
}
|
|
99
101
|
if (validityState === ValidityState.Suspended) {
|
|
100
102
|
return (
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
{labels.suspendedCredentialNotice}
|
|
106
|
-
</Typography>
|
|
107
|
-
</View>
|
|
103
|
+
<ShareCredentialCardNotice
|
|
104
|
+
testID={concatTestID(testID, 'notice.suspended')}
|
|
105
|
+
text={labels.suspendedCredentialNotice}
|
|
106
|
+
/>
|
|
108
107
|
);
|
|
109
108
|
}
|
|
110
109
|
|
|
111
110
|
if (invalid) {
|
|
112
111
|
return (
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
{labels.invalidCredentialNotice}
|
|
118
|
-
</Typography>
|
|
119
|
-
</View>
|
|
112
|
+
<ShareCredentialCardNotice
|
|
113
|
+
testID={concatTestID(testID, 'notice.invalid')}
|
|
114
|
+
text={labels.invalidCredentialNotice}
|
|
115
|
+
/>
|
|
120
116
|
);
|
|
121
117
|
}
|
|
122
118
|
|
|
123
119
|
if (multipleCredentialsAvailable) {
|
|
124
120
|
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>
|
|
121
|
+
<SelectShareCredentialCardNotice
|
|
122
|
+
buttonTitle={labels.multipleCredentialsSelect}
|
|
123
|
+
onPress={onSelectCredential}
|
|
124
|
+
testID={concatTestID(testID, 'notice.multiple')}
|
|
125
|
+
text={labels.multipleCredentialsNotice}
|
|
126
|
+
/>
|
|
139
127
|
);
|
|
140
128
|
}
|
|
141
|
-
}, [
|
|
129
|
+
}, [expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);
|
|
142
130
|
|
|
143
131
|
if (!config) {
|
|
144
132
|
return null;
|
|
@@ -182,13 +170,4 @@ const styles = StyleSheet.create({
|
|
|
182
170
|
borderWidth: 1,
|
|
183
171
|
marginBottom: 8,
|
|
184
172
|
},
|
|
185
|
-
notice: {
|
|
186
|
-
marginBottom: 22,
|
|
187
|
-
marginHorizontal: 12,
|
|
188
|
-
padding: 12,
|
|
189
|
-
},
|
|
190
|
-
noticeButton: {
|
|
191
|
-
marginTop: 24,
|
|
192
|
-
paddingVertical: 11,
|
|
193
|
-
},
|
|
194
173
|
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CredentialListItem, PresentationDefinitionV2CredentialDetail } from '@procivis/react-native-one-core';
|
|
2
|
+
import React, { FC, useCallback, useMemo } from 'react';
|
|
3
|
+
import { Dimensions, ImageSourcePropType } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { CredentialDetailsCardListItem } from '../../../ui-components';
|
|
6
|
+
import { ShareCredentialCardLabels, useCoreConfig } from '../../../utils';
|
|
7
|
+
import { selectCredentialCardFromV2Credential } from '../../../utils/parsers/credential-sharing-v2';
|
|
8
|
+
|
|
9
|
+
export const SelectCredentialV2: FC<{
|
|
10
|
+
credential: PresentationDefinitionV2CredentialDetail;
|
|
11
|
+
labels: ShareCredentialCardLabels;
|
|
12
|
+
lastItem: boolean;
|
|
13
|
+
multiple: boolean;
|
|
14
|
+
onImagePreview: (title: string, image: ImageSourcePropType) => void;
|
|
15
|
+
onSelected?: (credentialId: CredentialListItem['id'], selected: boolean) => void;
|
|
16
|
+
selected: boolean;
|
|
17
|
+
testID: string;
|
|
18
|
+
}> = ({ credential, labels, lastItem, multiple, onImagePreview, onSelected, selected, testID }) => {
|
|
19
|
+
const { data: config } = useCoreConfig();
|
|
20
|
+
const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
|
|
21
|
+
|
|
22
|
+
const onHeaderPress = useCallback(() => {
|
|
23
|
+
onSelected?.(credential.id, !selected);
|
|
24
|
+
}, [credential.id, onSelected, selected]);
|
|
25
|
+
|
|
26
|
+
if (!credential || !config) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const { card, attributes } = selectCredentialCardFromV2Credential(
|
|
31
|
+
credential,
|
|
32
|
+
selected,
|
|
33
|
+
multiple,
|
|
34
|
+
config,
|
|
35
|
+
testID,
|
|
36
|
+
labels,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<CredentialDetailsCardListItem
|
|
41
|
+
attributes={attributes}
|
|
42
|
+
card={{
|
|
43
|
+
...card,
|
|
44
|
+
onHeaderPress,
|
|
45
|
+
width: cardWidth,
|
|
46
|
+
}}
|
|
47
|
+
expanded={selected}
|
|
48
|
+
lastItem={lastItem}
|
|
49
|
+
onImagePreview={onImagePreview}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|