@procivis/one-react-native-components 0.3.115 → 0.3.130
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 +2 -1
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +3 -3
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js +2 -8
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js +1 -1
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/index.js +11 -11
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js +2 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +2 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +3 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +4 -2
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/components/trust-info/index.js +29 -0
- package/lib/commonjs/components/trust-info/index.js.map +1 -0
- package/lib/commonjs/components/trust-info/trust-info.js +79 -0
- package/lib/commonjs/components/trust-info/trust-info.js.map +1 -0
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +3 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/header/header.js +2 -0
- package/lib/commonjs/ui-components/header/header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +2 -2
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/icons/contact.js +45 -0
- package/lib/commonjs/ui-components/icons/contact.js.map +1 -0
- package/lib/commonjs/ui-components/icons/credential.js +3 -3
- package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +20 -1
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/icons/index.js +11 -0
- package/lib/commonjs/ui-components/icons/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +2 -0
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/screens/index.js +7 -0
- package/lib/commonjs/ui-components/screens/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +28 -24
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/trust-info-details-screen.js +384 -0
- package/lib/commonjs/ui-components/screens/trust-info-details-screen.js.map +1 -0
- package/lib/commonjs/utils/date.js +4 -5
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +8 -4
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-config.js +1 -6
- package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-context.js +0 -15
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +40 -1
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +0 -11
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +12 -1
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-list.js +19 -3
- package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/verifier-instance.js +22 -3
- package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +2 -2
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +14 -14
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +20 -18
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +36 -22
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/translations.js +15 -0
- package/lib/commonjs/utils/translations.js.map +1 -0
- package/lib/module/components/credential/credential.js +2 -1
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +3 -3
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-item.js +3 -9
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js +1 -1
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/index.js +1 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/proof-request/v1/select-credential.js +2 -1
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -1
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js +2 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +3 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2.js +4 -2
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/components/trust-info/index.js +4 -0
- package/lib/module/components/trust-info/index.js.map +1 -0
- package/lib/module/components/trust-info/trust-info.js +70 -0
- package/lib/module/components/trust-info/trust-info.js.map +1 -0
- package/lib/module/ui-components/credential/card/credential-details-card.js +3 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/header/header.js +2 -0
- package/lib/module/ui-components/header/header.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +3 -3
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/icons/contact.js +34 -0
- package/lib/module/ui-components/icons/contact.js.map +1 -0
- package/lib/module/ui-components/icons/credential.js +1 -1
- package/lib/module/ui-components/icons/credential.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +18 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/icons/index.js +1 -0
- package/lib/module/ui-components/icons/index.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +2 -0
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/screens/index.js +2 -0
- package/lib/module/ui-components/screens/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js +29 -25
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/trust-info-details-screen.js +375 -0
- package/lib/module/ui-components/screens/trust-info-details-screen.js.map +1 -0
- package/lib/module/utils/date.js +4 -5
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +8 -4
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/core-config.js +0 -4
- package/lib/module/utils/hooks/core/core-config.js.map +1 -1
- package/lib/module/utils/hooks/core/core-context.js +0 -15
- package/lib/module/utils/hooks/core/core-context.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +37 -1
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +0 -1
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +10 -0
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-list.js +20 -4
- package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
- package/lib/module/utils/hooks/core/verifier-instance.js +20 -2
- package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +15 -15
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +20 -18
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +37 -23
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/translations.js +8 -0
- package/lib/module/utils/translations.js.map +1 -0
- package/lib/typescript/components/credential/credential.d.ts +1 -0
- package/lib/typescript/components/history/history-list-item.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +1 -1
- package/lib/typescript/components/proof-request/v1/select-credential.d.ts +1 -0
- package/lib/typescript/components/proof-request/v1/share-credential.d.ts +1 -0
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +1 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +1 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +1 -0
- package/lib/typescript/components/trust-info/index.d.ts +3 -0
- package/lib/typescript/components/trust-info/trust-info.d.ts +19 -0
- package/lib/typescript/ui-components/header/header.d.ts +2 -0
- package/lib/typescript/ui-components/history/history-details.d.ts +2 -2
- package/lib/typescript/ui-components/icons/contact.d.ts +4 -0
- package/lib/typescript/ui-components/icons/credential.d.ts +1 -1
- package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
- package/lib/typescript/ui-components/icons/index.d.ts +1 -0
- package/lib/typescript/ui-components/screens/index.d.ts +3 -0
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +5 -12
- package/lib/typescript/ui-components/screens/trust-info-details-screen.d.ts +32 -0
- package/lib/typescript/utils/hooks/core/core-config.d.ts +0 -1
- package/lib/typescript/utils/hooks/core/core-context.d.ts +0 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +5 -1
- package/lib/typescript/utils/hooks/core/index.d.ts +0 -1
- package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/trust-list.d.ts +1 -4
- package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +2 -2
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +3 -3
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
- package/lib/typescript/utils/parsers/credential.d.ts +5 -5
- package/lib/typescript/utils/parsers/query.d.ts +1 -1
- package/lib/typescript/utils/translations.d.ts +1 -0
- package/package.json +8 -8
- package/src/components/credential/credential.tsx +3 -0
- package/src/components/history/history-list-item-icon.tsx +2 -2
- package/src/components/history/history-list-item.tsx +4 -9
- package/src/components/history/history-list-screen.tsx +1 -1
- package/src/components/index.ts +1 -1
- package/src/components/proof-request/v1/select-credential.tsx +3 -1
- package/src/components/proof-request/v1/share-credential.tsx +3 -0
- package/src/components/proof-request/v2/select-credential-v2.tsx +3 -1
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +4 -0
- package/src/components/proof-request/v2/share-credential-v2.tsx +5 -0
- package/src/components/trust-info/index.ts +4 -0
- package/src/components/trust-info/trust-info.tsx +90 -0
- package/src/ui-components/credential/card/credential-details-card.tsx +3 -2
- package/src/ui-components/header/foldable-header.tsx +10 -9
- package/src/ui-components/header/header.tsx +18 -3
- package/src/ui-components/history/history-details.tsx +4 -4
- package/src/ui-components/icons/contact.tsx +26 -0
- package/src/ui-components/icons/credential.tsx +1 -1
- package/src/ui-components/icons/icons.tsx +18 -0
- package/src/ui-components/icons/index.ts +1 -0
- package/src/ui-components/loader/loading-result.tsx +7 -1
- package/src/ui-components/screens/index.ts +3 -0
- package/src/ui-components/screens/nerd-mode-screen.tsx +49 -41
- package/src/ui-components/screens/trust-info-details-screen.tsx +472 -0
- package/src/utils/date.ts +7 -14
- package/src/utils/hooks/core/cache.ts +12 -4
- package/src/utils/hooks/core/core-config.ts +1 -6
- package/src/utils/hooks/core/core-context.tsx +0 -24
- package/src/utils/hooks/core/credentials.ts +43 -1
- package/src/utils/hooks/core/index.ts +0 -1
- package/src/utils/hooks/core/proofs.ts +14 -0
- package/src/utils/hooks/core/trust-list.ts +22 -11
- package/src/utils/hooks/core/verifier-instance.ts +23 -2
- package/src/utils/hooks/core/wallet-unit.ts +3 -3
- package/src/utils/parsers/credential-sharing-v2.tsx +29 -12
- package/src/utils/parsers/credential-sharing.tsx +33 -16
- package/src/utils/parsers/credential.ts +45 -14
- package/src/utils/parsers/query.ts +3 -0
- package/src/utils/translations.ts +10 -0
- package/lib/commonjs/components/entity/EntityButtons.js +0 -64
- package/lib/commonjs/components/entity/EntityButtons.js.map +0 -1
- package/lib/commonjs/components/entity/entity-attributes.js +0 -65
- package/lib/commonjs/components/entity/entity-attributes.js.map +0 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +0 -67
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +0 -1
- package/lib/commonjs/components/entity/entity-details.js +0 -101
- package/lib/commonjs/components/entity/entity-details.js.map +0 -1
- package/lib/commonjs/components/entity/index.js +0 -14
- package/lib/commonjs/components/entity/index.js.map +0 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +0 -147
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +0 -1
- package/lib/module/components/entity/EntityButtons.js +0 -56
- package/lib/module/components/entity/EntityButtons.js.map +0 -1
- package/lib/module/components/entity/entity-attributes.js +0 -57
- package/lib/module/components/entity/entity-attributes.js.map +0 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +0 -58
- package/lib/module/components/entity/entity-details-with-buttons.js.map +0 -1
- package/lib/module/components/entity/entity-details.js +0 -92
- package/lib/module/components/entity/entity-details.js.map +0 -1
- package/lib/module/components/entity/index.js +0 -3
- package/lib/module/components/entity/index.js.map +0 -1
- package/lib/module/utils/hooks/core/trust-entity.js +0 -136
- package/lib/module/utils/hooks/core/trust-entity.js.map +0 -1
- package/lib/typescript/components/entity/EntityButtons.d.ts +0 -14
- package/lib/typescript/components/entity/entity-attributes.d.ts +0 -15
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +0 -18
- package/lib/typescript/components/entity/entity-details.d.ts +0 -21
- package/lib/typescript/components/entity/index.d.ts +0 -3
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +0 -17
- package/src/components/entity/EntityButtons.tsx +0 -79
- package/src/components/entity/entity-attributes.tsx +0 -80
- package/src/components/entity/entity-details-with-buttons.tsx +0 -75
- package/src/components/entity/entity-details.tsx +0 -145
- package/src/components/entity/index.ts +0 -4
- package/src/utils/hooks/core/trust-entity.ts +0 -172
|
@@ -21,6 +21,7 @@ const ShareCredentialV2 = ({
|
|
|
21
21
|
grouped,
|
|
22
22
|
headerAccessory,
|
|
23
23
|
labels,
|
|
24
|
+
language,
|
|
24
25
|
lastItem,
|
|
25
26
|
onHeaderPress,
|
|
26
27
|
onImagePreview,
|
|
@@ -31,7 +32,7 @@ const ShareCredentialV2 = ({
|
|
|
31
32
|
style,
|
|
32
33
|
testID
|
|
33
34
|
}) => {
|
|
34
|
-
var _applicableCredential, _credential$issuer;
|
|
35
|
+
var _applicableCredential, _credentialQuery$purp, _credential$issuer;
|
|
35
36
|
const colorScheme = (0, _uiComponents.useAppColorScheme)();
|
|
36
37
|
const applicableCredentials = credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;
|
|
37
38
|
const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;
|
|
@@ -40,6 +41,7 @@ const ShareCredentialV2 = ({
|
|
|
40
41
|
data: config
|
|
41
42
|
} = (0, _utils.useCoreConfig)();
|
|
42
43
|
const cardWidth = (0, _react.useMemo)(() => _reactNative.Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0), [grouped]);
|
|
44
|
+
const purpose = credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? (_credentialQuery$purp = credentialQuery.purpose) === null || _credentialQuery$purp === void 0 ? void 0 : _credentialQuery$purp[language] : undefined;
|
|
43
45
|
const multipleCredentialsAvailable = Boolean((applicableCredentials === null || applicableCredentials === void 0 ? void 0 : applicableCredentials.length) && applicableCredentials.length > 1);
|
|
44
46
|
const validityState = (0, _utils.getValidityState)(credential ? {
|
|
45
47
|
...credential,
|
|
@@ -91,7 +93,7 @@ const ShareCredentialV2 = ({
|
|
|
91
93
|
...card
|
|
92
94
|
},
|
|
93
95
|
attributes
|
|
94
|
-
} = (0, _credentialSharingV.shareCredentialCardFromV2PresentationCredential)(credential, failureHint, Boolean(expanded), multipleCredentialsAvailable, selectedFields, config, testID, labels);
|
|
96
|
+
} = (0, _credentialSharingV.shareCredentialCardFromV2PresentationCredential)(credential, failureHint, Boolean(expanded), multipleCredentialsAvailable, purpose, selectedFields, config, testID, labels, language);
|
|
95
97
|
if (headerAccessory) {
|
|
96
98
|
header.accessory = headerAccessory;
|
|
97
99
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uiComponents","_utils","_credentialSharingV","_selectShareCredentialCardNotice","_shareCredentialCardNotice","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GroupedShareCredentialV2Padding","exports","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credential$issuer","colorScheme","useAppColorScheme","applicableCredentials","type_","undefined","failureHint","credential","find","c","id","data","config","useCoreConfig","cardWidth","useMemo","Dimensions","width","multipleCredentialsAvailable","Boolean","length","validityState","getValidityState","issuer","footer","ValidityState","Revoked","createElement","ShareCredentialCardNotice","concatTestID","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","SelectShareCredentialCardNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","useCallback","fieldPath","selected","card","header","attributes","shareCredentialCardFromV2PresentationCredential","accessory","CredentialDetailsCardListItem","credentialId","styles","groupedCredential","bordered","borderColor","background","StyleSheet","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n ApplicableCredentialOrFailureHint,\n CredentialListItem,\n PresentationDefinitionV2Claim,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: ApplicableCredentialOrFailureHint;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItem['id'],\n fieldPath: PresentationDefinitionV2Claim['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionV2Claim['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;\n const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2Claim['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n selectedFields,\n config,\n testID,\n labels,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n borderWidth: 0,\n marginBottom: 8,\n },\n groupedCredential: {\n marginHorizontal: GroupedShareCredentialV2Padding,\n },\n});\n"],"mappings":";;;;;;AAKA,IA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ED,IAAID,eAAe,EAAE;IACnB0D,MAAM,CAACG,SAAS,GAAG7D,eAAe;EACpC;EAEA,oBACEpC,MAAA,CAAAe,OAAA,CAAA4D,aAAA,CAACvE,aAAA,CAAA8F,6BAA6B;IAC5BH,UAAU,EAAEA,UAAW;IACvBF,IAAI,EAAE;MACJ,GAAGA,IAAI;MACPM,YAAY,EAAElE,mBAAmB;MACjC6D,MAAM;MACNvD,aAAa;MACb0B,KAAK,EAAEH;IACT,CAAE;IACF5B,QAAQ,EAAEA,QAAS;IACnBsC,MAAM,EAAEA,MAAO;IACflC,QAAQ,EAAEA,QAAS;IACnBmD,mBAAmB,EAAEA,mBAAoB;IACzCjD,cAAc,EAAEA,cAAe;IAC/BK,KAAK,EAAE,CACLuD,MAAM,CAAC7C,UAAU,EACjBpB,OAAO,GAAGiE,MAAM,CAACC,iBAAiB,GAAGD,MAAM,CAACE,QAAQ,EACpD;MAAEC,WAAW,EAAEtD,WAAW,CAACuD;IAAW,CAAC,EACvC3D,KAAK,CACL;IACFC,MAAM,EAAEA;EAAO,CAChB,CAAC;AAEN,CAAC;AAAChB,OAAA,CAAAC,iBAAA,GAAAA,iBAAA;AAEF,MAAMqE,MAAM,GAAGK,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,QAAQ,EAAE;IACRK,WAAW,EAAE;EACf,CAAC;EACDpD,UAAU,EAAE;IACVqD,YAAY,EAAE,EAAE;IAChBD,WAAW,EAAE,CAAC;IACdE,YAAY,EAAE;EAChB,CAAC;EACDR,iBAAiB,EAAE;IACjBS,gBAAgB,EAAEjF;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uiComponents","_utils","_credentialSharingV","_selectShareCredentialCardNotice","_shareCredentialCardNotice","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","GroupedShareCredentialV2Padding","exports","ShareCredentialV2","credentialQuery","credentialRequestId","expanded","grouped","headerAccessory","labels","language","lastItem","onHeaderPress","onImagePreview","onSelectCredential","onSelectField","selectedCredentialId","selectedFields","style","testID","_applicableCredential","_credentialQuery$purp","_credential$issuer","colorScheme","useAppColorScheme","applicableCredentials","type_","undefined","failureHint","credential","find","c","id","data","config","useCoreConfig","cardWidth","useMemo","Dimensions","width","purpose","multipleCredentialsAvailable","Boolean","length","validityState","getValidityState","issuer","footer","ValidityState","Revoked","createElement","ShareCredentialCardNotice","concatTestID","text","revokedCredentialNotice","Suspended","suspendedCredentialNotice","reason","invalidCredentialNotice","SelectShareCredentialCardNotice","buttonTitle","multipleCredentialsSelect","onPress","multipleCredentialsNotice","onAttributeSelected","useCallback","fieldPath","selected","card","header","attributes","shareCredentialCardFromV2PresentationCredential","accessory","CredentialDetailsCardListItem","credentialId","styles","groupedCredential","bordered","borderColor","background","StyleSheet","create","borderWidth","borderRadius","marginBottom","marginHorizontal"],"sources":["share-credential-v2.tsx"],"sourcesContent":["import {\n ApplicableCredentialOrFailureHint,\n CredentialListItem,\n PresentationDefinitionV2Claim,\n} from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useCallback, useMemo } from 'react';\nimport { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';\nimport { concatTestID, getValidityState, useCoreConfig, ValidityState } from '../../../utils';\nimport { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';\nimport { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';\nimport { ShareCredentialCardNotice } from '../share-credential-card-notice';\nimport { ShareCredentialLabels } from '../v1';\n\nexport type ShareCredentialV2Props = {\n credentialQuery: ApplicableCredentialOrFailureHint;\n credentialRequestId: string;\n expanded?: boolean;\n grouped?: boolean;\n headerAccessory?: React.ComponentType<any> | React.ReactElement;\n labels: ShareCredentialLabels;\n language: string;\n lastItem?: boolean;\n onHeaderPress?: (_credentialId?: string) => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n onSelectCredential?: () => void;\n onSelectField: (\n credentialId: CredentialListItem['id'],\n fieldPath: PresentationDefinitionV2Claim['path'],\n selected: boolean,\n ) => void;\n selectedCredentialId?: CredentialListItem['id'];\n selectedFields?: Array<PresentationDefinitionV2Claim['path']>;\n style?: StyleProp<ViewStyle>;\n testID: string;\n};\n\nexport const GroupedShareCredentialV2Padding = 4;\n\nexport const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({\n credentialQuery,\n credentialRequestId,\n expanded,\n grouped,\n headerAccessory,\n labels,\n language,\n lastItem,\n onHeaderPress,\n onImagePreview,\n onSelectCredential,\n onSelectField,\n selectedCredentialId,\n selectedFields,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const applicableCredentials =\n credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.applicableCredentials : undefined;\n const failureHint = credentialQuery.type_ === 'FAILURE_HINT' ? credentialQuery.failureHint : undefined;\n const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];\n const { data: config } = useCoreConfig();\n const cardWidth = useMemo(\n () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),\n [grouped],\n );\n const purpose = credentialQuery.type_ === 'APPLICABLE_CREDENTIALS' ? credentialQuery.purpose?.[language] : undefined;\n\n const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);\n\n const validityState = getValidityState(\n credential\n ? {\n ...credential,\n issuer: credential?.issuer?.id,\n }\n : undefined,\n );\n\n const footer = useMemo(() => {\n if (!expanded) {\n return;\n }\n if (validityState === ValidityState.Revoked) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.revoked')}\n text={labels.revokedCredentialNotice}\n />\n );\n }\n if (validityState === ValidityState.Suspended) {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.suspended')}\n text={labels.suspendedCredentialNotice}\n />\n );\n }\n\n if (failureHint?.reason === 'VALIDITY') {\n return (\n <ShareCredentialCardNotice\n testID={concatTestID(testID, 'notice.invalid')}\n text={labels.invalidCredentialNotice}\n />\n );\n }\n\n if (multipleCredentialsAvailable) {\n return (\n <SelectShareCredentialCardNotice\n buttonTitle={labels.multipleCredentialsSelect}\n onPress={onSelectCredential}\n testID={concatTestID(testID, 'notice.multiple')}\n text={labels.multipleCredentialsNotice}\n />\n );\n }\n }, [\n expanded,\n failureHint?.reason,\n labels.invalidCredentialNotice,\n labels.multipleCredentialsNotice,\n labels.multipleCredentialsSelect,\n labels.revokedCredentialNotice,\n labels.suspendedCredentialNotice,\n multipleCredentialsAvailable,\n onSelectCredential,\n testID,\n validityState,\n ]);\n\n const onAttributeSelected = useCallback(\n (fieldPath: PresentationDefinitionV2Claim['path'], selected: boolean) => {\n if (!selectedCredentialId) {\n return;\n }\n onSelectField(selectedCredentialId, fieldPath, selected);\n },\n [onSelectField, selectedCredentialId],\n );\n\n if (!config) {\n return null;\n }\n\n const {\n card: { header, ...card },\n attributes,\n } = shareCredentialCardFromV2PresentationCredential(\n credential,\n failureHint,\n Boolean(expanded),\n multipleCredentialsAvailable,\n purpose,\n selectedFields,\n config,\n testID,\n labels,\n language,\n );\n\n if (headerAccessory) {\n header.accessory = headerAccessory;\n }\n\n return (\n <CredentialDetailsCardListItem\n attributes={attributes}\n card={{\n ...card,\n credentialId: credentialRequestId,\n header,\n onHeaderPress,\n width: cardWidth,\n }}\n expanded={expanded}\n footer={footer}\n lastItem={lastItem}\n onAttributeSelected={onAttributeSelected}\n onImagePreview={onImagePreview}\n style={[\n styles.credential,\n grouped ? styles.groupedCredential : styles.bordered,\n { borderColor: colorScheme.background },\n style,\n ]}\n testID={testID}\n />\n );\n};\n\nconst styles = StyleSheet.create({\n bordered: {\n borderWidth: 1,\n },\n credential: {\n borderRadius: 10,\n borderWidth: 0,\n marginBottom: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;EACDR,iBAAiB,EAAE;IACjBS,gBAAgB,EAAEpF;EACpB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
TrustInfo: true
|
|
8
|
+
};
|
|
9
|
+
Object.defineProperty(exports, "TrustInfo", {
|
|
10
|
+
enumerable: true,
|
|
11
|
+
get: function () {
|
|
12
|
+
return _trustInfo.default;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
var _trustInfo = _interopRequireWildcard(require("./trust-info"));
|
|
16
|
+
Object.keys(_trustInfo).forEach(function (key) {
|
|
17
|
+
if (key === "default" || key === "__esModule") return;
|
|
18
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
19
|
+
if (key in exports && exports[key] === _trustInfo[key]) return;
|
|
20
|
+
Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () {
|
|
23
|
+
return _trustInfo[key];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
28
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_trustInfo","_interopRequireWildcard","require","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","n","__proto__","a","getOwnPropertyDescriptor","u","i","set"],"sources":["index.ts"],"sourcesContent":["import TrustInfo from './trust-info';\n\nexport * from './trust-info';\nexport { TrustInfo };\n"],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEAC,MAAA,CAAAC,IAAA,CAAAJ,UAAA,EAAAK,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAN,UAAA,CAAAM,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAd,UAAA,CAAAM,GAAA;IAAA;EAAA;AAAA;AAA6B,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAf,wBAAAe,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAL,GAAA,CAAAE,CAAA,OAAAO,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAtB,MAAA,CAAAS,cAAA,IAAAT,MAAA,CAAAuB,wBAAA,WAAAC,CAAA,IAAAX,CAAA,oBAAAW,CAAA,OAAAnB,cAAA,CAAAC,IAAA,CAAAO,CAAA,EAAAW,CAAA,SAAAC,CAAA,GAAAH,CAAA,GAAAtB,MAAA,CAAAuB,wBAAA,CAAAV,CAAA,EAAAW,CAAA,UAAAC,CAAA,KAAAA,CAAA,CAAAd,GAAA,IAAAc,CAAA,CAAAC,GAAA,IAAA1B,MAAA,CAAAS,cAAA,CAAAW,CAAA,EAAAI,CAAA,EAAAC,CAAA,IAAAL,CAAA,CAAAI,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAJ,CAAA,CAAAF,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAU,GAAA,CAAAb,CAAA,EAAAO,CAAA,GAAAA,CAAA","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _uiComponents = require("../../ui-components");
|
|
10
|
+
var _entityCluster = _interopRequireDefault(require("../../ui-components/entity/entity-cluster"));
|
|
11
|
+
var _icons = require("../../ui-components/icons");
|
|
12
|
+
var _utils = require("../../utils");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
16
|
+
const TrustInfo = ({
|
|
17
|
+
labels,
|
|
18
|
+
onPress,
|
|
19
|
+
style,
|
|
20
|
+
sublineColor,
|
|
21
|
+
testID,
|
|
22
|
+
textColor,
|
|
23
|
+
trustInformation
|
|
24
|
+
}) => {
|
|
25
|
+
const avatarProps = (0, _react.useMemo)(() => {
|
|
26
|
+
var _trustInformation$nam;
|
|
27
|
+
const placeholderText = (_trustInformation$nam = trustInformation === null || trustInformation === void 0 ? void 0 : trustInformation.name.substring(0, 1)) !== null && _trustInformation$nam !== void 0 ? _trustInformation$nam : labels.unknown.substring(0, 1);
|
|
28
|
+
const statusIcon = trustInformation ? /*#__PURE__*/_react.default.createElement(_icons.EntityTrustedIcon, {
|
|
29
|
+
testID: (0, _utils.concatTestID)(testID, 'statusIcon', 'trusted')
|
|
30
|
+
}) : /*#__PURE__*/_react.default.createElement(_icons.EntityNotTrustedIcon, {
|
|
31
|
+
testID: (0, _utils.concatTestID)(testID, 'statusIcon', 'notTrusted')
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
placeholderText,
|
|
35
|
+
statusIcon
|
|
36
|
+
};
|
|
37
|
+
}, [labels, testID, trustInformation]);
|
|
38
|
+
const trustEntityName = (0, _react.useMemo)(() => {
|
|
39
|
+
var _trustInformation$nam2;
|
|
40
|
+
return (_trustInformation$nam2 = trustInformation === null || trustInformation === void 0 ? void 0 : trustInformation.name) !== null && _trustInformation$nam2 !== void 0 ? _trustInformation$nam2 : labels.unknown;
|
|
41
|
+
}, [labels.unknown, trustInformation]);
|
|
42
|
+
return /*#__PURE__*/_react.default.createElement(_uiComponents.TouchableOpacity, {
|
|
43
|
+
disabled: !onPress || !trustInformation,
|
|
44
|
+
onPress: onPress,
|
|
45
|
+
style: [styles.button, style]
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_entityCluster.default, {
|
|
47
|
+
avatar: avatarProps,
|
|
48
|
+
entityName: trustEntityName,
|
|
49
|
+
style: styles.cluster,
|
|
50
|
+
subline: trustInformation ? undefined : labels.unknownSubline,
|
|
51
|
+
sublineColor: sublineColor,
|
|
52
|
+
testID: testID,
|
|
53
|
+
textColor: textColor
|
|
54
|
+
}), onPress && trustInformation && /*#__PURE__*/_react.default.createElement(_icons.UpIcon, {
|
|
55
|
+
color: textColor,
|
|
56
|
+
style: styles.chevron
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
59
|
+
const styles = _reactNative.StyleSheet.create({
|
|
60
|
+
button: {
|
|
61
|
+
alignItems: 'center',
|
|
62
|
+
flexDirection: 'row',
|
|
63
|
+
flexWrap: 'nowrap',
|
|
64
|
+
width: '100%'
|
|
65
|
+
},
|
|
66
|
+
chevron: {
|
|
67
|
+
marginLeft: 10,
|
|
68
|
+
marginRight: 18,
|
|
69
|
+
transform: [{
|
|
70
|
+
rotate: '90deg'
|
|
71
|
+
}]
|
|
72
|
+
},
|
|
73
|
+
cluster: {
|
|
74
|
+
flex: 1,
|
|
75
|
+
flexShrink: 1
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
var _default = exports.default = TrustInfo;
|
|
79
|
+
//# sourceMappingURL=trust-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_uiComponents","_entityCluster","_interopRequireDefault","_icons","_utils","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","TrustInfo","labels","onPress","style","sublineColor","testID","textColor","trustInformation","avatarProps","useMemo","_trustInformation$nam","placeholderText","name","substring","unknown","statusIcon","createElement","EntityTrustedIcon","concatTestID","EntityNotTrustedIcon","trustEntityName","_trustInformation$nam2","TouchableOpacity","disabled","styles","button","avatar","entityName","cluster","subline","undefined","unknownSubline","UpIcon","color","chevron","StyleSheet","create","alignItems","flexDirection","flexWrap","width","marginLeft","marginRight","transform","rotate","flex","flexShrink","_default","exports"],"sources":["trust-info.tsx"],"sourcesContent":["import React, { FC, useMemo } from 'react';\nimport { StyleProp, StyleSheet, ViewStyle } from 'react-native';\n\nimport { AvatarProps, TouchableOpacity } from '../../ui-components';\nimport EntityCluster from '../../ui-components/entity/entity-cluster';\nimport { EntityNotTrustedIcon, EntityTrustedIcon, UpIcon } from '../../ui-components/icons';\nimport { concatTestID } from '../../utils';\n\nexport type TrustInfoLabels = {\n unknown: string;\n unknownSubline: string;\n};\n\nexport type TrustInfoProps = {\n labels: TrustInfoLabels;\n onPress?: () => void;\n style?: StyleProp<ViewStyle>;\n sublineColor?: string;\n testID?: string;\n textColor?: string;\n trustInformation?: {\n name: string;\n };\n};\n\nconst TrustInfo: FC<TrustInfoProps> = ({\n labels,\n onPress,\n style,\n sublineColor,\n testID,\n textColor,\n trustInformation,\n}) => {\n const avatarProps: AvatarProps | undefined = useMemo(() => {\n const placeholderText = trustInformation?.name.substring(0, 1) ?? labels.unknown.substring(0, 1);\n\n const statusIcon = trustInformation ? (\n <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />\n ) : (\n <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />\n );\n\n return {\n placeholderText,\n statusIcon,\n };\n }, [labels, testID, trustInformation]);\n\n const trustEntityName = useMemo(() => trustInformation?.name ?? labels.unknown, [labels.unknown, trustInformation]);\n\n return (\n <TouchableOpacity disabled={!onPress || !trustInformation} onPress={onPress} style={[styles.button, style]}>\n <EntityCluster\n avatar={avatarProps}\n entityName={trustEntityName}\n style={styles.cluster}\n subline={trustInformation ? undefined : labels.unknownSubline}\n sublineColor={sublineColor}\n testID={testID}\n textColor={textColor}\n />\n {onPress && trustInformation && <UpIcon color={textColor} style={styles.chevron} />}\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n button: {\n alignItems: 'center',\n flexDirection: 'row',\n flexWrap: 'nowrap',\n width: '100%',\n },\n chevron: {\n marginLeft: 10,\n marginRight: 18,\n transform: [\n {\n rotate: '90deg',\n },\n ],\n },\n cluster: {\n flex: 1,\n flexShrink: 1,\n },\n});\n\nexport default TrustInfo;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAA2C,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAR,wBAAAQ,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,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CAAC;AAED,MAAMV,MAAM,GAAGW,uBAAU,CAACC,MAAM,CAAC;EAC/BX,MAAM,EAAE;IACNY,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,QAAQ,EAAE,QAAQ;IAClBC,KAAK,EAAE;EACT,CAAC;EACDN,OAAO,EAAE;IACPO,UAAU,EAAE,EAAE;IACdC,WAAW,EAAE,EAAE;IACfC,SAAS,EAAE,CACT;MACEC,MAAM,EAAE;IACV,CAAC;EAEL,CAAC;EACDhB,OAAO,EAAE;IACPiB,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAEYkB,SAAS","ignoreList":[]}
|
|
@@ -40,6 +40,7 @@ const CredentialDetailsCard = ({
|
|
|
40
40
|
const CaretIcon = expanded ? _credential.UpIcon : _credential.DownIcon;
|
|
41
41
|
const cardHeight = Math.ceil(card.width / _credentialCard.CredentialCardRatio);
|
|
42
42
|
const currentHeight = (0, _reactNativeReanimated.useSharedValue)(undefined);
|
|
43
|
+
const [animatedHeightSet, setAnimatedHeightSet] = (0, _react.useState)(false);
|
|
43
44
|
const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];
|
|
44
45
|
const extraAttributes = (0, _react.useMemo)(() => attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : [], [attributes]);
|
|
45
46
|
(0, _react.useEffect)(() => {
|
|
@@ -60,6 +61,7 @@ const CredentialDetailsCard = ({
|
|
|
60
61
|
const additionalAttributesHeight = fullAttributesHeight !== null && fullAttributesHeight !== void 0 ? fullAttributesHeight : 0;
|
|
61
62
|
const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;
|
|
62
63
|
const fullHeight = previewAttributesHeight + additionalHeight;
|
|
64
|
+
setAnimatedHeightSet(true);
|
|
63
65
|
if (!animate) {
|
|
64
66
|
currentHeight.value = fullHeight;
|
|
65
67
|
return;
|
|
@@ -108,7 +110,7 @@ const CredentialDetailsCard = ({
|
|
|
108
110
|
header,
|
|
109
111
|
...cardProps
|
|
110
112
|
} = card;
|
|
111
|
-
const renderExtraAttributes = allAttributesRendered || previewAttributesHeight !== undefined &&
|
|
113
|
+
const renderExtraAttributes = allAttributesRendered || previewAttributesHeight !== undefined && animatedHeightSet;
|
|
112
114
|
const ContainerComponent = animate ? _reactNativeReanimated.default.View : _reactNative.View;
|
|
113
115
|
return /*#__PURE__*/_react.default.createElement(ContainerComponent, _extends({
|
|
114
116
|
style: [styles.detailsCard, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","cardHeight","Math","ceil","width","CredentialCardRatio","currentHeight","useSharedValue","undefined","previewAttributes","slice","extraAttributes","useMemo","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","withTiming","animatedStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","Animated","View","detailsCard","backgroundColor","white","concatTestID","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","Button","type","ButtonType","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","borderWidth","overflow","marginTop","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps, CredentialCardRatio } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\nconst SEE_ALL_BUTTON_HEIGHT = 78;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const cardHeight = Math.ceil(card.width / CredentialCardRatio);\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const buttonViewHeight = !extraAttributes || allAttributesRendered ? 0 : SEE_ALL_BUTTON_HEIGHT;\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const fullHeight = previewAttributesHeight + additionalHeight;\n\n if (!animate) {\n currentHeight.value = fullHeight;\n return;\n }\n\n const newHeight = expanded ? fullHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = fullHeight / 5;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n currentHeight,\n animate,\n expanded,\n extraAttributes,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const animatedStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: cardHeight,\n };\n }\n return {\n height: cardHeight + currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\n\n const ContainerComponent = animate ? Animated.View : View;\n return (\n <ContainerComponent\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, animate ? animatedStyle : undefined, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <View>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.buttonWrapper}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </ContainerComponent>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesWrapper: {\n paddingTop: 7,\n width: '100%',\n },\n buttonWrapper: {\n height: SEE_ALL_BUTTON_HEIGHT,\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n card: {\n borderRadius: 0,\n borderWidth: 0,\n },\n detailsCard: {\n borderRadius: 10,\n borderWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAV,uBAAA,CAAAC,OAAA;AAA6F,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAX,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E,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,QAAQ,EAAE;EACZ,CAAC;EACDlG,MAAM,EAAE;IACNmG,SAAS,EAAE;EACb,CAAC;EACDtB,wBAAwB,EAAE;IACxBiB,iBAAiB,EAAE,CAAC;IACpBvE,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAA6E,QAAA,GAAAC,OAAA,CAAApI,OAAA,GAEY0B,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","SEE_ALL_BUTTON_HEIGHT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","cardHeight","Math","ceil","width","CredentialCardRatio","currentHeight","useSharedValue","undefined","animatedHeightSet","setAnimatedHeightSet","previewAttributes","slice","extraAttributes","useMemo","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","buttonViewHeight","additionalAttributesHeight","additionalHeight","fullHeight","value","newHeight","duration","withTiming","animatedStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","ContainerComponent","Animated","View","detailsCard","backgroundColor","white","concatTestID","accessory","onHeaderPress","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","buttonWrapper","Button","type","ButtonType","Secondary","title","index","create","paddingHorizontal","paddingTop","borderRadius","borderWidth","overflow","marginTop","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps, CredentialCardRatio } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\nconst SEE_ALL_BUTTON_HEIGHT = 78;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const cardHeight = Math.ceil(card.width / CredentialCardRatio);\n const currentHeight = useSharedValue<number | undefined>(undefined);\n const [animatedHeightSet, setAnimatedHeightSet] = useState(false);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const buttonViewHeight = !extraAttributes || allAttributesRendered ? 0 : SEE_ALL_BUTTON_HEIGHT;\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const fullHeight = previewAttributesHeight + additionalHeight;\n\n setAnimatedHeightSet(true);\n if (!animate) {\n currentHeight.value = fullHeight;\n return;\n }\n\n const newHeight = expanded ? fullHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = fullHeight / 5;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n currentHeight,\n animate,\n expanded,\n extraAttributes,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const animatedStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: cardHeight,\n };\n }\n return {\n height: cardHeight + currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes = allAttributesRendered || (previewAttributesHeight !== undefined && animatedHeightSet);\n\n const ContainerComponent = animate ? Animated.View : View;\n return (\n <ContainerComponent\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, animate ? animatedStyle : undefined, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <View>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.buttonWrapper}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </ContainerComponent>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesWrapper: {\n paddingTop: 7,\n width: '100%',\n },\n buttonWrapper: {\n height: SEE_ALL_BUTTON_HEIGHT,\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n card: {\n borderRadius: 0,\n borderWidth: 0,\n },\n detailsCard: {\n borderRadius: 10,\n borderWidth: 0,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAV,uBAAA,CAAAC,OAAA;AAA6F,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAK,CAAA,SAAAA,CAAA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CAAC;IACfC,WAAW,EAAE;EACf,CAAC;EACD5B,WAAW,EAAE;IACX2B,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE,CAAC;IACdC,QAAQ,EAAE;EACZ,CAAC;EACDpG,MAAM,EAAE;IACNqG,SAAS,EAAE;EACb,CAAC;EACDtB,wBAAwB,EAAE;IACxBiB,iBAAiB,EAAE,CAAC;IACpBzE,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAA+E,QAAA,GAAAC,OAAA,CAAAtI,OAAA,GAEY0B,qBAAqB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_blurView","_interopRequireDefault","_animatedSearchBar","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","FoldableSearchHeader","staticHeader","scrollOffset","searchBar","header","withNotice","safeAreaInsets","useSafeAreaInsets","colorScheme","useAppColorScheme","collapsed","setCollapsed","useState","headerHeight","setHeaderHeight","containerPaddingTop","top","containerPaddingStyle","paddingTop","useEffect","id","addListener","value","removeListener","playHeaderFoldAnimation","scrollHeaderAnimatedStyle","transform","translateY","interpolate","extrapolate","inputRange","outputRange","undefined","fadeHeaderOutAnimatedStyle","opacity","onHeaderLayout","useCallback","event","nativeEvent","layout","height","createElement","Animated","View","style","styles","headerContainer","noticeBorderRadius","blurFill","blurStyle","color","background","StyleSheet","absoluteFill","onLayout","create","bottom","left","overflow","position","right","width","borderTopLeftRadius","borderTopRightRadius","_default","exports"],"sources":["foldable-header.tsx"],"sourcesContent":["import React, { FunctionComponent, ReactElement, useCallback, useEffect, useState } from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport BlurView from '../blur/blur-view';\nimport AnimatedSearchBar, { AnimatedSearchBarProps } from '../searchbar/animated-search-bar';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type FoldableHeaderProps = {\n header: ReactElement;\n scrollOffset: Animated.Value;\n searchBar?: Omit<AnimatedSearchBarProps, 'collapsed'>;\n // if true, the header won't fold / fade out on scroll\n staticHeader?: boolean;\n withNotice?: boolean;\n};\n\nconst FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({\n staticHeader = false,\n scrollOffset,\n searchBar,\n header,\n withNotice,\n}) => {\n const safeAreaInsets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [collapsed, setCollapsed] = useState(header ? false : true);\n const [headerHeight, setHeaderHeight] = useState<number>();\n\n const containerPaddingTop = withNotice ? 15 : safeAreaInsets.top;\n const containerPaddingStyle = {\n paddingTop: containerPaddingTop,\n };\n\n useEffect(() => {\n const id = scrollOffset.addListener(({ value }) => {\n if (!headerHeight) {\n return;\n }\n\n if (value > headerHeight) {\n setCollapsed(true);\n } else {\n setCollapsed(false);\n }\n });\n return () => {\n scrollOffset.removeListener(id);\n };\n }, [scrollOffset, searchBar, headerHeight]);\n\n const playHeaderFoldAnimation = !staticHeader && headerHeight;\n\n const scrollHeaderAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n transform: [{\n
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeSafeAreaContext","_blurView","_interopRequireDefault","_animatedSearchBar","_colorSchemeContext","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","FoldableSearchHeader","staticHeader","scrollOffset","searchBar","header","withNotice","safeAreaInsets","useSafeAreaInsets","colorScheme","useAppColorScheme","collapsed","setCollapsed","useState","headerHeight","setHeaderHeight","containerPaddingTop","top","containerPaddingStyle","paddingTop","useEffect","id","addListener","value","removeListener","playHeaderFoldAnimation","scrollHeaderAnimatedStyle","transform","translateY","interpolate","extrapolate","inputRange","outputRange","undefined","fadeHeaderOutAnimatedStyle","opacity","onHeaderLayout","useCallback","event","nativeEvent","layout","height","createElement","Animated","View","style","styles","headerContainer","noticeBorderRadius","blurFill","blurStyle","color","background","StyleSheet","absoluteFill","onLayout","create","bottom","left","overflow","position","right","width","borderTopLeftRadius","borderTopRightRadius","_default","exports"],"sources":["foldable-header.tsx"],"sourcesContent":["import React, { FunctionComponent, ReactElement, useCallback, useEffect, useState } from 'react';\nimport { Animated, LayoutChangeEvent, StyleSheet, View, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport BlurView from '../blur/blur-view';\nimport AnimatedSearchBar, { AnimatedSearchBarProps } from '../searchbar/animated-search-bar';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type FoldableHeaderProps = {\n header: ReactElement;\n scrollOffset: Animated.Value;\n searchBar?: Omit<AnimatedSearchBarProps, 'collapsed'>;\n // if true, the header won't fold / fade out on scroll\n staticHeader?: boolean;\n withNotice?: boolean;\n};\n\nconst FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({\n staticHeader = false,\n scrollOffset,\n searchBar,\n header,\n withNotice,\n}) => {\n const safeAreaInsets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const [collapsed, setCollapsed] = useState(header ? false : true);\n const [headerHeight, setHeaderHeight] = useState<number>();\n\n const containerPaddingTop = withNotice ? 15 : safeAreaInsets.top;\n const containerPaddingStyle = {\n paddingTop: containerPaddingTop,\n };\n\n useEffect(() => {\n const id = scrollOffset.addListener(({ value }) => {\n if (!headerHeight) {\n return;\n }\n\n if (value > headerHeight) {\n setCollapsed(true);\n } else {\n setCollapsed(false);\n }\n });\n return () => {\n scrollOffset.removeListener(id);\n };\n }, [scrollOffset, searchBar, headerHeight]);\n\n const playHeaderFoldAnimation = !staticHeader && headerHeight;\n\n const scrollHeaderAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n transform: [\n {\n translateY: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight],\n outputRange: [0, -headerHeight],\n }),\n },\n ],\n }\n : undefined;\n\n const fadeHeaderOutAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation\n ? {\n opacity: scrollOffset.interpolate({\n extrapolate: 'clamp',\n inputRange: [0, headerHeight / 2],\n outputRange: [1, 0],\n }),\n }\n : undefined;\n\n const onHeaderLayout = useCallback(\n (event: LayoutChangeEvent) => {\n setHeaderHeight(event.nativeEvent.layout.height);\n },\n [setHeaderHeight],\n );\n\n return (\n <Animated.View\n style={[styles.headerContainer, containerPaddingStyle, withNotice ? styles.noticeBorderRadius : undefined]}>\n <Animated.View style={scrollHeaderAnimatedStyle}>\n <View style={[styles.blurFill, { top: -containerPaddingTop }]}>\n <BlurView\n blurStyle={'header'}\n color={colorScheme.background}\n style={[StyleSheet.absoluteFill, withNotice ? styles.noticeBorderRadius : undefined]}\n />\n </View>\n {header && (\n <Animated.View onLayout={onHeaderLayout} style={fadeHeaderOutAnimatedStyle}>\n {header}\n </Animated.View>\n )}\n {searchBar && <AnimatedSearchBar {...searchBar} collapsed={collapsed} />}\n </Animated.View>\n </Animated.View>\n );\n};\n\nconst styles = StyleSheet.create({\n blurFill: {\n bottom: 0,\n left: 0,\n overflow: 'hidden',\n position: 'absolute',\n right: 0,\n },\n headerContainer: {\n overflow: 'hidden',\n position: 'absolute',\n width: '100%',\n },\n noticeBorderRadius: {\n borderTopLeftRadius: 30,\n borderTopRightRadius: 30,\n overflow: 'hidden',\n },\n});\n\nexport default FoldableSearchHeader;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;A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EAAE;IACvBC,oBAAoB,EAAE,EAAE;IACxBL,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAzF,OAAA,GAEYwB,oBAAoB","ignoreList":[]}
|
|
@@ -26,6 +26,7 @@ const backButtonHitSlop = {
|
|
|
26
26
|
* states (Default + Dashboard)
|
|
27
27
|
*/
|
|
28
28
|
const Header = ({
|
|
29
|
+
backIcon,
|
|
29
30
|
onBack,
|
|
30
31
|
rightButtons,
|
|
31
32
|
style,
|
|
@@ -42,6 +43,7 @@ const Header = ({
|
|
|
42
43
|
style: styles.backButtonRow
|
|
43
44
|
}, /*#__PURE__*/_react.default.createElement(_buttons.BackButton, {
|
|
44
45
|
hitSlop: backButtonHitSlop,
|
|
46
|
+
icon: backIcon,
|
|
45
47
|
onPress: onBack,
|
|
46
48
|
testID: (0, _utils.concatTestID)(testID, 'back')
|
|
47
49
|
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, null), rightButtons), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_utils","_buttons","_text","_theme","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","backButtonHitSlop","top","bottom","left","right","Header","onBack","rightButtons","style","titleRowStyle","testID","title","viewProps","colorScheme","useAppColorScheme","createElement","View","styles","container","backButtonRow","BackButton","hitSlop","onPress","concatTestID","titleRow","titleRow2nd","titleRowNoBackButton","titleRowNoRightButton","Typography","accessibilityRole","color","text","preset","rightButtonWrapper","StyleSheet","create","alignItems","flexDirection","justifyContent","minHeight","paddingHorizontal","width","gap","height","paddingTop","flex","paddingBottom","paddingLeft","paddingRight","marginBottom","marginTop","_default","exports"],"sources":["header.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { Insets, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { BackButton } from '../buttons';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HeaderProps extends ViewProps {\n onBack?: () => void;\n rightButtons?: ReactNode[];\n style?: StyleProp<ViewStyle>;\n titleRowStyle?: StyleProp<ViewStyle>;\n title: ReactNode;\n}\n\nconst backButtonHitSlop: Insets = { top: 12, bottom: 12, left: 20, right: 20 };\n\n/**\n * Unified screen header\n *\n * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=425-18624\n * states (Default + Dashboard)\n */\nconst Header: FC<HeaderProps> = ({
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_utils","_buttons","_text","_theme","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","backButtonHitSlop","top","bottom","left","right","Header","backIcon","onBack","rightButtons","style","titleRowStyle","testID","title","viewProps","colorScheme","useAppColorScheme","createElement","View","styles","container","backButtonRow","BackButton","hitSlop","icon","onPress","concatTestID","titleRow","titleRow2nd","titleRowNoBackButton","titleRowNoRightButton","Typography","accessibilityRole","color","text","preset","rightButtonWrapper","StyleSheet","create","alignItems","flexDirection","justifyContent","minHeight","paddingHorizontal","width","gap","height","paddingTop","flex","paddingBottom","paddingLeft","paddingRight","marginBottom","marginTop","_default","exports"],"sources":["header.tsx"],"sourcesContent":["import React, { FC, ReactNode } from 'react';\nimport { Insets, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { BackButton, BackButtonIcon } from '../buttons';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HeaderProps extends ViewProps {\n backIcon?: BackButtonIcon;\n onBack?: () => void;\n rightButtons?: ReactNode[];\n style?: StyleProp<ViewStyle>;\n titleRowStyle?: StyleProp<ViewStyle>;\n title: ReactNode;\n}\n\nconst backButtonHitSlop: Insets = { top: 12, bottom: 12, left: 20, right: 20 };\n\n/**\n * Unified screen header\n *\n * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=425-18624\n * states (Default + Dashboard)\n */\nconst Header: FC<HeaderProps> = ({\n backIcon,\n onBack,\n rightButtons,\n style,\n titleRowStyle,\n testID,\n title,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n\n return (\n <View style={[styles.container, style]} testID={testID} {...viewProps}>\n {onBack && (\n <View style={styles.backButtonRow}>\n <BackButton\n hitSlop={backButtonHitSlop}\n icon={backIcon}\n onPress={onBack}\n testID={concatTestID(testID, 'back')}\n />\n <View />\n {rightButtons}\n </View>\n )}\n\n <View\n style={[\n styles.titleRow,\n onBack ? styles.titleRow2nd : styles.titleRowNoBackButton,\n (onBack || !rightButtons) && styles.titleRowNoRightButton,\n titleRowStyle,\n ]}>\n {typeof title === 'string' ? (\n <Typography\n accessibilityRole=\"header\"\n color={colorScheme.text}\n preset=\"l\"\n style={styles.title}\n testID={concatTestID(testID, 'title')}>\n {title}\n </Typography>\n ) : (\n <View style={styles.title}>{title}</View>\n )}\n\n {!onBack && rightButtons && <View style={styles.rightButtonWrapper}>{rightButtons}</View>}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n backButtonRow: {\n alignItems: 'center',\n flexDirection: 'row',\n justifyContent: 'space-between',\n minHeight: 48,\n paddingHorizontal: 20,\n width: '100%',\n },\n container: {\n width: '100%',\n },\n rightButtonWrapper: {\n alignItems: 'center',\n flexDirection: 'row',\n gap: '16',\n height: 48,\n justifyContent: 'center',\n paddingHorizontal: 12,\n paddingTop: 2,\n },\n title: {\n flex: 1,\n paddingBottom: 8, // to compensate \"l\" font line-height difference\n paddingTop: 9,\n },\n titleRow: {\n flexDirection: 'row',\n paddingLeft: 20,\n paddingRight: 8,\n width: '100%',\n },\n titleRow2nd: {\n marginBottom: 12,\n },\n titleRowNoBackButton: {\n marginTop: 12,\n },\n titleRowNoRightButton: {\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
|
|
83
83
|
backgroundColor: colorScheme.white
|
|
84
84
|
}]
|
|
85
|
-
}, data.header && 'entity' in data.header && /*#__PURE__*/_react.default.createElement(_components.
|
|
85
|
+
}, data.header && 'entity' in data.header && /*#__PURE__*/_react.default.createElement(_components.TrustInfo, _extends({}, data.header.entity, {
|
|
86
86
|
style: [styles.entity, {
|
|
87
|
-
|
|
87
|
+
borderBottomColor: colorScheme.background
|
|
88
88
|
}, data.header.entity.style]
|
|
89
89
|
})), data.header && 'credentialHeader' in data.header && /*#__PURE__*/_react.default.createElement(_credential.CredentialHeader, _extends({}, data.header.credentialHeader, {
|
|
90
90
|
blur: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_components","_headerButtons","_utils","_accessibility","_buttons","_credential","_icons","_screens","_text","_theme","_dataItem","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","useAppColorScheme","expandedCredential","onHeaderPress","setInitialCredential","useCredentialListExpandedCard","cardWidth","useMemo","Dimensions","width","useEffect","cards","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","HeaderInfoButton","onPress","concatTestID","accessibilityLabel","infoButtonAccessibility","hasAssets","header","ScrollViewScreen","leftItem","BackButton","rightItem","static","title","scrollView","style","styles","content","View","section","backgroundColor","white","EntityDetails","entity","borderColor","background","CredentialHeader","credentialHeader","blur","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","Typography","text","preset","sectionHeader","relatedAssets","TouchableOpacity","disabled","onPressed","accessory","NextIcon","assetsHeader","map","props","index","key","credential","CredentialDetails","expanded","lastItem","itemProps","headerPressable","toString","CredentialDetailsCardListItem","exports","StyleSheet","create","borderRadius","borderWidth","paddingHorizontal","paddingTop","marginBottom","borderBottomWidth","paddingBottom","marginTop","padding","marginHorizontal","marginVertical"],"sources":["history-details.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useEffect, useMemo } from 'react';\nimport { ColorValue, Dimensions, ImageSourcePropType, StyleSheet, View } from 'react-native';\n\nimport { CredentialDetails, CredentialDetailsProps, EntityDetails, EntityDetailsProps } from '../../components';\nimport { HeaderInfoButton } from '../../components/navigation/header-buttons';\nimport { CardLabels, concatTestID, useCredentialListExpandedCard } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport {\n CredentialDetailsCardListItem,\n CredentialDetailsCardListItemProps,\n CredentialHeader,\n CredentialHeaderProps,\n} from '../credential';\nimport { NextIcon } from '../icons';\nimport { ScrollViewScreen } from '../screens';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\nimport DataItem from './data-item';\n\nexport type HistoryDetailsLabels = {\n credentialCard: CardLabels;\n data: {\n date: string;\n action: string;\n };\n infoButtonAccessibility?: string;\n relatedAssets: string;\n title: string;\n};\n\ntype CredentialDetails = Omit<\n CredentialDetailsProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n>;\n\ntype CredentialCard = Omit<\n CredentialDetailsCardListItemProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n> & {\n /** default: true */\n headerPressable?: boolean;\n};\n\nexport type HistoryDetailsViewProps = {\n assets?: {\n header?: CredentialHeaderProps & {\n onPressed?: () => void;\n };\n cards?: (\n | {\n credentialDetails: CredentialDetails;\n }\n | {\n credentialCard: CredentialCard;\n }\n )[];\n };\n data: {\n header?:\n | {\n entity: EntityDetailsProps;\n }\n | {\n credentialHeader: CredentialHeaderProps;\n };\n date: string;\n action: {\n icon: ComponentType<any> | ReactElement;\n label: string;\n color: ColorValue;\n testID?: string;\n };\n };\n headerButton?: ReactElement;\n labels: HistoryDetailsLabels;\n onBackPressed: () => void;\n onInfoPressed?: () => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n testID: string;\n};\n\nexport const HistoryDetailsView: FC<HistoryDetailsViewProps> = ({\n assets,\n data,\n headerButton,\n labels,\n onBackPressed,\n onInfoPressed,\n onImagePreview,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { expandedCredential, onHeaderPress, setInitialCredential } = useCredentialListExpandedCard();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n // Expand the first credential\n useEffect(() => {\n if (assets?.cards && assets.cards.length > 0) {\n let id =\n 'credentialDetails' in assets.cards[0]\n ? assets.cards[0].credentialDetails.credentialId\n : assets.cards[0].credentialCard.card.credentialId;\n if (id) {\n setInitialCredential(id);\n }\n }\n }, [assets?.cards, setInitialCredential]);\n\n const moreInfoHeaderButton = useMemo(() => {\n if (headerButton) {\n return headerButton;\n }\n\n if (!onInfoPressed) {\n return undefined;\n }\n\n return (\n <HeaderInfoButton\n onPress={onInfoPressed}\n testID={concatTestID(testID, 'header', 'info')}\n accessibilityLabel={labels.infoButtonAccessibility ?? ''}\n />\n );\n }, [headerButton, labels.infoButtonAccessibility, onInfoPressed, testID]);\n\n const hasAssets = assets && (assets.header || assets.cards?.length);\n\n return (\n <ScrollViewScreen\n header={{\n leftItem: <BackButton onPress={onBackPressed} testID={concatTestID(testID, 'header', 'back')} />,\n rightItem: moreInfoHeaderButton,\n static: true,\n title: labels.title,\n }}\n scrollView={{\n style: styles.content,\n }}\n testID={testID}>\n <View style={[styles.section, { backgroundColor: colorScheme.white }]}>\n {data.header && 'entity' in data.header && (\n <EntityDetails\n {...data.header.entity}\n style={[styles.entity, { borderColor: colorScheme.background }, data.header.entity.style]}\n />\n )}\n {data.header && 'credentialHeader' in data.header && (\n <CredentialHeader\n {...data.header.credentialHeader}\n blur={false}\n style={[styles.header, { borderColor: colorScheme.background }, data.header.credentialHeader.style]}\n />\n )}\n <DataItem attribute={labels.data.date} value={data.date} />\n <DataItem\n attribute={labels.data.action}\n last\n testID={data.action.testID}\n value={data.action.label}\n valueColor={data.action.color}\n valueIcon={data.action.icon}\n />\n </View>\n\n {hasAssets && (\n <Typography color={colorScheme.text} preset=\"m\" style={styles.sectionHeader}>\n {labels.relatedAssets}\n </Typography>\n )}\n\n {assets?.header && (\n <TouchableOpacity disabled={!assets.header.onPressed} onPress={assets.header.onPressed}>\n <CredentialHeader\n {...assets.header}\n accessory={assets.header.onPressed ? <NextIcon color={colorScheme.text} /> : undefined}\n blur={false}\n style={[styles.assetsHeader, assets.header.style]}\n />\n </TouchableOpacity>\n )}\n {assets?.cards?.map((props, index, { length }) => {\n if ('credentialDetails' in props) {\n return (\n <View key={props.credentialDetails.credentialId} style={styles.credential}>\n <CredentialDetails\n {...props.credentialDetails}\n expanded={expandedCredential === props.credentialDetails.credentialId}\n labels={labels.credentialCard}\n lastItem={index === length - 1}\n onHeaderPress={onHeaderPress}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n } else {\n const itemProps = {\n ...props.credentialCard,\n card: {\n ...props.credentialCard.card,\n onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress,\n width: cardWidth,\n },\n };\n return (\n <View key={index.toString()} style={styles.credential}>\n <CredentialDetailsCardListItem\n {...itemProps}\n expanded={expandedCredential === props.credentialCard.card.credentialId}\n lastItem={index === length - 1}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n }\n })}\n </ScrollViewScreen>\n );\n};\n\nconst styles = StyleSheet.create({\n assetsHeader: {\n borderRadius: 8,\n borderWidth: 0,\n },\n content: {\n paddingHorizontal: 16,\n paddingTop: 12,\n },\n credential: {\n marginBottom: 4,\n },\n entity: {\n borderBottomWidth: 1,\n paddingBottom: 8,\n },\n header: {\n borderBottomWidth: 1,\n marginTop: -8,\n paddingBottom: 12,\n paddingHorizontal: 0,\n },\n section: {\n borderRadius: 8,\n borderWidth: 0,\n marginBottom: 12,\n padding: 12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AE;EACjB,CAAC;EACDhE,MAAM,EAAE;IACN+D,iBAAiB,EAAE,CAAC;IACpBE,SAAS,EAAE,CAAC,CAAC;IACbD,aAAa,EAAE,EAAE;IACjBJ,iBAAiB,EAAE;EACrB,CAAC;EACDhD,OAAO,EAAE;IACP8C,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE,CAAC;IACdG,YAAY,EAAE,EAAE;IAChBI,OAAO,EAAE;EACX,CAAC;EACD/B,aAAa,EAAE;IACbgC,gBAAgB,EAAE,CAAC;IACnBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_components","_headerButtons","_utils","_accessibility","_buttons","_credential","_icons","_screens","_text","_theme","_dataItem","_interopRequireDefault","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","HistoryDetailsView","assets","data","headerButton","labels","onBackPressed","onInfoPressed","onImagePreview","testID","_assets$cards","_assets$cards2","colorScheme","useAppColorScheme","expandedCredential","onHeaderPress","setInitialCredential","useCredentialListExpandedCard","cardWidth","useMemo","Dimensions","width","useEffect","cards","id","credentialDetails","credentialId","credentialCard","card","moreInfoHeaderButton","_labels$infoButtonAcc","undefined","createElement","HeaderInfoButton","onPress","concatTestID","accessibilityLabel","infoButtonAccessibility","hasAssets","header","ScrollViewScreen","leftItem","BackButton","rightItem","static","title","scrollView","style","styles","content","View","section","backgroundColor","white","TrustInfo","entity","borderBottomColor","background","CredentialHeader","credentialHeader","blur","borderColor","attribute","date","value","action","last","label","valueColor","color","valueIcon","icon","Typography","text","preset","sectionHeader","relatedAssets","TouchableOpacity","disabled","onPressed","accessory","NextIcon","assetsHeader","map","props","index","key","credential","CredentialDetails","expanded","lastItem","itemProps","headerPressable","toString","CredentialDetailsCardListItem","exports","StyleSheet","create","borderRadius","borderWidth","paddingHorizontal","paddingTop","marginBottom","borderBottomWidth","paddingBottom","marginTop","padding","marginHorizontal","marginVertical"],"sources":["history-details.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useEffect, useMemo } from 'react';\nimport { ColorValue, Dimensions, ImageSourcePropType, StyleSheet, View } from 'react-native';\n\nimport { CredentialDetails, CredentialDetailsProps, TrustInfo, TrustInfoProps } from '../../components';\nimport { HeaderInfoButton } from '../../components/navigation/header-buttons';\nimport { CardLabels, concatTestID, useCredentialListExpandedCard } from '../../utils';\nimport { TouchableOpacity } from '../accessibility';\nimport { BackButton } from '../buttons';\nimport {\n CredentialDetailsCardListItem,\n CredentialDetailsCardListItemProps,\n CredentialHeader,\n CredentialHeaderProps,\n} from '../credential';\nimport { NextIcon } from '../icons';\nimport { ScrollViewScreen } from '../screens';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\nimport DataItem from './data-item';\n\nexport type HistoryDetailsLabels = {\n credentialCard: CardLabels;\n data: {\n date: string;\n action: string;\n };\n infoButtonAccessibility?: string;\n relatedAssets: string;\n title: string;\n};\n\ntype CredentialDetails = Omit<\n CredentialDetailsProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n>;\n\ntype CredentialCard = Omit<\n CredentialDetailsCardListItemProps,\n 'expanded' | 'labels' | 'lastItem' | 'onHeaderPress' | 'onImagePreview'\n> & {\n /** default: true */\n headerPressable?: boolean;\n};\n\nexport type HistoryDetailsViewProps = {\n assets?: {\n header?: CredentialHeaderProps & {\n onPressed?: () => void;\n };\n cards?: (\n | {\n credentialDetails: CredentialDetails;\n }\n | {\n credentialCard: CredentialCard;\n }\n )[];\n };\n data: {\n header?:\n | {\n entity: TrustInfoProps;\n }\n | {\n credentialHeader: CredentialHeaderProps;\n };\n date: string;\n action: {\n icon: ComponentType<any> | ReactElement;\n label: string;\n color: ColorValue;\n testID?: string;\n };\n };\n headerButton?: ReactElement;\n labels: HistoryDetailsLabels;\n onBackPressed: () => void;\n onInfoPressed?: () => void;\n onImagePreview: (title: string, image: ImageSourcePropType) => void;\n testID: string;\n};\n\nexport const HistoryDetailsView: FC<HistoryDetailsViewProps> = ({\n assets,\n data,\n headerButton,\n labels,\n onBackPressed,\n onInfoPressed,\n onImagePreview,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const { expandedCredential, onHeaderPress, setInitialCredential } = useCredentialListExpandedCard();\n const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);\n\n // Expand the first credential\n useEffect(() => {\n if (assets?.cards && assets.cards.length > 0) {\n let id =\n 'credentialDetails' in assets.cards[0]\n ? assets.cards[0].credentialDetails.credentialId\n : assets.cards[0].credentialCard.card.credentialId;\n if (id) {\n setInitialCredential(id);\n }\n }\n }, [assets?.cards, setInitialCredential]);\n\n const moreInfoHeaderButton = useMemo(() => {\n if (headerButton) {\n return headerButton;\n }\n\n if (!onInfoPressed) {\n return undefined;\n }\n\n return (\n <HeaderInfoButton\n onPress={onInfoPressed}\n testID={concatTestID(testID, 'header', 'info')}\n accessibilityLabel={labels.infoButtonAccessibility ?? ''}\n />\n );\n }, [headerButton, labels.infoButtonAccessibility, onInfoPressed, testID]);\n\n const hasAssets = assets && (assets.header || assets.cards?.length);\n\n return (\n <ScrollViewScreen\n header={{\n leftItem: <BackButton onPress={onBackPressed} testID={concatTestID(testID, 'header', 'back')} />,\n rightItem: moreInfoHeaderButton,\n static: true,\n title: labels.title,\n }}\n scrollView={{\n style: styles.content,\n }}\n testID={testID}>\n <View style={[styles.section, { backgroundColor: colorScheme.white }]}>\n {data.header && 'entity' in data.header && (\n <TrustInfo\n {...data.header.entity}\n style={[styles.entity, { borderBottomColor: colorScheme.background }, data.header.entity.style]}\n />\n )}\n {data.header && 'credentialHeader' in data.header && (\n <CredentialHeader\n {...data.header.credentialHeader}\n blur={false}\n style={[styles.header, { borderColor: colorScheme.background }, data.header.credentialHeader.style]}\n />\n )}\n <DataItem attribute={labels.data.date} value={data.date} />\n <DataItem\n attribute={labels.data.action}\n last\n testID={data.action.testID}\n value={data.action.label}\n valueColor={data.action.color}\n valueIcon={data.action.icon}\n />\n </View>\n\n {hasAssets && (\n <Typography color={colorScheme.text} preset=\"m\" style={styles.sectionHeader}>\n {labels.relatedAssets}\n </Typography>\n )}\n\n {assets?.header && (\n <TouchableOpacity disabled={!assets.header.onPressed} onPress={assets.header.onPressed}>\n <CredentialHeader\n {...assets.header}\n accessory={assets.header.onPressed ? <NextIcon color={colorScheme.text} /> : undefined}\n blur={false}\n style={[styles.assetsHeader, assets.header.style]}\n />\n </TouchableOpacity>\n )}\n {assets?.cards?.map((props, index, { length }) => {\n if ('credentialDetails' in props) {\n return (\n <View key={props.credentialDetails.credentialId} style={styles.credential}>\n <CredentialDetails\n {...props.credentialDetails}\n expanded={expandedCredential === props.credentialDetails.credentialId}\n labels={labels.credentialCard}\n lastItem={index === length - 1}\n onHeaderPress={onHeaderPress}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n } else {\n const itemProps = {\n ...props.credentialCard,\n card: {\n ...props.credentialCard.card,\n onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress,\n width: cardWidth,\n },\n };\n return (\n <View key={index.toString()} style={styles.credential}>\n <CredentialDetailsCardListItem\n {...itemProps}\n expanded={expandedCredential === props.credentialCard.card.credentialId}\n lastItem={index === length - 1}\n onImagePreview={onImagePreview}\n />\n </View>\n );\n }\n })}\n </ScrollViewScreen>\n );\n};\n\nconst styles = StyleSheet.create({\n assetsHeader: {\n borderRadius: 8,\n borderWidth: 0,\n },\n content: {\n paddingHorizontal: 16,\n paddingTop: 12,\n },\n credential: {\n marginBottom: 4,\n },\n entity: {\n borderBottomWidth: 1,\n paddingBottom: 8,\n },\n header: {\n borderBottomWidth: 1,\n marginTop: -8,\n paddingBottom: 12,\n paddingHorizontal: 0,\n },\n section: {\n borderRadius: 8,\n borderWidth: 0,\n marginBottom: 12,\n padding: 12,\n },\n sectionHeader: {\n marginHorizontal: 4,\n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