@procivis/one-react-native-components 0.2.54 → 0.3.22
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/README.md +3 -8
- package/lib/commonjs/components/backup/index.js.map +1 -1
- package/lib/commonjs/components/backup/preview-credentials.js +18 -22
- package/lib/commonjs/components/backup/preview-credentials.js.map +1 -1
- package/lib/commonjs/components/credential/credential.js +11 -12
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/credential/index.js.map +1 -1
- package/lib/commonjs/components/entity/EntityButtons.js +20 -25
- package/lib/commonjs/components/entity/EntityButtons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-attributes.js +15 -17
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +18 -19
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +12 -14
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/entity/index.js +2 -2
- package/lib/commonjs/components/entity/index.js.map +1 -1
- package/lib/commonjs/components/history/history-details-screen.js +67 -0
- package/lib/commonjs/components/history/history-details-screen.js.map +1 -0
- package/lib/commonjs/components/history/history-list-item-icon.js +94 -0
- package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -0
- package/lib/commonjs/components/history/history-list-item.js +45 -0
- package/lib/commonjs/components/history/history-list-item.js.map +1 -0
- package/lib/commonjs/components/history/history-list-screen.js +121 -0
- package/lib/commonjs/components/history/history-list-screen.js.map +1 -0
- package/lib/commonjs/components/history/history-list-section-header.js +39 -0
- package/lib/commonjs/components/history/history-list-section-header.js.map +1 -0
- package/lib/commonjs/components/history/history-list.js +100 -0
- package/lib/commonjs/components/history/history-list.js.map +1 -0
- package/lib/commonjs/components/history/index.js +72 -0
- package/lib/commonjs/components/history/index.js.map +1 -0
- package/lib/commonjs/components/index.js +11 -0
- package/lib/commonjs/components/index.js.map +1 -1
- package/lib/commonjs/components/navigation/header-buttons.js +21 -25
- package/lib/commonjs/components/navigation/header-buttons.js.map +1 -1
- package/lib/commonjs/components/navigation/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/group.js +4 -5
- package/lib/commonjs/components/proof-request/group.js.map +1 -1
- package/lib/commonjs/components/proof-request/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/select-credential.js +11 -12
- package/lib/commonjs/components/proof-request/select-credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +23 -27
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/normalize-color.d.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibility.js +11 -7
- package/lib/commonjs/ui-components/accessibility/accessibility.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js +8 -12
- package/lib/commonjs/ui-components/accessibility/accessibilityHistory.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js +15 -17
- package/lib/commonjs/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js +8 -10
- package/lib/commonjs/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/index.js +1 -30
- package/lib/commonjs/ui-components/accessibility/index.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale/index.js +2 -3
- package/lib/commonjs/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/commonjs/ui-components/accessibility/locale.test.js.map +1 -1
- package/lib/commonjs/ui-components/action-modal/ActionModal.js +9 -11
- package/lib/commonjs/ui-components/action-modal/ActionModal.js.map +1 -1
- package/lib/commonjs/ui-components/action-modal/index.js +1 -1
- package/lib/commonjs/ui-components/action-modal/index.js.map +1 -1
- package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js +10 -12
- package/lib/commonjs/ui-components/activity-indicator/activity-indicator.js.map +1 -1
- package/lib/commonjs/ui-components/activity-indicator/index.js +1 -1
- package/lib/commonjs/ui-components/activity-indicator/index.js.map +1 -1
- package/lib/commonjs/ui-components/blur/blur-view.js +13 -15
- package/lib/commonjs/ui-components/blur/blur-view.js.map +1 -1
- package/lib/commonjs/ui-components/blur/index.js +2 -2
- package/lib/commonjs/ui-components/blur/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/back-button.js +12 -15
- package/lib/commonjs/ui-components/buttons/back-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/button.js +19 -22
- package/lib/commonjs/ui-components/buttons/button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/connectivity-button.js +16 -18
- package/lib/commonjs/ui-components/buttons/connectivity-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/filter-button.js +8 -10
- package/lib/commonjs/ui-components/buttons/filter-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/ghost-button.js +12 -14
- package/lib/commonjs/ui-components/buttons/ghost-button.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/hold-button.js +244 -0
- package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -0
- package/lib/commonjs/ui-components/buttons/index.js +9 -37
- package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/scan-button.js +7 -9
- package/lib/commonjs/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/commonjs/ui-components/camera/camera-overlay.js +11 -14
- package/lib/commonjs/ui-components/camera/camera-overlay.js.map +1 -1
- package/lib/commonjs/ui-components/camera/index.js +2 -2
- package/lib/commonjs/ui-components/camera/index.js.map +1 -1
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js +12 -14
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/commonjs/ui-components/control/checkbox.js +11 -12
- package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
- package/lib/commonjs/ui-components/control/index.js.map +1 -1
- package/lib/commonjs/ui-components/control/switch.js +10 -12
- package/lib/commonjs/ui-components/control/switch.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-card.js +22 -26
- package/lib/commonjs/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +30 -35
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +27 -20
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-header.js +25 -24
- package/lib/commonjs/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js +27 -29
- package/lib/commonjs/ui-components/credential/card/credential-image-carousel.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/index.js +6 -41
- package/lib/commonjs/ui-components/credential/card/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +51 -60
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js +18 -21
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/commonjs/ui-components/credential/index.js +2 -25
- package/lib/commonjs/ui-components/credential/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/selector-status.js +3 -4
- package/lib/commonjs/ui-components/credential/selector-status.js.map +1 -1
- package/lib/commonjs/ui-components/credential/selector.js +8 -10
- package/lib/commonjs/ui-components/credential/selector.js.map +1 -1
- package/lib/commonjs/ui-components/detail/detail.js +12 -14
- package/lib/commonjs/ui-components/detail/detail.js.map +1 -1
- package/lib/commonjs/ui-components/detail/index.js +1 -1
- package/lib/commonjs/ui-components/detail/index.js.map +1 -1
- package/lib/commonjs/ui-components/entity/avatar.js +14 -16
- package/lib/commonjs/ui-components/entity/avatar.js.map +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js +15 -18
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/entity/index.js +2 -2
- package/lib/commonjs/ui-components/entity/index.js.map +1 -1
- package/lib/commonjs/ui-components/header/focus-aware-status-bar.js +3 -4
- package/lib/commonjs/ui-components/header/focus-aware-status-bar.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js +14 -17
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/header/header.js +12 -14
- package/lib/commonjs/ui-components/header/header.js.map +1 -1
- package/lib/commonjs/ui-components/header/index.js +4 -24
- package/lib/commonjs/ui-components/header/index.js.map +1 -1
- package/lib/commonjs/ui-components/header/navigation-header.js +27 -33
- package/lib/commonjs/ui-components/header/navigation-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/data-item.js +30 -23
- package/lib/commonjs/ui-components/history/data-item.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +181 -0
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -0
- package/lib/commonjs/ui-components/history/{history-list-item.js → history-item.js} +47 -26
- package/lib/commonjs/ui-components/history/history-item.js.map +1 -0
- package/lib/commonjs/ui-components/history/history-section-header.js +7 -9
- package/lib/commonjs/ui-components/history/history-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-section-list-item.js +13 -12
- package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/history/index.js +30 -9
- package/lib/commonjs/ui-components/history/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/connectivity.js +19 -24
- package/lib/commonjs/ui-components/icons/connectivity.js.map +1 -1
- package/lib/commonjs/ui-components/icons/credential.js +60 -71
- package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js +7 -8
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/icons/history.js +113 -133
- package/lib/commonjs/ui-components/icons/history.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +73 -90
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/icons/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/input.js +3 -3
- package/lib/commonjs/ui-components/icons/input.js.map +1 -1
- package/lib/commonjs/ui-components/icons/keypad.js +69 -81
- package/lib/commonjs/ui-components/icons/keypad.js.map +1 -1
- package/lib/commonjs/ui-components/icons/loader.js +4 -4
- package/lib/commonjs/ui-components/icons/loader.js.map +1 -1
- package/lib/commonjs/ui-components/icons/nerd-view.js +6 -9
- package/lib/commonjs/ui-components/icons/nerd-view.js.map +1 -1
- package/lib/commonjs/ui-components/icons/selector.js +8 -9
- package/lib/commonjs/ui-components/icons/selector.js.map +1 -1
- package/lib/commonjs/ui-components/icons/wallet.js +16 -19
- package/lib/commonjs/ui-components/icons/wallet.js.map +1 -1
- package/lib/commonjs/ui-components/image/image-or-component.js +15 -18
- package/lib/commonjs/ui-components/image/image-or-component.js.map +1 -1
- package/lib/commonjs/ui-components/image/index.js +2 -9
- package/lib/commonjs/ui-components/image/index.js.map +1 -1
- package/lib/commonjs/ui-components/index.js.map +1 -1
- package/lib/commonjs/ui-components/input/index.js +2 -2
- package/lib/commonjs/ui-components/input/index.js.map +1 -1
- package/lib/commonjs/ui-components/input/radio-group.js +28 -25
- package/lib/commonjs/ui-components/input/radio-group.js.map +1 -1
- package/lib/commonjs/ui-components/input/selection-input.js +27 -38
- package/lib/commonjs/ui-components/input/selection-input.js.map +1 -1
- package/lib/commonjs/ui-components/input/text-input.js +25 -28
- package/lib/commonjs/ui-components/input/text-input.js.map +1 -1
- package/lib/commonjs/ui-components/list/index.js +20 -2
- package/lib/commonjs/ui-components/list/index.js.map +1 -1
- package/lib/commonjs/ui-components/list/list-page-loading-indicator.js +14 -0
- package/lib/commonjs/ui-components/list/list-page-loading-indicator.js.map +1 -0
- package/lib/commonjs/ui-components/list/list-section-header.js +10 -12
- package/lib/commonjs/ui-components/list/list-section-header.js.map +1 -1
- package/lib/commonjs/ui-components/list/list-title-header.js +6 -8
- package/lib/commonjs/ui-components/list/list-title-header.js.map +1 -1
- package/lib/commonjs/ui-components/list/wallet/empty-list.js +73 -0
- package/lib/commonjs/ui-components/list/wallet/empty-list.js.map +1 -0
- package/lib/commonjs/ui-components/list/wallet/empty-search-result.js +41 -0
- package/lib/commonjs/ui-components/list/wallet/empty-search-result.js.map +1 -0
- package/lib/commonjs/ui-components/list/wallet/index.js +21 -0
- package/lib/commonjs/ui-components/list/wallet/index.js.map +1 -0
- package/lib/commonjs/ui-components/loader/index.js +2 -2
- package/lib/commonjs/ui-components/loader/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loader.js +17 -17
- package/lib/commonjs/ui-components/loader/loader.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +22 -21
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/nerd-view/index.js +2 -8
- package/lib/commonjs/ui-components/nerd-view/index.js.map +1 -1
- package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js +37 -41
- package/lib/commonjs/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
- package/lib/commonjs/ui-components/pin/index.js +2 -2
- package/lib/commonjs/ui-components/pin/index.js.map +1 -1
- package/lib/commonjs/ui-components/pin/keypad.js +19 -23
- package/lib/commonjs/ui-components/pin/keypad.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pin-code-screen.js +19 -21
- package/lib/commonjs/ui-components/pin/pin-code-screen.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js +1 -2
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pin-lock.js +10 -12
- package/lib/commonjs/ui-components/pin/pin-lock.js.map +1 -1
- package/lib/commonjs/ui-components/pin/pins.js +8 -9
- package/lib/commonjs/ui-components/pin/pins.js.map +1 -1
- package/lib/commonjs/ui-components/screens/backup-screen.js +15 -18
- package/lib/commonjs/ui-components/screens/backup-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/image-preview-screen.js +12 -14
- package/lib/commonjs/ui-components/screens/image-preview-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/index.js +8 -49
- package/lib/commonjs/ui-components/screens/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +34 -41
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js +14 -16
- package/lib/commonjs/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/scroll-view-screen.js +12 -14
- package/lib/commonjs/ui-components/screens/scroll-view-screen.js.map +1 -1
- package/lib/commonjs/ui-components/screens/section-list-screen.js +13 -15
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js +10 -12
- package/lib/commonjs/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/index.js +2 -2
- package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/search-bar.js +15 -17
- package/lib/commonjs/ui-components/searchbar/search-bar.js.map +1 -1
- package/lib/commonjs/ui-components/settings/button-setting.js +14 -16
- package/lib/commonjs/ui-components/settings/button-setting.js.map +1 -1
- package/lib/commonjs/ui-components/settings/index.js +2 -2
- package/lib/commonjs/ui-components/settings/index.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item-separator.js +6 -8
- package/lib/commonjs/ui-components/settings/setting-item-separator.js.map +1 -1
- package/lib/commonjs/ui-components/settings/setting-item.js +11 -13
- package/lib/commonjs/ui-components/settings/setting-item.js.map +1 -1
- package/lib/commonjs/ui-components/settings/settings-button.js +7 -9
- package/lib/commonjs/ui-components/settings/settings-button.js.map +1 -1
- package/lib/commonjs/ui-components/settings/switch-setting.js +11 -13
- package/lib/commonjs/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/commonjs/ui-components/state/error-screen.js +10 -12
- package/lib/commonjs/ui-components/state/error-screen.js.map +1 -1
- package/lib/commonjs/ui-components/state/index.js +2 -2
- package/lib/commonjs/ui-components/state/index.js.map +1 -1
- package/lib/commonjs/ui-components/text/base.js +14 -16
- package/lib/commonjs/ui-components/text/base.js.map +1 -1
- package/lib/commonjs/ui-components/text/font.js +11 -13
- package/lib/commonjs/ui-components/text/font.js.map +1 -1
- package/lib/commonjs/ui-components/text/index.js +2 -9
- package/lib/commonjs/ui-components/text/index.js.map +1 -1
- package/lib/commonjs/ui-components/text/typography.js +10 -13
- package/lib/commonjs/ui-components/text/typography.js.map +1 -1
- package/lib/commonjs/ui-components/theme/color-scheme-context.js +2 -1
- package/lib/commonjs/ui-components/theme/color-scheme-context.js.map +1 -1
- package/lib/commonjs/ui-components/theme/color-scheme.js.map +1 -1
- package/lib/commonjs/ui-components/theme/index.js.map +1 -1
- package/lib/commonjs/utils/array.js.map +1 -1
- package/lib/commonjs/utils/backup.js.map +1 -1
- package/lib/commonjs/utils/color.js +1 -1
- package/lib/commonjs/utils/color.js.map +1 -1
- package/lib/commonjs/utils/contrasting-status-bar.js +8 -10
- package/lib/commonjs/utils/contrasting-status-bar.js.map +1 -1
- package/lib/commonjs/utils/date.js +3 -3
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/filtering.js +11 -0
- package/lib/commonjs/utils/filtering.js.map +1 -0
- package/lib/commonjs/utils/history.js +76 -0
- package/lib/commonjs/utils/history.js.map +1 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.js +37 -23
- package/lib/commonjs/utils/hooks/connectivity/connectivity.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +6 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +31 -31
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/cache.js +44 -0
- package/lib/commonjs/utils/hooks/core/cache.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/core-config.js +15 -1
- package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-context.js +15 -10
- package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +18 -12
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credential-schemas.js +16 -27
- package/lib/commonjs/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +27 -37
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/dids.js +4 -6
- package/lib/commonjs/utils/hooks/core/dids.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/error-code.js +3 -4
- package/lib/commonjs/utils/hooks/core/error-code.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/history.js +5 -37
- package/lib/commonjs/utils/hooks/core/history.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +11 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proof-schemas.js +23 -38
- package/lib/commonjs/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +107 -76
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/query.js +1 -2
- package/lib/commonjs/utils/hooks/core/query.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +8 -4
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
- package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js +1 -2
- package/lib/commonjs/utils/hooks/header/on-scroll-header-state.js.map +1 -1
- package/lib/commonjs/utils/hooks/http/client.js.map +1 -1
- package/lib/commonjs/utils/hooks/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/list/list-content-inset.js +9 -10
- package/lib/commonjs/utils/hooks/list/list-content-inset.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/before-remove.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/close-button-timeout.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/deep-link.js +3 -4
- package/lib/commonjs/utils/hooks/navigation/deep-link.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/navigation/open-settings.js +1 -2
- package/lib/commonjs/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/commonjs/utils/hooks/pin-security/pin-security.js +1 -2
- package/lib/commonjs/utils/hooks/pin-security/pin-security.js.map +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +17 -26
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/commonjs/utils/index.js +37 -1
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/navigation.js +5 -5
- package/lib/commonjs/utils/navigation.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js +1 -1
- package/lib/commonjs/utils/parsers/credential-images.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +16 -20
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +16 -26
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/index.js +11 -0
- package/lib/commonjs/utils/parsers/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +3 -2
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/parsers/universal-links.js +33 -0
- package/lib/commonjs/utils/parsers/universal-links.js.map +1 -0
- package/lib/commonjs/utils/parsers/universal-links.test.js +40 -0
- package/lib/commonjs/utils/parsers/universal-links.test.js.map +1 -0
- package/lib/commonjs/utils/ref.js.map +1 -1
- package/lib/commonjs/utils/reporting.js +4 -2
- package/lib/commonjs/utils/reporting.js.map +1 -1
- package/lib/commonjs/utils/string.js.map +1 -1
- package/lib/commonjs/utils/testID.js +1 -4
- package/lib/commonjs/utils/testID.js.map +1 -1
- package/lib/commonjs/utils/testID.test.js.map +1 -1
- package/lib/commonjs/utils/useMemoAsync.js +9 -0
- package/lib/commonjs/utils/useMemoAsync.js.map +1 -1
- package/lib/commonjs/utils/uuid.js +1 -1
- package/lib/commonjs/utils/uuid.js.map +1 -1
- package/lib/module/components/backup/index.js.map +1 -1
- package/lib/module/components/backup/preview-credentials.js +17 -21
- package/lib/module/components/backup/preview-credentials.js.map +1 -1
- package/lib/module/components/credential/credential.js +10 -11
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/credential/index.js.map +1 -1
- package/lib/module/components/entity/EntityButtons.js +17 -21
- package/lib/module/components/entity/EntityButtons.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js +12 -13
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +15 -15
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +8 -9
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/entity/index.js.map +1 -1
- package/lib/module/components/history/history-details-screen.js +59 -0
- package/lib/module/components/history/history-details-screen.js.map +1 -0
- package/lib/module/components/history/history-list-item-icon.js +84 -0
- package/lib/module/components/history/history-list-item-icon.js.map +1 -0
- package/lib/module/components/history/history-list-item.js +36 -0
- package/lib/module/components/history/history-list-item.js.map +1 -0
- package/lib/module/components/history/history-list-screen.js +112 -0
- package/lib/module/components/history/history-list-screen.js.map +1 -0
- package/lib/module/components/history/history-list-section-header.js +29 -0
- package/lib/module/components/history/history-list-section-header.js.map +1 -0
- package/lib/module/components/history/history-list.js +90 -0
- package/lib/module/components/history/history-list.js.map +1 -0
- package/lib/module/components/history/index.js +7 -0
- package/lib/module/components/history/index.js.map +1 -0
- package/lib/module/components/index.js +1 -0
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/navigation/header-buttons.js +19 -23
- package/lib/module/components/navigation/header-buttons.js.map +1 -1
- package/lib/module/components/navigation/index.js.map +1 -1
- package/lib/module/components/proof-request/group.js +3 -4
- package/lib/module/components/proof-request/group.js.map +1 -1
- package/lib/module/components/proof-request/index.js.map +1 -1
- package/lib/module/components/proof-request/select-credential.js +10 -11
- package/lib/module/components/proof-request/select-credential.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +21 -25
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/normalize-color.d.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibility.js +5 -7
- package/lib/module/ui-components/accessibility/accessibility.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistory.js +4 -8
- package/lib/module/ui-components/accessibility/accessibilityHistory.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js +10 -8
- package/lib/module/ui-components/accessibility/accessibilityHistoryWrappers.js.map +1 -1
- package/lib/module/ui-components/accessibility/accessibilityLanguage.js +6 -8
- package/lib/module/ui-components/accessibility/accessibilityLanguage.js.map +1 -1
- package/lib/module/ui-components/accessibility/index.js +4 -4
- package/lib/module/ui-components/accessibility/index.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale/index.js.map +1 -1
- package/lib/module/ui-components/accessibility/locale.test.js.map +1 -1
- package/lib/module/ui-components/action-modal/ActionModal.js +7 -8
- package/lib/module/ui-components/action-modal/ActionModal.js.map +1 -1
- package/lib/module/ui-components/action-modal/index.js.map +1 -1
- package/lib/module/ui-components/activity-indicator/activity-indicator.js +6 -7
- package/lib/module/ui-components/activity-indicator/activity-indicator.js.map +1 -1
- package/lib/module/ui-components/activity-indicator/index.js.map +1 -1
- package/lib/module/ui-components/blur/blur-view.js +10 -11
- package/lib/module/ui-components/blur/blur-view.js.map +1 -1
- package/lib/module/ui-components/blur/index.js.map +1 -1
- package/lib/module/ui-components/buttons/back-button.js +10 -11
- package/lib/module/ui-components/buttons/back-button.js.map +1 -1
- package/lib/module/ui-components/buttons/button.js +17 -18
- package/lib/module/ui-components/buttons/button.js.map +1 -1
- package/lib/module/ui-components/buttons/connectivity-button.js +14 -14
- package/lib/module/ui-components/buttons/connectivity-button.js.map +1 -1
- package/lib/module/ui-components/buttons/filter-button.js +6 -7
- package/lib/module/ui-components/buttons/filter-button.js.map +1 -1
- package/lib/module/ui-components/buttons/ghost-button.js +9 -10
- package/lib/module/ui-components/buttons/ghost-button.js.map +1 -1
- package/lib/module/ui-components/buttons/hold-button.js +236 -0
- package/lib/module/ui-components/buttons/hold-button.js.map +1 -0
- package/lib/module/ui-components/buttons/index.js +8 -7
- package/lib/module/ui-components/buttons/index.js.map +1 -1
- package/lib/module/ui-components/buttons/scan-button.js +5 -6
- package/lib/module/ui-components/buttons/scan-button.js.map +1 -1
- package/lib/module/ui-components/camera/camera-overlay.js +7 -9
- package/lib/module/ui-components/camera/camera-overlay.js.map +1 -1
- package/lib/module/ui-components/camera/index.js.map +1 -1
- package/lib/module/ui-components/camera/qr-code-scanner.js +8 -9
- package/lib/module/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/module/ui-components/control/checkbox.js +9 -10
- package/lib/module/ui-components/control/checkbox.js.map +1 -1
- package/lib/module/ui-components/control/index.js.map +1 -1
- package/lib/module/ui-components/control/switch.js +8 -9
- package/lib/module/ui-components/control/switch.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-card.js +16 -17
- package/lib/module/ui-components/credential/card/credential-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +26 -30
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-list-item.js +23 -15
- package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-header.js +21 -19
- package/lib/module/ui-components/credential/card/credential-header.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-image-carousel.js +23 -23
- package/lib/module/ui-components/credential/card/credential-image-carousel.js.map +1 -1
- package/lib/module/ui-components/credential/card/index.js +10 -10
- package/lib/module/ui-components/credential/card/index.js.map +1 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js +47 -55
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js +15 -18
- package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/module/ui-components/credential/index.js +2 -2
- package/lib/module/ui-components/credential/index.js.map +1 -1
- package/lib/module/ui-components/credential/selector-status.js +3 -3
- package/lib/module/ui-components/credential/selector-status.js.map +1 -1
- package/lib/module/ui-components/credential/selector.js +5 -6
- package/lib/module/ui-components/credential/selector.js.map +1 -1
- package/lib/module/ui-components/detail/detail.js +9 -10
- package/lib/module/ui-components/detail/detail.js.map +1 -1
- package/lib/module/ui-components/detail/index.js.map +1 -1
- package/lib/module/ui-components/entity/avatar.js +10 -11
- package/lib/module/ui-components/entity/avatar.js.map +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js +11 -13
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/entity/index.js.map +1 -1
- package/lib/module/ui-components/header/focus-aware-status-bar.js +1 -1
- package/lib/module/ui-components/header/focus-aware-status-bar.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js +10 -12
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/header/header.js +10 -11
- package/lib/module/ui-components/header/header.js.map +1 -1
- package/lib/module/ui-components/header/index.js +6 -6
- package/lib/module/ui-components/header/index.js.map +1 -1
- package/lib/module/ui-components/header/navigation-header.js +23 -28
- package/lib/module/ui-components/header/navigation-header.js.map +1 -1
- package/lib/module/ui-components/history/data-item.js +23 -15
- package/lib/module/ui-components/history/data-item.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +171 -0
- package/lib/module/ui-components/history/history-details.js.map +1 -0
- package/lib/module/ui-components/history/{history-list-item.js → history-item.js} +44 -22
- package/lib/module/ui-components/history/history-item.js.map +1 -0
- package/lib/module/ui-components/history/history-section-header.js +6 -7
- package/lib/module/ui-components/history/history-section-header.js.map +1 -1
- package/lib/module/ui-components/history/history-section-list-item.js +8 -9
- package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
- package/lib/module/ui-components/history/index.js +5 -4
- package/lib/module/ui-components/history/index.js.map +1 -1
- package/lib/module/ui-components/icons/connectivity.js +16 -21
- package/lib/module/ui-components/icons/connectivity.js.map +1 -1
- package/lib/module/ui-components/icons/credential.js +57 -68
- package/lib/module/ui-components/icons/credential.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js +4 -5
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/icons/history.js +101 -128
- package/lib/module/ui-components/icons/history.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +70 -87
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/icons/index.js.map +1 -1
- package/lib/module/ui-components/icons/input.js.map +1 -1
- package/lib/module/ui-components/icons/keypad.js +66 -78
- package/lib/module/ui-components/icons/keypad.js.map +1 -1
- package/lib/module/ui-components/icons/loader.js +1 -1
- package/lib/module/ui-components/icons/loader.js.map +1 -1
- package/lib/module/ui-components/icons/nerd-view.js.map +1 -1
- package/lib/module/ui-components/icons/selector.js +5 -6
- package/lib/module/ui-components/icons/selector.js.map +1 -1
- package/lib/module/ui-components/icons/wallet.js +13 -16
- package/lib/module/ui-components/icons/wallet.js.map +1 -1
- package/lib/module/ui-components/image/image-or-component.js +12 -14
- package/lib/module/ui-components/image/image-or-component.js.map +1 -1
- package/lib/module/ui-components/image/index.js +2 -2
- package/lib/module/ui-components/image/index.js.map +1 -1
- package/lib/module/ui-components/index.js.map +1 -1
- package/lib/module/ui-components/input/index.js.map +1 -1
- package/lib/module/ui-components/input/radio-group.js +26 -22
- package/lib/module/ui-components/input/radio-group.js.map +1 -1
- package/lib/module/ui-components/input/selection-input.js +21 -31
- package/lib/module/ui-components/input/selection-input.js.map +1 -1
- package/lib/module/ui-components/input/text-input.js +21 -22
- package/lib/module/ui-components/input/text-input.js.map +1 -1
- package/lib/module/ui-components/list/index.js +1 -0
- package/lib/module/ui-components/list/index.js.map +1 -1
- package/lib/module/ui-components/list/list-page-loading-indicator.js +7 -0
- package/lib/module/ui-components/list/list-page-loading-indicator.js.map +1 -0
- package/lib/module/ui-components/list/list-section-header.js +8 -9
- package/lib/module/ui-components/list/list-section-header.js.map +1 -1
- package/lib/module/ui-components/list/list-title-header.js +4 -5
- package/lib/module/ui-components/list/list-title-header.js.map +1 -1
- package/lib/module/ui-components/list/wallet/empty-list.js +66 -0
- package/lib/module/ui-components/list/wallet/empty-list.js.map +1 -0
- package/lib/module/ui-components/list/wallet/empty-search-result.js +34 -0
- package/lib/module/ui-components/list/wallet/empty-search-result.js.map +1 -0
- package/lib/module/ui-components/list/wallet/index.js +4 -0
- package/lib/module/ui-components/list/wallet/index.js.map +1 -0
- package/lib/module/ui-components/loader/index.js.map +1 -1
- package/lib/module/ui-components/loader/loader.js +14 -12
- package/lib/module/ui-components/loader/loader.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +21 -19
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/nerd-view/index.js +2 -2
- package/lib/module/ui-components/nerd-view/index.js.map +1 -1
- package/lib/module/ui-components/nerd-view/nerd-mode-item.js +31 -34
- package/lib/module/ui-components/nerd-view/nerd-mode-item.js.map +1 -1
- package/lib/module/ui-components/pin/index.js.map +1 -1
- package/lib/module/ui-components/pin/keypad.js +17 -19
- package/lib/module/ui-components/pin/keypad.js.map +1 -1
- package/lib/module/ui-components/pin/pin-code-screen.js +16 -17
- package/lib/module/ui-components/pin/pin-code-screen.js.map +1 -1
- package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/module/ui-components/pin/pin-lock.js +6 -7
- package/lib/module/ui-components/pin/pin-lock.js.map +1 -1
- package/lib/module/ui-components/pin/pins.js +7 -8
- package/lib/module/ui-components/pin/pins.js.map +1 -1
- package/lib/module/ui-components/screens/backup-screen.js +13 -14
- package/lib/module/ui-components/screens/backup-screen.js.map +1 -1
- package/lib/module/ui-components/screens/image-preview-screen.js +9 -10
- package/lib/module/ui-components/screens/image-preview-screen.js.map +1 -1
- package/lib/module/ui-components/screens/index.js +12 -12
- package/lib/module/ui-components/screens/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js +29 -34
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/screens/qr-code-scanner-screen.js +10 -11
- package/lib/module/ui-components/screens/qr-code-scanner-screen.js.map +1 -1
- package/lib/module/ui-components/screens/scroll-view-screen.js +10 -11
- package/lib/module/ui-components/screens/scroll-view-screen.js.map +1 -1
- package/lib/module/ui-components/screens/section-list-screen.js +11 -12
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/animated-search-bar.js +6 -7
- package/lib/module/ui-components/searchbar/animated-search-bar.js.map +1 -1
- package/lib/module/ui-components/searchbar/index.js.map +1 -1
- package/lib/module/ui-components/searchbar/search-bar.js +11 -12
- package/lib/module/ui-components/searchbar/search-bar.js.map +1 -1
- package/lib/module/ui-components/settings/button-setting.js +10 -11
- package/lib/module/ui-components/settings/button-setting.js.map +1 -1
- package/lib/module/ui-components/settings/index.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item-separator.js +4 -5
- package/lib/module/ui-components/settings/setting-item-separator.js.map +1 -1
- package/lib/module/ui-components/settings/setting-item.js +7 -8
- package/lib/module/ui-components/settings/setting-item.js.map +1 -1
- package/lib/module/ui-components/settings/settings-button.js +5 -6
- package/lib/module/ui-components/settings/settings-button.js.map +1 -1
- package/lib/module/ui-components/settings/switch-setting.js +9 -10
- package/lib/module/ui-components/settings/switch-setting.js.map +1 -1
- package/lib/module/ui-components/state/error-screen.js +7 -8
- package/lib/module/ui-components/state/error-screen.js.map +1 -1
- package/lib/module/ui-components/state/index.js.map +1 -1
- package/lib/module/ui-components/text/base.js +12 -13
- package/lib/module/ui-components/text/base.js.map +1 -1
- package/lib/module/ui-components/text/font.js +10 -11
- package/lib/module/ui-components/text/font.js.map +1 -1
- package/lib/module/ui-components/text/index.js +2 -2
- package/lib/module/ui-components/text/index.js.map +1 -1
- package/lib/module/ui-components/text/typography.js +8 -10
- package/lib/module/ui-components/text/typography.js.map +1 -1
- package/lib/module/ui-components/theme/color-scheme-context.js +1 -0
- package/lib/module/ui-components/theme/color-scheme-context.js.map +1 -1
- package/lib/module/ui-components/theme/color-scheme.js.map +1 -1
- package/lib/module/ui-components/theme/index.js.map +1 -1
- package/lib/module/utils/array.js.map +1 -1
- package/lib/module/utils/backup.js.map +1 -1
- package/lib/module/utils/color.js.map +1 -1
- package/lib/module/utils/contrasting-status-bar.js +5 -6
- package/lib/module/utils/contrasting-status-bar.js.map +1 -1
- package/lib/module/utils/date.js +4 -4
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/filtering.js +4 -0
- package/lib/module/utils/filtering.js.map +1 -0
- package/lib/module/utils/history.js +66 -0
- package/lib/module/utils/history.js.map +1 -0
- package/lib/module/utils/hooks/connectivity/connectivity.js +36 -19
- package/lib/module/utils/hooks/connectivity/connectivity.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js +6 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +31 -31
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/cache.js +37 -0
- package/lib/module/utils/hooks/core/cache.js.map +1 -0
- package/lib/module/utils/hooks/core/core-config.js +11 -0
- package/lib/module/utils/hooks/core/core-config.js.map +1 -1
- package/lib/module/utils/hooks/core/core-context.js +14 -9
- package/lib/module/utils/hooks/core/core-context.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +16 -8
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credential-schemas.js +12 -19
- package/lib/module/utils/hooks/core/credential-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +26 -36
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/dids.js +3 -4
- package/lib/module/utils/hooks/core/dids.js.map +1 -1
- package/lib/module/utils/hooks/core/error-code.js +3 -3
- package/lib/module/utils/hooks/core/error-code.js.map +1 -1
- package/lib/module/utils/hooks/core/history.js +4 -35
- package/lib/module/utils/hooks/core/history.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +1 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proof-schemas.js +19 -30
- package/lib/module/utils/hooks/core/proof-schemas.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +101 -67
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/query.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +7 -3
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/hooks/credential-card/credential-card-expanding.js.map +1 -1
- package/lib/module/utils/hooks/header/on-scroll-header-state.js +1 -2
- package/lib/module/utils/hooks/header/on-scroll-header-state.js.map +1 -1
- package/lib/module/utils/hooks/http/client.js.map +1 -1
- package/lib/module/utils/hooks/index.js.map +1 -1
- package/lib/module/utils/hooks/list/list-content-inset.js +9 -10
- package/lib/module/utils/hooks/list/list-content-inset.js.map +1 -1
- package/lib/module/utils/hooks/navigation/before-remove.js.map +1 -1
- package/lib/module/utils/hooks/navigation/close-button-timeout.js.map +1 -1
- package/lib/module/utils/hooks/navigation/deep-link.js +3 -4
- package/lib/module/utils/hooks/navigation/deep-link.js.map +1 -1
- package/lib/module/utils/hooks/navigation/index.js.map +1 -1
- package/lib/module/utils/hooks/navigation/open-settings.js +1 -2
- package/lib/module/utils/hooks/navigation/open-settings.js.map +1 -1
- package/lib/module/utils/hooks/pin-security/pin-security.js +1 -2
- package/lib/module/utils/hooks/pin-security/pin-security.js.map +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js +17 -26
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/index.js +3 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/navigation.js +5 -5
- package/lib/module/utils/navigation.js.map +1 -1
- package/lib/module/utils/parsers/credential-images.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +15 -19
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +16 -25
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/index.js +1 -0
- package/lib/module/utils/parsers/index.js.map +1 -1
- package/lib/module/utils/parsers/query.js +3 -2
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/parsers/universal-links.js +25 -0
- package/lib/module/utils/parsers/universal-links.js.map +1 -0
- package/lib/module/utils/parsers/universal-links.test.js +38 -0
- package/lib/module/utils/parsers/universal-links.test.js.map +1 -0
- package/lib/module/utils/ref.js.map +1 -1
- package/lib/module/utils/reporting.js +1 -0
- package/lib/module/utils/reporting.js.map +1 -1
- package/lib/module/utils/string.js.map +1 -1
- package/lib/module/utils/testID.js +1 -4
- package/lib/module/utils/testID.js.map +1 -1
- package/lib/module/utils/testID.test.js.map +1 -1
- package/lib/module/utils/useMemoAsync.js +10 -0
- package/lib/module/utils/useMemoAsync.js.map +1 -1
- package/lib/module/utils/uuid.js.map +1 -1
- package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
- package/lib/typescript/components/history/history-details-screen.d.ts +20 -0
- package/lib/typescript/components/history/history-list-item-icon.d.ts +8 -0
- package/lib/typescript/components/history/history-list-item.d.ts +20 -0
- package/lib/typescript/components/history/history-list-screen.d.ts +22 -0
- package/lib/typescript/components/history/history-list-section-header.d.ts +13 -0
- package/lib/typescript/components/history/history-list.d.ts +19 -0
- package/lib/typescript/components/history/index.d.ts +6 -0
- package/lib/typescript/components/index.d.ts +1 -0
- package/lib/typescript/ui-components/accessibility/accessibility.d.ts +2 -2
- package/lib/typescript/ui-components/accessibility/accessibilityHistory.d.ts +1 -1
- package/lib/typescript/ui-components/accessibility/accessibilityHistoryWrappers.d.ts +3 -3
- package/lib/typescript/ui-components/accessibility/index.d.ts +5 -3
- package/lib/typescript/ui-components/buttons/button.d.ts +2 -2
- package/lib/typescript/ui-components/buttons/hold-button.d.ts +16 -0
- package/lib/typescript/ui-components/buttons/index.d.ts +15 -7
- package/lib/typescript/ui-components/buttons/scan-button.d.ts +2 -2
- package/lib/typescript/ui-components/credential/card/credential-header.d.ts +1 -1
- package/lib/typescript/ui-components/credential/card/index.d.ts +10 -5
- package/lib/typescript/ui-components/credential/index.d.ts +2 -1
- package/lib/typescript/ui-components/header/index.d.ts +6 -3
- package/lib/typescript/ui-components/history/data-item.d.ts +2 -2
- package/lib/typescript/ui-components/history/history-details.d.ts +51 -0
- package/lib/typescript/ui-components/history/{history-list-item.d.ts → history-item.d.ts} +4 -3
- package/lib/typescript/ui-components/history/history-section-header.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 +5 -4
- package/lib/typescript/ui-components/icons/history.d.ts +20 -35
- package/lib/typescript/ui-components/image/index.d.ts +2 -1
- package/lib/typescript/ui-components/input/selection-input.d.ts +1 -1
- package/lib/typescript/ui-components/list/index.d.ts +1 -0
- package/lib/typescript/ui-components/list/list-page-loading-indicator.d.ts +4 -0
- package/lib/typescript/ui-components/list/wallet/empty-list.d.ts +10 -0
- package/lib/typescript/ui-components/list/wallet/empty-search-result.d.ts +7 -0
- package/lib/typescript/ui-components/list/wallet/index.d.ts +3 -0
- package/lib/typescript/ui-components/nerd-view/index.d.ts +2 -1
- package/lib/typescript/ui-components/pin/keypad.d.ts +2 -2
- package/lib/typescript/ui-components/screens/index.d.ts +12 -6
- package/lib/typescript/ui-components/text/index.d.ts +2 -1
- package/lib/typescript/ui-components/text/typography.d.ts +14 -14
- package/lib/typescript/ui-components/theme/color-scheme.d.ts +1 -0
- package/lib/typescript/utils/filtering.d.ts +1 -0
- package/lib/typescript/utils/history.d.ts +10 -0
- package/lib/typescript/utils/hooks/connectivity/connectivity.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/backup.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/cache.d.ts +2 -0
- package/lib/typescript/utils/hooks/core/core-config.d.ts +5 -1
- package/lib/typescript/utils/hooks/core/core-init.d.ts +10 -1
- package/lib/typescript/utils/hooks/core/credentials.d.ts +7 -3
- package/lib/typescript/utils/hooks/core/history.d.ts +2 -5
- package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +14 -8
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +5 -0
- package/lib/typescript/utils/hooks/revocation/credential-status.d.ts +2 -1
- package/lib/typescript/utils/index.d.ts +3 -0
- package/lib/typescript/utils/parsers/index.d.ts +1 -0
- package/lib/typescript/utils/parsers/universal-links.d.ts +1 -0
- package/lib/typescript/utils/parsers/universal-links.test.d.ts +1 -0
- package/lib/typescript/utils/ref.d.ts +1 -1
- package/package.json +60 -46
- package/src/components/entity/entity-attributes.tsx +4 -3
- package/src/components/entity/entity-details-with-buttons.tsx +4 -3
- package/src/components/history/history-details-screen.tsx +89 -0
- package/src/components/history/history-list-item-icon.tsx +108 -0
- package/src/components/history/history-list-item.tsx +53 -0
- package/src/components/history/history-list-screen.tsx +154 -0
- package/src/components/history/history-list-section-header.tsx +42 -0
- package/src/components/history/history-list.tsx +116 -0
- package/src/components/history/index.tsx +6 -0
- package/src/components/index.ts +1 -0
- package/src/ui-components/accessibility/accessibility.ts +2 -2
- package/src/ui-components/accessibility/accessibilityHistory.tsx +2 -2
- package/src/ui-components/accessibility/accessibilityHistoryWrappers.tsx +3 -5
- package/src/ui-components/accessibility/index.ts +4 -3
- package/src/ui-components/action-modal/ActionModal.stories.tsx +7 -3
- package/src/ui-components/activity-indicator/activity-indicator.stories.tsx +3 -6
- package/src/ui-components/buttons/back-button.stories.tsx +7 -8
- package/src/ui-components/buttons/button.stories.tsx +9 -10
- package/src/ui-components/buttons/connectivity-button.stories.tsx +10 -11
- package/src/ui-components/buttons/connectivity-button.tsx +1 -1
- package/src/ui-components/buttons/ghost-button.stories.tsx +8 -8
- package/src/ui-components/buttons/hold-button.stories.tsx +29 -0
- package/src/ui-components/buttons/hold-button.tsx +276 -0
- package/src/ui-components/buttons/index.ts +16 -6
- package/src/ui-components/buttons/scan-button.stories.tsx +8 -4
- package/src/ui-components/control/checkbox.stories.tsx +8 -8
- package/src/ui-components/control/switch.stories.tsx +11 -8
- package/src/ui-components/credential/card/credential-card.stories.tsx +22 -25
- package/src/ui-components/credential/card/credential-details-card.stories.tsx +249 -245
- package/src/ui-components/credential/card/credential-details-card.tsx +2 -2
- package/src/ui-components/credential/card/credential-details-list-item.tsx +16 -6
- package/src/ui-components/credential/card/credential-header.stories.tsx +15 -17
- package/src/ui-components/credential/card/credential-header.tsx +4 -1
- package/src/ui-components/credential/card/credential-image-carousel.tsx +4 -0
- package/src/ui-components/credential/card/index.ts +11 -5
- package/src/ui-components/credential/index.ts +2 -1
- package/src/ui-components/credential/selector.stories.tsx +7 -7
- package/src/ui-components/detail/detail.stories.tsx +11 -8
- package/src/ui-components/entity/avatar.stories.tsx +10 -7
- package/src/ui-components/entity/entity-cluster.stories.tsx +11 -8
- package/src/ui-components/header/header.stories.tsx +10 -7
- package/src/ui-components/header/index.ts +6 -3
- package/src/ui-components/header/navigation-header.stories.tsx +11 -8
- package/src/ui-components/history/data-item.tsx +13 -4
- package/src/ui-components/history/history-details.tsx +247 -0
- package/src/ui-components/history/{history-list-item.tsx → history-item.tsx} +72 -33
- package/src/ui-components/history/history-section-header.tsx +2 -2
- package/src/ui-components/history/history-section-list-item.tsx +3 -3
- package/src/ui-components/history/index.ts +5 -4
- package/src/ui-components/icons/history.tsx +82 -131
- package/src/ui-components/image/index.tsx +2 -1
- package/src/ui-components/input/radio-group.stories.tsx +34 -0
- package/src/ui-components/input/radio-group.tsx +8 -2
- package/src/ui-components/input/selection-input.stories.tsx +20 -17
- package/src/ui-components/list/index.ts +1 -0
- package/src/ui-components/list/list-page-loading-indicator.tsx +8 -0
- package/src/ui-components/list/wallet/empty-list.tsx +75 -0
- package/src/ui-components/list/wallet/empty-search-result.tsx +39 -0
- package/src/ui-components/list/wallet/index.tsx +4 -0
- package/src/ui-components/loader/loader.stories.tsx +6 -9
- package/src/ui-components/loader/loader.tsx +6 -3
- package/src/ui-components/loader/loading-result.stories.tsx +13 -10
- package/src/ui-components/loader/loading-result.tsx +8 -4
- package/src/ui-components/nerd-view/index.ts +2 -1
- package/src/ui-components/nerd-view/nerd-mode-item.tsx +2 -2
- package/src/ui-components/pin/pin-code-screen.stories.tsx +20 -13
- package/src/ui-components/screens/image-preview-screen.stories.tsx +9 -6
- package/src/ui-components/screens/index.ts +12 -6
- package/src/ui-components/screens/nerd-mode-screen.tsx +1 -1
- package/src/ui-components/screens/qr-code-scanner-screen.stories.tsx +10 -7
- package/src/ui-components/searchbar/search-bar.stories.tsx +15 -8
- package/src/ui-components/searchbar/search-bar.tsx +2 -2
- package/src/ui-components/state/error-screen.stories.tsx +8 -9
- package/src/ui-components/state/error-screen.tsx +1 -1
- package/src/ui-components/text/index.ts +2 -1
- package/src/ui-components/text/typography.stories.tsx +19 -12
- package/src/ui-components/theme/color-scheme-context.tsx +1 -0
- package/src/ui-components/theme/color-scheme.ts +1 -0
- package/src/utils/date.ts +5 -5
- package/src/utils/filtering.ts +5 -0
- package/src/utils/history.ts +71 -0
- package/src/utils/hooks/connectivity/connectivity.test.ts +8 -0
- package/src/utils/hooks/connectivity/connectivity.ts +28 -4
- package/src/utils/hooks/core/backup.ts +25 -21
- package/src/utils/hooks/core/cache.ts +43 -0
- package/src/utils/hooks/core/core-config.ts +19 -0
- package/src/utils/hooks/core/core-context.tsx +15 -2
- package/src/utils/hooks/core/core-init.ts +21 -7
- package/src/utils/hooks/core/credential-schemas.ts +1 -1
- package/src/utils/hooks/core/credentials.ts +9 -14
- package/src/utils/hooks/core/history.ts +2 -57
- package/src/utils/hooks/core/index.ts +1 -0
- package/src/utils/hooks/core/proof-schemas.ts +1 -1
- package/src/utils/hooks/core/proofs.ts +107 -49
- package/src/utils/hooks/core/trust-entity.ts +7 -3
- package/src/utils/hooks/navigation/open-settings.ts +2 -3
- package/src/utils/hooks/revocation/credential-status.ts +3 -2
- package/src/utils/index.ts +3 -0
- package/src/utils/navigation.ts +4 -2
- package/src/utils/parsers/credential.ts +1 -1
- package/src/utils/parsers/index.ts +1 -0
- package/src/utils/parsers/query.tsx +2 -0
- package/src/utils/parsers/universal-links.test.ts +57 -0
- package/src/utils/parsers/universal-links.ts +26 -0
- package/src/utils/ref.ts +1 -1
- package/src/utils/reporting.ts +1 -0
- package/lib/commonjs/ui-components/history/history-list-item.js.map +0 -1
- package/lib/module/ui-components/history/history-list-item.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireDefault","require","_credential","_icons","_testID","_credential2","obj","__esModule","default","validityCheckedCardFromCredential","credential","invalidLVVC","expanded","multipleCredentialsAvailable","config","notice","testID","labels","credentialHeaderDetail","credentialDetailErrorColor","credentialDetailPrimary","revoked","credentialDetailTestID","concatTestID","multipleCredentials","statusIcon","CredentialWarningIcon","card","getCredentialCardPropsFromCredential","claims","header","exports","missingCredentialCardFromRequest","request","_request$name","cardImage","undefined","color","missingCredential","credentialName","name","id","getAttributeSelectorStatus","field","validityState","claim","selected","ValidityState","Valid","SelectorStatus","Rejected","required","Required","Disabled","SelectedCheckmark","Empty","spreadClaims","parentClaimPath","arguments","length","reduce","acc","result","Array","isArray","value","claimPath","key","push","getDisplayedAttributes","selectiveDisclosureSupported","selectedFields","map","status","fields","includes","find","_ref","keyMap","shareCredentialCardAttributeFromClaim","_field$name$split$pop","_field$name","_field$name2","detailsCardAttributeFromClaim","split","pop","path","missingAttribute","valueErrorColor","setStatusForNestedObjectOrArrayFields","attribute","disabled","accessory","createElement","Selector","isObject","attributes","values","rightAccessory","_attribute$attributes","nested","nestedAttribute","shareCredentialCardFromCredential","_credential$issuerDid","_credential$issuerDid2","supportsSelectiveDisclosure","issuerDid","did","text","selectiveDisclosureNotice","noticeIcon","CredentialNoticeWarningIcon","cardTestId","getValidityState","displayedAttributes","_ref2","index","nestAttributes","selectCredentialCardAttributeFromClaim","RequiredAttributeIcon","selectCredentialCardFromCredential","_credential$issuerDid3","SelectedRadio","cardProps","_ref3"],"sources":["credential-sharing.tsx"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React from 'react';\n\nimport {\n CredentialAttribute,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n Selector,\n SelectorStatus,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialNoticeWarningIcon, CredentialWarningIcon, RequiredAttributeIcon } from '../../ui-components/icons';\nimport { concatTestID } from '../testID';\nimport {\n CardLabels,\n detailsCardAttributeFromClaim,\n getCredentialCardPropsFromCredential,\n getValidityState,\n nestAttributes,\n supportsSelectiveDisclosure,\n ValidityState,\n} from './credential';\n\nexport const validityCheckedCardFromCredential = (\n credential: CredentialDetail,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID'> => {\n let credentialHeaderDetail:\n | Pick<\n CredentialHeaderProps,\n | 'credentialDetailPrimary'\n | 'credentialDetailSecondary'\n | 'credentialDetailErrorColor'\n | 'credentialDetailTestID'\n | 'statusIcon'\n >\n | undefined;\n if (invalidLVVC) {\n credentialHeaderDetail = {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.revoked,\n credentialDetailTestID: concatTestID(testID, 'header.invalid'),\n };\n } else if (!expanded && multipleCredentialsAvailable) {\n credentialHeaderDetail = {\n credentialDetailPrimary: labels.multipleCredentials,\n credentialDetailTestID: concatTestID(testID, 'header.multiple'),\n statusIcon: CredentialWarningIcon,\n };\n }\n\n const card = getCredentialCardPropsFromCredential(credential, credential.claims, config, notice, testID, labels);\n return {\n ...card,\n header: {\n ...card.header,\n ...credentialHeaderDetail,\n },\n };\n};\n\nexport const missingCredentialCardFromRequest = (\n request: PresentationDefinitionRequestedCredential,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n return {\n cardImage: undefined,\n color: undefined,\n testID,\n header: {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.missingCredential,\n credentialDetailTestID: concatTestID(testID, 'header.missing'),\n credentialName: request.name ?? request.id,\n statusIcon: CredentialWarningIcon,\n },\n ...notice,\n };\n};\n\ninterface DisplayedAttribute {\n claim?: Claim;\n field?: PresentationDefinitionField;\n id: string;\n selected?: boolean;\n status: SelectorStatus;\n}\n\nconst getAttributeSelectorStatus = (\n field: PresentationDefinitionField,\n validityState: ValidityState,\n credential?: CredentialDetail,\n claim?: Claim,\n selected?: boolean,\n): SelectorStatus => {\n if (!credential || validityState !== ValidityState.Valid) {\n return SelectorStatus.Rejected;\n }\n if (field.required) {\n if (claim) {\n return SelectorStatus.Required;\n } else {\n return SelectorStatus.Rejected;\n }\n }\n if (!claim) {\n return SelectorStatus.Disabled;\n }\n return selected ? SelectorStatus.SelectedCheckmark : SelectorStatus.Empty;\n};\n\n// Returns a spread list of all claims with their full JSON path as key, including all intermediate objects\nconst spreadClaims = (claims: Claim[], parentClaimPath = ''): Claim[] => {\n return claims.reduce((acc, claim) => {\n const result = [claim];\n if (Array.isArray(claim.value)) {\n const claimPath = parentClaimPath ? `${parentClaimPath}/${claim.key}` : claim.key;\n result.push(...spreadClaims(claim.value, claimPath));\n }\n return [...acc, ...result];\n }, [] as Claim[]);\n};\n\nconst getDisplayedAttributes = (\n request: PresentationDefinitionRequestedCredential,\n validityState: ValidityState,\n credential?: CredentialDetail,\n selectiveDisclosureSupported?: boolean,\n selectedFields?: string[],\n): DisplayedAttribute[] => {\n if (credential && selectiveDisclosureSupported === false) {\n return credential.claims.map((claim) => ({\n claim,\n id: claim.id,\n status: SelectorStatus.Required,\n }));\n }\n\n return request.fields.map((field) => {\n const selected = !field.required && selectedFields?.includes(field.id);\n const claim =\n credential &&\n spreadClaims(credential.claims).find(({ key }) => {\n return key === field.keyMap[credential.id];\n });\n const status = getAttributeSelectorStatus(field, validityState, credential, claim, selected);\n return { claim, field, id: field.id, selected, status };\n });\n};\n\nexport const shareCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n if (claim) {\n return { ...detailsCardAttributeFromClaim(claim, config, testID), id };\n }\n return {\n id,\n name: field?.name?.split('/').pop() ?? id,\n path: field?.name ?? id,\n value: labels.missingAttribute,\n valueErrorColor: true,\n };\n};\n\n// Will propagate the attribute status (right accessory + selected?) for all nested attributes\n// Note: This function MUTATES the input attribute\nconst setStatusForNestedObjectOrArrayFields = (\n attribute: CredentialAttribute,\n status?: SelectorStatus,\n disabled?: boolean,\n) => {\n const accessory = status && <Selector status={status} />;\n const isObject = attribute.attributes && attribute.attributes.length > 0;\n const isArray = attribute.values && attribute.values.length > 0;\n\n // If the attribute is not an object or array, we update the attribute and return\n if (!isObject && !isArray) {\n attribute.rightAccessory = accessory;\n attribute.disabled = disabled;\n return attribute;\n }\n\n // The object can be optional (tappable radio-checkmark), or required (checkmark)\n if (status === SelectorStatus.SelectedCheckmark || status === SelectorStatus.Empty) {\n // If it's a selectable object, the accessory is rendered next to the object title,\n // The nested attributes have no accessory, and can not be selected\n attribute.rightAccessory = accessory;\n setStatusForNestedObjectOrArrayFields(attribute, undefined, true);\n } else {\n const nested = attribute.attributes ?? attribute.values;\n // If the object is required / rejected, the accessory is rendered next to each nested attribute (except other object titles)\n // all fields are disabled\n for (const nestedAttribute of nested) {\n setStatusForNestedObjectOrArrayFields(nestedAttribute, status, true);\n }\n }\n};\n\nexport type ShareCredentialCardLabels = CardLabels & {\n selectiveDisclosureNotice: string;\n missingAttribute: string;\n missingCredential: string;\n multipleCredentials: string;\n};\n\nexport const shareCredentialCardFromCredential = (\n credential: CredentialDetail | undefined,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n request: PresentationDefinitionRequestedCredential,\n selectedFields: string[] | undefined,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuerDid: credential.issuerDid?.did } : undefined,\n config,\n );\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const cardTestId = concatTestID(testID, 'card');\n const card = credential\n ? validityCheckedCardFromCredential(\n credential,\n invalidLVVC,\n expanded,\n multipleCredentialsAvailable,\n config,\n notice,\n cardTestId,\n labels,\n )\n : missingCredentialCardFromRequest(request, notice, cardTestId, labels);\n const validityState = getValidityState(\n credential ? { ...credential, issuerDid: credential.issuerDid?.did } : undefined,\n );\n const displayedAttributes = getDisplayedAttributes(\n request,\n validityState,\n credential,\n selectiveDisclosureSupported,\n selectedFields,\n );\n\n const attributes: CredentialAttribute[] = displayedAttributes.map(({ claim, field, id, selected, status }, index) => {\n const disabled = !credential || !field || field.required || !claim;\n const attribute: CredentialAttribute = {\n ...shareCredentialCardAttributeFromClaim(\n id,\n config,\n concatTestID(testID, 'attribute', `${index}`),\n labels,\n claim,\n field,\n ),\n selected,\n };\n\n setStatusForNestedObjectOrArrayFields(attribute, status, disabled);\n return attribute;\n });\n return {\n attributes: nestAttributes(attributes),\n card,\n };\n};\n\nexport const selectCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n const attribute = shareCredentialCardAttributeFromClaim(id, config, testID, labels, claim, field);\n if (!claim) {\n return attribute;\n }\n return {\n ...attribute,\n rightAccessory: RequiredAttributeIcon,\n };\n};\n\nexport const selectCredentialCardFromCredential = (\n credential: CredentialDetail,\n selected: boolean,\n request: PresentationDefinitionRequestedCredential,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuerDid: credential.issuerDid?.did } : undefined,\n config,\n );\n const rightAccessory = <Selector status={selected ? SelectorStatus.SelectedRadio : SelectorStatus.Empty} />;\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const { header, ...cardProps } = getCredentialCardPropsFromCredential(\n credential,\n credential.claims,\n config,\n notice,\n testID,\n labels,\n );\n const card = {\n header: {\n ...header,\n accessory: rightAccessory,\n },\n ...cardProps,\n };\n const attributes: CredentialAttribute[] = request.fields.map((field) => {\n const claim = spreadClaims(credential.claims).find(({ key }) => {\n return key === field.keyMap[credential.id];\n });\n\n const attribute = selectCredentialCardAttributeFromClaim(field.id, config, testID, labels, claim, field);\n return {\n ...attribute,\n rightAccessory: (\n <Selector status={field.required && !claim ? SelectorStatus.Rejected : SelectorStatus.Required} />\n ),\n };\n });\n return {\n attributes: nestAttributes(attributes),\n card,\n };\n};\n"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQsB,SAAAD,uBAAAM,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEf,MAAMG,iCAAiC,GAAGA,CAC/CC,UAA4B,EAC5BC,WAAoB,EACpBC,QAAiB,EACjBC,4BAAqC,EACrCC,MAAc,EACdC,MAAwC,EACxCC,MAAc,EACdC,MAAiC,KACmC;EACpE,IAAIC,sBASS;EACb,IAAIP,WAAW,EAAE;IACfO,sBAAsB,GAAG;MACvBC,0BAA0B,EAAE,IAAI;MAChCC,uBAAuB,EAAEH,MAAM,CAACI,OAAO;MACvCC,sBAAsB,EAAE,IAAAC,oBAAY,EAACP,MAAM,EAAE,gBAAgB;IAC/D,CAAC;EACH,CAAC,MAAM,IAAI,CAACJ,QAAQ,IAAIC,4BAA4B,EAAE;IACpDK,sBAAsB,GAAG;MACvBE,uBAAuB,EAAEH,MAAM,CAACO,mBAAmB;MACnDF,sBAAsB,EAAE,IAAAC,oBAAY,EAACP,MAAM,EAAE,iBAAiB,CAAC;MAC/DS,UAAU,EAAEC;IACd,CAAC;EACH;EAEA,MAAMC,IAAI,GAAG,IAAAC,iDAAoC,EAAClB,UAAU,EAAEA,UAAU,CAACmB,MAAM,EAAEf,MAAM,EAAEC,MAAM,EAAEC,MAAM,EAAEC,MAAM,CAAC;EAChH,OAAO;IACL,GAAGU,IAAI;IACPG,MAAM,EAAE;MACN,GAAGH,IAAI,CAACG,MAAM;MACd,GAAGZ;IACL;EACF,CAAC;AACH,CAAC;AAACa,OAAA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ZnG,MAAA,CAAAS,OAAA,CAAAqF,aAAA,CAAC3F,WAAA,CAAA4F,QAAQ;QAACrB,MAAM,EAAE9B,KAAK,CAACQ,QAAQ,IAAI,CAACN,KAAK,GAAGI,0BAAc,CAACC,QAAQ,GAAGD,0BAAc,CAACG;MAAS;IAEnG,CAAC;EACH,CAAC,CAAC;EACF,OAAO;IACL4C,UAAU,EAAE,IAAAqB,2BAAc,EAACrB,UAAU,CAAC;IACtCrE;EACF,CAAC;AACH,CAAC;AAACI,OAAA,CAAAyF,kCAAA,GAAAA,kCAAA"}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireDefault","require","_credential","_icons","_testID","_credential2","e","__esModule","default","validityCheckedCardFromCredential","credential","invalidLVVC","expanded","multipleCredentialsAvailable","config","notice","testID","labels","credentialHeaderDetail","credentialDetailErrorColor","credentialDetailPrimary","revoked","credentialDetailTestID","concatTestID","multipleCredentials","statusIcon","CredentialWarningIcon","card","getCredentialCardPropsFromCredential","claims","header","exports","missingCredentialCardFromRequest","request","_request$name","cardImage","undefined","color","missingCredential","credentialName","name","id","getAttributeSelectorStatus","field","validityState","claim","selected","ValidityState","Valid","SelectorStatus","Rejected","required","Required","Disabled","SelectedCheckmark","Empty","spreadClaims","parentClaimPath","reduce","acc","result","Array","isArray","value","claimPath","key","push","getDisplayedAttributes","selectiveDisclosureSupported","selectedFields","map","status","fields","includes","find","keyMap","shareCredentialCardAttributeFromClaim","_field$name$split$pop","_field$name","_field$name2","detailsCardAttributeFromClaim","split","pop","path","missingAttribute","valueErrorColor","setStatusForNestedObjectOrArrayFields","attribute","disabled","accessory","createElement","Selector","isObject","attributes","length","values","rightAccessory","_attribute$attributes","nested","nestedAttribute","shareCredentialCardFromCredential","_credential$issuerDid","_credential$issuerDid2","supportsSelectiveDisclosure","issuerDid","did","text","selectiveDisclosureNotice","noticeIcon","CredentialNoticeWarningIcon","cardTestId","getValidityState","displayedAttributes","index","nestAttributes","selectCredentialCardAttributeFromClaim","RequiredAttributeIcon","selectCredentialCardFromCredential","_credential$issuerDid3","SelectedRadio","cardProps"],"sources":["credential-sharing.tsx"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n PresentationDefinitionField,\n PresentationDefinitionRequestedCredential,\n} from '@procivis/react-native-one-core';\nimport React from 'react';\n\nimport {\n CredentialAttribute,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n Selector,\n SelectorStatus,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialNoticeWarningIcon, CredentialWarningIcon, RequiredAttributeIcon } from '../../ui-components/icons';\nimport { concatTestID } from '../testID';\nimport {\n CardLabels,\n detailsCardAttributeFromClaim,\n getCredentialCardPropsFromCredential,\n getValidityState,\n nestAttributes,\n supportsSelectiveDisclosure,\n ValidityState,\n} from './credential';\n\nexport const validityCheckedCardFromCredential = (\n credential: CredentialDetail,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style' | 'testID'> => {\n let credentialHeaderDetail:\n | Pick<\n CredentialHeaderProps,\n | 'credentialDetailPrimary'\n | 'credentialDetailSecondary'\n | 'credentialDetailErrorColor'\n | 'credentialDetailTestID'\n | 'statusIcon'\n >\n | undefined;\n if (invalidLVVC) {\n credentialHeaderDetail = {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.revoked,\n credentialDetailTestID: concatTestID(testID, 'header.invalid'),\n };\n } else if (!expanded && multipleCredentialsAvailable) {\n credentialHeaderDetail = {\n credentialDetailPrimary: labels.multipleCredentials,\n credentialDetailTestID: concatTestID(testID, 'header.multiple'),\n statusIcon: CredentialWarningIcon,\n };\n }\n\n const card = getCredentialCardPropsFromCredential(credential, credential.claims, config, notice, testID, labels);\n return {\n ...card,\n header: {\n ...card.header,\n ...credentialHeaderDetail,\n },\n };\n};\n\nexport const missingCredentialCardFromRequest = (\n request: PresentationDefinitionRequestedCredential,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n return {\n cardImage: undefined,\n color: undefined,\n testID,\n header: {\n credentialDetailErrorColor: true,\n credentialDetailPrimary: labels.missingCredential,\n credentialDetailTestID: concatTestID(testID, 'header.missing'),\n credentialName: request.name ?? request.id,\n statusIcon: CredentialWarningIcon,\n },\n ...notice,\n };\n};\n\ninterface DisplayedAttribute {\n claim?: Claim;\n field?: PresentationDefinitionField;\n id: string;\n selected?: boolean;\n status: SelectorStatus;\n}\n\nconst getAttributeSelectorStatus = (\n field: PresentationDefinitionField,\n validityState: ValidityState,\n credential?: CredentialDetail,\n claim?: Claim,\n selected?: boolean,\n): SelectorStatus => {\n if (!credential || validityState !== ValidityState.Valid) {\n return SelectorStatus.Rejected;\n }\n if (field.required) {\n if (claim) {\n return SelectorStatus.Required;\n } else {\n return SelectorStatus.Rejected;\n }\n }\n if (!claim) {\n return SelectorStatus.Disabled;\n }\n return selected ? SelectorStatus.SelectedCheckmark : SelectorStatus.Empty;\n};\n\n// Returns a spread list of all claims with their full JSON path as key, including all intermediate objects\nconst spreadClaims = (claims: Claim[], parentClaimPath = ''): Claim[] => {\n return claims.reduce((acc, claim) => {\n const result = [claim];\n if (Array.isArray(claim.value)) {\n const claimPath = parentClaimPath ? `${parentClaimPath}/${claim.key}` : claim.key;\n result.push(...spreadClaims(claim.value, claimPath));\n }\n return [...acc, ...result];\n }, [] as Claim[]);\n};\n\nconst getDisplayedAttributes = (\n request: PresentationDefinitionRequestedCredential,\n validityState: ValidityState,\n credential?: CredentialDetail,\n selectiveDisclosureSupported?: boolean,\n selectedFields?: string[],\n): DisplayedAttribute[] => {\n if (credential && selectiveDisclosureSupported === false) {\n return credential.claims.map((claim) => ({\n claim,\n id: claim.id,\n status: SelectorStatus.Required,\n }));\n }\n\n return request.fields.map((field) => {\n const selected = !field.required && selectedFields?.includes(field.id);\n const claim =\n credential &&\n spreadClaims(credential.claims).find(({ key }) => {\n return key === field.keyMap[credential.id];\n });\n const status = getAttributeSelectorStatus(field, validityState, credential, claim, selected);\n return { claim, field, id: field.id, selected, status };\n });\n};\n\nexport const shareCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n if (claim) {\n return { ...detailsCardAttributeFromClaim(claim, config, testID), id };\n }\n return {\n id,\n name: field?.name?.split('/').pop() ?? id,\n path: field?.name ?? id,\n value: labels.missingAttribute,\n valueErrorColor: true,\n };\n};\n\n// Will propagate the attribute status (right accessory + selected?) for all nested attributes\n// Note: This function MUTATES the input attribute\nconst setStatusForNestedObjectOrArrayFields = (\n attribute: CredentialAttribute,\n status?: SelectorStatus,\n disabled?: boolean,\n) => {\n const accessory = status && <Selector status={status} />;\n const isObject = attribute.attributes && attribute.attributes.length > 0;\n const isArray = attribute.values && attribute.values.length > 0;\n\n // If the attribute is not an object or array, we update the attribute and return\n if (!isObject && !isArray) {\n attribute.rightAccessory = accessory;\n attribute.disabled = disabled;\n return attribute;\n }\n\n // The object can be optional (tappable radio-checkmark), or required (checkmark)\n if (status === SelectorStatus.SelectedCheckmark || status === SelectorStatus.Empty) {\n // If it's a selectable object, the accessory is rendered next to the object title,\n // The nested attributes have no accessory, and can not be selected\n attribute.rightAccessory = accessory;\n setStatusForNestedObjectOrArrayFields(attribute, undefined, true);\n } else {\n const nested = attribute.attributes ?? attribute.values;\n // If the object is required / rejected, the accessory is rendered next to each nested attribute (except other object titles)\n // all fields are disabled\n for (const nestedAttribute of nested) {\n setStatusForNestedObjectOrArrayFields(nestedAttribute, status, true);\n }\n }\n};\n\nexport type ShareCredentialCardLabels = CardLabels & {\n selectiveDisclosureNotice: string;\n missingAttribute: string;\n missingCredential: string;\n multipleCredentials: string;\n};\n\nexport const shareCredentialCardFromCredential = (\n credential: CredentialDetail | undefined,\n invalidLVVC: boolean,\n expanded: boolean,\n multipleCredentialsAvailable: boolean,\n request: PresentationDefinitionRequestedCredential,\n selectedFields: string[] | undefined,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuerDid: credential.issuerDid?.did } : undefined,\n config,\n );\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const cardTestId = concatTestID(testID, 'card');\n const card = credential\n ? validityCheckedCardFromCredential(\n credential,\n invalidLVVC,\n expanded,\n multipleCredentialsAvailable,\n config,\n notice,\n cardTestId,\n labels,\n )\n : missingCredentialCardFromRequest(request, notice, cardTestId, labels);\n const validityState = getValidityState(\n credential ? { ...credential, issuerDid: credential.issuerDid?.did } : undefined,\n );\n const displayedAttributes = getDisplayedAttributes(\n request,\n validityState,\n credential,\n selectiveDisclosureSupported,\n selectedFields,\n );\n\n const attributes: CredentialAttribute[] = displayedAttributes.map(({ claim, field, id, selected, status }, index) => {\n const disabled = !credential || !field || field.required || !claim;\n const attribute: CredentialAttribute = {\n ...shareCredentialCardAttributeFromClaim(\n id,\n config,\n concatTestID(testID, 'attribute', `${index}`),\n labels,\n claim,\n field,\n ),\n selected,\n };\n\n setStatusForNestedObjectOrArrayFields(attribute, status, disabled);\n return attribute;\n });\n return {\n attributes: nestAttributes(attributes),\n card,\n };\n};\n\nexport const selectCredentialCardAttributeFromClaim = (\n id: string,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n claim?: Claim,\n field?: PresentationDefinitionField,\n): CredentialAttribute => {\n const attribute = shareCredentialCardAttributeFromClaim(id, config, testID, labels, claim, field);\n if (!claim) {\n return attribute;\n }\n return {\n ...attribute,\n rightAccessory: RequiredAttributeIcon,\n };\n};\n\nexport const selectCredentialCardFromCredential = (\n credential: CredentialDetail,\n selected: boolean,\n request: PresentationDefinitionRequestedCredential,\n config: Config,\n testID: string,\n labels: ShareCredentialCardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const selectiveDisclosureSupported = supportsSelectiveDisclosure(\n credential ? { ...credential, issuerDid: credential.issuerDid?.did } : undefined,\n config,\n );\n const rightAccessory = <Selector status={selected ? SelectorStatus.SelectedRadio : SelectorStatus.Empty} />;\n const notice: CredentialCardNotice | undefined =\n selectiveDisclosureSupported === false\n ? {\n text: labels.selectiveDisclosureNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n }\n : undefined;\n const { header, ...cardProps } = getCredentialCardPropsFromCredential(\n credential,\n credential.claims,\n config,\n notice,\n testID,\n labels,\n );\n const card = {\n header: {\n ...header,\n accessory: rightAccessory,\n },\n ...cardProps,\n };\n const attributes: CredentialAttribute[] = request.fields.map((field) => {\n const claim = spreadClaims(credential.claims).find(({ key }) => {\n return key === field.keyMap[credential.id];\n });\n\n const attribute = selectCredentialCardAttributeFromClaim(field.id, config, testID, labels, claim, field);\n return {\n ...attribute,\n rightAccessory: (\n <Selector status={field.required && !claim ? SelectorStatus.Rejected : SelectorStatus.Required} />\n ),\n };\n });\n return {\n attributes: nestAttributes(attributes),\n card,\n };\n};\n"],"mappings":";;;;;;AAOA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAQsB,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEf,MAAMG,iCAAiC,GAAGA,CAC/CC,UAA4B,EAC5BC,WAAoB,EACpBC,QAAiB,EACjBC,4BAAqC,EACrCC,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AAMU,IAAI,GAAG;IACXG,MAAM,EAAE;MACN,GAAGA,MAAM;MACT2D,SAAS,EAAEO;IACb,CAAC;IACD,GAAGwB;EACL,CAAC;EACD,MAAM3B,UAAiC,GAAG5D,OAAO,CAACuC,MAAM,CAACF,GAAG,CAAE3B,KAAK,IAAK;IACtE,MAAME,KAAK,GAAGW,YAAY,CAAC9C,UAAU,CAACmB,MAAM,CAAC,CAAC6C,IAAI,CAAC,CAAC;MAAET;IAAI,CAAC,KAAK;MAC9D,OAAOA,GAAG,KAAKtB,KAAK,CAACgC,MAAM,CAACjE,UAAU,CAAC+B,EAAE,CAAC;IAC5C,CAAC,CAAC;IAEF,MAAM8C,SAAS,GAAG4B,sCAAsC,CAACxE,KAAK,CAACF,EAAE,EAAE3B,MAAM,EAAEE,MAAM,EAAEC,MAAM,EAAE4B,KAAK,EAAEF,KAAK,CAAC;IACxG,OAAO;MACL,GAAG4C,SAAS;MACZS,cAAc,eACZjG,MAAA,CAAAS,OAAA,CAAAkF,aAAA,CAACxF,WAAA,CAAAyF,QAAQ;QAACpB,MAAM,EAAE5B,KAAK,CAACQ,QAAQ,IAAI,CAACN,KAAK,GAAGI,0BAAc,CAACC,QAAQ,GAAGD,0BAAc,CAACG;MAAS,CAAE;IAErG,CAAC;EACH,CAAC,CAAC;EACF,OAAO;IACLyC,UAAU,EAAE,IAAAqB,2BAAc,EAACrB,UAAU,CAAC;IACtClE;EACF,CAAC;AACH,CAAC;AAACI,OAAA,CAAAsF,kCAAA,GAAAA,kCAAA","ignoreList":[]}
|
|
@@ -11,13 +11,12 @@ var _icons = require("../../ui-components/icons");
|
|
|
11
11
|
var _date = require("../date");
|
|
12
12
|
var _testID = require("../testID");
|
|
13
13
|
var _credentialImages = require("./credential-images");
|
|
14
|
-
let ValidityState
|
|
15
|
-
exports.ValidityState = ValidityState;
|
|
16
|
-
(function (ValidityState) {
|
|
14
|
+
let ValidityState = exports.ValidityState = /*#__PURE__*/function (ValidityState) {
|
|
17
15
|
ValidityState["Revoked"] = "revoked";
|
|
18
16
|
ValidityState["Suspended"] = "suspended";
|
|
19
17
|
ValidityState["Valid"] = "valid";
|
|
20
|
-
|
|
18
|
+
return ValidityState;
|
|
19
|
+
}({});
|
|
21
20
|
const getValidityState = credential => {
|
|
22
21
|
if ((credential === null || credential === void 0 ? void 0 : credential.state) === _reactNativeOneCore.CredentialStateEnum.REVOKED) {
|
|
23
22
|
return ValidityState.Revoked;
|
|
@@ -29,9 +28,9 @@ const getValidityState = credential => {
|
|
|
29
28
|
};
|
|
30
29
|
exports.getValidityState = getValidityState;
|
|
31
30
|
const supportsSelectiveDisclosure = (credential, config) => {
|
|
32
|
-
var _formatConfig$capabil
|
|
31
|
+
var _formatConfig$capabil;
|
|
33
32
|
const formatConfig = credential && (config === null || config === void 0 ? void 0 : config.format[credential.schema.format]);
|
|
34
|
-
return formatConfig ? Boolean((_formatConfig$capabil = formatConfig.capabilities) === null || _formatConfig$capabil === void 0
|
|
33
|
+
return formatConfig ? Boolean((_formatConfig$capabil = formatConfig.capabilities) === null || _formatConfig$capabil === void 0 || (_formatConfig$capabil = _formatConfig$capabil.features) === null || _formatConfig$capabil === void 0 ? void 0 : _formatConfig$capabil.includes(_reactNativeOneCore.FormatFeatureEnum.SelectiveDisclosure)) : undefined;
|
|
35
34
|
};
|
|
36
35
|
exports.supportsSelectiveDisclosure = supportsSelectiveDisclosure;
|
|
37
36
|
const findClaimByPathParts = (path, claims) => {
|
|
@@ -58,12 +57,8 @@ const hasMsoValidityIssues = credential => {
|
|
|
58
57
|
return mdocMsoValidityIssue;
|
|
59
58
|
};
|
|
60
59
|
exports.hasMsoValidityIssues = hasMsoValidityIssues;
|
|
61
|
-
const cardHeaderFromCredential =
|
|
60
|
+
const cardHeaderFromCredential = (credential, claims = [], config, testID, labels) => {
|
|
62
61
|
var _formatDateTimeLocali, _layoutProperties$log, _layoutProperties$log2, _layoutProperties$log3;
|
|
63
|
-
let claims = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
64
|
-
let config = arguments.length > 2 ? arguments[2] : undefined;
|
|
65
|
-
let testID = arguments.length > 3 ? arguments[3] : undefined;
|
|
66
|
-
let labels = arguments.length > 4 ? arguments[4] : undefined;
|
|
67
62
|
let credentialDetailPrimary = (_formatDateTimeLocali = (0, _date.formatDateTimeLocalized)(new Date(credential.issuanceDate))) !== null && _formatDateTimeLocali !== void 0 ? _formatDateTimeLocali : '';
|
|
68
63
|
let credentialDetailSecondary;
|
|
69
64
|
let credentialDetailErrorColor;
|
|
@@ -105,7 +100,7 @@ const cardHeaderFromCredential = function (credential) {
|
|
|
105
100
|
}
|
|
106
101
|
}
|
|
107
102
|
return {
|
|
108
|
-
color: layoutProperties === null || layoutProperties === void 0
|
|
103
|
+
color: layoutProperties === null || layoutProperties === void 0 || (_layoutProperties$log = layoutProperties.logo) === null || _layoutProperties$log === void 0 ? void 0 : _layoutProperties$log.backgroundColor,
|
|
109
104
|
credentialDetailErrorColor,
|
|
110
105
|
credentialDetailPrimary,
|
|
111
106
|
credentialDetailSecondary,
|
|
@@ -116,19 +111,14 @@ const cardHeaderFromCredential = function (credential) {
|
|
|
116
111
|
uri: layoutProperties.logo.image
|
|
117
112
|
}
|
|
118
113
|
} : undefined,
|
|
119
|
-
iconLabelColor: layoutProperties === null || layoutProperties === void 0
|
|
114
|
+
iconLabelColor: layoutProperties === null || layoutProperties === void 0 || (_layoutProperties$log3 = layoutProperties.logo) === null || _layoutProperties$log3 === void 0 ? void 0 : _layoutProperties$log3.fontColor,
|
|
120
115
|
statusIcon,
|
|
121
116
|
testID
|
|
122
117
|
};
|
|
123
118
|
};
|
|
124
119
|
exports.cardHeaderFromCredential = cardHeaderFromCredential;
|
|
125
|
-
const getCredentialCardPropsFromCredential =
|
|
120
|
+
const getCredentialCardPropsFromCredential = (credential, claims = [], config, notice, testID, labels) => {
|
|
126
121
|
var _layoutProperties$bac, _layoutProperties$bac2;
|
|
127
|
-
let claims = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
128
|
-
let config = arguments.length > 2 ? arguments[2] : undefined;
|
|
129
|
-
let notice = arguments.length > 3 ? arguments[3] : undefined;
|
|
130
|
-
let testID = arguments.length > 4 ? arguments[4] : undefined;
|
|
131
|
-
let labels = arguments.length > 5 ? arguments[5] : undefined;
|
|
132
122
|
const {
|
|
133
123
|
layoutProperties
|
|
134
124
|
} = credential.schema;
|
|
@@ -145,7 +135,7 @@ const getCredentialCardPropsFromCredential = function (credential) {
|
|
|
145
135
|
uri: layoutProperties.background.image
|
|
146
136
|
}
|
|
147
137
|
} : undefined,
|
|
148
|
-
color: layoutProperties === null || layoutProperties === void 0
|
|
138
|
+
color: layoutProperties === null || layoutProperties === void 0 || (_layoutProperties$bac2 = layoutProperties.background) === null || _layoutProperties$bac2 === void 0 ? void 0 : _layoutProperties$bac2.color,
|
|
149
139
|
header: cardHeaderFromCredential(credential, claims, config, (0, _testID.concatTestID)(testID, 'header'), labels),
|
|
150
140
|
testID,
|
|
151
141
|
notice
|
|
@@ -167,7 +157,7 @@ const detailsCardAttributeValueFromClaim = (claim, config, testID) => {
|
|
|
167
157
|
const typeConfig = config === null || config === void 0 ? void 0 : config.datatype[claim.dataType];
|
|
168
158
|
if (claim.array) {
|
|
169
159
|
return {
|
|
170
|
-
values: claim.value.map((arrayValue, index) => {
|
|
160
|
+
values: (claim.value || []).map((arrayValue, index) => {
|
|
171
161
|
return detailsCardAttributeFromClaim({
|
|
172
162
|
...arrayValue,
|
|
173
163
|
id: `${arrayValue.id}/${index}`
|
|
@@ -292,7 +282,7 @@ const insertAttributeInObject = (attribute, object) => {
|
|
|
292
282
|
const nextParent = (_object$attributes = object.attributes) === null || _object$attributes === void 0 ? void 0 : _object$attributes.find(a => a.name === first);
|
|
293
283
|
if (!nextParent) {
|
|
294
284
|
var _object$attributes2;
|
|
295
|
-
(_object$attributes2 = object.attributes) === null || _object$attributes2 === void 0
|
|
285
|
+
(_object$attributes2 = object.attributes) === null || _object$attributes2 === void 0 || _object$attributes2.push(nestAttributeInDummyObject(attribute));
|
|
296
286
|
} else {
|
|
297
287
|
insertAttributeInObject({
|
|
298
288
|
...attribute,
|
|
@@ -304,18 +294,18 @@ function parseBase64Image(image) {
|
|
|
304
294
|
return image ? '__BASE64IMAGE__' : '';
|
|
305
295
|
}
|
|
306
296
|
function getCredentialSchemaWithoutImages(credentialSchema) {
|
|
307
|
-
var _credentialSchema$lay, _credentialSchema$lay2, _credentialSchema$lay3, _credentialSchema$lay4
|
|
297
|
+
var _credentialSchema$lay, _credentialSchema$lay2, _credentialSchema$lay3, _credentialSchema$lay4;
|
|
308
298
|
return {
|
|
309
299
|
...credentialSchema,
|
|
310
300
|
layoutProperties: {
|
|
311
301
|
...credentialSchema.layoutProperties,
|
|
312
302
|
background: {
|
|
313
303
|
...((_credentialSchema$lay = credentialSchema.layoutProperties) === null || _credentialSchema$lay === void 0 ? void 0 : _credentialSchema$lay.background),
|
|
314
|
-
image: parseBase64Image((_credentialSchema$lay2 = credentialSchema.layoutProperties) === null || _credentialSchema$lay2 === void 0
|
|
304
|
+
image: parseBase64Image((_credentialSchema$lay2 = credentialSchema.layoutProperties) === null || _credentialSchema$lay2 === void 0 || (_credentialSchema$lay2 = _credentialSchema$lay2.background) === null || _credentialSchema$lay2 === void 0 ? void 0 : _credentialSchema$lay2.image)
|
|
315
305
|
},
|
|
316
306
|
logo: {
|
|
317
|
-
...((_credentialSchema$
|
|
318
|
-
image: parseBase64Image((_credentialSchema$
|
|
307
|
+
...((_credentialSchema$lay3 = credentialSchema.layoutProperties) === null || _credentialSchema$lay3 === void 0 ? void 0 : _credentialSchema$lay3.logo),
|
|
308
|
+
image: parseBase64Image((_credentialSchema$lay4 = credentialSchema.layoutProperties) === null || _credentialSchema$lay4 === void 0 || (_credentialSchema$lay4 = _credentialSchema$lay4.logo) === null || _credentialSchema$lay4 === void 0 ? void 0 : _credentialSchema$lay4.image)
|
|
319
309
|
}
|
|
320
310
|
}
|
|
321
311
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNativeOneCore","require","_icons","_date","_testID","_credentialImages","ValidityState","exports","getValidityState","credential","state","CredentialStateEnum","REVOKED","Revoked","SUSPENDED","Suspended","Valid","supportsSelectiveDisclosure","config","_formatConfig$capabil","_formatConfig$capabil2","formatConfig","format","schema","Boolean","capabilities","features","includes","FormatFeatureEnum","SelectiveDisclosure","undefined","findClaimByPathParts","path","claims","length","first","second","rest","claim","find","c","key","dataType","DataTypeEnum","Object","value","findClaimByPath","split","formatCredentialDetail","testID","_attributeValue$value","attributeValue","detailsCardAttributeValueFromClaim","hasMsoValidityIssues","mdocMsoValidity","mdocMsoValidityIssue","nextUpdate","Date","cardHeaderFromCredential","_formatDateTimeLocali","_layoutProperties$log","_layoutProperties$log2","_layoutProperties$log3","arguments","labels","credentialDetailPrimary","formatDateTimeLocalized","issuanceDate","credentialDetailSecondary","credentialDetailErrorColor","credentialDetailTestID","statusIcon","layoutProperties","suspendEndDate","suspendedUntil","suspended","concatTestID","CredentialWarningIcon","revoked","CredentialErrorIcon","validityIssues","primary","primaryAttribute","secondary","secondaryAttribute","color","logo","backgroundColor","credentialName","name","icon","image","imageSource","uri","iconLabelColor","fontColor","getCredentialCardPropsFromCredential","_layoutProperties$bac","_layoutProperties$bac2","notice","text","validityIssuesNotice","noticeIcon","CredentialNoticeWarningIcon","result","cardCarouselImages","getCarouselImagesFromClaims","cardImage","background","header","detailsCardAttributeFromClaim","id","pop","typeConfig","datatype","array","values","map","arrayValue","index","toString","type","Array","isArray","attributes","nestedClaim","_formatDateLocalized","date","formatDateLocalized","File","_typeConfig$params","params","showAs","String","detailsCardFromCredential","detailsCardFromCredentialWithClaims","card","nestAttributes","attribute","attributePath","push","parent","a","insertAttributeInObject","join","nestAttributeInDummyObject","pathParts","disabled","object","_object$attributes","nextParent","_object$attributes2","parseBase64Image","getCredentialSchemaWithoutImages","credentialSchema","_credentialSchema$lay","_credentialSchema$lay2","_credentialSchema$lay3","_credentialSchema$lay4","_credentialSchema$lay5","_credentialSchema$lay6"],"sources":["credential.ts"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n CredentialListItem,\n CredentialSchema,\n CredentialStateEnum,\n DataTypeEnum,\n FormatFeatureEnum,\n} from '@procivis/react-native-one-core';\n\nimport {\n CredentialAttribute,\n CredentialAttributeValue,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialErrorIcon, CredentialNoticeWarningIcon, CredentialWarningIcon } from '../../ui-components/icons';\nimport { formatDateLocalized, formatDateTimeLocalized } from '../date';\nimport { concatTestID } from '../testID';\nimport { getCarouselImagesFromClaims } from './credential-images';\n\nexport enum ValidityState {\n Revoked = 'revoked',\n Suspended = 'suspended',\n Valid = 'valid',\n}\n\nexport const getValidityState = (credential: CredentialListItem | undefined) => {\n if (credential?.state === CredentialStateEnum.REVOKED) {\n return ValidityState.Revoked;\n }\n if (credential?.state === CredentialStateEnum.SUSPENDED) {\n return ValidityState.Suspended;\n }\n return ValidityState.Valid;\n};\n\nexport const supportsSelectiveDisclosure = (credential: CredentialListItem | undefined, config: Config | undefined) => {\n const formatConfig = credential && config?.format[credential.schema.format];\n return formatConfig\n ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))\n : undefined;\n};\n\nconst findClaimByPathParts = (path: string[], claims?: Claim[]): Claim | undefined => {\n if (!claims?.length) {\n return undefined;\n }\n const [first, second, ...rest] = path;\n const claim = claims.find((c) => c.key === first);\n if (claim === undefined || second === undefined || claim.dataType !== DataTypeEnum.Object) {\n return claim;\n }\n\n return findClaimByPathParts([`${first}/${second}`, ...rest], claim.value as Claim[]);\n};\n\nexport const findClaimByPath = (path: string | undefined, claims: Claim[] | undefined) =>\n path ? findClaimByPathParts(path.split('/'), claims) : undefined;\n\nconst formatCredentialDetail = (claim: Claim, config: Config, testID: string): string => {\n const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);\n return attributeValue.value ?? '';\n};\n\nexport const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {\n const mdocMsoValidity: { nextUpdate: string } | undefined =\n 'mdocMsoValidity' in credential ? (credential.mdocMsoValidity as { nextUpdate: string }) : undefined;\n\n const mdocMsoValidityIssue = Boolean(\n mdocMsoValidity?.nextUpdate && new Date(mdocMsoValidity.nextUpdate) < new Date(),\n );\n\n return mdocMsoValidityIssue;\n};\n\nexport type CardHeaderLabels = {\n validityIssues: string;\n revoked: string;\n suspended: string;\n suspendedUntil: (date: string) => string;\n};\n\nexport const cardHeaderFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): Omit<CredentialHeaderProps, 'style'> => {\n let credentialDetailPrimary = formatDateTimeLocalized(new Date(credential.issuanceDate)) ?? '';\n\n let credentialDetailSecondary: string | undefined;\n let credentialDetailErrorColor: boolean | undefined;\n let credentialDetailTestID: string | undefined;\n let statusIcon;\n\n const { layoutProperties } = credential.schema;\n\n switch (credential.state) {\n case CredentialStateEnum.SUSPENDED:\n credentialDetailPrimary = credential.suspendEndDate\n ? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)\n : labels.suspended;\n credentialDetailTestID = concatTestID(testID, 'suspended');\n statusIcon = CredentialWarningIcon;\n break;\n case CredentialStateEnum.REVOKED:\n credentialDetailPrimary = labels.revoked;\n credentialDetailErrorColor = true;\n credentialDetailTestID = concatTestID(testID, 'revoked');\n statusIcon = CredentialErrorIcon;\n break;\n default: {\n if (hasMsoValidityIssues(credential)) {\n credentialDetailPrimary = labels.validityIssues;\n credentialDetailTestID = concatTestID(testID, 'validity-issue');\n statusIcon = CredentialWarningIcon;\n } else {\n const primary = findClaimByPath(layoutProperties?.primaryAttribute, claims);\n\n if (primary) {\n credentialDetailPrimary = formatCredentialDetail(primary, config, concatTestID(testID, 'primary'));\n }\n\n const secondary = findClaimByPath(layoutProperties?.secondaryAttribute, claims);\n\n if (secondary) {\n credentialDetailSecondary = formatCredentialDetail(secondary, config, concatTestID(testID, 'secondary'));\n }\n\n credentialDetailTestID = concatTestID(testID, 'detail');\n }\n break;\n }\n }\n return {\n color: layoutProperties?.logo?.backgroundColor,\n credentialDetailErrorColor,\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialName: credential.schema.name,\n icon: layoutProperties?.logo?.image\n ? {\n imageSource: {\n uri: layoutProperties.logo.image,\n },\n }\n : undefined,\n iconLabelColor: layoutProperties?.logo?.fontColor,\n statusIcon,\n testID,\n };\n};\n\nexport type CardLabels = CardHeaderLabels & {\n validityIssuesNotice: string;\n};\n\nexport const getCredentialCardPropsFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n const { layoutProperties } = credential.schema;\n\n if (hasMsoValidityIssues(credential)) {\n notice = {\n text: labels.validityIssuesNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n };\n }\n\n const result: Omit<CredentialCardProps, 'onHeaderPress' | 'style'> = {\n cardCarouselImages: getCarouselImagesFromClaims(claims, layoutProperties, concatTestID(testID, 'carousel')),\n cardImage: layoutProperties?.background?.image\n ? { imageSource: { uri: layoutProperties.background.image } }\n : undefined,\n color: layoutProperties?.background?.color,\n header: cardHeaderFromCredential(credential, claims, config, concatTestID(testID, 'header'), labels),\n testID,\n notice,\n };\n\n return result;\n};\n\nexport const detailsCardAttributeFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttribute => {\n const value = detailsCardAttributeValueFromClaim(claim, config, testID);\n return {\n id: claim.id,\n name: claim.key.split('/').pop(),\n path: claim.key,\n ...value,\n };\n};\n\nconst detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttributeValue => {\n const typeConfig = config?.datatype[claim.dataType];\n\n if (claim.array) {\n return {\n values: claim.value.map((arrayValue, index) => {\n return detailsCardAttributeFromClaim(\n {\n ...arrayValue,\n id: `${arrayValue.id}/${index}`,\n },\n config,\n concatTestID(testID, index.toString()),\n );\n }),\n };\n } else {\n switch (typeConfig?.type) {\n case DataTypeEnum.Object: {\n if (!Array.isArray(claim.value)) {\n return { attributes: [] };\n }\n return {\n attributes: (claim.value as Claim[]).map((nestedClaim, index) =>\n detailsCardAttributeFromClaim(nestedClaim, config, concatTestID(testID, index.toString())),\n ),\n };\n }\n case DataTypeEnum.Date: {\n const date = claim.value as string;\n return {\n testID: testID,\n value: formatDateLocalized(new Date(date)) ?? date,\n };\n }\n case DataTypeEnum.File: {\n if (typeConfig.params?.showAs === 'IMAGE') {\n return { image: { uri: claim.value as string }, testID: testID };\n } else {\n return { testID: testID, value: claim.value as string };\n }\n }\n default:\n return { testID: testID, value: String(claim.value) };\n }\n }\n};\n\nexport const detailsCardFromCredential = (\n credential: CredentialDetail,\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n return detailsCardFromCredentialWithClaims(credential, credential.claims, config, testID, labels);\n};\n\nexport const detailsCardFromCredentialWithClaims = (\n credential: CredentialDetail,\n claims: Claim[],\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const attributes: CredentialAttribute[] = claims.map((claim, index) =>\n detailsCardAttributeFromClaim(claim, config, concatTestID(testID, 'attribute', index.toString())),\n );\n\n const card = getCredentialCardPropsFromCredential(\n credential,\n claims,\n config,\n undefined,\n concatTestID(testID, 'card'),\n labels,\n );\n\n return {\n attributes,\n card,\n };\n};\n\n// Converts a flat list of attributes into a nested structure\n// modifies the names to not include slashes\nexport const nestAttributes = (attributes: CredentialAttribute[]): CredentialAttribute[] => {\n const result: CredentialAttribute[] = [];\n\n for (const attribute of attributes) {\n const attributePath = attribute.path.split('/');\n if (attributePath.length === 0) {\n result.push(attribute);\n } else {\n const [first, ...rest] = attributePath;\n const parent = result.find((a) => a.name === first);\n if (parent) {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, parent);\n } else {\n result.push(nestAttributeInDummyObject(attribute));\n }\n }\n }\n\n return result;\n};\n\n// We nest the leaf node in a (one or more) nested object(s)\n// to make sure the tree structure is correctly rendered in proof request screens.\nconst nestAttributeInDummyObject = (attribute: CredentialAttribute): CredentialAttribute => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n if (!rest.length) {\n return attribute;\n }\n\n // The dummy object is not selectable, and contains a placeholder ID\n // the user can't interact with it.\n return {\n attributes: [nestAttributeInDummyObject({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: attribute.path,\n };\n};\n\n// Recursively insert an attribute into an object\n// Will create nested objects if necessary\nconst insertAttributeInObject = (attribute: CredentialAttribute, object: CredentialAttribute) => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n\n const nextParent = object.attributes?.find((a) => a.name === first);\n\n if (!nextParent) {\n object.attributes?.push(nestAttributeInDummyObject(attribute));\n } else {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, nextParent);\n }\n};\n\nfunction parseBase64Image(image: string | undefined) {\n return image ? '__BASE64IMAGE__' : '';\n}\n\nexport function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchema) {\n return {\n ...credentialSchema,\n layoutProperties: {\n ...credentialSchema.layoutProperties,\n background: {\n ...credentialSchema.layoutProperties?.background,\n image: parseBase64Image(credentialSchema.layoutProperties?.background?.image),\n },\n logo: {\n ...credentialSchema.layoutProperties?.logo,\n image: parseBase64Image(credentialSchema.layoutProperties?.logo?.image),\n },\n },\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAmBA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,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CAAC,GAAG;IAAE,CAAC,EAAEM,UAAU,CAAC;EAC7E;AACF,CAAC;AAED,SAASE,gBAAgBA,CAAC7D,KAAyB,EAAE;EACnD,OAAOA,KAAK,GAAG,iBAAiB,GAAG,EAAE;AACvC;AAEO,SAAS8D,gCAAgCA,CAACC,gBAAkC,EAAE;EAAA,IAAAC,qBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA,EAAAC,sBAAA;EACnF,OAAO;IACL,GAAGN,gBAAgB;IACnBlF,gBAAgB,EAAE;MAChB,GAAGkF,gBAAgB,CAAClF,gBAAgB;MACpCoC,UAAU,EAAE;QACV,KAAA+C,qBAAA,GAAGD,gBAAgB,CAAClF,gBAAgB,cAAAmF,qBAAA,uBAAjCA,qBAAA,CAAmC/C,UAAU;QAChDjB,KAAK,EAAE6D,gBAAgB,EAAAI,sBAAA,GAACF,gBAAgB,CAAClF,gBAAgB,cAAAoF,sBAAA,wBAAAC,sBAAA,GAAjCD,sBAAA,CAAmChD,UAAU,cAAAiD,sBAAA,uBAA7CA,sBAAA,CAA+ClE,KAAK;MAC9E,CAAC;MACDL,IAAI,EAAE;QACJ,KAAAwE,sBAAA,GAAGJ,gBAAgB,CAAClF,gBAAgB,cAAAsF,sBAAA,uBAAjCA,sBAAA,CAAmCxE,IAAI;QAC1CK,KAAK,EAAE6D,gBAAgB,EAAAO,sBAAA,GAACL,gBAAgB,CAAClF,gBAAgB,cAAAuF,sBAAA,wBAAAC,sBAAA,GAAjCD,sBAAA,CAAmCzE,IAAI,cAAA0E,sBAAA,uBAAvCA,sBAAA,CAAyCrE,KAAK;MACxE;IACF;EACF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"names":["_reactNativeOneCore","require","_icons","_date","_testID","_credentialImages","ValidityState","exports","getValidityState","credential","state","CredentialStateEnum","REVOKED","Revoked","SUSPENDED","Suspended","Valid","supportsSelectiveDisclosure","config","_formatConfig$capabil","formatConfig","format","schema","Boolean","capabilities","features","includes","FormatFeatureEnum","SelectiveDisclosure","undefined","findClaimByPathParts","path","claims","length","first","second","rest","claim","find","c","key","dataType","DataTypeEnum","Object","value","findClaimByPath","split","formatCredentialDetail","testID","_attributeValue$value","attributeValue","detailsCardAttributeValueFromClaim","hasMsoValidityIssues","mdocMsoValidity","mdocMsoValidityIssue","nextUpdate","Date","cardHeaderFromCredential","labels","_formatDateTimeLocali","_layoutProperties$log","_layoutProperties$log2","_layoutProperties$log3","credentialDetailPrimary","formatDateTimeLocalized","issuanceDate","credentialDetailSecondary","credentialDetailErrorColor","credentialDetailTestID","statusIcon","layoutProperties","suspendEndDate","suspendedUntil","suspended","concatTestID","CredentialWarningIcon","revoked","CredentialErrorIcon","validityIssues","primary","primaryAttribute","secondary","secondaryAttribute","color","logo","backgroundColor","credentialName","name","icon","image","imageSource","uri","iconLabelColor","fontColor","getCredentialCardPropsFromCredential","notice","_layoutProperties$bac","_layoutProperties$bac2","text","validityIssuesNotice","noticeIcon","CredentialNoticeWarningIcon","result","cardCarouselImages","getCarouselImagesFromClaims","cardImage","background","header","detailsCardAttributeFromClaim","id","pop","typeConfig","datatype","array","values","map","arrayValue","index","toString","type","Array","isArray","attributes","nestedClaim","_formatDateLocalized","date","formatDateLocalized","File","_typeConfig$params","params","showAs","String","detailsCardFromCredential","detailsCardFromCredentialWithClaims","card","nestAttributes","attribute","attributePath","push","parent","a","insertAttributeInObject","join","nestAttributeInDummyObject","pathParts","disabled","object","_object$attributes","nextParent","_object$attributes2","parseBase64Image","getCredentialSchemaWithoutImages","credentialSchema","_credentialSchema$lay","_credentialSchema$lay2","_credentialSchema$lay3","_credentialSchema$lay4"],"sources":["credential.ts"],"sourcesContent":["import {\n Claim,\n Config,\n CredentialDetail,\n CredentialListItem,\n CredentialSchema,\n CredentialStateEnum,\n DataTypeEnum,\n FormatFeatureEnum,\n} from '@procivis/react-native-one-core';\n\nimport {\n CredentialAttribute,\n CredentialAttributeValue,\n CredentialCardProps,\n CredentialDetailsCardProps,\n CredentialHeaderProps,\n} from '../../ui-components/credential';\nimport { CredentialCardNotice } from '../../ui-components/credential/card/credential-card';\nimport { CredentialErrorIcon, CredentialNoticeWarningIcon, CredentialWarningIcon } from '../../ui-components/icons';\nimport { formatDateLocalized, formatDateTimeLocalized } from '../date';\nimport { concatTestID } from '../testID';\nimport { getCarouselImagesFromClaims } from './credential-images';\n\nexport enum ValidityState {\n Revoked = 'revoked',\n Suspended = 'suspended',\n Valid = 'valid',\n}\n\nexport const getValidityState = (credential: CredentialListItem | undefined) => {\n if (credential?.state === CredentialStateEnum.REVOKED) {\n return ValidityState.Revoked;\n }\n if (credential?.state === CredentialStateEnum.SUSPENDED) {\n return ValidityState.Suspended;\n }\n return ValidityState.Valid;\n};\n\nexport const supportsSelectiveDisclosure = (credential: CredentialListItem | undefined, config: Config | undefined) => {\n const formatConfig = credential && config?.format[credential.schema.format];\n return formatConfig\n ? Boolean(formatConfig.capabilities?.features?.includes(FormatFeatureEnum.SelectiveDisclosure))\n : undefined;\n};\n\nconst findClaimByPathParts = (path: string[], claims?: Claim[]): Claim | undefined => {\n if (!claims?.length) {\n return undefined;\n }\n const [first, second, ...rest] = path;\n const claim = claims.find((c) => c.key === first);\n if (claim === undefined || second === undefined || claim.dataType !== DataTypeEnum.Object) {\n return claim;\n }\n\n return findClaimByPathParts([`${first}/${second}`, ...rest], claim.value as Claim[]);\n};\n\nexport const findClaimByPath = (path: string | undefined, claims: Claim[] | undefined) =>\n path ? findClaimByPathParts(path.split('/'), claims) : undefined;\n\nconst formatCredentialDetail = (claim: Claim, config: Config, testID: string): string => {\n const attributeValue = detailsCardAttributeValueFromClaim(claim, config, testID);\n return attributeValue.value ?? '';\n};\n\nexport const hasMsoValidityIssues = (credential: CredentialDetail): boolean => {\n const mdocMsoValidity: { nextUpdate: string } | undefined =\n 'mdocMsoValidity' in credential ? (credential.mdocMsoValidity as { nextUpdate: string }) : undefined;\n\n const mdocMsoValidityIssue = Boolean(\n mdocMsoValidity?.nextUpdate && new Date(mdocMsoValidity.nextUpdate) < new Date(),\n );\n\n return mdocMsoValidityIssue;\n};\n\nexport type CardHeaderLabels = {\n validityIssues: string;\n revoked: string;\n suspended: string;\n suspendedUntil: (date: string) => string;\n};\n\nexport const cardHeaderFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n testID: string,\n labels: CardHeaderLabels,\n): Omit<CredentialHeaderProps, 'style'> => {\n let credentialDetailPrimary = formatDateTimeLocalized(new Date(credential.issuanceDate)) ?? '';\n\n let credentialDetailSecondary: string | undefined;\n let credentialDetailErrorColor: boolean | undefined;\n let credentialDetailTestID: string | undefined;\n let statusIcon;\n\n const { layoutProperties } = credential.schema;\n\n switch (credential.state) {\n case CredentialStateEnum.SUSPENDED:\n credentialDetailPrimary = credential.suspendEndDate\n ? labels.suspendedUntil(formatDateTimeLocalized(new Date(credential.suspendEndDate))!)\n : labels.suspended;\n credentialDetailTestID = concatTestID(testID, 'suspended');\n statusIcon = CredentialWarningIcon;\n break;\n case CredentialStateEnum.REVOKED:\n credentialDetailPrimary = labels.revoked;\n credentialDetailErrorColor = true;\n credentialDetailTestID = concatTestID(testID, 'revoked');\n statusIcon = CredentialErrorIcon;\n break;\n default: {\n if (hasMsoValidityIssues(credential)) {\n credentialDetailPrimary = labels.validityIssues;\n credentialDetailTestID = concatTestID(testID, 'validity-issue');\n statusIcon = CredentialWarningIcon;\n } else {\n const primary = findClaimByPath(layoutProperties?.primaryAttribute, claims);\n\n if (primary) {\n credentialDetailPrimary = formatCredentialDetail(primary, config, concatTestID(testID, 'primary'));\n }\n\n const secondary = findClaimByPath(layoutProperties?.secondaryAttribute, claims);\n\n if (secondary) {\n credentialDetailSecondary = formatCredentialDetail(secondary, config, concatTestID(testID, 'secondary'));\n }\n\n credentialDetailTestID = concatTestID(testID, 'detail');\n }\n break;\n }\n }\n return {\n color: layoutProperties?.logo?.backgroundColor,\n credentialDetailErrorColor,\n credentialDetailPrimary,\n credentialDetailSecondary,\n credentialDetailTestID,\n credentialName: credential.schema.name,\n icon: layoutProperties?.logo?.image\n ? {\n imageSource: {\n uri: layoutProperties.logo.image,\n },\n }\n : undefined,\n iconLabelColor: layoutProperties?.logo?.fontColor,\n statusIcon,\n testID,\n };\n};\n\nexport type CardLabels = CardHeaderLabels & {\n validityIssuesNotice: string;\n};\n\nexport const getCredentialCardPropsFromCredential = (\n credential: CredentialDetail,\n claims: Claim[] = [],\n config: Config,\n notice: CredentialCardNotice | undefined,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialCardProps, 'onHeaderPress' | 'style'> => {\n const { layoutProperties } = credential.schema;\n\n if (hasMsoValidityIssues(credential)) {\n notice = {\n text: labels.validityIssuesNotice,\n noticeIcon: CredentialNoticeWarningIcon,\n };\n }\n\n const result: Omit<CredentialCardProps, 'onHeaderPress' | 'style'> = {\n cardCarouselImages: getCarouselImagesFromClaims(claims, layoutProperties, concatTestID(testID, 'carousel')),\n cardImage: layoutProperties?.background?.image\n ? { imageSource: { uri: layoutProperties.background.image } }\n : undefined,\n color: layoutProperties?.background?.color,\n header: cardHeaderFromCredential(credential, claims, config, concatTestID(testID, 'header'), labels),\n testID,\n notice,\n };\n\n return result;\n};\n\nexport const detailsCardAttributeFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttribute => {\n const value = detailsCardAttributeValueFromClaim(claim, config, testID);\n return {\n id: claim.id,\n name: claim.key.split('/').pop(),\n path: claim.key,\n ...value,\n };\n};\n\nconst detailsCardAttributeValueFromClaim = (claim: Claim, config: Config, testID: string): CredentialAttributeValue => {\n const typeConfig = config?.datatype[claim.dataType];\n\n if (claim.array) {\n return {\n values: (claim.value || []).map((arrayValue, index) => {\n return detailsCardAttributeFromClaim(\n {\n ...arrayValue,\n id: `${arrayValue.id}/${index}`,\n },\n config,\n concatTestID(testID, index.toString()),\n );\n }),\n };\n } else {\n switch (typeConfig?.type) {\n case DataTypeEnum.Object: {\n if (!Array.isArray(claim.value)) {\n return { attributes: [] };\n }\n return {\n attributes: (claim.value as Claim[]).map((nestedClaim, index) =>\n detailsCardAttributeFromClaim(nestedClaim, config, concatTestID(testID, index.toString())),\n ),\n };\n }\n case DataTypeEnum.Date: {\n const date = claim.value as string;\n return {\n testID: testID,\n value: formatDateLocalized(new Date(date)) ?? date,\n };\n }\n case DataTypeEnum.File: {\n if (typeConfig.params?.showAs === 'IMAGE') {\n return { image: { uri: claim.value as string }, testID: testID };\n } else {\n return { testID: testID, value: claim.value as string };\n }\n }\n default:\n return { testID: testID, value: String(claim.value) };\n }\n }\n};\n\nexport const detailsCardFromCredential = (\n credential: CredentialDetail,\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n return detailsCardFromCredentialWithClaims(credential, credential.claims, config, testID, labels);\n};\n\nexport const detailsCardFromCredentialWithClaims = (\n credential: CredentialDetail,\n claims: Claim[],\n config: Config,\n testID: string,\n labels: CardLabels,\n): Omit<CredentialDetailsCardProps, 'expanded'> => {\n const attributes: CredentialAttribute[] = claims.map((claim, index) =>\n detailsCardAttributeFromClaim(claim, config, concatTestID(testID, 'attribute', index.toString())),\n );\n\n const card = getCredentialCardPropsFromCredential(\n credential,\n claims,\n config,\n undefined,\n concatTestID(testID, 'card'),\n labels,\n );\n\n return {\n attributes,\n card,\n };\n};\n\n// Converts a flat list of attributes into a nested structure\n// modifies the names to not include slashes\nexport const nestAttributes = (attributes: CredentialAttribute[]): CredentialAttribute[] => {\n const result: CredentialAttribute[] = [];\n\n for (const attribute of attributes) {\n const attributePath = attribute.path.split('/');\n if (attributePath.length === 0) {\n result.push(attribute);\n } else {\n const [first, ...rest] = attributePath;\n const parent = result.find((a) => a.name === first);\n if (parent) {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, parent);\n } else {\n result.push(nestAttributeInDummyObject(attribute));\n }\n }\n }\n\n return result;\n};\n\n// We nest the leaf node in a (one or more) nested object(s)\n// to make sure the tree structure is correctly rendered in proof request screens.\nconst nestAttributeInDummyObject = (attribute: CredentialAttribute): CredentialAttribute => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n if (!rest.length) {\n return attribute;\n }\n\n // The dummy object is not selectable, and contains a placeholder ID\n // the user can't interact with it.\n return {\n attributes: [nestAttributeInDummyObject({ ...attribute, path: rest.join('/') })],\n disabled: true,\n id: `${attribute.id}/${first}`,\n name: first,\n path: attribute.path,\n };\n};\n\n// Recursively insert an attribute into an object\n// Will create nested objects if necessary\nconst insertAttributeInObject = (attribute: CredentialAttribute, object: CredentialAttribute) => {\n const pathParts = attribute.path.split('/');\n const [first, ...rest] = pathParts;\n\n const nextParent = object.attributes?.find((a) => a.name === first);\n\n if (!nextParent) {\n object.attributes?.push(nestAttributeInDummyObject(attribute));\n } else {\n insertAttributeInObject({ ...attribute, path: rest.join('/') }, nextParent);\n }\n};\n\nfunction parseBase64Image(image: string | undefined) {\n return image ? '__BASE64IMAGE__' : '';\n}\n\nexport function getCredentialSchemaWithoutImages(credentialSchema: CredentialSchema) {\n return {\n ...credentialSchema,\n layoutProperties: {\n ...credentialSchema.layoutProperties,\n background: {\n ...credentialSchema.layoutProperties?.background,\n image: parseBase64Image(credentialSchema.layoutProperties?.background?.image),\n },\n logo: {\n ...credentialSchema.layoutProperties?.logo,\n image: parseBase64Image(credentialSchema.layoutProperties?.logo?.image),\n },\n },\n };\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAmBA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAAkE,IAEtDK,aAAa,GAAAC,OAAA,CAAAD,aAAA,0BAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAbA,aAAa;EAAA,OAAbA,aAAa;AAAA;AAMlB,MAAME,gBAAgB,GAAIC,UAA0C,IAAK;EAC9E,IAAI,CAAAA,UAAU,aAAVA,UAAU,uBAAVA,UAA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AAAA,sBAAA,GAAjCA,sBAAA,CAAmCxE,IAAI,cAAAwE,sBAAA,uBAAvCA,sBAAA,CAAyCnE,KAAK;MACxE;IACF;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -47,4 +47,15 @@ Object.keys(_query).forEach(function (key) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
});
|
|
50
|
+
var _universalLinks = require("./universal-links");
|
|
51
|
+
Object.keys(_universalLinks).forEach(function (key) {
|
|
52
|
+
if (key === "default" || key === "__esModule") return;
|
|
53
|
+
if (key in exports && exports[key] === _universalLinks[key]) return;
|
|
54
|
+
Object.defineProperty(exports, key, {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _universalLinks[key];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
50
61
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_credential","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_credentialImages","_credentialSharing","_query"],"sources":["index.ts"],"sourcesContent":["export * from './credential';\nexport * from './credential-images';\nexport * from './credential-sharing';\nexport * from './query';\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,iBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,iBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,iBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,iBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,kBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,kBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,kBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,kBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,MAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,MAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,MAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,MAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
|
|
1
|
+
{"version":3,"names":["_credential","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_credentialImages","_credentialSharing","_query","_universalLinks"],"sources":["index.ts"],"sourcesContent":["export * from './credential';\nexport * from './credential-images';\nexport * from './credential-sharing';\nexport * from './query';\nexport * from './universal-links';\n"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,C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A,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,MAAA,CAAAP,GAAA;IAAA;EAAA;AAAA;AACA,IAAAQ,eAAA,GAAAZ,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAU,eAAA,EAAAT,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAQ,eAAA,CAAAR,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAI,eAAA,CAAAR,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -35,9 +35,10 @@ const getQueryKeyFromHistoryListQueryParams = queryParams => {
|
|
|
35
35
|
credentialId,
|
|
36
36
|
credentialSchemaId,
|
|
37
37
|
searchText,
|
|
38
|
-
searchType
|
|
38
|
+
searchType,
|
|
39
|
+
proofSchemaId
|
|
39
40
|
} = queryParams;
|
|
40
|
-
return [entityId, action, entityTypes, createdDateFrom, createdDateTo, didId, credentialId, credentialSchemaId, searchText, searchType];
|
|
41
|
+
return [entityId, action, entityTypes, createdDateFrom, createdDateTo, didId, credentialId, credentialSchemaId, searchText, searchType, proofSchemaId];
|
|
41
42
|
};
|
|
42
43
|
exports.getQueryKeyFromHistoryListQueryParams = getQueryKeyFromHistoryListQueryParams;
|
|
43
44
|
const getQueryKeyFromCredentialSchemaListQueryParams = queryParams => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getQueryKeyFromCredentialListQueryParams","queryParams","name","sort","sortDirection","exact","role","ids","status","include","exports","getQueryKeyFromHistoryListQueryParams","entityId","action","entityTypes","createdDateFrom","createdDateTo","didId","credentialId","credentialSchemaId","searchText","searchType","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","proofStates","proofSchemaIds","getQueryKeyFromDidListQueryParams","did","type","deactivated","keyAlgorithms","keyRoles"],"sources":["query.tsx"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams?: Partial<CredentialListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, role, ids, status, include } = queryParams;\n return [name, sort, sortDirection, exact, role, ids, status, include];\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams?: Partial<HistoryListQuery>) => {\n if (!queryParams) {\n return [];\n }\n\n const {\n entityId,\n action,\n entityTypes,\n createdDateFrom,\n createdDateTo,\n didId,\n credentialId,\n credentialSchemaId,\n searchText,\n searchType,\n } = queryParams;\n return [\n entityId,\n action,\n entityTypes,\n createdDateFrom,\n createdDateTo,\n didId,\n credentialId,\n credentialSchemaId,\n searchText,\n searchType,\n ];\n};\n\nexport const getQueryKeyFromCredentialSchemaListQueryParams = (queryParams?: Partial<CredentialSchemaListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids, include } = queryParams;\n return [name, sort, sortDirection, exact, ids, include];\n};\n\nexport const getQueryKeyFromProofSchemaListQueryParams = (queryParams?: Partial<ProofSchemaListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids } = queryParams;\n return [name, sort, sortDirection, exact, ids];\n};\n\nexport const getQueryKeyFromProofListQueryParams = (queryParams?: Partial<ProofListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids, proofStates, proofSchemaIds } = queryParams;\n return [name, sort, sortDirection, exact, ids, proofStates, proofSchemaIds];\n};\n\nexport const getQueryKeyFromDidListQueryParams = (queryParams?: Partial<DidListQuery>) => {\n if (!queryParams) {\n return [];\n }\n\n const { name, did, type, deactivated, keyAlgorithms, keyRoles } = queryParams;\n return [name, did, type, deactivated, keyAlgorithms, keyRoles];\n};\n"],"mappings":";;;;;;AASO,MAAMA,wCAAwC,GAAIC,WAA0C,IAAK;EACtG,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EACA,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC,aAAa;IAAEC,KAAK;IAAEC,IAAI;IAAEC,GAAG;IAAEC,MAAM;IAAEC;EAAQ,CAAC,GAAGR,WAAW;EACpF,OAAO,CAACC,IAAI,EAAEC,IAAI,EAAEC,aAAa,EAAEC,KAAK,EAAEC,IAAI,EAAEC,GAAG,EAAEC,MAAM,EAAEC,OAAO,CAAC;AACvE,CAAC;AAACC,OAAA,CAAAV,wCAAA,GAAAA,wCAAA;AAEK,MAAMW,qCAAqC,GAAIV,WAAuC,IAAK;EAChG,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EAEA,MAAM;IACJW,QAAQ;IACRC,MAAM;IACNC,WAAW;IACXC,eAAe;IACfC,aAAa;IACbC,KAAK;IACLC,YAAY;IACZC,kBAAkB;IAClBC,UAAU;IACVC;EACF,CAAC,
|
|
1
|
+
{"version":3,"names":["getQueryKeyFromCredentialListQueryParams","queryParams","name","sort","sortDirection","exact","role","ids","status","include","exports","getQueryKeyFromHistoryListQueryParams","entityId","action","entityTypes","createdDateFrom","createdDateTo","didId","credentialId","credentialSchemaId","searchText","searchType","proofSchemaId","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","proofStates","proofSchemaIds","getQueryKeyFromDidListQueryParams","did","type","deactivated","keyAlgorithms","keyRoles"],"sources":["query.tsx"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams?: Partial<CredentialListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, role, ids, status, include } = queryParams;\n return [name, sort, sortDirection, exact, role, ids, status, include];\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams?: Partial<HistoryListQuery>) => {\n if (!queryParams) {\n return [];\n }\n\n const {\n entityId,\n action,\n entityTypes,\n createdDateFrom,\n createdDateTo,\n didId,\n credentialId,\n credentialSchemaId,\n searchText,\n searchType,\n proofSchemaId,\n } = queryParams;\n return [\n entityId,\n action,\n entityTypes,\n createdDateFrom,\n createdDateTo,\n didId,\n credentialId,\n credentialSchemaId,\n searchText,\n searchType,\n proofSchemaId,\n ];\n};\n\nexport const getQueryKeyFromCredentialSchemaListQueryParams = (queryParams?: Partial<CredentialSchemaListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids, include } = queryParams;\n return [name, sort, sortDirection, exact, ids, include];\n};\n\nexport const getQueryKeyFromProofSchemaListQueryParams = (queryParams?: Partial<ProofSchemaListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids } = queryParams;\n return [name, sort, sortDirection, exact, ids];\n};\n\nexport const getQueryKeyFromProofListQueryParams = (queryParams?: Partial<ProofListQuery>) => {\n if (!queryParams) {\n return [];\n }\n const { name, sort, sortDirection, exact, ids, proofStates, proofSchemaIds } = queryParams;\n return [name, sort, sortDirection, exact, ids, proofStates, proofSchemaIds];\n};\n\nexport const getQueryKeyFromDidListQueryParams = (queryParams?: Partial<DidListQuery>) => {\n if (!queryParams) {\n return [];\n }\n\n const { name, did, type, deactivated, keyAlgorithms, keyRoles } = queryParams;\n return [name, did, type, deactivated, keyAlgorithms, keyRoles];\n};\n"],"mappings":";;;;;;AASO,MAAMA,wCAAwC,GAAIC,WAA0C,IAAK;EACtG,IAAI,CAACA,WAAW,EAAE;I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IAChB,OAAO,EAAE;EACX;EACA,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC,aAAa;IAAEC,KAAK;IAAEE;EAAI,CAAC,GAAGN,WAAW;EAC7D,OAAO,CAACC,IAAI,EAAEC,IAAI,EAAEC,aAAa,EAAEC,KAAK,EAAEE,GAAG,CAAC;AAChD,CAAC;AAACG,OAAA,CAAAc,yCAAA,GAAAA,yCAAA;AAEK,MAAMC,mCAAmC,GAAIxB,WAAqC,IAAK;EAC5F,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EACA,MAAM;IAAEC,IAAI;IAAEC,IAAI;IAAEC,aAAa;IAAEC,KAAK;IAAEE,GAAG;IAAEmB,WAAW;IAAEC;EAAe,CAAC,GAAG1B,WAAW;EAC1F,OAAO,CAACC,IAAI,EAAEC,IAAI,EAAEC,aAAa,EAAEC,KAAK,EAAEE,GAAG,EAAEmB,WAAW,EAAEC,cAAc,CAAC;AAC7E,CAAC;AAACjB,OAAA,CAAAe,mCAAA,GAAAA,mCAAA;AAEK,MAAMG,iCAAiC,GAAI3B,WAAmC,IAAK;EACxF,IAAI,CAACA,WAAW,EAAE;IAChB,OAAO,EAAE;EACX;EAEA,MAAM;IAAEC,IAAI;IAAE2B,GAAG;IAAEC,IAAI;IAAEC,WAAW;IAAEC,aAAa;IAAEC;EAAS,CAAC,GAAGhC,WAAW;EAC7E,OAAO,CAACC,IAAI,EAAE2B,GAAG,EAAEC,IAAI,EAAEC,WAAW,EAAEC,aAAa,EAAEC,QAAQ,CAAC;AAChE,CAAC;AAACvB,OAAA,CAAAkB,iCAAA,GAAAA,iCAAA","ignoreList":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseUniversalLink = void 0;
|
|
7
|
+
var _parseUrl = _interopRequireDefault(require("parse-url"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
const parseUniversalLink = universalLink => {
|
|
10
|
+
let parsedUrl;
|
|
11
|
+
try {
|
|
12
|
+
parsedUrl = (0, _parseUrl.default)(universalLink);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
if (parsedUrl.parse_failed) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const protocol = parsedUrl.protocol;
|
|
20
|
+
if (!['http', 'https'].includes(protocol)) {
|
|
21
|
+
return undefined;
|
|
22
|
+
}
|
|
23
|
+
if (!parsedUrl.pathname.startsWith('/app-link/')) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
if (parsedUrl.pathname === '/app-link/schema') {
|
|
27
|
+
return parsedUrl.query.url;
|
|
28
|
+
}
|
|
29
|
+
const originalProtocol = parsedUrl.pathname.split('/').pop();
|
|
30
|
+
return `${originalProtocol}://?${parsedUrl.search}`;
|
|
31
|
+
};
|
|
32
|
+
exports.parseUniversalLink = parseUniversalLink;
|
|
33
|
+
//# sourceMappingURL=universal-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_parseUrl","_interopRequireDefault","require","e","__esModule","default","parseUniversalLink","universalLink","parsedUrl","parseUrl","undefined","parse_failed","protocol","includes","pathname","startsWith","query","url","originalProtocol","split","pop","search","exports"],"sources":["universal-links.ts"],"sourcesContent":["import parseUrl from 'parse-url';\n\nexport const parseUniversalLink = (universalLink: string): string | undefined => {\n let parsedUrl: parseUrl.ParsedUrl;\n try {\n parsedUrl = parseUrl(universalLink);\n } catch (e) {\n return undefined;\n }\n\n if (parsedUrl.parse_failed) {\n return undefined;\n }\n const protocol = parsedUrl.protocol as string;\n if (!['http', 'https'].includes(protocol)) {\n return undefined;\n }\n if (!parsedUrl.pathname.startsWith('/app-link/')) {\n return undefined;\n }\n if (parsedUrl.pathname === '/app-link/schema') {\n return parsedUrl.query.url;\n }\n const originalProtocol = parsedUrl.pathname.split('/').pop();\n return `${originalProtocol}://?${parsedUrl.search}`;\n};\n"],"mappings":";;;;;;AAAA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAiC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE1B,MAAMG,kBAAkB,GAAIC,aAAqB,IAAyB;EAC/E,IAAIC,SAA6B;EACjC,IAAI;IACFA,SAAS,GAAG,IAAAC,iBAAQ,EAACF,aAAa,CAAC;EACrC,CAAC,CAAC,OAAOJ,CAAC,EAAE;IACV,OAAOO,SAAS;EAClB;EAEA,IAAIF,SAAS,CAACG,YAAY,EAAE;IAC1B,OAAOD,SAAS;EAClB;EACA,MAAME,QAAQ,GAAGJ,SAAS,CAACI,QAAkB;EAC7C,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAACC,QAAQ,CAACD,QAAQ,CAAC,EAAE;IACzC,OAAOF,SAAS;EAClB;EACA,IAAI,CAACF,SAAS,CAACM,QAAQ,CAACC,UAAU,CAAC,YAAY,CAAC,EAAE;IAChD,OAAOL,SAAS;EAClB;EACA,IAAIF,SAAS,CAACM,QAAQ,KAAK,kBAAkB,EAAE;IAC7C,OAAON,SAAS,CAACQ,KAAK,CAACC,GAAG;EAC5B;EACA,MAAMC,gBAAgB,GAAGV,SAAS,CAACM,QAAQ,CAACK,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,CAAC,CAAC;EAC5D,OAAO,GAAGF,gBAAgB,OAAOV,SAAS,CAACa,MAAM,EAAE;AACrD,CAAC;AAACC,OAAA,CAAAhB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _universalLinks = require("./universal-links");
|
|
4
|
+
jest.mock('@react-native-community/netinfo', () => ({
|
|
5
|
+
addEventListener: () => {}
|
|
6
|
+
}));
|
|
7
|
+
jest.mock('react-native-bluetooth-state-manager', () => ({
|
|
8
|
+
onStateChange: () => {}
|
|
9
|
+
}));
|
|
10
|
+
describe('parseUniversalLink', () => {
|
|
11
|
+
test('Credential schema universal link url', () => {
|
|
12
|
+
const parsedLink = (0, _universalLinks.parseUniversalLink)('https://desk.dev.procivis-one.com/app-link/schema?url=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Fschema%2Fv1%2F2c986182-0bca-4342-b0e0-4e149b1818c7');
|
|
13
|
+
expect(parsedLink).toStrictEqual('https://core.dev.procivis-one.com/ssi/schema/v1/2c986182-0bca-4342-b0e0-4e149b1818c7');
|
|
14
|
+
});
|
|
15
|
+
test('OpenID4VC credential offer universal link url', () => {
|
|
16
|
+
const parsedLink = (0, _universalLinks.parseUniversalLink)('https://desk.dev.procivis-one.com/app-link/openid-credential-offer?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2Ffde1ca86-3ea1-410e-9da4-b210355e5dd2%2Foffer%2F4e626c92-9f20-4031-992d-242563ab5ef3');
|
|
17
|
+
expect(parsedLink).toStrictEqual('openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2Ffde1ca86-3ea1-410e-9da4-b210355e5dd2%2Foffer%2F4e626c92-9f20-4031-992d-242563ab5ef3');
|
|
18
|
+
});
|
|
19
|
+
test('OpenID4VP proof request universal link url', () => {
|
|
20
|
+
const parsedLink = (0, _universalLinks.parseUniversalLink)('https://desk.dev.procivis-one.com/app-link/openid4vp?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_id_scheme=verifier_attestation&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F74fe0d75-d568-4178-9f73-5cd4e3f5a2ae%2Fclient-request');
|
|
21
|
+
expect(parsedLink).toStrictEqual('openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_id_scheme=verifier_attestation&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F74fe0d75-d568-4178-9f73-5cd4e3f5a2ae%2Fclient-request');
|
|
22
|
+
});
|
|
23
|
+
test('Invalid link', () => {
|
|
24
|
+
const parsedLink = (0, _universalLinks.parseUniversalLink)('invalid');
|
|
25
|
+
expect(parsedLink).toStrictEqual(undefined);
|
|
26
|
+
});
|
|
27
|
+
test('Non-universal link', () => {
|
|
28
|
+
const parsedLink = (0, _universalLinks.parseUniversalLink)('openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_id_scheme=verifier_attestation&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F74fe0d75-d568-4178-9f73-5cd4e3f5a2ae%2Fclient-request');
|
|
29
|
+
expect(parsedLink).toStrictEqual(undefined);
|
|
30
|
+
});
|
|
31
|
+
test('Invalid https universal link url', () => {
|
|
32
|
+
const parsedLink = (0, _universalLinks.parseUniversalLink)('https://desk.dev.procivis-one.com/app-schema/link?url=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Fschema%2Fv1%2F2c986182-0bca-4342-b0e0-4e149b1818c7');
|
|
33
|
+
expect(parsedLink).toStrictEqual(undefined);
|
|
34
|
+
});
|
|
35
|
+
test('Schema universal link url with invalid params', () => {
|
|
36
|
+
const parsedLink = (0, _universalLinks.parseUniversalLink)('https://desk.dev.procivis-one.com/app-link/schema?key=value');
|
|
37
|
+
expect(parsedLink).toStrictEqual(undefined);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=universal-links.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_universalLinks","require","jest","mock","addEventListener","onStateChange","describe","test","parsedLink","parseUniversalLink","expect","toStrictEqual","undefined"],"sources":["universal-links.test.ts"],"sourcesContent":["import { parseUniversalLink } from './universal-links';\n\njest.mock('@react-native-community/netinfo', () => ({\n addEventListener: () => {},\n}));\n\njest.mock('react-native-bluetooth-state-manager', () => ({\n onStateChange: () => {},\n}));\n\ndescribe('parseUniversalLink', () => {\n test('Credential schema universal link url', () => {\n const parsedLink = parseUniversalLink(\n 'https://desk.dev.procivis-one.com/app-link/schema?url=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Fschema%2Fv1%2F2c986182-0bca-4342-b0e0-4e149b1818c7',\n );\n expect(parsedLink).toStrictEqual(\n 'https://core.dev.procivis-one.com/ssi/schema/v1/2c986182-0bca-4342-b0e0-4e149b1818c7',\n );\n });\n test('OpenID4VC credential offer universal link url', () => {\n const parsedLink = parseUniversalLink(\n 'https://desk.dev.procivis-one.com/app-link/openid-credential-offer?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2Ffde1ca86-3ea1-410e-9da4-b210355e5dd2%2Foffer%2F4e626c92-9f20-4031-992d-242563ab5ef3',\n );\n expect(parsedLink).toStrictEqual(\n 'openid-credential-offer://?credential_offer_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-issuer%2Fv1%2Ffde1ca86-3ea1-410e-9da4-b210355e5dd2%2Foffer%2F4e626c92-9f20-4031-992d-242563ab5ef3',\n );\n });\n test('OpenID4VP proof request universal link url', () => {\n const parsedLink = parseUniversalLink(\n 'https://desk.dev.procivis-one.com/app-link/openid4vp?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_id_scheme=verifier_attestation&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F74fe0d75-d568-4178-9f73-5cd4e3f5a2ae%2Fclient-request',\n );\n expect(parsedLink).toStrictEqual(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_id_scheme=verifier_attestation&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F74fe0d75-d568-4178-9f73-5cd4e3f5a2ae%2Fclient-request',\n );\n });\n\n test('Invalid link', () => {\n const parsedLink = parseUniversalLink('invalid');\n expect(parsedLink).toStrictEqual(undefined);\n });\n test('Non-universal link', () => {\n const parsedLink = parseUniversalLink(\n 'openid4vp://?client_id=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2Fresponse&client_id_scheme=verifier_attestation&request_uri=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Foidc-verifier%2Fv1%2F74fe0d75-d568-4178-9f73-5cd4e3f5a2ae%2Fclient-request',\n );\n expect(parsedLink).toStrictEqual(undefined);\n });\n test('Invalid https universal link url', () => {\n const parsedLink = parseUniversalLink(\n 'https://desk.dev.procivis-one.com/app-schema/link?url=https%3A%2F%2Fcore.dev.procivis-one.com%2Fssi%2Fschema%2Fv1%2F2c986182-0bca-4342-b0e0-4e149b1818c7',\n );\n expect(parsedLink).toStrictEqual(undefined);\n });\n test('Schema universal link url with invalid params', () => {\n const parsedLink = parseUniversalLink('https://desk.dev.procivis-one.com/app-link/schema?key=value');\n expect(parsedLink).toStrictEqual(undefined);\n });\n});\n"],"mappings":";;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAEAC,IAAI,CAACC,IAAI,CAAC,iCAAiC,EAAE,OAAO;EAClDC,gBAAgB,EAAEA,CAAA,KAAM,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEHF,IAAI,CAACC,IAAI,CAAC,sCAAsC,EAAE,OAAO;EACvDE,aAAa,EAAEA,CAAA,KAAM,CAAC;AACxB,CAAC,CAAC,CAAC;AAEHC,QAAQ,CAAC,o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ACC,SAAS,CAAC;EAC7C,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","isWritable","obj","key","desc","Object","getOwnPropertyDescriptor","getPrototypeOf","Boolean","writable","useForwardedRef","passedRef","localRef","useRef","useMemo","ref","forwardedRef","instance","current","Function","e","exports"],"sources":["ref.ts"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\n\nconst isWritable = <T extends Object>(obj: T, key: keyof T) => {\n const desc =\n Object.getOwnPropertyDescriptor(obj, key) || Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), key) || {};\n return Boolean(desc.writable);\n};\n\n/**\n * Transforms a forwarded ref to a locally usable reference object\n * @example\n * const Component = forwardRef<RefComponent, Props>((props, ref) => {\n * const [forwardedRef, refObject] = useForwardedRef(ref);\n * const onAction = useCallback(() => doSomething(refObject.current), [refObject]);\n * return <RefComponent ref={forwardedRef} {...props} />;\n * }\n */\nexport const useForwardedRef = <Component extends React.
|
|
1
|
+
{"version":3,"names":["_react","require","isWritable","obj","key","desc","Object","getOwnPropertyDescriptor","getPrototypeOf","Boolean","writable","useForwardedRef","passedRef","localRef","useRef","useMemo","ref","forwardedRef","instance","current","Function","e","exports"],"sources":["ref.ts"],"sourcesContent":["import React, { useMemo, useRef } from 'react';\n\nconst isWritable = <T extends Object>(obj: T, key: keyof T) => {\n const desc =\n Object.getOwnPropertyDescriptor(obj, key) || Object.getOwnPropertyDescriptor(Object.getPrototypeOf(obj), key) || {};\n return Boolean(desc.writable);\n};\n\n/**\n * Transforms a forwarded ref to a locally usable reference object\n * @example\n * const Component = forwardRef<RefComponent, Props>((props, ref) => {\n * const [forwardedRef, refObject] = useForwardedRef(ref);\n * const onAction = useCallback(() => doSomething(refObject.current), [refObject]);\n * return <RefComponent ref={forwardedRef} {...props} />;\n * }\n */\nexport const useForwardedRef = <Component extends React.ElementType<any, any>>(\n passedRef?: React.Ref<Component>,\n) => {\n const localRef = useRef<Component>(null);\n return useMemo<[React.Ref<Component>, React.RefObject<Component>]>(() => {\n const ref: React.MutableRefObject<Component | null> = localRef;\n const forwardedRef: React.Ref<Component> = (instance: Component | null) => {\n ref.current = instance;\n if (passedRef) {\n if (passedRef instanceof Function) {\n passedRef(instance);\n } else if (isWritable(passedRef, 'current')) {\n try {\n (passedRef as any).current = instance;\n } catch (e) {}\n }\n }\n };\n\n return [forwardedRef, ref as React.RefObject<Component>];\n }, [passedRef]);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,MAAMC,UAAU,GAAGA,CAAmBC,GAAM,EAAEC,GAAY,KAAK;EAC7D,MAAMC,IAAI,GACRC,MAAM,CAACC,wBAAwB,CAACJ,GAAG,EAAEC,GAAG,CAAC,IAAIE,MAAM,CAACC,wBAAwB,CAACD,MAAM,CAACE,cAAc,CAACL,GAAG,CAAC,EAAEC,GAAG,CAAC,IAAI,CAAC,CAAC;EACrH,OAAOK,OAAO,CAACJ,IAAI,CAACK,QAAQ,CAAC;AAC/B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,GAC1BC,SAAgC,IAC7B;EACH,MAAMC,QAAQ,GAAG,IAAAC,aAAM,EAAY,IAAI,CAAC;EACxC,OAAO,IAAAC,cAAO,EAAqD,MAAM;IACvE,MAAMC,GAA6C,GAAGH,QAAQ;IAC9D,MAAMI,YAAkC,GAAIC,QAA0B,IAAK;MACzEF,GAAG,CAACG,OAAO,GAAGD,QAAQ;MACtB,IAAIN,SAAS,EAAE;QACb,IAAIA,SAAS,YAAYQ,QAAQ,EAAE;UACjCR,SAAS,CAACM,QAAQ,CAAC;QACrB,CAAC,MAAM,IAAIhB,UAAU,CAACU,SAAS,EAAE,SAAS,CAAC,EAAE;UAC3C,IAAI;YACDA,SAAS,CAASO,OAAO,GAAGD,QAAQ;UACvC,CAAC,CAAC,OAAOG,CAAC,EAAE,CAAC;QACf;MACF;IACF,CAAC;IAED,OAAO,CAACJ,YAAY,EAAED,GAAG,CAA+B;EAC1D,CAAC,EAAE,CAACJ,SAAS,CAAC,CAAC;AACjB,CAAC;AAACU,OAAA,CAAAX,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -8,8 +8,10 @@ exports.reportException = reportException;
|
|
|
8
8
|
exports.reportTraceInfo = reportTraceInfo;
|
|
9
9
|
var _reactNativeOneCore = require("@procivis/react-native-one-core");
|
|
10
10
|
var Sentry = _interopRequireWildcard(require("@sentry/react-native"));
|
|
11
|
-
function _getRequireWildcardCache(
|
|
12
|
-
function _interopRequireWildcard(
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
/* eslint-disable no-console */
|
|
14
|
+
|
|
13
15
|
function reportError(message) {
|
|
14
16
|
if (!__DEV__) {
|
|
15
17
|
try {
|