@procivis/one-react-native-components 0.3.94 → 0.3.99
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +2 -2
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +3 -3
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/history/history-details-screen.js +10 -10
- package/lib/commonjs/components/history/history-details-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item-icon.js +12 -8
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js +1 -1
- package/lib/commonjs/components/history/history-list-section-header.js.map +1 -1
- package/lib/commonjs/components/history/history-list.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js +1 -1
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +2 -2
- 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 +2 -2
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale/fi.json +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/ui-components/settings/button-setting.js +3 -1
- package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item.js +4 -2
- package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
- package/lib/commonjs/ui-components/settings/switch-setting.js +4 -2
- package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/history.js +1 -41
- package/lib/commonjs/utils/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +3 -3
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +10 -10
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-context.js +5 -5
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +3 -3
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/history.js +1 -1
- package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +3 -3
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +9 -9
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +5 -5
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +11 -10
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +14 -33
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +4 -12
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +31 -32
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/url.js.map +1 -1
- package/lib/module/components/backup/preview-credentials.js.map +1 -1
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/entity/EntityButtons.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +3 -3
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +4 -4
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/history/history-details-screen.js +11 -11
- package/lib/module/components/history/history-details-screen.js.map +1 -1
- package/lib/module/components/history/history-list-item-icon.js +13 -9
- package/lib/module/components/history/history-list-item-icon.js.map +1 -1
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/history/history-list-screen.js.map +1 -1
- package/lib/module/components/history/history-list-section-header.js +1 -1
- package/lib/module/components/history/history-list-section-header.js.map +1 -1
- package/lib/module/components/history/history-list.js.map +1 -1
- package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -1
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/v1/share-credential.js +2 -2
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +2 -2
- 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 +2 -2
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale/fi.json +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-header.js +1 -1
- package/lib/module/ui-components/history/history-section-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/ui-components/settings/button-setting.js +3 -1
- package/lib/module/ui-components/settings/button-setting.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item.js +4 -2
- package/lib/module/ui-components/settings/setting-item.js.map +1 -1
- package/lib/module/ui-components/settings/switch-setting.js +4 -2
- package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/history.js +0 -38
- package/lib/module/utils/history.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +4 -4
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +11 -11
- package/lib/module/utils/hooks/core/cache.js.map +1 -1
- package/lib/module/utils/hooks/core/core-context.js +5 -5
- package/lib/module/utils/hooks/core/core-context.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +4 -4
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/dids.js +2 -2
- package/lib/module/utils/hooks/core/dids.js.map +1 -1
- package/lib/module/utils/hooks/core/history.js +1 -1
- package/lib/module/utils/hooks/core/history.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +4 -4
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +10 -10
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +6 -6
- package/lib/module/utils/hooks/core/trust-entity.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/hooks/navigation/open-settings.js.map +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js +2 -2
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/parsers/credential-images.js +12 -11
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +14 -33
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +4 -12
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +32 -33
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/url.js.map +1 -1
- package/lib/typescript/components/backup/preview-credentials.d.ts +2 -2
- package/lib/typescript/components/credential/credential.d.ts +2 -2
- package/lib/typescript/components/entity/EntityButtons.d.ts +2 -2
- package/lib/typescript/components/entity/entity-attributes.d.ts +2 -2
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +3 -3
- package/lib/typescript/components/entity/entity-details.d.ts +5 -5
- package/lib/typescript/components/history/history-details-screen.d.ts +2 -2
- package/lib/typescript/components/history/history-list-item-icon.d.ts +3 -3
- package/lib/typescript/components/history/history-list-item.d.ts +5 -5
- package/lib/typescript/components/history/history-list-screen.d.ts +4 -4
- package/lib/typescript/components/history/history-list.d.ts +5 -5
- package/lib/typescript/components/proof-request/v1/select-credential.d.ts +2 -2
- package/lib/typescript/components/proof-request/v1/share-credential.d.ts +6 -6
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +3 -3
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +4 -4
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +5 -5
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +2 -2
- package/lib/typescript/ui-components/settings/setting-item.d.ts +1 -0
- package/lib/typescript/utils/history.d.ts +3 -5
- package/lib/typescript/utils/hooks/core/backup.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/cache.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/core-context.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/credential-schemas.d.ts +6 -6
- package/lib/typescript/utils/hooks/core/credentials.d.ts +8 -8
- package/lib/typescript/utils/hooks/core/dids.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/history.d.ts +2 -2
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +3 -3
- package/lib/typescript/utils/hooks/core/proof-schemas.d.ts +7 -7
- package/lib/typescript/utils/hooks/core/proofs.d.ts +9 -9
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +6 -6
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +5 -5
- package/lib/typescript/utils/parsers/credential-images.d.ts +2 -2
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +7 -7
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +8 -9
- package/lib/typescript/utils/parsers/credential.d.ts +15 -35
- package/lib/typescript/utils/parsers/query.d.ts +8 -8
- package/package.json +6 -4
- package/src/components/backup/preview-credentials.tsx +2 -2
- package/src/components/credential/credential.tsx +2 -2
- package/src/components/entity/EntityButtons.tsx +2 -2
- package/src/components/entity/entity-attributes.tsx +4 -4
- package/src/components/entity/entity-details-with-buttons.tsx +11 -6
- package/src/components/entity/entity-details.tsx +17 -16
- package/src/components/history/history-details-screen.tsx +13 -16
- package/src/components/history/history-list-item-icon.tsx +19 -11
- package/src/components/history/history-list-item.tsx +9 -5
- package/src/components/history/history-list-screen.tsx +4 -4
- package/src/components/history/history-list-section-header.tsx +1 -1
- package/src/components/history/history-list.tsx +6 -6
- package/src/components/proof-request/share-credential-card-notice.tsx +1 -1
- package/src/components/proof-request/v1/select-credential.tsx +2 -2
- package/src/components/proof-request/v1/share-credential.tsx +13 -11
- package/src/components/proof-request/v2/select-credential-v2.tsx +6 -3
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +12 -12
- package/src/components/proof-request/v2/share-credential-v2.tsx +11 -11
- package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +4 -1
- package/src/ui-components/accessibility/locale/fi.json +1 -1
- package/src/ui-components/buttons/ghost-button.stories.tsx +0 -1
- package/src/ui-components/control/checkbox.stories.tsx +1 -1
- package/src/ui-components/control/switch.stories.tsx +1 -1
- package/src/ui-components/credential/card/credential-header.stories.tsx +0 -1
- package/src/ui-components/entity/entity-cluster.tsx +7 -6
- package/src/ui-components/header/foldable-header.tsx +8 -11
- package/src/ui-components/history/history-section-header.tsx +1 -1
- package/src/ui-components/history/history-section-list-item.tsx +1 -1
- package/src/ui-components/icons/entity.tsx +2 -2
- package/src/ui-components/pin/pin-code-screen.stories.tsx +1 -1
- package/src/ui-components/screens/image-preview-screen.stories.tsx +1 -1
- package/src/ui-components/screens/nerd-mode-screen.tsx +2 -2
- package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +1 -1
- package/src/ui-components/screens/section-list-screen.tsx +10 -1
- package/src/ui-components/searchbar/search-bar.stories.tsx +0 -1
- package/src/ui-components/settings/button-setting.tsx +2 -1
- package/src/ui-components/settings/setting-item.tsx +9 -2
- package/src/ui-components/settings/switch-setting.tsx +9 -2
- package/src/ui-components/text/typography.stories.tsx +2 -2
- package/src/utils/date.ts +2 -2
- package/src/utils/history.ts +4 -45
- package/src/utils/hooks/connectivity/connectivity.test.ts +2 -2
- package/src/utils/hooks/core/backup.ts +4 -4
- package/src/utils/hooks/core/cache.ts +13 -13
- package/src/utils/hooks/core/core-context.tsx +6 -6
- package/src/utils/hooks/core/credential-schemas.ts +7 -4
- package/src/utils/hooks/core/credentials.ts +21 -13
- package/src/utils/hooks/core/dids.ts +3 -3
- package/src/utils/hooks/core/history.ts +3 -3
- package/src/utils/hooks/core/identifiers.ts +9 -5
- package/src/utils/hooks/core/proof-schemas.ts +21 -16
- package/src/utils/hooks/core/proofs.ts +31 -27
- package/src/utils/hooks/core/trust-entity.ts +19 -12
- package/src/utils/hooks/core/wallet-unit.ts +21 -11
- package/src/utils/hooks/navigation/open-settings.ts +1 -1
- package/src/utils/hooks/revocation/credential-status.ts +2 -2
- package/src/utils/parsers/credential-images.tsx +19 -13
- package/src/utils/parsers/credential-sharing-v2.tsx +32 -48
- package/src/utils/parsers/credential-sharing.tsx +26 -36
- package/src/utils/parsers/credential.ts +64 -61
- package/src/utils/parsers/query.ts +16 -14
- package/src/utils/url.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","Platform","SectionList","StyleSheet","View","useSafeAreaInsets","useOnScrollHeaderState","useListContentInset","NavigationHeader","ListTitleHeader","useAppColorScheme","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","top","contentInsetsStyle","headerHeight","OS","titleVisible","onScroll","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","undefined","isValidElement","HeaderComponent","createElement","_extends","container","backgroundColor","background","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","create","flex","position","width"],"sources":["section-list-screen.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Platform, SectionList, SectionListProps, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { useOnScrollHeaderState } from '../../utils/hooks/header/on-scroll-header-state';\nimport { useListContentInset } from '../../utils/hooks/list/list-content-inset';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport ListTitleHeader from '../list/list-title-header';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type SectionListScreenProps<ItemT, SectionT> = ViewProps & {\n header: Omit<NavigationHeaderProps, 'animate' | 'blurred' | 'style' | 'title' | 'titleVisible'> & {\n static?: boolean;\n title: string;\n };\n list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'> & {\n header?: React.ComponentType<any> | React.ReactElement;\n };\n modalPresentation?: boolean;\n};\n\nconst SectionListScreen = <ItemT, SectionT>({\n header,\n list: { contentContainerStyle, header: listHeader, stickySectionHeadersEnabled, ...listProps },\n modalPresentation,\n style,\n ...viewProps\n}: SectionListScreenProps<ItemT, SectionT>) => {\n const colorScheme = useAppColorScheme();\n const { top } = useSafeAreaInsets();\n const contentInsetsStyle = useListContentInset({\n headerHeight: modalPresentation && Platform.OS === 'ios' ? 63 : 48,\n modalPresentation,\n });\n const { titleVisible, onScroll } = useOnScrollHeaderState();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (!modalPresentation || Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (modalPresentation && !header.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n const headerView: React.ReactElement | undefined = useMemo(() => {\n if (!listHeader) {\n return undefined;\n }\n if (React.isValidElement(listHeader)) {\n return listHeader;\n } else {\n const HeaderComponent = listHeader as React.ComponentType<any>;\n return <HeaderComponent />;\n }\n }, [listHeader]);\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <SectionList<ItemT, SectionT>\n ListHeaderComponent={!header.static ? <View
|
|
1
|
+
{"version":3,"names":["React","useMemo","Platform","SectionList","StyleSheet","View","useSafeAreaInsets","useOnScrollHeaderState","useListContentInset","NavigationHeader","ListTitleHeader","useAppColorScheme","SectionListScreen","header","list","contentContainerStyle","listHeader","stickySectionHeadersEnabled","listProps","modalPresentation","style","viewProps","colorScheme","top","contentInsetsStyle","headerHeight","OS","titleVisible","onScroll","headerPaddingStyle","paddingTop","modalHandleVisible","styles","modalHeaderWithoutHandle","headerView","undefined","isValidElement","HeaderComponent","createElement","_extends","container","backgroundColor","background","ListHeaderComponent","static","title","scrollEventThrottle","animate","blurred","create","flex","position","width"],"sources":["section-list-screen.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Platform, SectionList, SectionListProps, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport { useOnScrollHeaderState } from '../../utils/hooks/header/on-scroll-header-state';\nimport { useListContentInset } from '../../utils/hooks/list/list-content-inset';\nimport NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';\nimport ListTitleHeader from '../list/list-title-header';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nexport type SectionListScreenProps<ItemT, SectionT> = ViewProps & {\n header: Omit<NavigationHeaderProps, 'animate' | 'blurred' | 'style' | 'title' | 'titleVisible'> & {\n static?: boolean;\n title: string;\n };\n list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'> & {\n header?: React.ComponentType<any> | React.ReactElement;\n };\n modalPresentation?: boolean;\n};\n\nconst SectionListScreen = <ItemT, SectionT>({\n header,\n list: { contentContainerStyle, header: listHeader, stickySectionHeadersEnabled, ...listProps },\n modalPresentation,\n style,\n ...viewProps\n}: SectionListScreenProps<ItemT, SectionT>) => {\n const colorScheme = useAppColorScheme();\n const { top } = useSafeAreaInsets();\n const contentInsetsStyle = useListContentInset({\n headerHeight: modalPresentation && Platform.OS === 'ios' ? 63 : 48,\n modalPresentation,\n });\n const { titleVisible, onScroll } = useOnScrollHeaderState();\n\n let headerPaddingStyle: ViewStyle | undefined;\n if (!modalPresentation || Platform.OS === 'android') {\n headerPaddingStyle = {\n paddingTop: top,\n };\n } else if (modalPresentation && !header.modalHandleVisible && Platform.OS === 'ios') {\n headerPaddingStyle = styles.modalHeaderWithoutHandle;\n }\n\n const headerView: React.ReactElement | undefined = useMemo(() => {\n if (!listHeader) {\n return undefined;\n }\n if (React.isValidElement(listHeader)) {\n return listHeader;\n } else {\n const HeaderComponent = listHeader as React.ComponentType<any>;\n return <HeaderComponent />;\n }\n }, [listHeader]);\n\n return (\n <View style={[styles.container, { backgroundColor: colorScheme.background }, style]} {...viewProps}>\n <SectionList<ItemT, SectionT>\n ListHeaderComponent={\n !header.static ? (\n <View>\n <ListTitleHeader title={header.title} />\n {headerView}\n </View>\n ) : (\n headerView\n )\n }\n contentContainerStyle={[contentInsetsStyle, contentContainerStyle]}\n onScroll={onScroll}\n scrollEventThrottle={100}\n stickySectionHeadersEnabled={stickySectionHeadersEnabled ?? false}\n {...listProps}\n />\n <NavigationHeader\n animate\n blurred\n style={[styles.header, headerPaddingStyle]}\n titleVisible={header.static || titleVisible}\n {...header}\n />\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n },\n header: {\n position: 'absolute',\n width: '100%',\n },\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;IAC3CF,YAAY,EAAEd,MAAM,CAAC+B,MAAM,IAAIjB;EAAa,GACxCd,MAAM,CACX,CACG,CAAC;AAEX,CAAC;AAED,MAAMmB,MAAM,GAAG5B,UAAU,CAAC6C,MAAM,CAAC;EAC/BT,SAAS,EAAE;IACTU,IAAI,EAAE;EACR,CAAC;EACDrC,MAAM,EAAE;IACNsC,QAAQ,EAAE,UAAU;IACpBC,KAAK,EAAE;EACT,CAAC;EACDnB,wBAAwB,EAAE;IACxBH,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAelB,iBAAiB","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo } from 'react';
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
+
import { concatTestID } from '../../utils';
|
|
3
4
|
import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
|
|
4
5
|
import { NextIcon } from '../icons/wallet';
|
|
5
6
|
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
@@ -38,7 +39,8 @@ const ButtonSetting = ({
|
|
|
38
39
|
}, /*#__PURE__*/React.createElement(SettingItem, {
|
|
39
40
|
icon: icon,
|
|
40
41
|
style: style,
|
|
41
|
-
title: title
|
|
42
|
+
title: title,
|
|
43
|
+
testID: concatTestID(testID, 'text')
|
|
42
44
|
}, accessoryView));
|
|
43
45
|
};
|
|
44
46
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","StyleSheet","View","TouchableOpacity","NextIcon","useAppColorScheme","SettingItem","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","accessoryView","createElement","styles","arrow","color","text","isValidElement","AccessoryComponent","accessibilityRole","container","create","alignItems","height","justifyContent","width"],"sources":["button-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport { NextIcon } from '../icons/wallet';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport SettingItem from './setting-item';\n\nexport type ButtonSettingProps = {\n accessory?: ComponentType<any> | ReactElement;\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onPress: () => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n};\n\nconst ButtonSetting: FunctionComponent<ButtonSettingProps> = ({\n accessory,\n disabled,\n title,\n onPress,\n icon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return (\n <View style={styles.arrow}>\n <NextIcon color={colorScheme.text} />\n </View>\n );\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory, colorScheme.text]);\n\n return (\n <TouchableOpacity\n disabled={disabled}\n accessibilityRole=\"button\"\n onPress={onPress}\n style={styles.container}\n testID={testID}>\n <SettingItem icon={icon} style={style} title={title}>\n {accessoryView}\n </SettingItem>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n arrow: {\n alignItems: 'center',\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n container: {\n width: '100%',\n },\n});\n\nexport default ButtonSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAoDC,OAAO,QAAQ,OAAO;AACtF,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGV,iBAAiB,CAAC,CAAC;EAEvC,MAAMW,aAA6C,
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","View","concatTestID","TouchableOpacity","NextIcon","useAppColorScheme","SettingItem","ButtonSetting","accessory","disabled","title","onPress","icon","style","testID","colorScheme","accessoryView","createElement","styles","arrow","color","text","isValidElement","AccessoryComponent","accessibilityRole","container","create","alignItems","height","justifyContent","width"],"sources":["button-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';\nimport { NextIcon } from '../icons/wallet';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport SettingItem from './setting-item';\n\nexport type ButtonSettingProps = {\n accessory?: ComponentType<any> | ReactElement;\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onPress: () => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n};\n\nconst ButtonSetting: FunctionComponent<ButtonSettingProps> = ({\n accessory,\n disabled,\n title,\n onPress,\n icon,\n style,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n\n const accessoryView: React.ReactElement | undefined = useMemo(() => {\n if (!accessory) {\n return (\n <View style={styles.arrow}>\n <NextIcon color={colorScheme.text} />\n </View>\n );\n }\n if (React.isValidElement(accessory)) {\n return accessory;\n } else {\n const AccessoryComponent = accessory as React.ComponentType<any>;\n return <AccessoryComponent />;\n }\n }, [accessory, colorScheme.text]);\n\n return (\n <TouchableOpacity\n disabled={disabled}\n accessibilityRole=\"button\"\n onPress={onPress}\n style={styles.container}\n testID={testID}>\n <SettingItem icon={icon} style={style} title={title} testID={concatTestID(testID, 'text')}>\n {accessoryView}\n </SettingItem>\n </TouchableOpacity>\n );\n};\n\nconst styles = StyleSheet.create({\n arrow: {\n alignItems: 'center',\n height: 24,\n justifyContent: 'center',\n width: 24,\n },\n container: {\n width: '100%',\n },\n});\n\nexport default ButtonSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAoDC,OAAO,QAAQ,OAAO;AACtF,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,gBAAgB,QAAQ,+CAA+C;AAChF,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,iBAAiB,QAAQ,+BAA+B;AACjE,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,SAAS;EACTC,QAAQ;EACRC,KAAK;EACLC,OAAO;EACPC,IAAI;EACJC,KAAK;EACLC;AACF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGV,iBAAiB,CAAC,CAAC;EAEvC,MAAMW,aAA6C,GAAGjB,OAAO,CAAC,MAAM;IAClE,IAAI,CAACS,SAAS,EAAE;MACd,oBACEV,KAAA,CAAAmB,aAAA,CAAChB,IAAI;QAACY,KAAK,EAAEK,MAAM,CAACC;MAAM,gBACxBrB,KAAA,CAAAmB,aAAA,CAACb,QAAQ;QAACgB,KAAK,EAAEL,WAAW,CAACM;MAAK,CAAE,CAChC,CAAC;IAEX;IACA,iBAAIvB,KAAK,CAACwB,cAAc,CAACd,SAAS,CAAC,EAAE;MACnC,OAAOA,SAAS;IAClB,CAAC,MAAM;MACL,MAAMe,kBAAkB,GAAGf,SAAqC;MAChE,oBAAOV,KAAA,CAAAmB,aAAA,CAACM,kBAAkB,MAAE,CAAC;IAC/B;EACF,CAAC,EAAE,CAACf,SAAS,EAAEO,WAAW,CAACM,IAAI,CAAC,CAAC;EAEjC,oBACEvB,KAAA,CAAAmB,aAAA,CAACd,gBAAgB;IACfM,QAAQ,EAAEA,QAAS;IACnBe,iBAAiB,EAAC,QAAQ;IAC1Bb,OAAO,EAAEA,OAAQ;IACjBE,KAAK,EAAEK,MAAM,CAACO,SAAU;IACxBX,MAAM,EAAEA;EAAO,gBACfhB,KAAA,CAAAmB,aAAA,CAACX,WAAW;IAACM,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACH,KAAK,EAAEA,KAAM;IAACI,MAAM,EAAEZ,YAAY,CAACY,MAAM,EAAE,MAAM;EAAE,GACvFE,aACU,CACG,CAAC;AAEvB,CAAC;AAED,MAAME,MAAM,GAAGlB,UAAU,CAAC0B,MAAM,CAAC;EAC/BP,KAAK,EAAE;IACLQ,UAAU,EAAE,QAAQ;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDL,SAAS,EAAE;IACTK,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAEF,eAAevB,aAAa","ignoreList":[]}
|
|
@@ -33,7 +33,8 @@ const SettingItem = ({
|
|
|
33
33
|
title,
|
|
34
34
|
icon,
|
|
35
35
|
style,
|
|
36
|
-
children
|
|
36
|
+
children,
|
|
37
|
+
testID
|
|
37
38
|
}) => {
|
|
38
39
|
const colorScheme = useAppColorScheme();
|
|
39
40
|
const iconView = useMemo(() => {
|
|
@@ -61,7 +62,8 @@ const SettingItem = ({
|
|
|
61
62
|
accessible: false,
|
|
62
63
|
color: colorScheme.text,
|
|
63
64
|
preset: "s",
|
|
64
|
-
style: styles.label
|
|
65
|
+
style: styles.label,
|
|
66
|
+
testID: testID
|
|
65
67
|
}, title), children));
|
|
66
68
|
};
|
|
67
69
|
export default SettingItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMemo","StyleSheet","View","Typography","useAppColorScheme","styles","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","colorScheme","iconView","undefined","isValidElement","IconComponent","createElement","backgroundColor","white","background","accessible","color","text","preset"],"sources":["setting-item.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n justifyContent: 'center',\n width: '100%',\n },\n icon: {\n alignItems: 'center',\n borderRadius: 18,\n height: 36,\n justifyContent: 'center',\n marginRight: 12,\n width: 36,\n },\n label: {\n flex: 1,\n marginBottom: 0,\n marginTop: 0,\n },\n wrapper: {\n justifyContent: 'center',\n marginHorizontal: 16,\n paddingHorizontal: 12,\n },\n});\n\nexport type SettingItemProps = {\n icon?: ComponentType<any> | ReactElement;\n style?: StyleProp<ViewStyle>;\n title: string;\n};\n\nconst SettingItem: FunctionComponent<PropsWithChildren<SettingItemProps>> = ({
|
|
1
|
+
{"version":3,"names":["React","useMemo","StyleSheet","View","Typography","useAppColorScheme","styles","create","container","alignItems","flexDirection","height","justifyContent","width","icon","borderRadius","marginRight","label","flex","marginBottom","marginTop","wrapper","marginHorizontal","paddingHorizontal","SettingItem","title","style","children","testID","colorScheme","iconView","undefined","isValidElement","IconComponent","createElement","backgroundColor","white","background","accessible","color","text","preset"],"sources":["setting-item.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, PropsWithChildren, ReactElement, useMemo } from 'react';\nimport { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n height: 60,\n justifyContent: 'center',\n width: '100%',\n },\n icon: {\n alignItems: 'center',\n borderRadius: 18,\n height: 36,\n justifyContent: 'center',\n marginRight: 12,\n width: 36,\n },\n label: {\n flex: 1,\n marginBottom: 0,\n marginTop: 0,\n },\n wrapper: {\n justifyContent: 'center',\n marginHorizontal: 16,\n paddingHorizontal: 12,\n },\n});\n\nexport type SettingItemProps = {\n icon?: ComponentType<any> | ReactElement;\n style?: StyleProp<ViewStyle>;\n title: string;\n testID?: string;\n};\n\nconst SettingItem: FunctionComponent<PropsWithChildren<SettingItemProps>> = ({\n title,\n icon,\n style,\n children,\n testID,\n}) => {\n const colorScheme = useAppColorScheme();\n const iconView: React.ReactElement | undefined = useMemo(() => {\n if (!icon) {\n return undefined;\n }\n if (React.isValidElement(icon)) {\n return icon;\n } else {\n const IconComponent = icon as React.ComponentType<any>;\n return <IconComponent />;\n }\n }, [icon]);\n\n return (\n <View style={[styles.wrapper, { backgroundColor: colorScheme.white }, style]}>\n <View style={styles.container}>\n {iconView && <View style={[styles.icon, { backgroundColor: colorScheme.background }]}>{iconView}</View>}\n <Typography accessible={false} color={colorScheme.text} preset=\"s\" style={styles.label} testID={testID}>\n {title}\n </Typography>\n {children}\n </View>\n </View>\n );\n};\n\nexport default SettingItem;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAuEC,OAAO,QAAQ,OAAO;AACzG,SAAoBC,UAAU,EAAEC,IAAI,QAAmB,cAAc;AAErE,OAAOC,UAAU,MAAM,oBAAoB;AAC3C,SAASC,iBAAiB,QAAQ,+BAA+B;AAEjE,MAAMC,MAAM,GAAGJ,UAAU,CAACK,MAAM,CAAC;EAC/BC,SAAS,EAAE;IACTC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE,KAAK;IACpBC,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBC,KAAK,EAAE;EACT,CAAC;EACDC,IAAI,EAAE;IACJL,UAAU,EAAE,QAAQ;IACpBM,YAAY,EAAE,EAAE;IAChBJ,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE,QAAQ;IACxBI,WAAW,EAAE,EAAE;IACfH,KAAK,EAAE;EACT,CAAC;EACDI,KAAK,EAAE;IACLC,IAAI,EAAE,CAAC;IACPC,YAAY,EAAE,CAAC;IACfC,SAAS,EAAE;EACb,CA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EAAEA;EAAO,GACpGH,KACS,CAAC,EACZE,QACG,CACF,CAAC;AAEX,CAAC;AAED,eAAeH,WAAW","ignoreList":[]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { concatTestID } from '../../utils';
|
|
2
3
|
import { Switch } from '../control/switch';
|
|
3
4
|
import SettingItem from './setting-item';
|
|
4
5
|
const SwitchSetting = ({
|
|
@@ -13,12 +14,13 @@ const SwitchSetting = ({
|
|
|
13
14
|
return /*#__PURE__*/React.createElement(SettingItem, {
|
|
14
15
|
icon: icon,
|
|
15
16
|
style: style,
|
|
16
|
-
title: title
|
|
17
|
+
title: title,
|
|
18
|
+
testID: concatTestID(testID, 'text')
|
|
17
19
|
}, /*#__PURE__*/React.createElement(Switch, {
|
|
18
20
|
accessibilityLabel: title,
|
|
19
21
|
disabled: disabled,
|
|
20
22
|
onChange: onChange,
|
|
21
|
-
testID: testID,
|
|
23
|
+
testID: concatTestID(testID, 'switch'),
|
|
22
24
|
value: value
|
|
23
25
|
}));
|
|
24
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Switch","SettingItem","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","accessibilityLabel"],"sources":["switch-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { Switch } from '../control/switch';\nimport SettingItem from './setting-item';\n\nexport type SwitchSettingProps = {\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onChange: (newValue: boolean) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n value: boolean;\n};\n\nconst SwitchSetting: FunctionComponent<SwitchSettingProps> = ({\n title,\n value,\n onChange,\n icon,\n style,\n disabled = false,\n testID,\n}) => {\n return (\n <SettingItem icon={icon} style={style} title={title}>\n <Switch
|
|
1
|
+
{"version":3,"names":["React","concatTestID","Switch","SettingItem","SwitchSetting","title","value","onChange","icon","style","disabled","testID","createElement","accessibilityLabel"],"sources":["switch-setting.tsx"],"sourcesContent":["import React, { ComponentType, FunctionComponent, ReactElement } from 'react';\nimport type { StyleProp, ViewStyle } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport { Switch } from '../control/switch';\nimport SettingItem from './setting-item';\n\nexport type SwitchSettingProps = {\n disabled?: boolean;\n icon?: ComponentType<any> | ReactElement;\n onChange: (newValue: boolean) => void;\n style?: StyleProp<ViewStyle>;\n testID?: string;\n title: string;\n value: boolean;\n};\n\nconst SwitchSetting: FunctionComponent<SwitchSettingProps> = ({\n title,\n value,\n onChange,\n icon,\n style,\n disabled = false,\n testID,\n}) => {\n return (\n <SettingItem icon={icon} style={style} title={title} testID={concatTestID(testID, 'text')}>\n <Switch\n accessibilityLabel={title}\n disabled={disabled}\n onChange={onChange}\n testID={concatTestID(testID, 'switch')}\n value={value}\n />\n </SettingItem>\n );\n};\n\nexport default SwitchSetting;\n"],"mappings":"AAAA,OAAOA,KAAK,MAA0D,OAAO;AAG7E,SAASC,YAAY,QAAQ,aAAa;AAC1C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,WAAW,MAAM,gBAAgB;AAYxC,MAAMC,aAAoD,GAAGA,CAAC;EAC5DC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,IAAI;EACJC,KAAK;EACLC,QAAQ,GAAG,KAAK;EAChBC;AACF,CAAC,KAAK;EACJ,oBACEX,KAAA,CAAAY,aAAA,CAACT,WAAW;IAACK,IAAI,EAAEA,IAAK;IAACC,KAAK,EAAEA,KAAM;IAACJ,KAAK,EAAEA,KAAM;IAACM,MAAM,EAAEV,YAAY,CAACU,MAAM,EAAE,MAAM;EAAE,gBACxFX,KAAA,CAAAY,aAAA,CAACV,MAAM;IACLW,kBAAkB,EAAER,KAAM;IAC1BK,QAAQ,EAAEA,QAAS;IACnBH,QAAQ,EAAEA,QAAS;IACnBI,MAAM,EAAEV,YAAY,CAACU,MAAM,EAAE,QAAQ,CAAE;IACvCL,KAAK,EAAEA;EAAM,CACd,CACU,CAAC;AAElB,CAAC;AAED,eAAeF,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["I18nManager","Platform","Settings","format","MINUTE","DAY","systemLocale","_I18nManager$getConst","getConstants","localeIdentifier","replace","split","formatDate","date","locale","options","toLocaleDateString","undefined","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","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","_ref","OS","get","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 = I18nManager.getConstants()
|
|
1
|
+
{"version":3,"names":["I18nManager","Platform","Settings","format","MINUTE","DAY","systemLocale","_I18nManager$getConst","getConstants","localeIdentifier","replace","split","formatDate","date","locale","options","toLocaleDateString","undefined","formatTime","toLocaleTimeString","hour","minute","formatDateTime","toLocaleString","year","month","day","hour12","formatMonth","getFullYear","formatTimeAgo","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","_ref","OS","get","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 = I18nManager.getConstants()\n .localeIdentifier?.replace(/_/g, '-')\n .split(/[#@]/)[0]\n .replace(/-$/, '');\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\nconst locale = (\n Platform.OS === 'ios'\n ? Settings.get('AppleLocale')\n : I18nManager.getConstants().localeIdentifier\n)\n ?.split('@')[0]\n .replace('_', '-');\n\nexport const formatDateTimeLocalized = (date: Date) => {\n return formatDateTime(date, locale);\n};\n\nexport const formatDateLocalized = (date: Date) => {\n return formatDate(date, locale);\n};\n"],"mappings":";AAAA;;AAEA,SAASA,WAAW,EAAEC,QAAQ,EAAEC,QAAQ,QAAQ,cAAc;AAC9D,SAASC,MAAM,QAAQ,YAAY;AAEnC,MAAMC,MAAM,GAAG,EAAE,GAAG,IAAI;AACxB,MAAMC,GAAG,GAAG,EAAE,GAAG,EAAE,GAAGD,MAAM;;AAE5B;AACA,MAAME,YAAgC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C,aAAa,CAAC,GAC3B7D,WAAW,CAACQ,YAAY,CAAC,CAAC,CAACC,gBAAgB,cAAAkD,IAAA,uBAHlCA,IAAA,CAKXhD,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CACdD,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;AAEpB,OAAO,MAAMoD,uBAAuB,GAAIjD,IAAU,IAAK;EACrD,OAAOS,cAAc,CAACT,IAAI,EAAEC,MAAM,CAAC;AACrC,CAAC;AAED,OAAO,MAAMiD,mBAAmB,GAAIlD,IAAU,IAAK;EACjD,OAAOD,UAAU,CAACC,IAAI,EAAEC,MAAM,CAAC;AACjC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { DataTypeEnum } from '@procivis/react-native-one-core';
|
|
2
1
|
import moment from 'moment';
|
|
3
|
-
import { nonEmptyFilter } from './filtering';
|
|
4
2
|
export const groupEntriesByDay = entries => {
|
|
5
3
|
const groupedEntries = entries.reduce((result, entry) => {
|
|
6
4
|
const entryDate = moment(entry.createdDate);
|
|
@@ -27,40 +25,4 @@ export const groupEntriesByDay = entries => {
|
|
|
27
25
|
return item;
|
|
28
26
|
});
|
|
29
27
|
};
|
|
30
|
-
export const claimValueFromProofInputClaim = ({
|
|
31
|
-
schema,
|
|
32
|
-
value
|
|
33
|
-
}) => {
|
|
34
|
-
if (!value) {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
if (Array.isArray(value)) {
|
|
38
|
-
const values = value.map(claimFromProofInputClaim).filter(nonEmptyFilter);
|
|
39
|
-
return schema.dataType === DataTypeEnum.Object ? {
|
|
40
|
-
array: schema.array,
|
|
41
|
-
dataType: DataTypeEnum.Object,
|
|
42
|
-
value: values
|
|
43
|
-
} : {
|
|
44
|
-
array: true,
|
|
45
|
-
dataType: schema.dataType,
|
|
46
|
-
value: values
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
array: false,
|
|
51
|
-
dataType: schema.dataType,
|
|
52
|
-
value
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
export const claimFromProofInputClaim = input => {
|
|
56
|
-
const value = claimValueFromProofInputClaim(input);
|
|
57
|
-
if (!value) {
|
|
58
|
-
return undefined;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
...value,
|
|
62
|
-
id: input.schema.id,
|
|
63
|
-
key: input.schema.key
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
28
|
//# sourceMappingURL=history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["moment","groupEntriesByDay","entries","groupedEntries","reduce","result","entry","entryDate","createdDate","matchingEntry","find","date","isSame","data","push","firstYearEntry","sort","a","b","valueOf","map","item","index","list"],"sources":["history.ts"],"sourcesContent":["import { HistoryListItemBindingDto } from '@procivis/react-native-one-core';\nimport moment, { Moment } from 'moment';\n\nexport interface HistoryGroupByDaySection {\n data: HistoryListItemBindingDto[];\n date: Moment;\n firstYearEntry: boolean;\n}\n\nexport const groupEntriesByDay = (entries: HistoryListItemBindingDto[]) => {\n const groupedEntries = entries.reduce((result: HistoryGroupByDaySection[], entry: HistoryListItemBindingDto) => {\n const entryDate = moment(entry.createdDate);\n\n const matchingEntry = result.find(({ date }) => date.isSame(entryDate, 'day'));\n if (matchingEntry) {\n matchingEntry.data.push(entry);\n } else {\n result.push({ data: [entry], date: entryDate, firstYearEntry: false });\n }\n\n return result;\n }, []);\n\n return groupedEntries\n .sort(({ date: a }, { date: b }) => b.valueOf() - a.valueOf())\n .map((item, index, list) => {\n item.firstYearEntry = !index || !list[index - 1].date.isSame(item.date, 'year');\n return item;\n });\n};\n"],"mappings":"AACA,OAAOA,MAAM,MAAkB,QAAQ;AAQvC,OAAO,MAAMC,iBAAiB,GAAIC,OAAoC,IAAK;EACzE,MAAMC,cAAc,GAAGD,OAAO,CAACE,MAAM,CAAC,CAACC,MAAkC,EAAEC,KAAgC,KAAK;IAC9G,MAAMC,SAAS,GAAGP,MAAM,CAACM,KAAK,CAACE,WAAW,CAAC;IAE3C,MAAMC,aAAa,GAAGJ,MAAM,CAACK,IAAI,CAAC,CAAC;MAAEC;IAAK,CAAC,KAAKA,IAAI,CAACC,MAAM,CAACL,SAAS,EAAE,KAAK,CAAC,CAAC;IAC9E,IAAIE,aAAa,EAAE;MACjBA,aAAa,CAACI,IAAI,CAACC,IAAI,CAACR,KAAK,CAAC;IAChC,CAAC,MAAM;MACLD,MAAM,CAACS,IAAI,CAAC;QAAED,IAAI,EAAE,CAACP,KAAK,CAAC;QAAEK,IAAI,EAAEJ,SAAS;QAAEQ,cAAc,EAAE;MAAM,CAAC,CAAC;IACxE;IAEA,OAAOV,MAAM;EACf,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,cAAc,CAClBa,IAAI,CAAC,CAAC;IAAEL,IAAI,EAAEM;EAAE,CAAC,EAAE;IAAEN,IAAI,EAAEO;EAAE,CAAC,KAAKA,CAAC,CAACC,OAAO,CAAC,CAAC,GAAGF,CAAC,CAACE,OAAO,CAAC,CAAC,CAAC,CAC7DC,GAAG,CAAC,CAACC,IAAI,EAAEC,KAAK,EAAEC,IAAI,KAAK;IAC1BF,IAAI,CAACN,cAAc,GAAG,CAACO,KAAK,IAAI,CAACC,IAAI,CAACD,KAAK,GAAG,CAAC,CAAC,CAACX,IAAI,CAACC,MAAM,CAACS,IAAI,CAACV,IAAI,EAAE,MAAM,CAAC;IAC/E,OAAOU,IAAI;EACb,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getInvitationUrlTransports","Transport","jest","mock","initializeCore","Promise","resolve","captureException","getEnabledTransports","useCoreConfig","addEventListener","onStateChange","describe","test","transports","expect","toStrictEqual","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@procivis/react-native-one-core', () => ({\n initializeCore: () => Promise.resolve({} as any),\n}));\n\njest.mock('@sentry/react-native', () => ({\n captureException: () => {},\n}));\n\njest.mock('../core/core-config', () => ({\n getEnabledTransports: () => [],\n useCoreConfig: () => ({}),\n}));\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {
|
|
1
|
+
{"version":3,"names":["getInvitationUrlTransports","Transport","jest","mock","initializeCore","Promise","resolve","captureException","getEnabledTransports","useCoreConfig","addEventListener","onStateChange","describe","test","transports","expect","toStrictEqual","Bluetooth","MQTT","HTTP"],"sources":["connectivity.test.ts"],"sourcesContent":["import { getInvitationUrlTransports, Transport } from './connectivity';\n\njest.mock('@procivis/react-native-one-core', () => ({\n initializeCore: () => Promise.resolve({} as any),\n}));\n\njest.mock('@sentry/react-native', () => ({\n captureException: () => {},\n}));\n\njest.mock('../core/core-config', () => ({\n getEnabledTransports: () => [],\n useCoreConfig: () => ({}),\n}));\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {},\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => {},\n}));\n\ndescribe('getInvitationUrlTransports', () => {\n test('BLE OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('BLE OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth]);\n });\n test('MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.MQTT]);\n });\n test('Mixed BLE/MQTT OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'MDOC-OPENID4VP://connect?name=XFwsduA5&key=24c810cb01a8b12200bdb66dc5a7ac9b49a4cfdd5c4b89f51e03206be3abac5b&brokerUrl=mqtt://dev.procivis-one.com&topicId=540684a4-430c-441c-b188-786653f5ab35',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.Bluetooth, Transport.MQTT]);\n });\n test('HTTP OpenID4VP url', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with custom scheme', () => {\n const transports = getInvitationUrlTransports(\n 'mdoc-openid4vp://?response_type=vp_token&state=25fdb134-487d-4bcd-9fdf-777e7f74f128&nonce=DZE2qP6FaDksHxkfOdYJC1LWgVyf5Ibc&client_id_scheme=redirect_uri&client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&response_mode=direct_post&response_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_metadata_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fclient-metadata&presentation_definition_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F89973de1-75ba-4367-89ef-4d928de88933%2Fpresentation-definition',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID4VP url with requestUri', () => {\n const transports = getInvitationUrlTransports(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F6e442f9d-bc14-4362-8786-504d7b79c402%2Fclient-request',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n test('HTTP OpenID credential offer url', () => {\n const transports = getInvitationUrlTransports(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2F0c2cd9a6-1eff-4536-9505-98d7bd87aad1%2Foffer%2F275c09b2-4f4f-4738-85fc-35399acad176',\n 'mdoc-openid4vp',\n );\n expect(transports).toStrictEqual([Transport.HTTP]);\n });\n\n test('Invalid link', () => {\n const transports = getInvitationUrlTransports('invalid');\n expect(transports).toStrictEqual([]);\n });\n});\n"],"mappings":"AAAA,SAASA,0BAA0B,EAAEC,SAAS,QAAQ,gBAAgB;AAEtEC,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDC,cAAc,EAAEA,CAAA,KAAMC,OAAO,CAACC,OAAO,CAAC,CAAC,CAAQ;AACjD,CAAC,CAAC,CAAC;AAEHJ,IAAI,CAACC,IAAI,CAAC,sBAAsB,EAAE,OAAO;EACvCI,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHL,IAAI,CAACC,IAAI,CAAC,qBAAqB,EAAE,OAAO;EACtCK,oBAAoB,EAAEA,CAAA,KAAM,EAAE;EAC9BC,aAAa,EAAEA,CAAA,MAAO,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC;AAEHP,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDO,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHR,IAAI,CAACC,IAAI,CAAC,sCAAsC,EAAE,OAAO;EACvDQ,aAAa,EAAEA,CAAA,KAAM,CAAC;AACxB,CAAC,CAAC,CAAC;AAEHC,QAAQ,CAAC,4BAA4B,EAAE,MAAM;EAC3CC,IAAI,CAAC,mBAAmB,EAAE,MAAM;IAC9B,MAAMC,UAAU,GAAGd,0BAA0B,CAC3C,wGAAwG,EACxG,gBACF,CAAC;IACDe,MAAM,CAACD,UAAU,CAAC,CAACE,aA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C,UAAU,GAAGd,0BAA0B,CAC3C,kpBAAkpB,EAClpB,gBACF,CAAC;IACDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFN,IAAI,CAAC,uCAAuC,EAAE,MAAM;IAClD,MAAMC,UAAU,GAAGd,0BAA0B,CAC3C,upBAAupB,EACvpB,gBACF,CAAC;IACDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFN,IAAI,CAAC,oCAAoC,EAAE,MAAM;IAC/C,MAAMC,UAAU,GAAGd,0BAA0B,CAC3C,6OAA6O,EAC7O,gBACF,CAAC;IACDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EACFN,IAAI,CAAC,kCAAkC,EAAE,MAAM;IAC7C,MAAMC,UAAU,GAAGd,0BAA0B,CAC3C,wMAAwM,EACxM,gBACF,CAAC;IACDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,CAACf,SAAS,CAACkB,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EAEFN,IAAI,CAAC,cAAc,EAAE,MAAM;IACzB,MAAMC,UAAU,GAAGd,0BAA0B,CAAC,SAAS,CAAC;IACxDe,MAAM,CAACD,UAAU,CAAC,CAACE,aAAa,CAAC,EAAE,CAAC;EACtC,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IdentifierStateBindingEnum, IdentifierTypeBindingEnum } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
|
4
4
|
import { reportException } from '../../reporting';
|
|
@@ -80,12 +80,12 @@ export const useBackupFinalizeImportProcedure = ({
|
|
|
80
80
|
let swIdentifierId;
|
|
81
81
|
if (generateSwKey) {
|
|
82
82
|
var _identifiers$values$f;
|
|
83
|
-
const identifiers = await core.
|
|
84
|
-
states: [
|
|
83
|
+
const identifiers = await core.listIdentifiers({
|
|
84
|
+
states: [IdentifierStateBindingEnum.ACTIVE],
|
|
85
85
|
organisationId,
|
|
86
86
|
page: 0,
|
|
87
87
|
pageSize: 1,
|
|
88
|
-
types: [
|
|
88
|
+
types: [IdentifierTypeBindingEnum.DID],
|
|
89
89
|
isRemote: false
|
|
90
90
|
});
|
|
91
91
|
swIdentifierId = (_identifiers$values$f = identifiers.values.find(identifier => identifier.name.startsWith(SW_DID_NAME_PREFIX))) === null || _identifiers$values$f === void 0 ? void 0 : _identifiers$values$f.id;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["IdentifierStateBindingEnum","IdentifierTypeBindingEnum","useCallback","useMutation","useQuery","useQueryClient","reportException","useONECore","generateHwIdentifier","generateSwIdentifier","SW_DID_NAME_PREFIX","HISTORY_LIST_QUERY_KEY","BACKUP_INFO_QUERY_KEY","useBackupInfo","core","backupInfo","keepPreviousData","useCreateBackup","queryClient","password","outputPath","createBackup","onSuccess","invalidateQueries","useUnpackBackup","inputPath","unpackBackup","resetQueries","useFinalizeImport","finalizeImport","useRollbackImport","rollbackImport","useBackupFinalizeImportProcedure","generateHwKey","generateSwKey","mutateAsync","organisationId","swIdentifierId","_identifiers$values$f","identifiers","listIdentifiers","states","ACTIVE","page","pageSize","types","DID","isRemote","values","find","identifier","name","startsWith","id","Promise","all","catch","err"],"sources":["backup.ts"],"sourcesContent":["import { IdentifierStateBindingEnum, IdentifierTypeBindingEnum } from '@procivis/react-native-one-core';\nimport { useCallback } from 'react';\nimport { useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { reportException } from '../../reporting';\nimport { useONECore } from './core-context';\nimport {\n generateHwIdentifier,\n generateSwIdentifier,\n IdentifiersInitializationConfig,\n SW_DID_NAME_PREFIX,\n} from './core-init';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst BACKUP_INFO_QUERY_KEY = 'backup-info';\n\nexport const useBackupInfo = () => {\n const { core } = useONECore();\n\n return useQuery([BACKUP_INFO_QUERY_KEY], () => core.backupInfo(), {\n keepPreviousData: true,\n });\n};\n\nexport const useCreateBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, outputPath }: { outputPath: string; password: string }) =>\n core.createBackup(password, outputPath),\n {\n onSuccess: () => queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY),\n },\n );\n};\n\nexport const useUnpackBackup = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async ({ password, inputPath }: { inputPath: string; password: string }) => core.unpackBackup(password, inputPath),\n {\n onSuccess: () => queryClient.resetQueries(),\n },\n );\n};\n\nexport const useFinalizeImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.finalizeImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\nexport const useRollbackImport = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async () => core.rollbackImport(), {\n onSuccess: () => queryClient.resetQueries(),\n });\n};\n\n/**\n * Finalize backup import and extract/prepare identifiers\n * @param {IdentifiersInitializationConfig} config Select desired keys/dids to be restored/created\n * @returns [hwIdentifierId, swIdentifierId]\n */\nexport const useBackupFinalizeImportProcedure = ({ generateHwKey, generateSwKey }: IdentifiersInitializationConfig) => {\n const { mutateAsync: finalizeImport } = useFinalizeImport();\n const { core, organisationId } = useONECore();\n\n return useCallback(async () => {\n await finalizeImport();\n\n // update wallet identifier references\n let swIdentifierId: string | undefined;\n if (generateSwKey) {\n const identifiers = await core.listIdentifiers({\n states: [IdentifierStateBindingEnum.ACTIVE],\n organisationId,\n page: 0,\n pageSize: 1,\n types: [IdentifierTypeBindingEnum.DID],\n isRemote: false,\n });\n swIdentifierId = identifiers.values.find((identifier) => identifier.name.startsWith(SW_DID_NAME_PREFIX))?.id;\n }\n\n return Promise.all([\n generateHwKey ? generateHwIdentifier(core, organisationId) : null,\n !swIdentifierId && generateSwKey ? generateSwIdentifier(core, organisationId) : swIdentifierId,\n ]).catch((err) => {\n reportException(err, 'Failed to create base identifiers');\n throw err;\n });\n }, [finalizeImport, generateSwKey, generateHwKey, core, organisationId]);\n};\n"],"mappings":"AAAA,SAASA,0BAA0B,EAAEC,yBAAyB,QAAQ,iCAAiC;AACvG,SAASC,WAAW,QAAQ,OAAO;AACnC,SAASC,WAAW,EAAEC,QAAQ,EAAEC,cAAc,QAAQ,aAAa;AAEnE,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SACEC,oBAAoB,EACpBC,oBAAoB,EAEpBC,kBAAkB,QACb,aAAa;AACpB,SAASC,sBAAsB,QAAQ,WAAW;AAElD,MAAMC,qBAAqB,GAAG,aAAa;AAE3C,OAAO,MAAMC,aAAa,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAK,CAAC,GAAGP,UAAU,CAAC,CAAC;EAE7B,OAAOH,QAAQ,CAAC,CAACQ,qBAAqB,CAAC,EAAE,MAAME,IAAI,CAACC,UAAU,CAAC,CAAC,EAAE;IAChEC,gBAAgB,EAAE;EACpB,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACnC,MAAMC,WAAW,GAAGb,cAAc,CAAC,CAAC;EACpC,MAAM;IAAES;EAAK,CAAC,GAAGP,UAAU,CAAC,CAAC;EAE7B,OAAOJ,WAAW,CAChB,OAAO;IAAEgB,QAAQ;IAAEC;EAAqD,CAAC,KACvEN,IAAI,CAACO,YAAY,CAACF,QAAQ,EAAEC,UAAU,CAAC,EACzC;IACEE,SAAS,EAAEA,CAAA,KAAMJ,WAAW,CAACK,iBAA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ryClient } from 'react-query';
|
|
3
3
|
import { useONECore } from './core-context';
|
|
4
4
|
import { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';
|
|
@@ -6,17 +6,17 @@ import { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } f
|
|
|
6
6
|
const CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];
|
|
7
7
|
const TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];
|
|
8
8
|
|
|
9
|
-
// Map each
|
|
9
|
+
// Map each CacheTypeBindingDto to the query keys that should be invalidated when that cache is cleared.
|
|
10
10
|
const cacheTypeToQueryKeys = {
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
17
|
-
[
|
|
18
|
-
[
|
|
19
|
-
[
|
|
11
|
+
[CacheTypeBindingDto.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,
|
|
12
|
+
[CacheTypeBindingDto.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,
|
|
13
|
+
[CacheTypeBindingDto.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
|
|
14
|
+
[CacheTypeBindingDto.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
|
|
15
|
+
[CacheTypeBindingDto.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
|
|
16
|
+
[CacheTypeBindingDto.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
|
|
17
|
+
[CacheTypeBindingDto.X509_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
18
|
+
[CacheTypeBindingDto.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
|
|
19
|
+
[CacheTypeBindingDto.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS
|
|
20
20
|
};
|
|
21
21
|
export const useCacheClear = () => {
|
|
22
22
|
const queryClient = useQueryClient();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CacheTypeBindingDto","useMutation","useQueryClient","useONECore","CREDENTIAL_DETAIL_QUERY_KEY","CREDENTIAL_LIST_PAGED_QUERY_KEY","CREDENTIAL_LIST_QUERY_KEY","REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY","TRUST_ENTITY_DETAIL_QUERY_KEY","CREDENTIAL_QUERY_KEYS","TRUST_ENTITY_QUERY_KEYS","cacheTypeToQueryKeys","DID_DOCUMENT","JSON_LD_CONTEXT","STATUS_LIST_CREDENTIAL","VCT_METADATA","JSON_SCHEMA","TRUST_LIST","X509_CRL","ANDROID_ATTESTATION_CRL","OPEN_ID_METADATA","useCacheClear","queryClient","core","cacheTypes","deleteCache","onSuccess","_","queryKeysToInvalidate","Set","forEach","cacheType","keys","key","add","Promise","all","map","queryKey","invalidateQueries"],"sources":["cache.ts"],"sourcesContent":["import { CacheTypeBindingDto } 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 { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';\n\nconst CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];\nconst TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];\n\n// Map each CacheTypeBindingDto to the query keys that should be invalidated when that cache is cleared.\nconst cacheTypeToQueryKeys: Record<CacheTypeBindingDto, string[]> = {\n [CacheTypeBindingDto.DID_DOCUMENT]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.JSON_LD_CONTEXT]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],\n [CacheTypeBindingDto.X509_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,\n [CacheTypeBindingDto.OPEN_ID_METADATA]: CREDENTIAL_QUERY_KEYS,\n};\n\nexport const useCacheClear = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(\n async (cacheTypes: CacheTypeBindingDto[]) => {\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,SAASA,mBAAmB,QAAQ,iCAAiC;AACrE,SAASC,WAAW,EAAEC,cAAc,QAAQ,aAAa;AAEzD,SAASC,UAAU,QAAQ,gBAAgB;AAC3C,SAASC,2BAA2B,EAAEC,+B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AACoB,SAAS,CAAC,IAAI,EAAE;QAClDC,IAAI,CAACF,OAAO,CAAEG,GAAG,IAAKL,qBAAqB,CAACM,GAAG,CAACD,GAAG,CAAC,CAAC;MACvD,CAAC,CAAC;MAEF,MAAME,OAAO,CAACC,GAAG,CAAC,CAAC,GAAGR,qBAAqB,CAAC,CAACS,GAAG,CAAEC,QAAQ,IAAKhB,WAAW,CAACiB,iBAAiB,CAACD,QAAQ,CAAC,CAAC,CAAC;IAC1G;EACF,CACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -11,12 +11,12 @@ const defaultContextValue = {
|
|
|
11
11
|
const ONECoreContext = /*#__PURE__*/createContext(defaultContextValue);
|
|
12
12
|
export const ONECoreContextProvider = ({
|
|
13
13
|
children,
|
|
14
|
-
organisationId =
|
|
14
|
+
organisationId = defaultContextValue.organisationId,
|
|
15
15
|
publisherReference,
|
|
16
16
|
config
|
|
17
17
|
}) => {
|
|
18
18
|
const [core, setCore] = useState();
|
|
19
|
-
const createTrustAnchor = useCreateTrustAnchor(
|
|
19
|
+
const createTrustAnchor = useCreateTrustAnchor();
|
|
20
20
|
const initialize = useCallback(async force => {
|
|
21
21
|
if (core && !force) {
|
|
22
22
|
return core;
|
|
@@ -41,16 +41,16 @@ export const ONECoreContextProvider = ({
|
|
|
41
41
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
42
42
|
[]);
|
|
43
43
|
useEffect(() => {
|
|
44
|
-
if (!core) {
|
|
44
|
+
if (!core || !publisherReference) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
core.getConfig().then(coreConfig => {
|
|
48
48
|
const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(TrustManagementEnum.SimpleTrustList);
|
|
49
49
|
if (trustManagementEnabled) {
|
|
50
|
-
createTrustAnchor(core).catch(() => {});
|
|
50
|
+
createTrustAnchor(core, publisherReference).catch(() => {});
|
|
51
51
|
}
|
|
52
52
|
}).catch(() => {});
|
|
53
|
-
}, [core, createTrustAnchor]);
|
|
53
|
+
}, [core, createTrustAnchor, publisherReference]);
|
|
54
54
|
const contextValue = useMemo(() => ({
|
|
55
55
|
core: core !== null && core !== void 0 ? core : defaultContextValue.core,
|
|
56
56
|
organisationId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["initializeCore","React","createContext","useCallback","useContext","useEffect","useMemo","useState","reportException","getEnabledTrustManagement","TrustManagementEnum","useCreateTrustAnchor","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","ONECoreContextProvider","children","publisherReference","config","setCore","createTrustAnchor","force","coreInstance","e","corePromise","then","c","uninitialize","catch","getConfig","coreConfig","trustManagementEnabled","includes","SimpleTrustList","contextValue","createElement","Provider","value","useONECore"],"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';\nimport { getEnabledTrustManagement } from './core-config';\nimport { TrustManagementEnum, useCreateTrustAnchor } from './trust-entity';\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 publisherReference
|
|
1
|
+
{"version":3,"names":["initializeCore","React","createContext","useCallback","useContext","useEffect","useMemo","useState","reportException","getEnabledTrustManagement","TrustManagementEnum","useCreateTrustAnchor","defaultContextValue","core","organisationId","initialize","Promise","reject","ONECoreContext","ONECoreContextProvider","children","publisherReference","config","setCore","createTrustAnchor","force","coreInstance","e","corePromise","then","c","uninitialize","catch","getConfig","coreConfig","trustManagementEnabled","includes","SimpleTrustList","contextValue","createElement","Provider","value","useONECore"],"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';\nimport { getEnabledTrustManagement } from './core-config';\nimport { TrustManagementEnum, useCreateTrustAnchor } from './trust-entity';\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 publisherReference?: string;\n};\n\nconst ONECoreContext = createContext<ContextValue>(defaultContextValue);\n\nexport const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({\n children,\n organisationId = defaultContextValue.organisationId,\n publisherReference,\n config,\n}) => {\n const [core, setCore] = useState<ONECore>();\n const createTrustAnchor = useCreateTrustAnchor();\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 useEffect(() => {\n if (!core || !publisherReference) {\n return;\n }\n\n core\n .getConfig()\n .then((coreConfig) => {\n const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(\n TrustManagementEnum.SimpleTrustList,\n );\n\n if (trustManagementEnabled) {\n createTrustAnchor(core, publisherReference).catch(() => {});\n }\n })\n .catch(() => {});\n }, [core, createTrustAnchor, publisherReference]);\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,SAASA,cAAc,QAAiB,iCAAiC;AACzE,OAAOC,KAAK,IACVC,aAAa,EAGbC,WAAW,EACXC,UAAU,EACVC,SAAS,EACTC,OAAO,EACPC,QAAQ,QACH,OAAO;AAEd,SAASC,eAAe,QAAQ,iBAAiB;AACjD,SAASC,yBAAyB,QAAQ,eAAe;AACzD,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,gBAAgB;AAQ1E,MAAMC,mBAAiC,GAAG;EACxCC,IAAI,EAAE,CAAC,CAAY;EACnBC,cAAc,EAAE,sCAAsC;EACtDC,UAAU,EAAEA,CAAA,KAAMC,OAAO,CAACC,MAAM,CAAC;AACnC,CAAC;AAQD,MAAMC,cAAc,gBAAGhB,aAAa,CAAeU,mBAAmB,CAAC;AAEvE,OAAO,MAAMO,sBAA0E,GAAGA,CAAC;EACzFC,QAAQ;EACRN,cAAc,GAAGF,mBAAmB,CAACE,cAAc;EACnDO,kBAAkB;EAClBC;AACF,CAAC,KAAK;EACJ,MAAM,CAACT,IAAI,EAAEU,OAAO,CAAC,GAAGhB,QAAQ,CAAU,CAAC;EAC3C,MAAMiB,iBAAiB,GAAGb,oBAAoB,CAAC,CAAC;EAEhD,MAAMI,UAAU,GAAGZ,WAAW,CAC5B,MAAOsB,KAAe,IAAK;IACzB,IAAIZ,IAAI,IAAI,CAACY,KAAK,EAAE;MAClB,OAAOZ,IAAI;IACb;IAEA,IAAI;MACF,MAAMa,YAAY,GAAG,MAAM1B,cAAc,CAACsB,MAAM,CAAC;MACjDC,OAAO,CAACG,YAAY,CAAC;MACrB,OAAOA,YAAY;IACrB,CAAC,CAAC,OAAOC,CAAC,EAAE;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AI,EAAE;IACT,OAAO,IAAI;EACb;EAEA,oBAAOZ,KAAA,CAAAsC,aAAA,CAACrB,cAAc,CAACsB,QAAQ;IAACC,KAAK,EAAEH;EAAa,GAAElB,QAAkC,CAAC;AAC3F,CAAC;AAED,OAAO,MAAMsB,UAAU,GAAGA,CAAA,KAAMtC,UAAU,CAACc,cAAc,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useInfiniteQuery","useMutation","useQuery","useQueryClient","getQueryKeyFromCredentialSchemaListQueryParams","useHTTPClient","useONECore","HISTORY_LIST_QUERY_KEY","PAGE_SIZE","CREDENTIAL_SCHEMA_LIST_QUERY_KEY","CREDENTIAL_SCHEMA_DETAIL_QUERY_KEY","CREDENTIAL_SCHEMA_PREVIEW_QUERY_KEY","CREDENTIAL_SCHEMA_SHARE_QUERY_KEY","useCredentialSchemas","queryParams","core","organisationId","pageParam","getCredentialSchemas","page","pageSize","then","values","getNextPageParam","lastPage","allPages","length","undefined","keepPreviousData","useCredentialSchemaPreview","url","httpClient","get","response","ok","originalError","data","useCredentialSchemaAccept","queryClient","schema","importCredentialSchema","onSuccess","invalidateQueries","useCredentialSchemaDetail","credentialId","active","getCredentialSchema","enabled","Boolean","useCredentialSchemaDelete","credentialSchemaId","deleteCredentialSchema","_","removeQueries","useShareCredentialSchema","schemaId","shareCredentialSchema","Promise","reject"],"sources":["credential-schemas.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["useInfiniteQuery","useMutation","useQuery","useQueryClient","getQueryKeyFromCredentialSchemaListQueryParams","useHTTPClient","useONECore","HISTORY_LIST_QUERY_KEY","PAGE_SIZE","CREDENTIAL_SCHEMA_LIST_QUERY_KEY","CREDENTIAL_SCHEMA_DETAIL_QUERY_KEY","CREDENTIAL_SCHEMA_PREVIEW_QUERY_KEY","CREDENTIAL_SCHEMA_SHARE_QUERY_KEY","useCredentialSchemas","queryParams","core","organisationId","pageParam","getCredentialSchemas","page","pageSize","then","values","getNextPageParam","lastPage","allPages","length","undefined","keepPreviousData","useCredentialSchemaPreview","url","httpClient","get","response","ok","originalError","data","useCredentialSchemaAccept","queryClient","schema","importCredentialSchema","onSuccess","invalidateQueries","useCredentialSchemaDetail","credentialId","active","getCredentialSchema","enabled","Boolean","useCredentialSchemaDelete","credentialSchemaId","deleteCredentialSchema","_","removeQueries","useShareCredentialSchema","schemaId","shareCredentialSchema","Promise","reject"],"sources":["credential-schemas.ts"],"sourcesContent":["import {\n CredentialSchemaListQueryBindingDto,\n ImportCredentialSchemaRequestSchemaBindingDto,\n} from '@procivis/react-native-one-core';\nimport { useInfiniteQuery, useMutation, useQuery, useQueryClient } from 'react-query';\n\nimport { getQueryKeyFromCredentialSchemaListQueryParams } from '../../parsers/query';\nimport { useHTTPClient } from '../http/client';\nimport { useONECore } from './core-context';\nimport { HISTORY_LIST_QUERY_KEY } from './history';\n\nconst PAGE_SIZE = 10;\nexport const CREDENTIAL_SCHEMA_LIST_QUERY_KEY = 'credential-schema-list';\nexport const CREDENTIAL_SCHEMA_DETAIL_QUERY_KEY = 'credential-schema-detail';\nexport const CREDENTIAL_SCHEMA_PREVIEW_QUERY_KEY = 'credential-schema-preview';\nexport const CREDENTIAL_SCHEMA_SHARE_QUERY_KEY = 'credential-schema-share';\n\nexport const useCredentialSchemas = (queryParams?: Partial<CredentialSchemaListQueryBindingDto>) => {\n const { core, organisationId } = useONECore();\n\n return useInfiniteQuery(\n [CREDENTIAL_SCHEMA_LIST_QUERY_KEY, ...getQueryKeyFromCredentialSchemaListQueryParams(queryParams)],\n ({ pageParam = 0 }) =>\n core\n .getCredentialSchemas({\n organisationId,\n page: pageParam,\n pageSize: PAGE_SIZE,\n ...queryParams,\n })\n .then(({ values }) => values),\n {\n getNextPageParam: (lastPage, allPages) => (lastPage.length === PAGE_SIZE ? allPages.length : undefined),\n keepPreviousData: true,\n },\n );\n};\n\nexport const useCredentialSchemaPreview = (url: string) => {\n const httpClient = useHTTPClient();\n\n return useQuery(\n [CREDENTIAL_SCHEMA_PREVIEW_QUERY_KEY, url],\n () =>\n httpClient.get(url).then((response) => {\n if (!response.ok) {\n throw response.originalError;\n }\n return response.data as ImportCredentialSchemaRequestSchemaBindingDto;\n }),\n {\n keepPreviousData: true,\n },\n );\n};\n\nexport const useCredentialSchemaAccept = () => {\n const queryClient = useQueryClient();\n const { core, organisationId } = useONECore();\n\n return useMutation(\n async (schema: ImportCredentialSchemaRequestSchemaBindingDto) =>\n core.importCredentialSchema({\n organisationId,\n schema,\n }),\n {\n onSuccess: async () => {\n await queryClient.invalidateQueries(CREDENTIAL_SCHEMA_LIST_QUERY_KEY);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n },\n );\n};\n\nexport const useCredentialSchemaDetail = (credentialId: string | undefined, active = true) => {\n const { core } = useONECore();\n\n return useQuery(\n [CREDENTIAL_SCHEMA_DETAIL_QUERY_KEY, credentialId],\n () => (credentialId ? core.getCredentialSchema(credentialId) : undefined),\n {\n enabled: active && Boolean(credentialId),\n keepPreviousData: true,\n },\n );\n};\n\nexport const useCredentialSchemaDelete = () => {\n const queryClient = useQueryClient();\n const { core } = useONECore();\n\n return useMutation(async (credentialSchemaId: string) => core.deleteCredentialSchema(credentialSchemaId), {\n onSuccess: async (_, credentialId) => {\n await queryClient.invalidateQueries(CREDENTIAL_SCHEMA_LIST_QUERY_KEY);\n await queryClient.removeQueries([CREDENTIAL_SCHEMA_DETAIL_QUERY_KEY, credentialId]);\n await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);\n },\n });\n};\n\nexport const useShareCredentialSchema = (schemaId?: string) => {\n const { core } = useONECore();\n\n return useQuery(\n [CREDENTIAL_SCHEMA_SHARE_QUERY_KEY, schemaId],\n () => (schemaId ? core.shareCredentialSchema(schemaId) : Promise.reject()),\n {\n enabled: Boolean(schemaId),\n keepPreviousData: true,\n },\n );\n};\n"],"mappings":"AAIA,SAASA,gBAAgB,EAAEC,WAAW,EAAEC,QAAQ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AAOiD,kBAA0B,IAAKnC,IAAI,CAACoC,sBAAsB,CAACD,kBAAkB,CAAC,EAAE;IACxGT,SAAS,EAAE,MAAAA,CAAOW,CAAC,EAAER,YAAY,KAAK;MACpC,MAAMN,WAAW,CAACI,iBAAiB,CAACjC,gCAAgC,CAAC;MACrE,MAAM6B,WAAW,CAACe,aAAa,CAAC,CAAC3C,kCAAkC,EAAEkC,YAAY,CAAC,CAAC;MACnF,MAAMN,WAAW,CAACI,iBAAiB,CAACnC,sBAAsB,CAAC;IAC7D;EACF,CAAC,CAAC;AACJ,CAAC;AAED,OAAO,MAAM+C,wBAAwB,GAAIC,QAAiB,IAAK;EAC7D,MAAM;IAAExC;EAAK,CAAC,GAAGT,UAAU,CAAC,CAAC;EAE7B,OAAOJ,QAAQ,CACb,CAACU,iCAAiC,EAAE2C,QAAQ,CAAC,EAC7C,MAAOA,QAAQ,GAAGxC,IAAI,CAACyC,qBAAqB,CAACD,QAAQ,CAAC,GAAGE,OAAO,CAACC,MAAM,CAAC,CAAE,EAC1E;IACEX,OAAO,EAAEC,OAAO,CAACO,QAAQ,CAAC;IAC1B3B,gBAAgB,EAAE;EACpB,CACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CredentialStateBindingEnum, OneError } from '@procivis/react-native-one-core';
|
|
2
2
|
import { useInfiniteQuery, useMutation, useQuery, useQueryClient } from 'react-query';
|
|
3
3
|
import { getQueryKeyFromCredentialListQueryParams } from '../../parsers/query';
|
|
4
4
|
import { useONECore } from './core-context';
|
|
@@ -23,7 +23,7 @@ export const useCredentials = queryParams => {
|
|
|
23
23
|
page: 0,
|
|
24
24
|
// TODO: workaround pagination for now, until it's supported by UI
|
|
25
25
|
pageSize: 10000,
|
|
26
|
-
states: [
|
|
26
|
+
states: [CredentialStateBindingEnum.ACCEPTED, CredentialStateBindingEnum.SUSPENDED, CredentialStateBindingEnum.REVOKED],
|
|
27
27
|
...queryParams
|
|
28
28
|
});
|
|
29
29
|
return values;
|
|
@@ -42,7 +42,7 @@ export const usePagedCredentials = queryParams => {
|
|
|
42
42
|
organisationId,
|
|
43
43
|
page: pageParam,
|
|
44
44
|
pageSize: PAGE_SIZE,
|
|
45
|
-
states: [
|
|
45
|
+
states: [CredentialStateBindingEnum.ACCEPTED, CredentialStateBindingEnum.SUSPENDED, CredentialStateBindingEnum.REVOKED],
|
|
46
46
|
...queryParams
|
|
47
47
|
}), {
|
|
48
48
|
getNextPageParam: (lastPage, allPages) => allPages.length < lastPage.totalPages ? allPages.length : undefined,
|
|
@@ -69,7 +69,7 @@ export const useInvitationHandler = () => {
|
|
|
69
69
|
...request
|
|
70
70
|
}), {
|
|
71
71
|
onSuccess: async result => {
|
|
72
|
-
if ('
|
|
72
|
+
if (result.type_ === 'PROOF_REQUEST') {
|
|
73
73
|
await queryClient.invalidateQueries(PROOF_LIST_QUERY_KEY);
|
|
74
74
|
} else {
|
|
75
75
|
await queryClient.invalidateQueries(CREDENTIAL_LIST_QUERY_KEY);
|