@procivis/one-react-native-components 0.3.27 → 0.3.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/components/entity/entity-attributes.js +14 -1
- package/lib/commonjs/components/entity/entity-attributes.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details-with-buttons.js +9 -42
- package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/commonjs/components/entity/entity-details.js +60 -32
- package/lib/commonjs/components/entity/entity-details.js.map +1 -1
- package/lib/commonjs/components/entity/index.js +2 -15
- package/lib/commonjs/components/entity/index.js.map +1 -1
- package/lib/commonjs/components/history/history-list-item.js +14 -12
- package/lib/commonjs/components/history/history-list-item.js.map +1 -1
- package/lib/commonjs/components/proof-request/share-credential.js +1 -2
- package/lib/commonjs/components/proof-request/share-credential.js.map +1 -1
- package/lib/commonjs/ui-components/blur/index.js +2 -9
- package/lib/commonjs/ui-components/blur/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/hold-button.js +3 -2
- package/lib/commonjs/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/commonjs/ui-components/camera/index.js +2 -9
- package/lib/commonjs/ui-components/camera/index.js.map +1 -1
- package/lib/commonjs/ui-components/control/index.js +0 -12
- package/lib/commonjs/ui-components/control/index.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/commonjs/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/commonjs/ui-components/entity/entity-cluster.js +50 -2
- package/lib/commonjs/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/commonjs/ui-components/entity/index.js +3 -16
- package/lib/commonjs/ui-components/entity/index.js.map +1 -1
- package/lib/commonjs/ui-components/history/history-details.js +1 -1
- package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
- package/lib/commonjs/ui-components/history/index.js +4 -27
- package/lib/commonjs/ui-components/history/index.js.map +1 -1
- package/lib/commonjs/ui-components/icons/entity.js +10 -13
- package/lib/commonjs/ui-components/icons/entity.js.map +1 -1
- package/lib/commonjs/ui-components/input/index.js +3 -32
- package/lib/commonjs/ui-components/input/index.js.map +1 -1
- package/lib/commonjs/ui-components/list/index.js +4 -19
- package/lib/commonjs/ui-components/list/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/index.js +2 -13
- package/lib/commonjs/ui-components/loader/index.js.map +1 -1
- package/lib/commonjs/ui-components/pin/index.js +2 -21
- package/lib/commonjs/ui-components/pin/index.js.map +1 -1
- package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/commonjs/ui-components/searchbar/index.js +3 -16
- package/lib/commonjs/ui-components/searchbar/index.js.map +1 -1
- package/lib/commonjs/ui-components/settings/index.js +6 -37
- package/lib/commonjs/ui-components/settings/index.js.map +1 -1
- package/lib/commonjs/ui-components/state/index.js +2 -15
- package/lib/commonjs/ui-components/state/index.js.map +1 -1
- package/lib/commonjs/utils/date.js +1 -1
- package/lib/commonjs/utils/date.js.map +1 -1
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/commonjs/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +22 -66
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +6 -2
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +23 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +24 -14
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/trust-entity.js +56 -14
- package/lib/commonjs/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing.js +6 -15
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +2 -2
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +23 -86
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/module/components/entity/entity-attributes.js +15 -2
- package/lib/module/components/entity/entity-attributes.js.map +1 -1
- package/lib/module/components/entity/entity-details-with-buttons.js +11 -44
- package/lib/module/components/entity/entity-details-with-buttons.js.map +1 -1
- package/lib/module/components/entity/entity-details.js +61 -33
- package/lib/module/components/entity/entity-details.js.map +1 -1
- package/lib/module/components/entity/index.js +2 -2
- package/lib/module/components/entity/index.js.map +1 -1
- package/lib/module/components/history/history-list-item.js +15 -13
- package/lib/module/components/history/history-list-item.js.map +1 -1
- package/lib/module/components/proof-request/share-credential.js +1 -2
- package/lib/module/components/proof-request/share-credential.js.map +1 -1
- package/lib/module/ui-components/blur/index.js +2 -2
- package/lib/module/ui-components/blur/index.js.map +1 -1
- package/lib/module/ui-components/buttons/hold-button.js +4 -3
- package/lib/module/ui-components/buttons/hold-button.js.map +1 -1
- package/lib/module/ui-components/camera/index.js +2 -2
- package/lib/module/ui-components/camera/index.js.map +1 -1
- package/lib/module/ui-components/control/index.js +3 -3
- package/lib/module/ui-components/control/index.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js +1 -1
- package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
- package/lib/module/ui-components/credential/credential-carousel-images.js +15 -8
- package/lib/module/ui-components/credential/credential-carousel-images.js.map +1 -1
- package/lib/module/ui-components/entity/entity-cluster.js +51 -3
- package/lib/module/ui-components/entity/entity-cluster.js.map +1 -1
- package/lib/module/ui-components/entity/index.js +4 -4
- package/lib/module/ui-components/entity/index.js.map +1 -1
- package/lib/module/ui-components/history/history-details.js +1 -1
- package/lib/module/ui-components/history/history-details.js.map +1 -1
- package/lib/module/ui-components/history/index.js +6 -6
- package/lib/module/ui-components/history/index.js.map +1 -1
- package/lib/module/ui-components/icons/entity.js +10 -13
- package/lib/module/ui-components/icons/entity.js.map +1 -1
- package/lib/module/ui-components/input/index.js +6 -6
- package/lib/module/ui-components/input/index.js.map +1 -1
- package/lib/module/ui-components/list/index.js +4 -4
- package/lib/module/ui-components/list/index.js.map +1 -1
- package/lib/module/ui-components/loader/index.js +4 -4
- package/lib/module/ui-components/loader/index.js.map +1 -1
- package/lib/module/ui-components/pin/index.js +3 -3
- package/lib/module/ui-components/pin/index.js.map +1 -1
- package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
- package/lib/module/ui-components/searchbar/index.js +4 -4
- package/lib/module/ui-components/searchbar/index.js.map +1 -1
- package/lib/module/ui-components/settings/index.js +10 -10
- package/lib/module/ui-components/settings/index.js.map +1 -1
- package/lib/module/ui-components/state/index.js +2 -2
- package/lib/module/ui-components/state/index.js.map +1 -1
- package/lib/module/utils/date.js +1 -1
- package/lib/module/utils/date.js.map +1 -1
- package/lib/module/utils/hooks/connectivity/connectivity.test.js +4 -0
- package/lib/module/utils/hooks/connectivity/connectivity.test.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +24 -68
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +5 -3
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +21 -0
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +24 -14
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/trust-entity.js +57 -15
- package/lib/module/utils/hooks/core/trust-entity.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing.js +6 -15
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +2 -2
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/query.js +21 -85
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/typescript/components/entity/entity-attributes.d.ts +1 -0
- package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +1 -2
- package/lib/typescript/components/entity/entity-details.d.ts +3 -2
- package/lib/typescript/components/entity/index.d.ts +2 -1
- package/lib/typescript/ui-components/blur/index.d.ts +2 -1
- package/lib/typescript/ui-components/buttons/hold-button.d.ts +2 -2
- package/lib/typescript/ui-components/camera/index.d.ts +2 -1
- package/lib/typescript/ui-components/control/index.d.ts +4 -2
- package/lib/typescript/ui-components/credential/credential-carousel-images.d.ts +1 -0
- package/lib/typescript/ui-components/entity/entity-cluster.d.ts +1 -0
- package/lib/typescript/ui-components/entity/index.d.ts +4 -2
- package/lib/typescript/ui-components/history/history-details.d.ts +4 -1
- package/lib/typescript/ui-components/history/index.d.ts +6 -3
- package/lib/typescript/ui-components/input/index.d.ts +6 -3
- package/lib/typescript/ui-components/list/index.d.ts +4 -2
- package/lib/typescript/ui-components/loader/index.d.ts +4 -2
- package/lib/typescript/ui-components/pin/index.d.ts +4 -2
- package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +1 -1
- package/lib/typescript/ui-components/searchbar/index.d.ts +4 -2
- package/lib/typescript/ui-components/settings/index.d.ts +10 -5
- package/lib/typescript/ui-components/state/index.d.ts +2 -1
- package/lib/typescript/utils/hooks/core/backup.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/core-init.d.ts +4 -1
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +4 -1
- package/lib/typescript/utils/hooks/core/proofs.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/trust-entity.d.ts +9 -3
- package/lib/typescript/utils/parsers/query.d.ts +8 -7
- package/package.json +10 -5
- package/src/components/entity/entity-attributes.tsx +16 -2
- package/src/components/entity/entity-details-with-buttons.tsx +11 -42
- package/src/components/entity/entity-details.tsx +96 -33
- package/src/components/entity/index.ts +2 -1
- package/src/components/history/history-list-item.tsx +17 -13
- package/src/components/proof-request/share-credential.tsx +0 -1
- package/src/ui-components/blur/index.ts +2 -1
- package/src/ui-components/buttons/hold-button.tsx +6 -5
- package/src/ui-components/camera/index.tsx +2 -1
- package/src/ui-components/control/index.ts +4 -2
- package/src/ui-components/credential/card/credential-details-card.tsx +1 -1
- package/src/ui-components/credential/credential-carousel-images.tsx +15 -8
- package/src/ui-components/entity/entity-cluster.tsx +63 -10
- package/src/ui-components/entity/index.ts +4 -2
- package/src/ui-components/history/history-details.tsx +5 -2
- package/src/ui-components/history/index.ts +6 -3
- package/src/ui-components/icons/entity.tsx +8 -12
- package/src/ui-components/input/index.ts +6 -3
- package/src/ui-components/list/index.ts +4 -2
- package/src/ui-components/loader/index.ts +4 -2
- package/src/ui-components/pin/index.ts +4 -2
- package/src/ui-components/screens/nerd-mode-screen.tsx +1 -1
- package/src/ui-components/searchbar/index.ts +4 -2
- package/src/ui-components/settings/index.ts +10 -5
- package/src/ui-components/state/index.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/hooks/connectivity/connectivity.test.ts +7 -2
- package/src/utils/hooks/core/backup.ts +30 -72
- package/src/utils/hooks/core/core-init.ts +5 -3
- package/src/utils/hooks/core/identifiers.ts +22 -1
- package/src/utils/hooks/core/proofs.ts +27 -16
- package/src/utils/hooks/core/trust-entity.ts +73 -23
- package/src/utils/parsers/credential-sharing.tsx +8 -14
- package/src/utils/parsers/credential.ts +2 -1
- package/src/utils/parsers/query.ts +149 -0
- package/src/utils/parsers/query.tsx +0 -82
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blurView","
|
|
1
|
+
{"version":3,"names":["_blurView","_interopRequireDefault","require","e","__esModule","default"],"sources":["index.ts"],"sourcesContent":["import type { BlurViewProps } from './blur-view';\nimport BlurView from './blur-view';\n\nexport { BlurView, BlurViewProps };\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -152,13 +152,14 @@ const HoldButtonLayouted = ({
|
|
|
152
152
|
textColor: colorScheme.accentText
|
|
153
153
|
}, contentProps)))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
154
154
|
style: styles.pressableLayer
|
|
155
|
-
}, /*#__PURE__*/_react.default.createElement(_accessibilityHistoryWrappers.
|
|
155
|
+
}, /*#__PURE__*/_react.default.createElement(_accessibilityHistoryWrappers.TouchableOpacity, _extends({
|
|
156
156
|
accessibilityRole: "button",
|
|
157
157
|
ref: ref,
|
|
158
158
|
disabled: isFinished || disabled,
|
|
159
159
|
onLongPress: onLongPress,
|
|
160
160
|
onPressIn: isFinished ? undefined : onPressIn,
|
|
161
|
-
onPressOut: isFinished ? undefined : onPressOut
|
|
161
|
+
onPressOut: isFinished ? undefined : onPressOut,
|
|
162
|
+
activeOpacity: 1
|
|
162
163
|
}, props), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
163
164
|
style: {
|
|
164
165
|
width,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_accessibilityHistoryWrappers","_text","_theme","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","Content","title","subtitlePrefix","subtitleSuffix","width","height","textColor","progress","holdTimeoutSecs","disabled","nums","useMemo","Array","from","map","_","index","subtitleHeight","setSubtitleHeight","useState","onSubtitleLayout","useCallback","nativeEvent","layout","translateY","useDerivedValue","value","movingUpStyle","useAnimatedStyle","transform","createElement","View","style","styles","contentWrapper","contentDisabled","pointerEvents","Typography","color","numberOfLines","subtitle","subtitleDisabled","onLayout","preset","subtitleSecsWrapper","subtitleSecs","val","key","HoldButtonLayouted","onFinished","ref","props","colorScheme","useAppColorScheme","isFinished","setFinished","useEffect","useSharedValue","onLongPress","onPressIn","holdTimeout","withTiming","duration","easing","Easing","linear","finished","runOnJS","onPressOut","cancelAnimation","translateX","movingRightStyle","movingLeftStyle","contentProps","Fragment","accent","movingLayer","backgroundColor","accentText","pressableLayer","TouchableWithoutFeedback","accessibilityRole","undefined","HoldButton","React","forwardRef","setLayout","onContainerLayout","container","white","background","borderColor","displayName","StyleSheet","create","borderRadius","overflow","opacity","alignItems","justifyContent","paddingBottom","paddingHorizontal","paddingTop","borderWidth","position","flexDirection","_default","exports"],"sources":["hold-button.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { ColorValue, LayoutChangeEvent, StyleSheet, TouchableWithoutFeedbackProps, View } from 'react-native';\nimport Animated, {\n cancelAnimation,\n Easing,\n runOnJS,\n SharedValue,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { TouchableWithoutFeedback, TouchableWithoutFeedbackRef } from '../accessibility/accessibilityHistoryWrappers';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HoldButtonProps\n extends Omit<\n TouchableWithoutFeedbackProps,\n 'children' | 'onLayout' | 'onPress' | 'onLongPress' | 'onPressIn' | 'onPressOut'\n > {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n holdTimeoutSecs?: number;\n onFinished: () => void;\n}\n\ninterface ContentProps {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n width: number;\n height: number;\n textColor: ColorValue;\n progress: SharedValue<number>;\n holdTimeoutSecs: number;\n disabled?: boolean;\n}\n\nconst Content = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n width,\n height,\n textColor,\n progress,\n holdTimeoutSecs,\n disabled,\n}: ContentProps) => {\n const nums = useMemo(\n () => Array.from({ length: holdTimeoutSecs + 1 }).map((_, index) => holdTimeoutSecs - index),\n [holdTimeoutSecs],\n );\n\n const [subtitleHeight, setSubtitleHeight] = useState<number>(0);\n const onSubtitleLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setSubtitleHeight(nativeEvent.layout.height);\n }, []);\n\n const translateY = useDerivedValue(\n () => progress.value * subtitleHeight * holdTimeoutSecs,\n [subtitleHeight, holdTimeoutSecs],\n );\n const movingUpStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: -translateY.value }],\n }), [translateY]);\n\n return (\n <View style={[styles.contentWrapper, disabled && styles.contentDisabled, { width, height }]} pointerEvents=\"none\">\n <Typography color={textColor} numberOfLines={1}>\n {title}\n </Typography>\n\n <View style={[styles.subtitle, disabled && styles.subtitleDisabled]}>\n <Typography onLayout={onSubtitleLayout} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitlePrefix}\n </Typography>\n <View style={[styles.subtitleSecsWrapper, { height: subtitleHeight }]}>\n <Animated.View style={[styles.subtitleSecs, movingUpStyle]}>\n {nums.map((val) => (\n <Typography key={val} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {val}\n </Typography>\n ))}\n </Animated.View>\n </View>\n <Typography preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitleSuffix}\n </Typography>\n </View>\n </View>\n );\n};\n\ninterface HoldButtonLayoutedProps extends Omit<HoldButtonProps, 'style'> {\n ref: React.ForwardedRef<TouchableWithoutFeedbackRef>;\n width: number;\n height: number;\n}\n\nconst HoldButtonLayouted = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n onFinished,\n holdTimeoutSecs = 3,\n width,\n height,\n disabled,\n ref,\n ...props\n}: HoldButtonLayoutedProps) => {\n const colorScheme = useAppColorScheme();\n\n const [isFinished, setFinished] = useState(false);\n useEffect(() => {\n if (isFinished) {\n onFinished();\n }\n }, [isFinished, onFinished]);\n\n const progress = useSharedValue(0);\n\n const onLongPress = useCallback(() => {\n // Fix for detox bug https://github.com/wix/Detox/issues/4754\n if (isFinished || progress.value !== 0) {\n return;\n }\n setFinished(true);\n }, [progress, isFinished]);\n\n const onPressIn = useCallback(() => {\n const holdTimeout = holdTimeoutSecs * 1000;\n\n // start moving forward\n progress.value = withTiming(\n 1,\n {\n duration: (1 - progress.value) * holdTimeout,\n easing: Easing.linear,\n },\n (finished) => {\n if (finished) {\n runOnJS(setFinished)(true);\n } else {\n // start moving back\n progress.value = withTiming(0, {\n duration: progress.value * holdTimeout,\n easing: Easing.linear,\n });\n }\n },\n );\n }, [holdTimeoutSecs, progress]);\n\n const onPressOut = useCallback(() => cancelAnimation(progress), [progress]);\n\n const translateX = useDerivedValue(() => progress.value * width, [width]);\n const movingRightStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: translateX.value }],\n }), [translateX]);\n const movingLeftStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: -translateX.value }],\n }), [translateX]);\n\n const contentProps = useMemo(\n () => ({ title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height }),\n [title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height],\n );\n\n return (\n <>\n <Content textColor={colorScheme.accent} disabled={disabled} {...contentProps} />\n {!disabled && (\n <Animated.View style={[styles.movingLayer, { backgroundColor: colorScheme.accent }, movingRightStyle]}>\n <Animated.View style={movingLeftStyle}>\n <Content textColor={colorScheme.accentText} {...contentProps} />\n </Animated.View>\n </Animated.View>\n )}\n <View style={styles.pressableLayer}>\n <TouchableWithoutFeedback\n accessibilityRole=\"button\"\n ref={ref}\n disabled={isFinished || disabled}\n onLongPress={onLongPress}\n onPressIn={isFinished ? undefined : onPressIn}\n onPressOut={isFinished ? undefined : onPressOut}\n {...props}>\n <View style={{ width, height }} />\n </TouchableWithoutFeedback>\n </View>\n </>\n );\n};\n\n/**\n * Press and hold button component\n *\n * follows design: https://www.figma.com/design/cCmAyBQrQWCQZuDi85pJfe/Procivis-One-Wallet-Developments-2025?node-id=1-871\n */\nconst HoldButton = React.forwardRef<TouchableWithoutFeedbackRef, HoldButtonProps>(\n ({ style, disabled, ...props }, ref) => {\n const colorScheme = useAppColorScheme();\n\n const [layout, setLayout] = useState<{ width: number; height: number }>();\n const onContainerLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setLayout({ width: nativeEvent.layout.width, height: nativeEvent.layout.height });\n }, []);\n\n return (\n <View\n onLayout={onContainerLayout}\n style={[\n styles.container,\n disabled && styles.disabled,\n {\n backgroundColor: disabled ? colorScheme.white : colorScheme.background,\n borderColor: colorScheme.background,\n },\n style,\n ]}>\n {layout && <HoldButtonLayouted ref={ref} disabled={disabled} {...props} {...layout} />}\n </View>\n );\n },\n);\n\nHoldButton.displayName = 'HoldButton';\n\nconst styles = StyleSheet.create({\n container: {\n borderRadius: 12,\n height: 68,\n overflow: 'hidden',\n },\n contentDisabled: {\n opacity: 0.4,\n },\n contentWrapper: {\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingBottom: 16,\n paddingHorizontal: 24,\n paddingTop: 12,\n },\n disabled: {\n borderWidth: 1,\n },\n movingLayer: {\n overflow: 'hidden',\n position: 'absolute',\n },\n pressableLayer: {\n position: 'absolute',\n },\n subtitle: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n opacity: 0.8,\n },\n subtitleDisabled: {\n opacity: 1,\n },\n subtitleSecs: {\n alignItems: 'center',\n },\n subtitleSecsWrapper: {\n overflow: 'hidden',\n },\n});\n\nexport default HoldButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAWA,IAAAG,6BAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAA6C,SAAAM,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,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AAU,CAACS,WAAW,GAAG,YAAY;AAErC,MAAM3D,MAAM,GAAG4D,uBAAU,CAACC,MAAM,CAAC;EAC/BN,SAAS,EAAE;IACTO,YAAY,EAAE,EAAE;IAChB1F,MAAM,EAAE,EAAE;IACV2F,QAAQ,EAAE;EACZ,CAAC;EACD7D,eAAe,EAAE;IACf8D,OAAO,EAAE;EACX,CAAC;EACD/D,cAAc,EAAE;IACdgE,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,eAAe;IAC/BC,aAAa,EAAE,EAAE;IACjBC,iBAAiB,EAAE,EAAE;IACrBC,UAAU,EAAE;EACd,CAAC;EACD7F,QAAQ,EAAE;IACR8F,WAAW,EAAE;EACf,CAAC;EACD3B,WAAW,EAAE;IACXoB,QAAQ,EAAE,QAAQ;IAClBQ,QAAQ,EAAE;EACZ,CAAC;EACDzB,cAAc,EAAE;IACdyB,QAAQ,EAAE;EACZ,CAAC;EACDhE,QAAQ,EAAE;IACR0D,UAAU,EAAE,UAAU;IACtBO,aAAa,EAAE,KAAK;IACpBR,OAAO,EAAE;EACX,CAAC;EACDxD,gBAAgB,EAAE;IAChBwD,OAAO,EAAE;EACX,CAAC;EACDpD,YAAY,EAAE;IACZqD,UAAU,EAAE;EACd,CAAC;EACDtD,mBAAmB,EAAE;IACnBoD,QAAQ,EAAE;EACZ;AACF,CAAC,CAAC;AAAC,IAAAU,QAAA,GAAAC,OAAA,CAAA/H,OAAA,GAEYuG,UAAU","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_accessibilityHistoryWrappers","_text","_theme","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","Content","title","subtitlePrefix","subtitleSuffix","width","height","textColor","progress","holdTimeoutSecs","disabled","nums","useMemo","Array","from","map","_","index","subtitleHeight","setSubtitleHeight","useState","onSubtitleLayout","useCallback","nativeEvent","layout","translateY","useDerivedValue","value","movingUpStyle","useAnimatedStyle","transform","createElement","View","style","styles","contentWrapper","contentDisabled","pointerEvents","Typography","color","numberOfLines","subtitle","subtitleDisabled","onLayout","preset","subtitleSecsWrapper","subtitleSecs","val","key","HoldButtonLayouted","onFinished","ref","props","colorScheme","useAppColorScheme","isFinished","setFinished","useEffect","useSharedValue","onLongPress","onPressIn","holdTimeout","withTiming","duration","easing","Easing","linear","finished","runOnJS","onPressOut","cancelAnimation","translateX","movingRightStyle","movingLeftStyle","contentProps","Fragment","accent","movingLayer","backgroundColor","accentText","pressableLayer","TouchableOpacity","accessibilityRole","undefined","activeOpacity","HoldButton","React","forwardRef","setLayout","onContainerLayout","container","white","background","borderColor","displayName","StyleSheet","create","borderRadius","overflow","opacity","alignItems","justifyContent","paddingBottom","paddingHorizontal","paddingTop","borderWidth","position","flexDirection","_default","exports"],"sources":["hold-button.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useMemo, useState } from 'react';\nimport { ColorValue, LayoutChangeEvent, StyleSheet, TouchableWithoutFeedbackProps, View } from 'react-native';\nimport Animated, {\n cancelAnimation,\n Easing,\n runOnJS,\n SharedValue,\n useAnimatedStyle,\n useDerivedValue,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { TouchableOpacity, TouchableOpacityRef } from '../accessibility/accessibilityHistoryWrappers';\nimport { Typography } from '../text';\nimport { useAppColorScheme } from '../theme';\n\nexport interface HoldButtonProps\n extends Omit<\n TouchableWithoutFeedbackProps,\n 'children' | 'onLayout' | 'onPress' | 'onLongPress' | 'onPressIn' | 'onPressOut'\n > {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n holdTimeoutSecs?: number;\n onFinished: () => void;\n}\n\ninterface ContentProps {\n title: string;\n subtitlePrefix: string;\n subtitleSuffix: string;\n width: number;\n height: number;\n textColor: ColorValue;\n progress: SharedValue<number>;\n holdTimeoutSecs: number;\n disabled?: boolean;\n}\n\nconst Content = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n width,\n height,\n textColor,\n progress,\n holdTimeoutSecs,\n disabled,\n}: ContentProps) => {\n const nums = useMemo(\n () => Array.from({ length: holdTimeoutSecs + 1 }).map((_, index) => holdTimeoutSecs - index),\n [holdTimeoutSecs],\n );\n\n const [subtitleHeight, setSubtitleHeight] = useState<number>(0);\n const onSubtitleLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setSubtitleHeight(nativeEvent.layout.height);\n }, []);\n\n const translateY = useDerivedValue(\n () => progress.value * subtitleHeight * holdTimeoutSecs,\n [subtitleHeight, holdTimeoutSecs],\n );\n const movingUpStyle = useAnimatedStyle(() => ({\n transform: [{ translateY: -translateY.value }],\n }), [translateY]);\n\n return (\n <View style={[styles.contentWrapper, disabled && styles.contentDisabled, { width, height }]} pointerEvents=\"none\">\n <Typography color={textColor} numberOfLines={1}>\n {title}\n </Typography>\n\n <View style={[styles.subtitle, disabled && styles.subtitleDisabled]}>\n <Typography onLayout={onSubtitleLayout} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitlePrefix}\n </Typography>\n <View style={[styles.subtitleSecsWrapper, { height: subtitleHeight }]}>\n <Animated.View style={[styles.subtitleSecs, movingUpStyle]}>\n {nums.map((val) => (\n <Typography key={val} preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {val}\n </Typography>\n ))}\n </Animated.View>\n </View>\n <Typography preset=\"s/line-height-capped\" color={textColor} numberOfLines={1}>\n {subtitleSuffix}\n </Typography>\n </View>\n </View>\n );\n};\n\ninterface HoldButtonLayoutedProps extends Omit<HoldButtonProps, 'style'> {\n ref: React.ForwardedRef<TouchableOpacityRef>;\n width: number;\n height: number;\n}\n\nconst HoldButtonLayouted = ({\n title,\n subtitlePrefix,\n subtitleSuffix,\n onFinished,\n holdTimeoutSecs = 3,\n width,\n height,\n disabled,\n ref,\n ...props\n}: HoldButtonLayoutedProps) => {\n const colorScheme = useAppColorScheme();\n\n const [isFinished, setFinished] = useState(false);\n useEffect(() => {\n if (isFinished) {\n onFinished();\n }\n }, [isFinished, onFinished]);\n\n const progress = useSharedValue(0);\n\n const onLongPress = useCallback(() => {\n // Fix for detox bug https://github.com/wix/Detox/issues/4754\n if (isFinished || progress.value !== 0) {\n return;\n }\n setFinished(true);\n }, [progress, isFinished]);\n\n const onPressIn = useCallback(() => {\n const holdTimeout = holdTimeoutSecs * 1000;\n\n // start moving forward\n progress.value = withTiming(\n 1,\n {\n duration: (1 - progress.value) * holdTimeout,\n easing: Easing.linear,\n },\n (finished) => {\n if (finished) {\n runOnJS(setFinished)(true);\n } else {\n // start moving back\n progress.value = withTiming(0, {\n duration: progress.value * holdTimeout,\n easing: Easing.linear,\n });\n }\n },\n );\n }, [holdTimeoutSecs, progress]);\n\n const onPressOut = useCallback(() => cancelAnimation(progress), [progress]);\n\n const translateX = useDerivedValue(() => progress.value * width, [width]);\n const movingRightStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: translateX.value }],\n }), [translateX]);\n const movingLeftStyle = useAnimatedStyle(() => ({\n transform: [{ translateX: -translateX.value }],\n }), [translateX]);\n\n const contentProps = useMemo(\n () => ({ title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height }),\n [title, subtitlePrefix, subtitleSuffix, progress, holdTimeoutSecs, width, height],\n );\n\n return (\n <>\n <Content textColor={colorScheme.accent} disabled={disabled} {...contentProps} />\n {!disabled && (\n <Animated.View style={[styles.movingLayer, { backgroundColor: colorScheme.accent }, movingRightStyle]}>\n <Animated.View style={movingLeftStyle}>\n <Content textColor={colorScheme.accentText} {...contentProps} />\n </Animated.View>\n </Animated.View>\n )}\n <View style={styles.pressableLayer}>\n <TouchableOpacity\n accessibilityRole=\"button\"\n ref={ref}\n disabled={isFinished || disabled}\n onLongPress={onLongPress}\n onPressIn={isFinished ? undefined : onPressIn}\n onPressOut={isFinished ? undefined : onPressOut}\n activeOpacity={1}\n {...props}>\n <View style={{ width, height }} />\n </TouchableOpacity>\n </View>\n </>\n );\n};\n\n/**\n * Press and hold button component\n *\n * follows design: https://www.figma.com/design/cCmAyBQrQWCQZuDi85pJfe/Procivis-One-Wallet-Developments-2025?node-id=1-871\n */\nconst HoldButton = React.forwardRef<TouchableOpacityRef, HoldButtonProps>(\n ({ style, disabled, ...props }, ref) => {\n const colorScheme = useAppColorScheme();\n\n const [layout, setLayout] = useState<{ width: number; height: number }>();\n const onContainerLayout = useCallback(({ nativeEvent }: LayoutChangeEvent) => {\n setLayout({ width: nativeEvent.layout.width, height: nativeEvent.layout.height });\n }, []);\n\n return (\n <View\n onLayout={onContainerLayout}\n style={[\n styles.container,\n disabled && styles.disabled,\n {\n backgroundColor: disabled ? colorScheme.white : colorScheme.background,\n borderColor: colorScheme.background,\n },\n style,\n ]}>\n {layout && <HoldButtonLayouted ref={ref} disabled={disabled} {...props} {...layout} />}\n </View>\n );\n },\n);\n\nHoldButton.displayName = 'HoldButton';\n\nconst styles = StyleSheet.create({\n container: {\n borderRadius: 12,\n height: 68,\n overflow: 'hidden',\n },\n contentDisabled: {\n opacity: 0.4,\n },\n contentWrapper: {\n alignItems: 'center',\n justifyContent: 'space-between',\n paddingBottom: 16,\n paddingHorizontal: 24,\n paddingTop: 12,\n },\n disabled: {\n borderWidth: 1,\n },\n movingLayer: {\n overflow: 'hidden',\n position: 'absolute',\n },\n pressableLayer: {\n position: 'absolute',\n },\n subtitle: {\n alignItems: 'flex-end',\n flexDirection: 'row',\n opacity: 0.8,\n },\n subtitleDisabled: {\n opacity: 1,\n },\n subtitleSecs: {\n alignItems: 'center',\n },\n subtitleSecsWrapper: {\n overflow: 'hidden',\n },\n});\n\nexport default HoldButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAWA,IAAAG,6BAAA,GAAAH,OAAA;AACA,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
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
get: function () {
|
|
15
|
-
return _qrCodeScanner.QRCodeScannerProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _qrCodeScanner = _interopRequireWildcard(require("./qr-code-scanner"));
|
|
19
|
-
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); }
|
|
20
|
-
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; }
|
|
12
|
+
var _qrCodeScanner = _interopRequireDefault(require("./qr-code-scanner"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_qrCodeScanner","
|
|
1
|
+
{"version":3,"names":["_qrCodeScanner","_interopRequireDefault","require","e","__esModule","default"],"sources":["index.tsx"],"sourcesContent":["import type { QRCodeScannerProps } from './qr-code-scanner';\nimport QRCodeScanner from './qr-code-scanner';\n\nexport { QRCodeScanner, QRCodeScannerProps };\n"],"mappings":";;;;;;;;;;;AACA,IAAAA,cAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA8C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -9,24 +9,12 @@ Object.defineProperty(exports, "Checkbox", {
|
|
|
9
9
|
return _checkbox.Checkbox;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "CheckboxProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _checkbox.CheckboxProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "Switch", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
21
15
|
return _switch.Switch;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
|
-
Object.defineProperty(exports, "SwitchProps", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _switch.SwitchProps;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
18
|
var _checkbox = require("./checkbox");
|
|
31
19
|
var _switch = require("./switch");
|
|
32
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_checkbox","require","_switch"],"sources":["index.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"names":["_checkbox","require","_switch"],"sources":["index.ts"],"sourcesContent":["import type { CheckboxProps } from './checkbox';\nimport { Checkbox } from './checkbox';\nimport type { SwitchProps } from './switch';\nimport { Switch } from './switch';\n\nexport { Checkbox, CheckboxProps, Switch, SwitchProps };\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,IAAAA,SAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA","ignoreList":[]}
|
|
@@ -119,7 +119,7 @@ const CredentialDetailsCard = ({
|
|
|
119
119
|
}), /*#__PURE__*/_react.default.createElement(_credentialCard.default, _extends({}, cardProps, {
|
|
120
120
|
header: {
|
|
121
121
|
...header,
|
|
122
|
-
accessory: (_header$accessory = header.accessory) !== null && _header$accessory !== void 0 ? _header$accessory : CaretIcon
|
|
122
|
+
accessory: (_header$accessory = header.accessory) !== null && _header$accessory !== void 0 ? _header$accessory : cardProps.onHeaderPress ? CaretIcon : undefined
|
|
123
123
|
},
|
|
124
124
|
style: [styles.card, cardProps.style]
|
|
125
125
|
})), previewAttributes.length > 0 && /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","buttonViewHeight","setButtonViewHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","currentHeight","useSharedValue","undefined","previewAttributes","slice","extraAttributes","useMemo","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","additionalAttributesHeight","additionalHeight","newHeight","value","duration","withTiming","credentialAttributesStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","onButtonViewLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","View","detailsCard","backgroundColor","white","concatTestID","accessory","attributesAnimatedWrapper","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","Button","type","ButtonType","Secondary","title","index","create","paddingHorizontal","width","overflow","paddingTop","position","borderRadius","marginTop","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n const [buttonViewHeight, setButtonViewHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (!extraAttributes || allAttributesRendered) {\n setButtonViewHeight(0);\n }\n }, [extraAttributes, allAttributesRendered]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined || buttonViewHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const newHeight = expanded || !animate ? previewAttributesHeight + additionalHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = !expanded\n ? 250\n : allAttributesRendered\n ? previewAttributes.length * 50\n : extraAttributes.length * 50;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n buttonViewHeight,\n currentHeight,\n animate,\n expanded,\n extraAttributes.length,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const credentialAttributesStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: 0,\n };\n }\n return {\n height: currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onButtonViewLayout = useCallback((event: LayoutChangeEvent) => {\n setButtonViewHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\n return (\n <View\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? CaretIcon }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <Animated.View style={[styles.attributesAnimatedWrapper, credentialAttributesStyle]}>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.allAttributesWrapper} onLayout={onButtonViewLayout}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </Animated.View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesAnimatedWrapper: {\n overflow: 'hidden',\n },\n attributesWrapper: {\n paddingTop: 7,\n position: 'absolute',\n width: '100%',\n },\n card: {\n borderRadius: 0,\n },\n detailsCard: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAD,sBAAA,CAAAR,OAAA;AAAwE,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAA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AC;IACpBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAA7H,OAAA,GAEYyB,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_testID","_buttons","_credential","_colorSchemeContext","_credentialAttributeItem","_interopRequireDefault","_credentialCard","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","PREVIEW_ATTRIBUTES_COUNT","CredentialDetailsCard","animate","attributes","card","expanded","footer","onImagePreview","onAttributeSelected","style","showAllButtonLabel","testID","viewProps","_header$accessory","colorScheme","useAppColorScheme","previewAttributesHeight","setPreviewAttributesHeight","useState","fullAttributesHeight","setFullAttributesHeight","buttonViewHeight","setButtonViewHeight","allAttributesRendered","setAllAttributesRendered","CaretIcon","UpIcon","DownIcon","currentHeight","useSharedValue","undefined","previewAttributes","slice","extraAttributes","useMemo","useEffect","viewStyle","StyleSheet","flatten","styles","allAttributesWrapper","allAttributesWrapperWithFooter","padding","paddingBottom","additionalAttributesHeight","additionalHeight","newHeight","value","duration","withTiming","credentialAttributesStyle","useAnimatedStyle","height","onPreviewAttrContentLayout","useCallback","event","nativeEvent","layout","onFullAttrContentLayout","onButtonViewLayout","footerView","React","isValidElement","FooterComponent","createElement","header","cardProps","renderExtraAttributes","View","detailsCard","backgroundColor","white","concatTestID","accessory","onHeaderPress","attributesAnimatedWrapper","attributesWrapper","onLayout","previewAttributesWrapper","map","attribute","idx","key","id","last","toString","onPress","Button","type","ButtonType","Secondary","title","index","create","paddingHorizontal","width","overflow","paddingTop","position","borderRadius","marginTop","_default","exports"],"sources":["credential-details-card.tsx"],"sourcesContent":["import React, { ComponentType, FC, ReactElement, useCallback, useEffect, useMemo, useState } from 'react';\nimport { ImageSourcePropType, LayoutChangeEvent, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\n\nimport { concatTestID } from '../../../utils/testID';\nimport { Button, ButtonType } from '../../buttons';\nimport { DownIcon, UpIcon } from '../../icons/credential';\nimport { useAppColorScheme } from '../../theme/color-scheme-context';\nimport CredentialAttributeItem, { CredentialAttribute } from '../credential-attribute-item';\nimport CredentialCard, { CredentialCardProps } from './credential-card';\n\nexport type CredentialDetailsCardProps = ViewProps & {\n animate?: boolean;\n attributes: CredentialAttribute[] | false;\n card: CredentialCardProps;\n expanded?: boolean;\n footer?: ComponentType<any> | ReactElement;\n onImagePreview?: (name: string, image: ImageSourcePropType) => void;\n onAttributeSelected?: (id: string, selected: boolean) => void;\n showAllButtonLabel?: string;\n};\n\nconst PREVIEW_ATTRIBUTES_COUNT = 3;\n\nconst CredentialDetailsCard: FC<CredentialDetailsCardProps> = ({\n animate = true,\n attributes,\n card,\n expanded,\n footer,\n onImagePreview,\n onAttributeSelected,\n style,\n showAllButtonLabel,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n const [previewAttributesHeight, setPreviewAttributesHeight] = useState<number>();\n const [fullAttributesHeight, setFullAttributesHeight] = useState<number>();\n const [buttonViewHeight, setButtonViewHeight] = useState<number>();\n\n const [allAttributesRendered, setAllAttributesRendered] = useState<boolean>(\n (attributes && attributes.length <= PREVIEW_ATTRIBUTES_COUNT) || !showAllButtonLabel,\n );\n\n const CaretIcon = expanded ? UpIcon : DownIcon;\n\n const currentHeight = useSharedValue<number | undefined>(undefined);\n\n const previewAttributes = attributes ? attributes.slice(0, PREVIEW_ATTRIBUTES_COUNT) : [];\n const extraAttributes = useMemo(() => (attributes ? attributes.slice(PREVIEW_ATTRIBUTES_COUNT) : []), [attributes]);\n\n useEffect(() => {\n if (!extraAttributes || allAttributesRendered) {\n setButtonViewHeight(0);\n }\n }, [extraAttributes, allAttributesRendered]);\n\n useEffect(() => {\n if (extraAttributes.length === 0) {\n const viewStyle = StyleSheet.flatten([\n styles.allAttributesWrapper,\n footer && styles.allAttributesWrapperWithFooter,\n ]);\n const padding = viewStyle.paddingBottom;\n setFullAttributesHeight(padding);\n }\n }, [extraAttributes, footer]);\n\n useEffect(() => {\n if (previewAttributesHeight === undefined || buttonViewHeight === undefined) {\n return;\n }\n if (allAttributesRendered && fullAttributesHeight === undefined) {\n return;\n }\n\n const additionalAttributesHeight = fullAttributesHeight ?? 0;\n const additionalHeight = allAttributesRendered ? additionalAttributesHeight : buttonViewHeight;\n const newHeight = expanded || !animate ? previewAttributesHeight + additionalHeight : 0;\n\n if (currentHeight.value === undefined || !animate) {\n currentHeight.value = newHeight;\n return;\n }\n\n const duration = !expanded\n ? 250\n : allAttributesRendered\n ? previewAttributes.length * 50\n : extraAttributes.length * 50;\n currentHeight.value = withTiming(newHeight, {\n duration,\n });\n }, [\n allAttributesRendered,\n buttonViewHeight,\n currentHeight,\n animate,\n expanded,\n extraAttributes.length,\n fullAttributesHeight,\n previewAttributes.length,\n previewAttributesHeight,\n ]);\n\n const credentialAttributesStyle = useAnimatedStyle(() => {\n if (currentHeight.value === undefined) {\n if (expanded) {\n return {};\n }\n return {\n height: 0,\n };\n }\n return {\n height: currentHeight.value,\n };\n }, [expanded, currentHeight]);\n\n const onPreviewAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setPreviewAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onFullAttrContentLayout = useCallback((event: LayoutChangeEvent) => {\n setFullAttributesHeight(event.nativeEvent.layout.height);\n }, []);\n\n const onButtonViewLayout = useCallback((event: LayoutChangeEvent) => {\n setButtonViewHeight(event.nativeEvent.layout.height);\n }, []);\n\n const footerView: ReactElement | undefined = useMemo(() => {\n if (!footer) {\n return undefined;\n }\n if (React.isValidElement(footer)) {\n return footer;\n } else {\n const FooterComponent = footer as React.ComponentType<any>;\n return <FooterComponent />;\n }\n }, [footer]);\n\n const { header, ...cardProps } = card;\n\n const renderExtraAttributes =\n allAttributesRendered || (previewAttributesHeight !== undefined && currentHeight.value !== undefined);\n return (\n <View\n style={[styles.detailsCard, { backgroundColor: colorScheme.white }, style]}\n {...viewProps}\n testID={concatTestID(card.testID, expanded ? 'expanded' : 'collapsed')}>\n <CredentialCard\n {...cardProps}\n header={{ ...header, accessory: header.accessory ?? (cardProps.onHeaderPress ? CaretIcon : undefined) }}\n style={[styles.card, cardProps.style]}\n />\n {previewAttributes.length > 0 && (\n <Animated.View style={[styles.attributesAnimatedWrapper, credentialAttributesStyle]}>\n <View style={styles.attributesWrapper}>\n <View onLayout={onPreviewAttrContentLayout} style={styles.previewAttributesWrapper}>\n {previewAttributes.map((attribute, idx) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && !extraAttributes.length && idx === previewAttributes.length - 1}\n testID={concatTestID(testID, 'attribute', idx.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n {!allAttributesRendered && extraAttributes.length > 0 && (\n <View style={styles.allAttributesWrapper} onLayout={onButtonViewLayout}>\n <Button\n onPress={() => setAllAttributesRendered(true)}\n type={ButtonType.Secondary}\n testID={concatTestID(testID, 'showAllAttributesButton')}\n title={showAllButtonLabel!}\n />\n </View>\n )}\n {renderExtraAttributes && (\n <View\n style={[styles.allAttributesWrapper, footerView && styles.allAttributesWrapperWithFooter]}\n onLayout={onFullAttrContentLayout}>\n {extraAttributes.map((attribute, index, { length }) => (\n <CredentialAttributeItem\n key={attribute.id}\n last={!footerView && index === length - 1}\n testID={concatTestID(testID, 'attribute', index.toString())}\n onImagePreview={onImagePreview}\n onPress={onAttributeSelected}\n {...attribute}\n />\n ))}\n </View>\n )}\n </View>\n </Animated.View>\n )}\n {footerView ? <View style={styles.footer}>{footerView}</View> : null}\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n allAttributesWrapper: {\n paddingBottom: 12,\n paddingHorizontal: 4,\n width: '100%',\n },\n allAttributesWrapperWithFooter: {\n paddingBottom: 0,\n },\n attributesAnimatedWrapper: {\n overflow: 'hidden',\n },\n attributesWrapper: {\n paddingTop: 7,\n position: 'absolute',\n width: '100%',\n },\n card: {\n borderRadius: 0,\n },\n detailsCard: {\n borderRadius: 10,\n overflow: 'hidden',\n },\n footer: {\n marginTop: 12,\n },\n previewAttributesWrapper: {\n paddingHorizontal: 4,\n width: '100%',\n },\n});\n\nexport default CredentialDetailsCard;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,sBAAA,GAAAH,uBAAA,CAAAC,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AACA,IAAAO,wBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,eAAA,GAAAD,sBAAA,CAAAR,OAAA;AAAwE,SAAAQ,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAAA,GAAAM,CAAA,GAAAD,CAAA,KAAAL,CAAA;AAAA,SAAAX,wBAAAW,CAAA,EAAAK,CAAA,SAAAA,CAAA,IAAAL,CAAA,IAAAA,CAAA,CAAAC,UAAA,SAAAD,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAE,OAAA,EAAAF,CAAA,QAAAM,CAAA,GAAAH,wBAAA,CAAAE,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAC,GAAA,CAAAP,CAAA,UAAAM,CAAA,CAAAE,GAAA,CAAAR,CAAA,OAAAS,CA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AAE;IACxBgB,iBAAiB,EAAE,CAAC;IACpBC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAA9H,OAAA,GAEYyB,qBAAqB","ignoreList":[]}
|
|
@@ -60,16 +60,23 @@ exports.Barcode = Barcode;
|
|
|
60
60
|
const QrCode = ({
|
|
61
61
|
content,
|
|
62
62
|
padding,
|
|
63
|
-
testID
|
|
63
|
+
testID,
|
|
64
|
+
onError
|
|
64
65
|
}) => {
|
|
65
66
|
const qrCodeXml = (0, _react.useMemo)(() => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
try {
|
|
68
|
+
return new _qrcodeSvg.default({
|
|
69
|
+
container: 'svg-viewbox',
|
|
70
|
+
content,
|
|
71
|
+
ecl: 'L',
|
|
72
|
+
join: true,
|
|
73
|
+
padding: padding !== null && padding !== void 0 ? padding : 1
|
|
74
|
+
}).svg();
|
|
75
|
+
} catch (err) {
|
|
76
|
+
onError && onError(err instanceof Error ? err.message : 'Unknown error occurred.');
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
}, [content, onError, padding]);
|
|
73
80
|
return /*#__PURE__*/_react.default.createElement(_reactNativeSvg.SvgXml, {
|
|
74
81
|
height: '100%',
|
|
75
82
|
testID: testID,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_pureSvgCode","require","_qrcodeSvg","_interopRequireDefault","_react","_interopRequireWildcard","_reactNative","_reactNativeSvg","_typography","_colorSchemeContext","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","styles","StyleSheet","create","barcodeBackground","alignSelf","backgroundColor","borderRadius","barcodeContent","margin","container","flex","justifyContent","mrzBackground","paddingHorizontal","Barcode","content","width","height","testID","colorScheme","useAppColorScheme","barcodeXml","useMemo","barcode","barHeight","bgColor","white","createElement","View","style","SvgXml","xml","exports","QrCode","padding","qrCodeXml","QRCode","join","svg","Mrz","color","text","preset"],"sources":["credential-carousel-images.tsx"],"sourcesContent":["import { barcode } from 'pure-svg-code';\nimport QRCode from 'qrcode-svg';\nimport React, { FC, useMemo } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { SvgXml } from 'react-native-svg';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n barcodeBackground: {\n alignSelf: 'center',\n backgroundColor: 'white',\n borderRadius: 5,\n },\n barcodeContent: {\n margin: 12,\n },\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n mrzBackground: {\n backgroundColor: 'white',\n paddingHorizontal: 12,\n },\n});\n\ntype BarcodeProps = {\n content: string;\n height?: number;\n testID?: string;\n width?: number;\n};\n\nexport const Barcode: FC<BarcodeProps> = ({ content, width = 220, height = 80, testID }) => {\n const colorScheme = useAppColorScheme();\n const barcodeXml = useMemo(\n () =>\n barcode(content, 'code128', {\n barHeight: height,\n bgColor: colorScheme.white,\n width: width,\n }),\n [content, colorScheme, height, width],\n );\n\n return (\n <View style={styles.container}>\n <View style={styles.barcodeBackground}>\n <SvgXml\n height={height}\n style={[styles.barcodeBackground, styles.barcodeContent]}\n testID={testID}\n width={width}\n xml={barcodeXml}\n />\n </View>\n </View>\n );\n};\n\ntype QrCodeProps = {\n content: string;\n padding?: number;\n testID?: string;\n};\n\nexport const QrCode: FC<QrCodeProps> = ({ content, padding, testID }) => {\n const qrCodeXml = useMemo(() => {\n return new QRCode({\n
|
|
1
|
+
{"version":3,"names":["_pureSvgCode","require","_qrcodeSvg","_interopRequireDefault","_react","_interopRequireWildcard","_reactNative","_reactNativeSvg","_typography","_colorSchemeContext","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","styles","StyleSheet","create","barcodeBackground","alignSelf","backgroundColor","borderRadius","barcodeContent","margin","container","flex","justifyContent","mrzBackground","paddingHorizontal","Barcode","content","width","height","testID","colorScheme","useAppColorScheme","barcodeXml","useMemo","barcode","barHeight","bgColor","white","createElement","View","style","SvgXml","xml","exports","QrCode","padding","onError","qrCodeXml","QRCode","ecl","join","svg","err","Error","message","Mrz","color","text","preset"],"sources":["credential-carousel-images.tsx"],"sourcesContent":["import { barcode } from 'pure-svg-code';\nimport QRCode from 'qrcode-svg';\nimport React, { FC, useMemo } from 'react';\nimport { StyleSheet, View } from 'react-native';\nimport { SvgXml } from 'react-native-svg';\n\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\n\nconst styles = StyleSheet.create({\n barcodeBackground: {\n alignSelf: 'center',\n backgroundColor: 'white',\n borderRadius: 5,\n },\n barcodeContent: {\n margin: 12,\n },\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n mrzBackground: {\n backgroundColor: 'white',\n paddingHorizontal: 12,\n },\n});\n\ntype BarcodeProps = {\n content: string;\n height?: number;\n testID?: string;\n width?: number;\n};\n\nexport const Barcode: FC<BarcodeProps> = ({ content, width = 220, height = 80, testID }) => {\n const colorScheme = useAppColorScheme();\n const barcodeXml = useMemo(\n () =>\n barcode(content, 'code128', {\n barHeight: height,\n bgColor: colorScheme.white,\n width: width,\n }),\n [content, colorScheme, height, width],\n );\n\n return (\n <View style={styles.container}>\n <View style={styles.barcodeBackground}>\n <SvgXml\n height={height}\n style={[styles.barcodeBackground, styles.barcodeContent]}\n testID={testID}\n width={width}\n xml={barcodeXml}\n />\n </View>\n </View>\n );\n};\n\ntype QrCodeProps = {\n content: string;\n padding?: number;\n testID?: string;\n onError?: (err: string) => void;\n};\n\nexport const QrCode: FC<QrCodeProps> = ({ content, padding, testID, onError }) => {\n const qrCodeXml = useMemo(() => {\n try {\n return new QRCode({\n container: 'svg-viewbox',\n content,\n ecl: 'L',\n join: true,\n padding: padding ?? 1,\n }).svg();\n } catch (err) {\n onError && onError(err instanceof Error ? err.message : 'Unknown error occurred.');\n return null;\n }\n }, [content, onError, padding]);\n return <SvgXml height={'100%'} testID={testID} width={'100%'} xml={qrCodeXml} />;\n};\n\nexport const Mrz: FC<{ content: string; testID?: string }> = ({ content, testID }) => {\n const colorScheme = useAppColorScheme();\n return (\n <View style={[styles.container, styles.mrzBackground]}>\n <Typography color={colorScheme.text} preset={'s/code'} testID={testID}>\n {content}\n </Typography>\n </View>\n );\n};\n"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AAEA,IAAAO,WAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,mBAAA,GAAAR,OAAA;AAAkE,SAAAS,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAN,wBAAAM,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC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E,CAAC5B,OAAO,EAAEoB,OAAO,EAAED,OAAO,CAAC,CAAC;EAC/B,oBAAO5D,MAAA,CAAAY,OAAA,CAAAyC,aAAA,CAAClD,eAAA,CAAAqD,MAAM;IAACb,MAAM,EAAE,MAAO;IAACC,MAAM,EAAEA,MAAO;IAACF,KAAK,EAAE,MAAO;IAACe,GAAG,EAAEK;EAAU,CAAE,CAAC;AAClF,CAAC;AAACJ,OAAA,CAAAC,MAAA,GAAAA,MAAA;AAEK,MAAMW,GAA6C,GAAGA,CAAC;EAAE7B,OAAO;EAAEG;AAAO,CAAC,KAAK;EACpF,MAAMC,WAAW,GAAG,IAAAC,qCAAiB,EAAC,CAAC;EACvC,oBACE9C,MAAA,CAAAY,OAAA,CAAAyC,aAAA,CAACnD,YAAA,CAAAoD,IAAI;IAACC,KAAK,EAAE,CAAC7B,MAAM,CAACS,SAAS,EAAET,MAAM,CAACY,aAAa;EAAE,gBACpDtC,MAAA,CAAAY,OAAA,CAAAyC,aAAA,CAACjD,WAAA,CAAAQ,OAAU;IAAC2D,KAAK,EAAE1B,WAAW,CAAC2B,IAAK;IAACC,MAAM,EAAE,QAAS;IAAC7B,MAAM,EAAEA;EAAO,GACnEH,OACS,CACR,CAAC;AAEX,CAAC;AAACiB,OAAA,CAAAY,GAAA,GAAAA,GAAA","ignoreList":[]}
|
|
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
+
var _reactNativeReanimated = _interopRequireWildcard(require("react-native-reanimated"));
|
|
10
|
+
var _loader = require("../../ui-components/loader");
|
|
9
11
|
var _utils = require("../../utils");
|
|
10
12
|
var _typography = _interopRequireDefault(require("../text/typography"));
|
|
11
13
|
var _colorSchemeContext = require("../theme/color-scheme-context");
|
|
@@ -23,18 +25,47 @@ const EntityCluster = ({
|
|
|
23
25
|
style,
|
|
24
26
|
sublineColor,
|
|
25
27
|
testID,
|
|
28
|
+
isLoading,
|
|
26
29
|
...viewProps
|
|
27
30
|
}) => {
|
|
28
31
|
const colorScheme = (0, _colorSchemeContext.useAppColorScheme)();
|
|
32
|
+
const opacity = (0, _reactNativeReanimated.useSharedValue)(1);
|
|
33
|
+
const animatedStyle = (0, _reactNativeReanimated.useAnimatedStyle)(() => ({
|
|
34
|
+
opacity: opacity.value
|
|
35
|
+
}));
|
|
36
|
+
(0, _react.useEffect)(() => {
|
|
37
|
+
if (!isLoading) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
opacity.value = (0, _reactNativeReanimated.withRepeat)((0, _reactNativeReanimated.withTiming)(0.3, {
|
|
41
|
+
duration: 1000
|
|
42
|
+
}), 0, true);
|
|
43
|
+
}, [opacity, isLoading]);
|
|
29
44
|
const avatarProps = (0, _react.useMemo)(() => {
|
|
30
45
|
var _avatar$placeholderTe;
|
|
46
|
+
if (isLoading) {
|
|
47
|
+
return {
|
|
48
|
+
avatar: {
|
|
49
|
+
component: /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
50
|
+
style: [styles.loaderWrapper, {
|
|
51
|
+
backgroundColor: colorScheme.grayDark
|
|
52
|
+
}]
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
54
|
+
style: styles.loader
|
|
55
|
+
}, /*#__PURE__*/_react.default.createElement(_loader.LoaderView, {
|
|
56
|
+
animate: true,
|
|
57
|
+
state: _loader.LoaderViewState.InProgress
|
|
58
|
+
})))
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
31
62
|
const initials = entityName.split(' ', 3).map(word => word[0]);
|
|
32
63
|
const placeholderText = initials.length > 0 ? initials.join('') : '';
|
|
33
64
|
return {
|
|
34
65
|
...avatar,
|
|
35
66
|
placeholderText: (_avatar$placeholderTe = avatar === null || avatar === void 0 ? void 0 : avatar.placeholderText) !== null && _avatar$placeholderTe !== void 0 ? _avatar$placeholderTe : placeholderText
|
|
36
67
|
};
|
|
37
|
-
}, [avatar, entityName]);
|
|
68
|
+
}, [avatar, entityName, colorScheme.grayDark, isLoading]);
|
|
38
69
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, _extends({
|
|
39
70
|
style: [styles.entity, style],
|
|
40
71
|
testID: testID
|
|
@@ -42,13 +73,19 @@ const EntityCluster = ({
|
|
|
42
73
|
testID: (0, _utils.concatTestID)(testID, 'avatar')
|
|
43
74
|
}, avatarProps)), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
44
75
|
style: styles.labels
|
|
76
|
+
}, isLoading ? /*#__PURE__*/_react.default.createElement(_reactNativeReanimated.default.View, {
|
|
77
|
+
style: [{
|
|
78
|
+
backgroundColor: colorScheme.grayDark
|
|
79
|
+
}, animatedStyle]
|
|
45
80
|
}, /*#__PURE__*/_react.default.createElement(_typography.default, {
|
|
81
|
+
color: colorScheme.grayDark
|
|
82
|
+
})) : /*#__PURE__*/_react.default.createElement(_typography.default, {
|
|
46
83
|
testID: (0, _utils.concatTestID)(testID, 'entityName'),
|
|
47
84
|
color: textColor !== null && textColor !== void 0 ? textColor : colorScheme.text,
|
|
48
85
|
numberOfLines: 1,
|
|
49
86
|
preset: "m",
|
|
50
87
|
style: styles.entityName
|
|
51
|
-
}, entityName), subline && /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_typography.default, {
|
|
88
|
+
}, !isLoading ? entityName : undefined), subline && /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_typography.default, {
|
|
52
89
|
testID: (0, _utils.concatTestID)(testID, 'subline'),
|
|
53
90
|
color: sublineColor !== null && sublineColor !== void 0 ? sublineColor : colorScheme.text,
|
|
54
91
|
numberOfLines: 1,
|
|
@@ -66,6 +103,17 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
66
103
|
labels: {
|
|
67
104
|
flex: 1,
|
|
68
105
|
marginLeft: 12
|
|
106
|
+
},
|
|
107
|
+
loader: {
|
|
108
|
+
transform: [{
|
|
109
|
+
scale: 0.5
|
|
110
|
+
}]
|
|
111
|
+
},
|
|
112
|
+
loaderWrapper: {
|
|
113
|
+
height: 72,
|
|
114
|
+
paddingLeft: 3,
|
|
115
|
+
paddingTop: 4,
|
|
116
|
+
width: 72
|
|
69
117
|
}
|
|
70
118
|
});
|
|
71
119
|
var _default = exports.default = EntityCluster;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_utils","_typography","_interopRequireDefault","_colorSchemeContext","_avatar","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityCluster","avatar","entityName","subline","textColor","style","sublineColor","testID","viewProps","colorScheme","useAppColorScheme","avatarProps","useMemo","_avatar$placeholderTe","initials","split","map","word","placeholderText","join","createElement","View","styles","entity","concatTestID","labels","color","text","numberOfLines","preset","StyleSheet","create","alignItems","flexDirection","letterSpacing","Platform","OS","flex","marginLeft","_default","exports"],"sources":["entity-cluster.tsx"],"sourcesContent":["import React, { FunctionComponent, useMemo } from 'react';\nimport { Platform, StyleSheet, View, ViewProps } from 'react-native';\n\nimport { concatTestID } from '../../utils';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport Avatar, { AvatarProps } from './avatar';\n\nexport type EntityClusterProps = ViewProps & {\n avatar?: AvatarProps;\n entityName: string;\n subline?: string;\n textColor?: string;\n sublineColor?: string;\n testID?: string;\n};\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25595&mode=design&t=YI1oD2BfBie5HcvJ-0\nconst EntityCluster: FunctionComponent<EntityClusterProps> = ({\n avatar,\n entityName,\n subline,\n textColor,\n style,\n sublineColor,\n testID,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n\n const avatarProps = useMemo<AvatarProps>(() => {\n const initials = entityName.split(' ', 3).map((word: string) => word[0]);\n const placeholderText = initials.length > 0 ? initials.join('') : '';\n return {\n ...avatar,\n placeholderText: avatar?.placeholderText ?? placeholderText,\n };\n }, [avatar, entityName]);\n\n return (\n <View style={[styles.entity, style]} testID={testID} {...viewProps}>\n <Avatar testID={concatTestID(testID, 'avatar')} {...avatarProps} />\n <View style={styles.labels}>\n <Typography\n testID={concatTestID(testID, 'entityName')}\n color={textColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"m\"\n style={styles.entityName}>\n {entityName}\n </Typography>\n {subline && (\n <View>\n <Typography\n testID={concatTestID(testID, 'subline')}\n color={sublineColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"xs\">\n {subline}\n </Typography>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n entity: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n entityName: {\n letterSpacing: Platform.OS === 'ios' ? -0.2 : -0.3, // -0.2 breaks layout on Android\n },\n labels: {\n flex: 1,\n marginLeft: 12,\n },\n});\n\nexport default EntityCluster;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,mBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAF,sBAAA,CAAAJ,OAAA;AAA+C,SAAAI,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAG,yBAAAH,CAAA,6BAAAI,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAD,wBAAA,YAAAA,CAAAH,CAAA,WAAAA,CAA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reList":[]}
|
|
1
|
+
{"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeReanimated","_loader","_utils","_typography","_interopRequireDefault","_colorSchemeContext","_avatar","e","__esModule","default","_getRequireWildcardCache","WeakMap","r","t","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","EntityCluster","avatar","entityName","subline","textColor","style","sublineColor","testID","isLoading","viewProps","colorScheme","useAppColorScheme","opacity","useSharedValue","animatedStyle","useAnimatedStyle","value","useEffect","withRepeat","withTiming","duration","avatarProps","useMemo","_avatar$placeholderTe","component","createElement","View","styles","loaderWrapper","backgroundColor","grayDark","loader","LoaderView","animate","state","LoaderViewState","InProgress","initials","split","map","word","placeholderText","join","entity","concatTestID","labels","color","text","numberOfLines","preset","undefined","StyleSheet","create","alignItems","flexDirection","letterSpacing","Platform","OS","flex","marginLeft","transform","scale","height","paddingLeft","paddingTop","width","_default","exports"],"sources":["entity-cluster.tsx"],"sourcesContent":["import React, { FunctionComponent, useEffect, useMemo } from 'react';\nimport { Platform, StyleSheet, View, ViewProps } from 'react-native';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n withRepeat,\n withTiming,\n} from 'react-native-reanimated';\n\nimport { LoaderView, LoaderViewState } from '../../ui-components/loader';\nimport { concatTestID } from '../../utils';\nimport Typography from '../text/typography';\nimport { useAppColorScheme } from '../theme/color-scheme-context';\nimport Avatar, { AvatarProps } from './avatar';\n\nexport type EntityClusterProps = ViewProps & {\n avatar?: AvatarProps;\n entityName: string;\n subline?: string;\n textColor?: string;\n sublineColor?: string;\n testID?: string;\n isLoading?: boolean;\n};\n\n// https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?type=design&node-id=426-25595&mode=design&t=YI1oD2BfBie5HcvJ-0\nconst EntityCluster: FunctionComponent<EntityClusterProps> = ({\n avatar,\n entityName,\n subline,\n textColor,\n style,\n sublineColor,\n testID,\n isLoading,\n ...viewProps\n}) => {\n const colorScheme = useAppColorScheme();\n \n const opacity = useSharedValue<number>(1);\n\n const animatedStyle = useAnimatedStyle(() => ({\n opacity: opacity.value,\n }));\n\n useEffect(() => {\n if (!isLoading) {\n return;\n }\n opacity.value = withRepeat(\n withTiming(0.3, { duration: 1000 }),\n 0,\n true\n );\n }, [opacity, isLoading]);\n\n const avatarProps = useMemo<AvatarProps>(() => {\n if (isLoading) {\n return {\n avatar: {\n component: \n <View style={[styles.loaderWrapper, { backgroundColor: colorScheme.grayDark }]}>\n <View style={styles.loader}>\n <LoaderView animate={true} state={LoaderViewState.InProgress} />\n </View>\n </View>\n }\n }\n }\n const initials = entityName.split(' ', 3).map((word: string) => word[0]);\n const placeholderText = initials.length > 0 ? initials.join('') : '';\n return {\n ...avatar,\n placeholderText: avatar?.placeholderText ?? placeholderText,\n };\n }, [avatar, entityName, colorScheme.grayDark, isLoading]);\n\n return (\n <View style={[styles.entity, style]} testID={testID} {...viewProps}>\n <Avatar testID={concatTestID(testID, 'avatar')} {...avatarProps} />\n <View style={styles.labels}>\n {isLoading ? (\n <Animated.View style={[{ backgroundColor: colorScheme.grayDark }, animatedStyle]}>\n <Typography color={colorScheme.grayDark} />\n </Animated.View>\n ) : (\n <Typography\n testID={concatTestID(testID, 'entityName')}\n color={textColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"m\"\n style={styles.entityName}>\n {!isLoading ? entityName : undefined}\n </Typography>\n )}\n {subline && (\n <View>\n <Typography\n testID={concatTestID(testID, 'subline')}\n color={sublineColor ?? colorScheme.text}\n numberOfLines={1}\n preset=\"xs\">\n {subline}\n </Typography>\n </View>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n entity: {\n alignItems: 'center',\n flexDirection: 'row',\n },\n entityName: {\n letterSpacing: Platform.OS === 'ios' ? -0.2 : -0.3, // -0.2 breaks layout on Android\n },\n labels: {\n flex: 1,\n marginLeft: 12,\n },\n loader: {\n transform: [{scale: 0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AAS,GAAGN,UAAU,GAAGgD,SACjB,CACb,EACA/C,OAAO,iBACNxC,MAAA,CAAAa,OAAA,CAAAiD,aAAA,CAAC3D,YAAA,CAAA4D,IAAI,qBACH/D,MAAA,CAAAa,OAAA,CAAAiD,aAAA,CAACvD,WAAA,CAAAM,OAAU;IACT+B,MAAM,EAAE,IAAAqC,mBAAY,EAACrC,MAAM,EAAE,SAAS,CAAE;IACxCuC,KAAK,EAAExC,YAAY,aAAZA,YAAY,cAAZA,YAAY,GAAII,WAAW,CAACqC,IAAK;IACxCC,aAAa,EAAE,CAAE;IACjBC,MAAM,EAAC;EAAI,GACV9C,OACS,CACR,CAEJ,CACF,CAAC;AAEX,CAAC;AAED,MAAMwB,MAAM,GAAGwB,uBAAU,CAACC,MAAM,CAAC;EAC/BT,MAAM,EAAE;IACNU,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB,CAAC;EACDpD,UAAU,EAAE;IACVqD,aAAa,EAAEC,qBAAQ,CAACC,EAAE,KAAK,KAAK,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAE;EACtD,CAAC;EACDZ,MAAM,EAAE;IACNa,IAAI,EAAE,CAAC;IACPC,UAAU,EAAE;EACd,CAAC;EACD5B,MAAM,EAAE;IACN6B,SAAS,EAAE,CAAC;MAACC,KAAK,EAAE;IAAG,CAAC;EAC1B,CAAC;EACDjC,aAAa,EAAE;IACbkC,MAAM,EAAE,EAAE;IACVC,WAAW,EAAE,CAAC;IACdC,UAAU,EAAE,CAAC;IACbC,KAAK,EAAE;EACT;AACF,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAA3F,OAAA,GAEYwB,aAAa","ignoreList":[]}
|
|
@@ -9,26 +9,13 @@ Object.defineProperty(exports, "Avatar", {
|
|
|
9
9
|
return _avatar.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "AvatarProps", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _avatar.AvatarProps;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
12
|
Object.defineProperty(exports, "EntityCluster", {
|
|
19
13
|
enumerable: true,
|
|
20
14
|
get: function () {
|
|
21
15
|
return _entityCluster.default;
|
|
22
16
|
}
|
|
23
17
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return _entityCluster.EntityClusterProps;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var _avatar = _interopRequireWildcard(require("./avatar"));
|
|
31
|
-
var _entityCluster = _interopRequireWildcard(require("./entity-cluster"));
|
|
32
|
-
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); }
|
|
33
|
-
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; }
|
|
18
|
+
var _avatar = _interopRequireDefault(require("./avatar"));
|
|
19
|
+
var _entityCluster = _interopRequireDefault(require("./entity-cluster"));
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
34
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_avatar","
|
|
1
|
+
{"version":3,"names":["_avatar","_interopRequireDefault","require","_entityCluster","e","__esModule","default"],"sources":["index.ts"],"sourcesContent":["import type { AvatarProps } from './avatar';\nimport Avatar from './avatar';\nimport type { EntityClusterProps } from './entity-cluster';\nimport EntityCluster from './entity-cluster';\n\nexport { Avatar, AvatarProps };\nexport { EntityCluster, EntityClusterProps };\n"],"mappings":";;;;;;;;;;;;;;;;;AACA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,cAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA6C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA","ignoreList":[]}
|
|
@@ -132,7 +132,7 @@ const HistoryDetailsView = ({
|
|
|
132
132
|
...props.credentialCard,
|
|
133
133
|
card: {
|
|
134
134
|
...props.credentialCard.card,
|
|
135
|
-
onHeaderPress
|
|
135
|
+
onHeaderPress: props.credentialCard.headerPressable === false ? undefined : onHeaderPress
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
138
|
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|