@procivis/one-react-native-components 0.3.121 → 0.3.132
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 +5 -12
- 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 +0 -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 +7 -3
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- 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.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/history/history-section-list-item.js +2 -2
- package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/history/index.js +0 -8
- package/lib/commonjs/ui-components/history/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/contact.js.map +1 -1
- 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/list/index.js +8 -0
- package/lib/commonjs/ui-components/list/index.js.map +1 -1
- package/lib/commonjs/ui-components/{history/history-item.js → list/list-item.js} +32 -22
- package/lib/commonjs/ui-components/list/list-item.js.map +1 -0
- 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/nerd-mode-screen.js +7 -33
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- 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 +7 -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 +15 -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/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 +23 -18
- 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 +2 -2
- 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 +7 -14
- 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 +0 -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 +7 -3
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- 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.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/history/history-section-list-item.js +2 -2
- package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/module/ui-components/history/index.js +0 -2
- package/lib/module/ui-components/history/index.js.map +1 -1
- package/lib/module/ui-components/icons/contact.js.map +1 -1
- 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/list/index.js +2 -0
- package/lib/module/ui-components/list/index.js.map +1 -1
- package/lib/module/ui-components/{history/history-item.js → list/list-item.js} +32 -22
- package/lib/module/ui-components/list/list-item.js.map +1 -0
- 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/nerd-mode-screen.js +7 -33
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- 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 +7 -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 +13 -0
- 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/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 +24 -19
- 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 +2 -2
- 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 +0 -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/ui-components/history/history-details.d.ts +2 -2
- package/lib/typescript/ui-components/history/history-section-list-item.d.ts +2 -2
- package/lib/typescript/ui-components/history/index.d.ts +0 -3
- 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/list/index.d.ts +3 -0
- package/lib/typescript/ui-components/{history/history-item.d.ts → list/list-item.d.ts} +4 -4
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +0 -12
- 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 +1 -0
- package/lib/typescript/utils/hooks/core/index.d.ts +0 -1
- 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 +2 -2
- package/lib/typescript/utils/translations.d.ts +1 -0
- package/package.json +3 -3
- 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 +7 -12
- package/src/components/history/history-list-screen.tsx +1 -1
- package/src/components/index.ts +0 -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 +7 -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 +10 -1
- package/src/ui-components/history/history-details.tsx +4 -4
- package/src/ui-components/history/history-section-list-item.tsx +3 -3
- package/src/ui-components/history/index.ts +0 -3
- package/src/ui-components/icons/contact.tsx +1 -1
- package/src/ui-components/icons/credential.tsx +1 -1
- package/src/ui-components/icons/icons.tsx +18 -0
- package/src/ui-components/list/index.ts +3 -0
- package/src/ui-components/{history/history-item.tsx → list/list-item.tsx} +36 -33
- package/src/ui-components/loader/loading-result.tsx +7 -1
- package/src/ui-components/screens/nerd-mode-screen.tsx +2 -52
- package/src/utils/date.ts +7 -14
- package/src/utils/hooks/core/cache.ts +10 -3
- 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 +13 -0
- package/src/utils/hooks/core/index.ts +0 -1
- 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 +34 -14
- package/src/utils/parsers/credential-sharing.tsx +33 -16
- package/src/utils/parsers/credential.ts +45 -14
- package/src/utils/parsers/query.ts +5 -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/ui-components/history/history-item.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/ui-components/history/history-item.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSafeAreaContext","_button","_shareButton","_navigationHeader","_typography","_colorSchemeContext","_loader","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","LoadingResultScreen","button","header","loader","label","loaderProps","secondaryButton","button2","shareButton","style","tertiaryButton","button3","viewProps","colorScheme","useAppColorScheme","top","bottom","useSafeAreaInsets","headerPaddingStyle","Platform","OS","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","buttonsWrapperMarginStyle","marginBottom","createElement","View","container","backgroundColor","background","headerWrapper","loaderWrapper","align","color","text","preset","buttonWrapper","Button","title","StyleSheet","create","gap","height","justifyContent","padding","alignItems","flex","flexDirection","marginHorizontal","marginTop","alignSelf","_default","exports"],"sources":["loading-result.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Platform, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { Button, ButtonProps } from '../buttons/button';\nimport ShareButton, { ShareButtonProps } from '../buttons/share-button';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport LoaderView, { LoaderViewProps } from './loader';\n\nexport type LoadingResultScreenProps = ViewProps & {\n button?: ButtonProps;\n header?: NavigationHeaderProps;\n loader: LoaderViewProps & {\n label?: string;\n };\n secondaryButton?: ButtonProps;\n shareButton?: ShareButtonProps;\n tertiaryButton?: ButtonProps;\n};\n\nconst LoadingResultScreen: FC<LoadingResultScreenProps> = ({\n button,\n header,\n loader: { label, ...loaderProps },\n secondaryButton: button2,\n shareButton,\n style,\n tertiaryButton: button3,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const { top, bottom } = useSafeAreaInsets();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (!header?.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n let buttonsWrapperMarginStyle: ViewStyle = {\n marginBottom: bottom,\n };\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <View style={[styles.headerWrapper, headerPaddingStyle]}>\n <NavigationHeader {...header} />\n </View>\n <View style={styles.loaderWrapper}>\n <LoaderView {...loaderProps} />\n <Typography align=\"center\"
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_reactNative","_reactNativeSafeAreaContext","_utils","_button","_shareButton","_navigationHeader","_typography","_colorSchemeContext","_loader","e","__esModule","default","_extends","Object","assign","bind","n","arguments","length","t","r","hasOwnProperty","call","apply","LoadingResultScreen","button","header","loader","label","loaderProps","secondaryButton","button2","shareButton","style","tertiaryButton","button3","viewProps","colorScheme","useAppColorScheme","top","bottom","useSafeAreaInsets","headerPaddingStyle","Platform","OS","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","buttonsWrapperMarginStyle","marginBottom","createElement","View","container","backgroundColor","background","headerWrapper","loaderWrapper","testID","concatTestID","align","color","text","preset","buttonWrapper","Button","title","StyleSheet","create","gap","height","justifyContent","padding","alignItems","flex","flexDirection","marginHorizontal","marginTop","alignSelf","_default","exports"],"sources":["loading-result.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport { Platform, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { concatTestID } from '../../utils';\nimport { Button, ButtonProps } from '../buttons/button';\nimport ShareButton, { ShareButtonProps } from '../buttons/share-button';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport LoaderView, { LoaderViewProps } from './loader';\n\nexport type LoadingResultScreenProps = ViewProps & {\n button?: ButtonProps;\n header?: NavigationHeaderProps;\n loader: LoaderViewProps & {\n label?: string;\n };\n secondaryButton?: ButtonProps;\n shareButton?: ShareButtonProps;\n tertiaryButton?: ButtonProps;\n};\n\nconst LoadingResultScreen: FC<LoadingResultScreenProps> = ({\n button,\n header,\n loader: { label, ...loaderProps },\n secondaryButton: button2,\n shareButton,\n style,\n tertiaryButton: button3,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const { top, bottom } = useSafeAreaInsets();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (!header?.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n let buttonsWrapperMarginStyle: ViewStyle = {\n marginBottom: bottom,\n };\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <View style={[styles.headerWrapper, headerPaddingStyle]}>\n <NavigationHeader {...header} />\n </View>\n <View style={styles.loaderWrapper}>\n <LoaderView {...loaderProps} />\n <Typography\n testID={concatTestID(viewProps.testID, 'label')}\n align=\"center\"\n color={colorScheme.text}\n preset=\"regular\"\n style={styles.label}>\n {label}\n </Typography>\n </View>\n <View style={[styles.buttonWrapper, buttonsWrapperMarginStyle]}>\n {shareButton && <ShareButton {...shareButton} style={styles.shareButton} />}\n {button && <Button {...button}>{button.title}</Button>}\n {button2 && <Button {...button2}>{button2.title}</Button>}\n {button3 && <Button {...button3}>{button3.title}</Button>}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n buttonWrapper: {\n gap: 12,\n height: 274,\n justifyContent: 'flex-end',\n padding: 12,\n },\n container: {\n alignItems: 'stretch',\n flex: 1,\n flexDirection: 'column',\n justifyContent: 'space-between',\n },\n headerWrapper: {\n height: 215,\n },\n label: {\n marginHorizontal: 20,\n marginTop: 20,\n },\n loaderWrapper: {\n alignItems: 'center',\n flexDirection: 'column',\n height: 108,\n justifyContent: 'space-between',\n },\n modalHeaderWithoutHandle: {\n paddingTop: 15,\n },\n shareButton: {\n alignSelf: 'center',\n },\n});\n\nexport default LoadingResultScreen;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,2BAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,iBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAV,sBAAA,CAAAC,OAAA;AAAuD,SAAAD,uBAAAW,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,SAAA,WAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,CAAA,aAAAP,CAAA,MAAAA,CAAA,GAAAQ,SAAA,CAAAC,MAAA,EAAAT,CAAA,UAAAU,CAAA,GAAAF,SAAA,CAAAR,CAAA,YAAAW,CAAA,IAAAD,CAAA,OAAAE,cAAA,CAAAC,IAAA,CAAAH,CAAA,EAAAC,CAAA,MAAAJ,CAAA,CAAAI,CAAA,IAA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CAAC;AAED,MAAMnB,MAAM,GAAGoB,uBAAU,CAACC,MAAM,CAAC;EAC/BJ,aAAa,EAAE;IACbK,GAAG,EAAE,EAAE;IACPC,MAAM,EAAE,GAAG;IACXC,cAAc,EAAE,UAAU;IAC1BC,OAAO,EAAE;EACX,CAAC;EACDnB,SAAS,EAAE;IACToB,UAAU,EAAE,SAAS;IACrBC,IAAI,EAAE,CAAC;IACPC,aAAa,EAAE,QAAQ;IACvBJ,cAAc,EAAE;EAClB,CAAC;EACDf,aAAa,EAAE;IACbc,MAAM,EAAE;EACV,CAAC;EACD1C,KAAK,EAAE;IACLgD,gBAAgB,EAAE,EAAE;IACpBC,SAAS,EAAE;EACb,CAAC;EACDpB,aAAa,EAAE;IACbgB,UAAU,EAAE,QAAQ;IACpBE,aAAa,EAAE,QAAQ;IACvBL,MAAM,EAAE,GAAG;IACXC,cAAc,EAAE;EAClB,CAAC;EACDvB,wBAAwB,EAAE;IACxBH,UAAU,EAAE;EACd,CAAC;EACDb,WAAW,EAAE;IACX8C,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAEYa,mBAAmB","ignoreList":[]}
|
|
@@ -9,7 +9,6 @@ var _reactNative = require("react-native");
|
|
|
9
9
|
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
10
10
|
var _reactNativeSafeAreaContext = require("react-native-safe-area-context");
|
|
11
11
|
var _components = require("../../components");
|
|
12
|
-
var _entityDetailsWithButtons = _interopRequireDefault(require("../../components/entity/entity-details-with-buttons"));
|
|
13
12
|
var _contrastingStatusBar = _interopRequireDefault(require("../../utils/contrasting-status-bar"));
|
|
14
13
|
var _testID = require("../../utils/testID");
|
|
15
14
|
var _accessibilityHistoryWrappers = require("../accessibility/accessibilityHistoryWrappers");
|
|
@@ -70,35 +69,21 @@ const NerdModeScreen = ({
|
|
|
70
69
|
};
|
|
71
70
|
}, {});
|
|
72
71
|
const listHeader = (0, _react.useMemo)(() => {
|
|
73
|
-
var _entityCluster$
|
|
72
|
+
var _entityCluster$testID, _entityCluster$trustI;
|
|
74
73
|
if (!entityCluster) {
|
|
75
74
|
return null;
|
|
76
75
|
}
|
|
77
|
-
if (entityCluster.legacyTrustManagementEnabled) {
|
|
78
|
-
var _entityCluster$testID;
|
|
79
|
-
return /*#__PURE__*/_react.default.createElement(_entityDetailsWithButtons.default, _extends({}, entityCluster, {
|
|
80
|
-
entityType: EntityType.ProofEntity,
|
|
81
|
-
entityLabels: entityCluster.entityLabels,
|
|
82
|
-
attributesLabels: labels,
|
|
83
|
-
style: [styles.entityCluster, {
|
|
84
|
-
backgroundColor: colorScheme.nerdView.background
|
|
85
|
-
}],
|
|
86
|
-
onCopyToClipboard: onCopyToClipboard,
|
|
87
|
-
testID: (_entityCluster$testID = entityCluster.testID) !== null && _entityCluster$testID !== void 0 ? _entityCluster$testID : (0, _testID.concatTestID)(testID, 'entityCluster'),
|
|
88
|
-
textColor: colorScheme.white
|
|
89
|
-
}));
|
|
90
|
-
}
|
|
91
76
|
return /*#__PURE__*/_react.default.createElement(_components.TrustInfo, {
|
|
92
77
|
labels: entityCluster.trustInfoLabels,
|
|
93
78
|
onPress: onOpenTrustInfoDetails && entityCluster.trustInformation ? () => onOpenTrustInfoDetails(entityCluster.trustInformation) : undefined,
|
|
94
79
|
style: [styles.entityCluster, {
|
|
95
80
|
backgroundColor: colorScheme.nerdView.background
|
|
96
81
|
}],
|
|
97
|
-
testID: (_entityCluster$
|
|
82
|
+
testID: (_entityCluster$testID = entityCluster.testID) !== null && _entityCluster$testID !== void 0 ? _entityCluster$testID : (0, _testID.concatTestID)(testID, 'trustInfo'),
|
|
98
83
|
textColor: colorScheme.white,
|
|
99
84
|
trustInformation: (_entityCluster$trustI = entityCluster.trustInformation) === null || _entityCluster$trustI === void 0 ? void 0 : _entityCluster$trustI.eudiEcosystem
|
|
100
85
|
});
|
|
101
|
-
}, [entityCluster, colorScheme.nerdView.background, colorScheme.white,
|
|
86
|
+
}, [entityCluster, colorScheme.nerdView.background, colorScheme.white, onOpenTrustInfoDetails, testID]);
|
|
102
87
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_contrastingStatusBar.default, {
|
|
103
88
|
backgroundColor: colorScheme.nerdView.background
|
|
104
89
|
}), /*#__PURE__*/_react.default.createElement(_navigationHeader.default, {
|
|
@@ -119,28 +104,17 @@ const NerdModeScreen = ({
|
|
|
119
104
|
onScroll: onScroll,
|
|
120
105
|
renderItem: ({
|
|
121
106
|
item,
|
|
122
|
-
section
|
|
123
|
-
index
|
|
107
|
+
section
|
|
124
108
|
}) => {
|
|
125
109
|
if (isSectionEntityCluster(item)) {
|
|
126
|
-
var _item$testID, _item$
|
|
127
|
-
return
|
|
128
|
-
entityType: EntityType.CredentialEntity,
|
|
129
|
-
entityLabels: item.entityLabels,
|
|
130
|
-
attributesLabels: labels,
|
|
131
|
-
style: [styles.entityCluster, {
|
|
132
|
-
backgroundColor: colorScheme.nerdView.background
|
|
133
|
-
}],
|
|
134
|
-
onCopyToClipboard: onCopyToClipboard,
|
|
135
|
-
testID: (_item$testID = item.testID) !== null && _item$testID !== void 0 ? _item$testID : (0, _testID.concatTestID)(testID, 'sectionEntityCluster', index.toString()),
|
|
136
|
-
textColor: colorScheme.white
|
|
137
|
-
})) : /*#__PURE__*/_react.default.createElement(_components.TrustInfo, {
|
|
110
|
+
var _item$testID, _item$trustInformatio;
|
|
111
|
+
return /*#__PURE__*/_react.default.createElement(_components.TrustInfo, {
|
|
138
112
|
labels: item.trustInfoLabels,
|
|
139
113
|
onPress: onOpenTrustInfoDetails && item.trustInformation ? () => onOpenTrustInfoDetails(item.trustInformation) : undefined,
|
|
140
114
|
style: [styles.entityCluster, {
|
|
141
115
|
backgroundColor: colorScheme.nerdView.background
|
|
142
116
|
}],
|
|
143
|
-
testID: (_item$
|
|
117
|
+
testID: (_item$testID = item.testID) !== null && _item$testID !== void 0 ? _item$testID : (0, _testID.concatTestID)(testID, 'trustInfo'),
|
|
144
118
|
textColor: colorScheme.white,
|
|
145
119
|
trustInformation: (_item$trustInformatio = item.trustInformation) === null || _item$trustInformatio === void 0 ? void 0 : _item$trustInformatio.eudiEcosystem
|
|
146
120
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeSafeAreaContext","_components","_entityDetailsWithButtons","_interopRequireDefault","_contrastingStatusBar","_testID","_accessibilityHistoryWrappers","_entityCluster","_navigationHeader","_icons","_nerdModeItem","_typography","_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","EntityType","exports","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","Animated","createAnimatedComponent","SectionList","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","onOpenTrustInfoDetails","entityCluster","testID","title","insets","useSafeAreaInsets","colorScheme","useAppColorScheme","scrollOffset","useSharedValue","expandedAttributes","setExpandedAttributes","useState","onExpand","expanded","prev","onScroll","useAnimatedScrollHandler","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","attributeKey","listHeader","useMemo","_entityCluster$testID2","_entityCluster$trustI","legacyTrustManagementEnabled","_entityCluster$testID","createElement","entityType","ProofEntity","entityLabels","attributesLabels","style","styles","backgroundColor","nerdView","background","concatTestID","textColor","white","TrustInfo","trustInfoLabels","onPress","trustInformation","eudiEcosystem","Fragment","leftItem","TouchableOpacity","CloseIcon","color","paddingTop","top","titleColor","ListHeaderComponent","renderItem","section","index","_item$testID","_item$testID2","_item$trustInformatio","CredentialEntity","toString","last","renderSectionHeader","View","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","StyleSheet","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity","_default"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { IdentifierListItem, TrustInformationDetail } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { TrustInfo, TrustInfoLabels } from '../../components';\nimport EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface EntityLabels {\n trusted: string;\n unknownIssuer: string;\n unknownVerifier: string;\n visitWebsite: string;\n termsAndServices: string;\n privacyPolicy: string;\n}\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: IdentifierListItem;\n subline?: string;\n entityLabels: EntityLabels;\n legacyTrustManagementEnabled: boolean;\n role: ContextRole;\n testID?: string;\n trustInfoLabels: TrustInfoLabels;\n trustInformation?: TrustInformationDetail;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n onOpenTrustInfoDetails?: (trustInformation: TrustInformationDetail) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n onOpenTrustInfoDetails,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n const listHeader = useMemo(() => {\n if (!entityCluster) {\n return null;\n }\n if (entityCluster.legacyTrustManagementEnabled) {\n return (\n <EntityDetailsWithButtons\n {...entityCluster}\n entityType={EntityType.ProofEntity}\n entityLabels={entityCluster.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}\n textColor={colorScheme.white}\n />\n );\n }\n return (\n <TrustInfo\n labels={entityCluster.trustInfoLabels}\n onPress={\n onOpenTrustInfoDetails && entityCluster.trustInformation\n ? () => onOpenTrustInfoDetails(entityCluster.trustInformation!)\n : undefined\n }\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n testID={entityCluster.testID ?? concatTestID(testID, 'trustInfo')}\n textColor={colorScheme.white}\n trustInformation={entityCluster.trustInformation?.eudiEcosystem}\n />\n );\n }, [\n entityCluster,\n colorScheme.nerdView.background,\n colorScheme.white,\n labels,\n onCopyToClipboard,\n onOpenTrustInfoDetails,\n testID,\n ]);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={listHeader}\n onScroll={onScroll}\n renderItem={({ item, section, index }) => {\n if (isSectionEntityCluster(item)) {\n return item.legacyTrustManagementEnabled ? (\n <EntityDetailsWithButtons\n {...item}\n entityType={EntityType.CredentialEntity}\n entityLabels={item!.entityLabels}\n attributesLabels={labels}\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n onCopyToClipboard={onCopyToClipboard}\n testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}\n textColor={colorScheme.white}\n />\n ) : (\n <TrustInfo\n labels={item.trustInfoLabels}\n onPress={\n onOpenTrustInfoDetails && item.trustInformation\n ? () => onOpenTrustInfoDetails(item.trustInformation!)\n : undefined\n }\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n testID={item.testID ?? concatTestID(testID, 'trustInfo')}\n textColor={colorScheme.white}\n trustInformation={item.trustInformation?.eudiEcosystem}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n});\n\nexport default NerdModeScreen;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,yBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,qBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AACA,IAAAS,6BAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAAW,iBAAA,GAAAL,sBAAA,CAAAN,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,aAAA,GAAAP,sBAAA,CAAAN,OAAA;AACA,IAAAc,WAAA,GAAAR,sBAAA,CAAAN,OAAA;AACA,IAAAe,mBAAA,GAAAf,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EYkC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_reactNativeSafeAreaContext","_components","_contrastingStatusBar","_interopRequireDefault","_testID","_accessibilityHistoryWrappers","_entityCluster","_navigationHeader","_icons","_nerdModeItem","_typography","_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","EntityType","exports","isSectionEntityCluster","item","identifier","undefined","AnimatedSectionList","Animated","createAnimatedComponent","SectionList","NerdModeScreen","sections","labels","onClose","onCopyToClipboard","onOpenTrustInfoDetails","entityCluster","testID","title","insets","useSafeAreaInsets","colorScheme","useAppColorScheme","scrollOffset","useSharedValue","expandedAttributes","setExpandedAttributes","useState","onExpand","expanded","prev","onScroll","useAnimatedScrollHandler","contentOffset","value","y","lastElementsForSection","reduce","acc","sectionTitle","data","lastElement","attributeKey","listHeader","useMemo","_entityCluster$testID","_entityCluster$trustI","createElement","TrustInfo","trustInfoLabels","onPress","trustInformation","style","styles","backgroundColor","nerdView","background","concatTestID","textColor","white","eudiEcosystem","Fragment","leftItem","TouchableOpacity","CloseIcon","color","paddingTop","top","titleColor","ListHeaderComponent","renderItem","section","_item$testID","_item$trustInformatio","last","renderSectionHeader","View","sectionHeaderContainer","sectionHeaderText","scrollEventThrottle","stickySectionHeadersEnabled","StyleSheet","create","paddingHorizontal","paddingVertical","justifyContent","marginTop","opacity","_default"],"sources":["nerd-mode-screen.tsx"],"sourcesContent":["import { IdentifierListItem, TrustInformationDetail } from '@procivis/react-native-one-core';\nimport React, { FunctionComponent, useMemo, useState } from 'react';\nimport { SectionList, StyleSheet, View } from 'react-native';\nimport Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { TrustInfo, TrustInfoLabels } from '../../components';\nimport ContrastingStatusBar from '../../utils/contrasting-status-bar';\nimport { concatTestID } from '../../utils/testID';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport SectionEntityCluster from '../entity/entity-cluster';\nimport NavigationHeader from '../header/navigation-header';\nimport { CloseIcon } from '../icons/icons';\nimport NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport interface AttributesLabels {\n trustRegistry: string;\n issuerIdentifier: string;\n entityIdentifier: string;\n role: string;\n expand: string;\n collapse: string;\n}\n\ninterface SectionEntityCluster {\n identifier?: IdentifierListItem;\n subline?: string;\n testID?: string;\n trustInfoLabels: TrustInfoLabels;\n trustInformation?: TrustInformationDetail;\n}\n\ntype SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;\n\ntype NerdModeSectionItem = SectionAttribute | SectionEntityCluster;\n\nexport type NerdModeSection = {\n data: NerdModeSectionItem[];\n title?: string;\n};\n\nexport type NerdModeScreenProps = {\n entityCluster?: SectionEntityCluster;\n labels: AttributesLabels;\n onClose: () => void;\n onCopyToClipboard: (value: string) => void;\n onOpenTrustInfoDetails?: (trustInformation: TrustInformationDetail) => void;\n sections: NerdModeSection[];\n testID: string;\n title: string;\n};\n\nexport enum EntityType {\n CredentialEntity,\n ProofEntity,\n}\n\nfunction isSectionEntityCluster(item: NerdModeSectionItem): item is SectionEntityCluster {\n return (item as SectionEntityCluster).identifier !== undefined;\n}\n\nconst AnimatedSectionList = Animated.createAnimatedComponent(SectionList<NerdModeSectionItem>);\n\nconst NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({\n sections,\n labels,\n onClose,\n onCopyToClipboard,\n onOpenTrustInfoDetails,\n entityCluster,\n testID,\n title,\n}) => {\n const insets = useSafeAreaInsets();\n const colorScheme = useAppColorScheme();\n const scrollOffset = useSharedValue(0);\n const [expandedAttributes, setExpandedAttributes] = useState(0);\n\n // This is a bit of a hack. It's used to notify attributes that another attribute has been expanded\n // which will allow them to update their scroll offset accordingly.\n const onExpand = (expanded: boolean) => {\n setExpandedAttributes((prev) => (expanded ? prev + 1 : prev - 1));\n };\n\n const onScroll = useAnimatedScrollHandler({\n onScroll: ({ contentOffset }) => {\n scrollOffset.value = contentOffset.y;\n },\n });\n\n const lastElementsForSection = sections.reduce((acc, { title: sectionTitle = '', data }) => {\n const lastElement = data[data.length - 1];\n return {\n ...acc,\n [sectionTitle]: lastElement && !isSectionEntityCluster(lastElement) ? lastElement.attributeKey : '',\n };\n }, {} as Record<string, string>);\n\n const listHeader = useMemo(() => {\n if (!entityCluster) {\n return null;\n }\n return (\n <TrustInfo\n labels={entityCluster.trustInfoLabels}\n onPress={\n onOpenTrustInfoDetails && entityCluster.trustInformation\n ? () => onOpenTrustInfoDetails(entityCluster.trustInformation!)\n : undefined\n }\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n testID={entityCluster.testID ?? concatTestID(testID, 'trustInfo')}\n textColor={colorScheme.white}\n trustInformation={entityCluster.trustInformation?.eudiEcosystem}\n />\n );\n }, [\n entityCluster,\n colorScheme.nerdView.background,\n colorScheme.white,\n onOpenTrustInfoDetails,\n testID,\n ]);\n\n return (\n <>\n <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />\n <NavigationHeader\n leftItem={\n <TouchableOpacity onPress={onClose} testID={concatTestID(testID, 'closeIcon')}>\n <CloseIcon color={colorScheme.white} />\n </TouchableOpacity>\n }\n style={{\n backgroundColor: colorScheme.nerdView.background,\n paddingTop: insets.top,\n }}\n title={title}\n titleColor={colorScheme.white}\n />\n <AnimatedSectionList\n ListHeaderComponent={listHeader}\n onScroll={onScroll}\n renderItem={({ item, section }) => {\n if (isSectionEntityCluster(item)) {\n return (\n <TrustInfo\n labels={item.trustInfoLabels}\n onPress={\n onOpenTrustInfoDetails && item.trustInformation\n ? () => onOpenTrustInfoDetails(item.trustInformation!)\n : undefined\n }\n style={[\n styles.entityCluster,\n {\n backgroundColor: colorScheme.nerdView.background,\n },\n ]}\n testID={item.testID ?? concatTestID(testID, 'trustInfo')}\n textColor={colorScheme.white}\n trustInformation={item.trustInformation?.eudiEcosystem}\n />\n );\n } else {\n return (\n <NerdModeItem\n {...item}\n expandedAttributes={expandedAttributes}\n labels={labels}\n last={lastElementsForSection[section.title] === item.attributeKey}\n onCopyToClipboard={onCopyToClipboard}\n onExpand={onExpand}\n scrollOffset={scrollOffset}\n testID={concatTestID(testID, item.testID)}\n />\n );\n }\n }}\n renderSectionHeader={({ section }) => {\n return section.title ? (\n <View style={styles.sectionHeaderContainer} testID={concatTestID(testID, section.title)}>\n <Typography color={colorScheme.white} style={styles.sectionHeaderText}>\n {section.title}\n </Typography>\n </View>\n ) : null;\n }}\n scrollEventThrottle={16}\n sections={sections}\n stickySectionHeadersEnabled={false}\n style={{ backgroundColor: colorScheme.nerdView.background }}\n testID={testID}\n />\n </>\n );\n};\n\nconst styles = StyleSheet.create({\n entityCluster: {\n paddingHorizontal: 24,\n paddingVertical: 20,\n },\n sectionHeaderContainer: {\n justifyContent: 'center',\n marginTop: 20,\n paddingVertical: 16,\n },\n sectionHeaderText: {\n opacity: 0.7,\n paddingHorizontal: 20,\n },\n});\n\nexport default NerdModeScreen;\n"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,2BAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,qBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,6BAAA,GAAAR,OAAA;AACA,IAAAS,cAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,iBAAA,GAAAJ,sBAAA,CAAAN,OAAA;AACA,IAAA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IAAAK,QAAA,GAAAvF,OAAA,CAAAzB,OAAA,GAEYkC,cAAc","ignoreList":[]}
|
|
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.formatTimestamp = exports.formatTimeAgo = exports.formatTime = exports.formatMonth = exports.formatDateTimeLocalized = exports.formatDateTime = exports.formatDateOnlyFromUTCTimestamp = exports.formatDateLocalized = exports.formatDate = exports.convertDateToUTCTimestamp = exports.convertDateStrToLocalDate = void 0;
|
|
7
7
|
var _reactNative = require("react-native");
|
|
8
8
|
var _timeago = require("timeago.js");
|
|
9
|
-
var
|
|
9
|
+
var _ref; // Date & Time formatted as specified in SW-610
|
|
10
10
|
const MINUTE = 60 * 1000;
|
|
11
11
|
const DAY = 24 * 60 * MINUTE;
|
|
12
12
|
|
|
13
13
|
// OS locale
|
|
14
|
-
const systemLocale = (
|
|
14
|
+
const systemLocale = (_ref = _reactNative.Platform.OS === 'ios' ? _reactNative.Settings.get('AppleLocale') : _reactNative.I18nManager.getConstants().localeIdentifier) === null || _ref === void 0 || (_ref = _ref.match(/[a-zA-Z]+_[a-zA-Z]+/)[0]) === null || _ref === void 0 ? void 0 : _ref.replaceAll('_', '-');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Date only format
|
|
@@ -142,13 +142,12 @@ const formatDateOnlyFromUTCTimestamp = utcTimestamp => {
|
|
|
142
142
|
return (_formatDate = formatDate(convertDateStrToLocalDate(`${utcDate.getUTCFullYear()}-${pad(utcDate.getUTCMonth() + 1)}-${pad(utcDate.getUTCDate())}`))) !== null && _formatDate !== void 0 ? _formatDate : '';
|
|
143
143
|
};
|
|
144
144
|
exports.formatDateOnlyFromUTCTimestamp = formatDateOnlyFromUTCTimestamp;
|
|
145
|
-
const locale = (_ref = _reactNative.Platform.OS === 'ios' ? _reactNative.Settings.get('AppleLocale') : _reactNative.I18nManager.getConstants().localeIdentifier) === null || _ref === void 0 ? void 0 : _ref.split('@')[0].replace('_', '-');
|
|
146
145
|
const formatDateTimeLocalized = date => {
|
|
147
|
-
return formatDateTime(date,
|
|
146
|
+
return formatDateTime(date, systemLocale);
|
|
148
147
|
};
|
|
149
148
|
exports.formatDateTimeLocalized = formatDateTimeLocalized;
|
|
150
149
|
const formatDateLocalized = date => {
|
|
151
|
-
return formatDate(date,
|
|
150
|
+
return formatDate(date, systemLocale);
|
|
152
151
|
};
|
|
153
152
|
exports.formatDateLocalized = formatDateLocalized;
|
|
154
153
|
//# sourceMappingURL=date.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_timeago","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_timeago","_ref","MINUTE","DAY","systemLocale","Platform","OS","Settings","get","I18nManager","getConstants","localeIdentifier","match","replaceAll","formatDate","date","locale","options","toLocaleDateString","undefined","exports","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","format","formatTimestamp","nowLabel","_formatDateTime2","now","Date","timestamp","getTime","_formatDateTime","pad","x","String","convertDateToUTCTimestamp","parse","getMonth","getDate","convertDateStrToLocalDate","select","android","timezoneOffset","getTimezoneOffset","default","formatDateOnlyFromUTCTimestamp","utcTimestamp","_formatDate","utcDate","getUTCFullYear","getUTCMonth","getUTCDate","formatDateTimeLocalized","formatDateLocalized"],"sources":["date.ts"],"sourcesContent":["// Date & Time formatted as specified in SW-610\n\nimport { I18nManager, Platform, Settings } from 'react-native';\nimport { format } from 'timeago.js';\n\nconst MINUTE = 60 * 1000;\nconst DAY = 24 * 60 * MINUTE;\n\n// OS locale\nconst systemLocale: string | undefined = (\n Platform.OS === 'ios' ? Settings.get('AppleLocale') : I18nManager.getConstants().localeIdentifier\n)\n ?.match(/[a-zA-Z]+_[a-zA-Z]+/)[0]\n ?.replaceAll('_', '-');\n\n/**\n * Date only format\n */\nexport const formatDate = (date: Date, locale?: string, options?: Intl.DateTimeFormatOptions) => {\n try {\n return date.toLocaleDateString(locale || systemLocale, options);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Time only format\n */\nexport const formatTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleTimeString(locale || systemLocale, { hour: '2-digit', minute: '2-digit' });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Date and time format\n */\nexport const formatDateTime = (date: Date, locale?: string) => {\n try {\n return date.toLocaleString(locale || systemLocale, {\n hour: '2-digit',\n minute: '2-digit',\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour12: locale === 'en-US',\n });\n } catch {\n return undefined;\n }\n};\n\n/**\n * Month format\n */\nexport const formatMonth = (date: Date, locale: string): string => {\n return `${date.toLocaleString(locale, {\n month: 'long',\n })} ${date.getFullYear()}`;\n};\n\n/**\n * Time-ago format\n */\nexport const formatTimeAgo = (date: Date, locale: string): string => {\n return format(date, locale);\n};\n\n/**\n * Timestamp formatted for general use\n */\nexport const formatTimestamp = (date: Date, locale: string, nowLabel: string): string => {\n const now = Date.now();\n const timestamp = date.getTime();\n if (now < timestamp) {\n // in the future\n return formatDateTime(date, locale) ?? '';\n }\n\n // in the past\n if (now - timestamp < MINUTE) {\n // less than a minute ago\n return nowLabel;\n }\n\n // less than a day ago\n if (now - timestamp < DAY) {\n return formatTimeAgo(date, locale);\n }\n\n // longer ago\n return formatDateTime(date, locale) ?? '';\n};\n\nconst pad = (x: number) => (x >= 0 && x < 10 ? `0${x}` : String(x));\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {Date} date local timezone representation\n * @returns {number} the same day, but UTC timezone with midnight time\n */\nexport const convertDateToUTCTimestamp = (date: Date): number =>\n Date.parse(`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`);\n\n/**\n * Utility function to deal with `date`-type attributes\n * @param {string} date in YYYY-MM-DD representation\n * @returns {Date} the same day, but local timezone with midnight time\n */\nexport const convertDateStrToLocalDate = (date: string): Date =>\n Platform.select({\n // android conversion using the standard date parsing doesn't work, computing the timestamp manually\n android: (() => {\n const timestamp = Date.parse(date);\n const timezoneOffset = new Date(date).getTimezoneOffset();\n return new Date(timestamp + timezoneOffset * MINUTE);\n })(),\n default: new Date(`${date}T00:00:00`),\n });\n\n/**\n * Inverted function to {@link convertDateToUTCTimestamp}\n * @param {number} utcTimestamp date timestamp represented as midnight UTC time\n * @returns {string} formatted date (based on locale settings, e.g. `21/02/2021`)\n */\nexport const formatDateOnlyFromUTCTimestamp = (utcTimestamp: number): string => {\n const utcDate = new Date(utcTimestamp);\n return (\n formatDate(\n convertDateStrToLocalDate(\n `${utcDate.getUTCFullYear()}-${pad(utcDate.getUTCMonth() + 1)}-${pad(utcDate.getUTCDate())}`,\n ),\n ) ?? ''\n );\n};\n\nexport const formatDateTimeLocalized = (date: Date) => {\n return formatDateTime(date, systemLocale);\n};\n\nexport const formatDateLocalized = (date: Date) => {\n return formatDate(date, systemLocale);\n};\n"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAAoC,IAAAE,IAAA,EAHpC;AAKA,MAAMC,MAAM,GAAG,EAAE,GAAG,IAAI;AACxB,MAAMC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAGD,MAAM;;AAE5B;AACA,MAAME,YAAgC,IAAAH,IAAA,GACpCI,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAGC,qBAAQ,CAACC,GAAG,CAAC,aAAa,CAAC,GAAGC,wBAAW,CAACC,YAAY,CAAC,CAAC,CAACC,gBAAgB,cAAAV,IAAA,gBAAAA,IAAA,GAD1DA,IAAA,CAGrCW,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,cAAAX,IAAA,uBAHMA,IAAA,CAIrCY,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC;;AAExB;AACA;AACA;AACO,MAAMC,UAAU,GAAGA,CAACC,IAAU,EAAEC,MAAe,EAAEC,OAAoC,KAAK;EAC/F,IAAI;IACF,OAAOF,IAAI,CAACG,kB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AAA,uBAAA;AAEK,MAAMC,mBAAmB,GAAIjD,IAAU,IAAK;EACjD,OAAOD,UAAU,CAACC,IAAI,EAAEX,YAAY,CAAC;AACvC,CAAC;AAACgB,OAAA,CAAA4C,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -8,9 +8,10 @@ var _reactNativeOneCore = require("@procivis/react-native-one-core");
|
|
|
8
8
|
var _reactQuery = require("react-query");
|
|
9
9
|
var _coreContext = require("./core-context");
|
|
10
10
|
var _credentials = require("./credentials");
|
|
11
|
-
var
|
|
11
|
+
var _verifierInstance = require("./verifier-instance");
|
|
12
|
+
var _walletUnit = require("./wallet-unit");
|
|
12
13
|
const CREDENTIAL_QUERY_KEYS = [_credentials.CREDENTIAL_LIST_QUERY_KEY, _credentials.CREDENTIAL_LIST_PAGED_QUERY_KEY, _credentials.CREDENTIAL_DETAIL_QUERY_KEY];
|
|
13
|
-
const
|
|
14
|
+
const WALLET_VERIFIER_INSTANCE_QUERY_KEYS = [_walletUnit.WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY, _walletUnit.WALLET_UNIT_QUERY_KEY, _verifierInstance.VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY];
|
|
14
15
|
|
|
15
16
|
// Map each CacheType to the query keys that should be invalidated when that cache is cleared.
|
|
16
17
|
const cacheTypeToQueryKeys = {
|
|
@@ -19,11 +20,13 @@ const cacheTypeToQueryKeys = {
|
|
|
19
20
|
[_reactNativeOneCore.CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
|
|
20
21
|
[_reactNativeOneCore.CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
|
|
21
22
|
[_reactNativeOneCore.CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
|
|
22
|
-
[_reactNativeOneCore.CacheType.TRUST_LIST]:
|
|
23
|
+
[_reactNativeOneCore.CacheType.TRUST_LIST]: CREDENTIAL_QUERY_KEYS,
|
|
23
24
|
[_reactNativeOneCore.CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
24
25
|
[_reactNativeOneCore.CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
25
26
|
[_reactNativeOneCore.CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,
|
|
26
|
-
[_reactNativeOneCore.CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS
|
|
27
|
+
[_reactNativeOneCore.CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS,
|
|
28
|
+
[_reactNativeOneCore.CacheType.WALLET_PROVIDER_METADATA]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,
|
|
29
|
+
[_reactNativeOneCore.CacheType.REMOTE_TRUST_COLLECTION]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS
|
|
27
30
|
};
|
|
28
31
|
const useCacheClear = () => {
|
|
29
32
|
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeOneCore","require","_reactQuery","_coreContext","_credentials","
|
|
1
|
+
{"version":3,"names":["_reactNativeOneCore","require","_reactQuery","_coreContext","_credentials","_verifierInstance","_walletUnit","CREDENTIAL_QUERY_KEYS","CREDENTIAL_LIST_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_DETAIL_QUERY_KEY","WALLET_VERIFIER_INSTANCE_QUERY_KEYS","WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY","WALLET_UNIT_QUERY_KEY","VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY","cacheTypeToQueryKeys","CacheType","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","OPEN_ID_METADATA_HOLDER","OPEN_ID_METADATA_ISSUER","WALLET_PROVIDER_METADATA","REMOTE_TRUST_COLLECTION","useCacheClear","queryClient","useQueryClient","core","useONECore","useMutation","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries","exports"],"sources":["cache.ts"],"sourcesContent":["import { CacheType } from '@procivis/react-native-one-core';\nimport { useMutation, useQueryClient } from 'react-query';\n\nimport { useONECore } from './core-context';\nimport { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';\nimport { VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY } from './verifier-instance';\nimport { WALLET_UNIT_QUERY_KEY, WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY } from './wallet-unit';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst WALLET_VERIFIER_INSTANCE_QUERY_KEYS = [\n WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY,\n WALLET_UNIT_QUERY_KEY,\n VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY,\n];\n\n// Map each CacheType to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheType, string[]> = {\n [CacheType.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheType.TRUST_LIST]: CREDENTIAL_QUERY_KEYS,\n [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,\n [CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS,\n [CacheType.WALLET_PROVIDER_METADATA]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,\n [CacheType.REMOTE_TRUST_COLLECTION]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheType[]) => {\n await core.deleteCache(cacheTypes);\n return cacheTypes;\n },\n {\n onSuccess: async (_, cacheTypes) => {\n const queryKeysToInvalidate = new Set<string>();\n\n cacheTypes.forEach((cacheType) => {\n const keys = cacheTypeToQueryKeys[cacheType] || [];\n keys.forEach((key) => queryKeysToInvalidate.add(key));\n });\n\n await Promise.all([...queryKeysToInvalidate].map((queryKey) => queryClient.invalidateQueries(queryKey)));\n },\n },\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAEA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAEA,MAAMM,qBAAqB,GAAG,CAACC,sCAAyB,EAAEC,4CAA+B,EAAEC,wCAA2B,CAAC;AACvH,MAAMC,mCAAmC,GAAG,CAC1CC,mDAAuC,EACvCC,iCAAqB,EACrBC,+DAA6C,CAC9C;;AAED;AACA,MAAMC,oBAAiD,GAAG;EACxD,CAACC,6BAAS,CAACC,YAAY,GAAGV,qBAAqB;EAC/C,CAACS,6BAAS,CAACE,eAAe,GAAGX,qBAAqB;EAClD,CAACS,6BAAS,CAACG,sBAAsB,GAAGZ,qBAAqB;EACzD,CAACS,6BAAS,CAACI,YAAY,GAAGb,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AACE,OAAA,CAAAtB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.useCoreConfig = exports.
|
|
6
|
+
exports.useCoreConfig = exports.getEnabledTransports = exports.getEnabledExchangeProtocols = void 0;
|
|
7
7
|
var _reactQuery = require("react-query");
|
|
8
8
|
var _coreContext = require("./core-context");
|
|
9
9
|
const CONFIG_QUERY_KEY = 'config';
|
|
@@ -25,9 +25,4 @@ const getEnabledExchangeProtocols = exchangeProtocol => {
|
|
|
25
25
|
return Object.values(exchangeProtocol !== null && exchangeProtocol !== void 0 ? exchangeProtocol : {}).filter(t => t.enabled !== false).map(exchange => exchange.type);
|
|
26
26
|
};
|
|
27
27
|
exports.getEnabledExchangeProtocols = getEnabledExchangeProtocols;
|
|
28
|
-
const getEnabledTrustManagement = config => {
|
|
29
|
-
var _config$trustManageme;
|
|
30
|
-
return Object.values((_config$trustManageme = config === null || config === void 0 ? void 0 : config.trustManagement) !== null && _config$trustManageme !== void 0 ? _config$trustManageme : {}).filter(t => t.enabled !== false).map(trustManagement => trustManagement.type);
|
|
31
|
-
};
|
|
32
|
-
exports.getEnabledTrustManagement = getEnabledTrustManagement;
|
|
33
28
|
//# sourceMappingURL=core-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactQuery","require","_coreContext","CONFIG_QUERY_KEY","useCoreConfig","core","useONECore","useQuery","getConfig","keepPreviousData","exports","getEnabledTransports","config","_config$transport","Object","values","transport","filter","t","enabled","map","type","getEnabledExchangeProtocols","exchangeProtocol","exchange"
|
|
1
|
+
{"version":3,"names":["_reactQuery","require","_coreContext","CONFIG_QUERY_KEY","useCoreConfig","core","useONECore","useQuery","getConfig","keepPreviousData","exports","getEnabledTransports","config","_config$transport","Object","values","transport","filter","t","enabled","map","type","getEnabledExchangeProtocols","exchangeProtocol","exchange"],"sources":["core-config.ts"],"sourcesContent":["import { ConfigEntities, CoreConfig } from '@procivis/react-native-one-core';\nimport { useQuery } from 'react-query';\n\nimport { useONECore } from './core-context';\n\nconst CONFIG_QUERY_KEY = 'config';\n\nexport const useCoreConfig = () => {\n const { core } = useONECore();\n\n return useQuery([CONFIG_QUERY_KEY], () => core?.getConfig(), {\n keepPreviousData: true,\n });\n};\n\nexport const getEnabledTransports = (config: CoreConfig): string[] => {\n return Object.values(config?.transport ?? {})\n .filter((t) => t.enabled !== false)\n .map((transport) => transport.type);\n};\n\nexport const getEnabledExchangeProtocols = (exchangeProtocol: ConfigEntities<any>): string[] => {\n return Object.values(exchangeProtocol ?? {})\n .filter((t) => t.enabled !== false)\n .map((exchange) => exchange.type);\n};\n\n"],"mappings":";;;;;;AACA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,MAAME,gBAAgB,GAAG,QAAQ;AAE1B,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,uBAAU,EAAC,CAAC;EAE7B,OAAO,IAAAC,oBAAQ,EAAC,CAACJ,gBAAgB,CAAC,EAAE,MAAME,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEG,SAAS,CAAC,CAAC,EAAE;IAC3DC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAN,aAAA,GAAAA,aAAA;AAEK,MAAMO,oBAAoB,GAAIC,MAAkB,IAAe;EAAA,IAAAC,iBAAA;EACpE,OAAOC,MAAM,CAACC,MAAM,EAAAF,iBAAA,GAACD,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEI,SAAS,cAAAH,iBAAA,cAAAA,iBAAA,GAAI,CAAC,CAAC,CAAC,CAC1CI,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEJ,SAAS,IAAKA,SAAS,CAACK,IAAI,CAAC;AACvC,CAAC;AAACX,OAAA,CAAAC,oBAAA,GAAAA,oBAAA;AAEK,MAAMW,2BAA2B,GAAIC,gBAAqC,IAAe;EAC9F,OAAOT,MAAM,CAACC,MAAM,CAACQ,gBAAgB,aAAhBA,gBAAgB,cAAhBA,gBAAgB,GAAI,CAAC,CAAC,CAAC,CACzCN,MAAM,CAAEC,CAAC,IAAKA,CAAC,CAACC,OAAO,KAAK,KAAK,CAAC,CAClCC,GAAG,CAAEI,QAAQ,IAAKA,QAAQ,CAACH,IAAI,CAAC;AACrC,CAAC;AAACX,OAAA,CAAAY,2BAAA,GAAAA,2BAAA","ignoreList":[]}
|
|
@@ -7,8 +7,6 @@ exports.useONECore = exports.ONECoreContextProvider = void 0;
|
|
|
7
7
|
var _reactNativeOneCore = require("@procivis/react-native-one-core");
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _reporting = require("../../reporting");
|
|
10
|
-
var _coreConfig = require("./core-config");
|
|
11
|
-
var _trustEntity = require("./trust-entity");
|
|
12
10
|
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); }
|
|
13
11
|
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; }
|
|
14
12
|
const defaultContextValue = {
|
|
@@ -20,11 +18,9 @@ const ONECoreContext = /*#__PURE__*/(0, _react.createContext)(defaultContextValu
|
|
|
20
18
|
const ONECoreContextProvider = ({
|
|
21
19
|
children,
|
|
22
20
|
organisationId = defaultContextValue.organisationId,
|
|
23
|
-
publisherReference,
|
|
24
21
|
config
|
|
25
22
|
}) => {
|
|
26
23
|
const [core, setCore] = (0, _react.useState)();
|
|
27
|
-
const createTrustAnchor = (0, _trustEntity.useCreateTrustAnchor)();
|
|
28
24
|
const initialize = (0, _react.useCallback)(async force => {
|
|
29
25
|
if (core && !force) {
|
|
30
26
|
return core;
|
|
@@ -48,17 +44,6 @@ const ONECoreContextProvider = ({
|
|
|
48
44
|
},
|
|
49
45
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
46
|
[]);
|
|
51
|
-
(0, _react.useEffect)(() => {
|
|
52
|
-
if (!core || !publisherReference) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
core.getConfig().then(coreConfig => {
|
|
56
|
-
const trustManagementEnabled = (0, _coreConfig.getEnabledTrustManagement)(coreConfig).includes(_trustEntity.TrustManagementEnum.SimpleTrustList);
|
|
57
|
-
if (trustManagementEnabled) {
|
|
58
|
-
createTrustAnchor(core, publisherReference).catch(() => {});
|
|
59
|
-
}
|
|
60
|
-
}).catch(() => {});
|
|
61
|
-
}, [core, createTrustAnchor, publisherReference]);
|
|
62
47
|
const contextValue = (0, _react.useMemo)(() => ({
|
|
63
48
|
core: core !== null && core !== void 0 ? core : defaultContextValue.core,
|
|
64
49
|
organisationId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_reporting","
|
|
1
|
+
{"version":3,"names":["_reactNativeOneCore","require","_react","_interopRequireWildcard","_reporting","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","createContext","ONECoreContextProvider","children","config","setCore","useState","useCallback","force","coreInstance","initializeCore","reportException","useEffect","corePromise","then","c","uninitialize","catch","contextValue","useMemo","createElement","Provider","value","exports","useONECore","useContext"],"sources":["core-context.tsx"],"sourcesContent":["import { initializeCore, ONECore } from '@procivis/react-native-one-core';\nimport React, {\n createContext,\n FC,\n PropsWithChildren,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from 'react';\n\nimport { reportException } from '../../reporting';\n\ninterface ContextValue {\n core: ONECore;\n organisationId: string;\n initialize: (force?: boolean) => Promise<ONECore>;\n}\n\nconst defaultContextValue: ContextValue = {\n core: {} as ONECore,\n organisationId: '11111111-2222-3333-a444-ffffffffffff',\n initialize: () => Promise.reject(),\n};\n\nexport type ONECoreContextProviderProps = {\n config?: Record<string, unknown>;\n organisationId?: string;\n};\n\nconst ONECoreContext = createContext<ContextValue>(defaultContextValue);\n\nexport const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({\n children,\n organisationId = defaultContextValue.organisationId,\n config,\n}) => {\n const [core, setCore] = useState<ONECore>();\n\n const initialize = useCallback(\n async (force?: boolean) => {\n if (core && !force) {\n return core;\n }\n\n try {\n const coreInstance = await initializeCore(config);\n setCore(coreInstance);\n return coreInstance;\n } catch (e) {\n reportException(e, 'Failed to initialize core');\n throw e;\n }\n },\n [core, config],\n );\n\n useEffect(\n () => {\n const corePromise = initialize();\n return () => {\n corePromise\n .then((c) => c?.uninitialize(false))\n .catch((e) => {\n reportException(e, 'Core uninitialization error');\n });\n };\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [],\n );\n\n const contextValue = useMemo(\n () => ({\n core: core ?? defaultContextValue.core,\n organisationId,\n initialize,\n }),\n [core, initialize, organisationId],\n );\n\n if (!core) {\n return null;\n }\n\n return <ONECoreContext.Provider value={contextValue}>{children}</ONECoreContext.Provider>;\n};\n\nexport const useONECore = () => useContext(ONECoreContext);\n"],"mappings":";;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAWA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,CAAC,EACF,CAACF,IAAI,EAAEE,UAAU,EAAED,cAAc,CACnC,CAAC;EAED,IAAI,CAACD,IAAI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,oBAAOxB,MAAA,CAAAS,OAAA,CAAAwC,aAAA,CAACpB,cAAc,CAACqB,QAAQ;IAACC,KAAK,EAAEJ;EAAa,GAAEf,QAAkC,CAAC;AAC3F,CAAC;AAACoB,OAAA,CAAArB,sBAAA,GAAAA,sBAAA;AAEK,MAAMsB,UAAU,GAAGA,CAAA,KAAM,IAAAC,iBAAU,EAACzB,cAAc,CAAC;AAACuB,OAAA,CAAAC,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.usePagedCredentials = exports.useInvitationHandler = exports.useInvalidateCredentialDetails = exports.useInitiateIssuance = exports.useCredentialsTrustInformation = exports.useCredentials = exports.useCredentialTrustInformation = exports.useCredentialRevocationCheck = exports.useCredentialReject = exports.useCredentialDetail = exports.useCredentialDelete = exports.useCredentialAccept = exports.useContinueIssuance = exports.CREDENTIAL_TRUST_INFORMATION_QUERY_KEY = exports.CREDENTIAL_LIST_QUERY_KEY = exports.CREDENTIAL_LIST_PAGED_QUERY_KEY = exports.CREDENTIAL_DETAIL_QUERY_KEY = void 0;
|
|
6
|
+
exports.usePagedCredentials = exports.useInvitationHandler = exports.useInvalidateCredentialDetails = exports.useInitiateIssuance = exports.useCredentialsTrustInformation = exports.useCredentials = exports.useCredentialTrustInformation = exports.useCredentialRevocationCheck = exports.useCredentialReject = exports.useCredentialRefresh = exports.useCredentialDetail = exports.useCredentialDelete = exports.useCredentialAccept = exports.useContinueIssuance = exports.CREDENTIAL_TRUST_INFORMATION_QUERY_KEY = exports.CREDENTIAL_LIST_QUERY_KEY = exports.CREDENTIAL_LIST_PAGED_QUERY_KEY = exports.CREDENTIAL_DETAIL_QUERY_KEY = void 0;
|
|
7
7
|
var _reactNativeOneCore = require("@procivis/react-native-one-core");
|
|
8
8
|
var _reactQuery = require("react-query");
|
|
9
9
|
var _query = require("../../parsers/query");
|
|
@@ -154,6 +154,20 @@ const useCredentialDelete = () => {
|
|
|
154
154
|
});
|
|
155
155
|
};
|
|
156
156
|
exports.useCredentialDelete = useCredentialDelete;
|
|
157
|
+
const useCredentialRefresh = () => {
|
|
158
|
+
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
159
|
+
const {
|
|
160
|
+
core
|
|
161
|
+
} = (0, _coreContext.useONECore)();
|
|
162
|
+
return (0, _reactQuery.useMutation)(async interactionId => core.holderRefreshCredential(interactionId), {
|
|
163
|
+
onSuccess: async () => {
|
|
164
|
+
await queryClient.invalidateQueries(CREDENTIAL_LIST_QUERY_KEY);
|
|
165
|
+
await queryClient.invalidateQueries(CREDENTIAL_DETAIL_QUERY_KEY);
|
|
166
|
+
await queryClient.invalidateQueries(_history.HISTORY_LIST_QUERY_KEY);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
exports.useCredentialRefresh = useCredentialRefresh;
|
|
157
171
|
const useInvalidateCredentialDetails = () => {
|
|
158
172
|
const queryClient = (0, _reactQuery.useQueryClient)();
|
|
159
173
|
return credentialId => queryClient.invalidateQueries([CREDENTIAL_DETAIL_QUERY_KEY, credentialId]);
|