react-native-ui-lib 7.38.1-snapshot.6312 → 7.38.1-snapshot.6314
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/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
{
|
|
13
13
|
"name": "animate",
|
|
14
14
|
"type": "boolean",
|
|
15
|
-
"description": "Adds fade in animation when Avatar image loads",
|
|
15
|
+
"description": "Adds fade in animation when Avatar image loads. This prop isn't supported on web (will be set to false by default when using web).",
|
|
16
16
|
"default": "false"
|
|
17
17
|
},
|
|
18
18
|
{"name": "backgroundColor", "type": "string", "description": "Background color for Avatar"},
|
|
@@ -162,29 +162,30 @@ declare const Avatar: React.ForwardRefExoticComponent<Pick<AccessibilityProps, "
|
|
|
162
162
|
* Image props object
|
|
163
163
|
*/
|
|
164
164
|
imageProps?: Partial<Omit<import("react-native").ImageProps, "source"> & Pick<import("react-native").ImageBackgroundProps, "imageStyle"> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & import("../..").RecorderProps & {
|
|
165
|
+
/**
|
|
166
|
+
* Avatar colors to be used when useAutoColors is true
|
|
167
|
+
*/
|
|
165
168
|
sourceTransformer?: ((props: any) => import("../image").ImageSourceType) | undefined;
|
|
166
169
|
assetName?: string | undefined;
|
|
167
170
|
assetGroup?: string | undefined;
|
|
168
171
|
tintColor?: string | undefined;
|
|
169
|
-
supportRTL?: boolean | undefined;
|
|
172
|
+
supportRTL?: boolean | undefined; /**
|
|
173
|
+
* Background color for Avatar
|
|
174
|
+
*/
|
|
170
175
|
cover?: boolean | undefined;
|
|
171
176
|
aspectRatio?: number | undefined;
|
|
172
|
-
overlayType?: string | undefined;
|
|
177
|
+
overlayType?: string | undefined; /**
|
|
178
|
+
* Image props object
|
|
179
|
+
*/
|
|
173
180
|
overlayIntensity?: import("../overlay").OverlayIntensityType | undefined;
|
|
174
181
|
overlayColor?: string | undefined;
|
|
175
182
|
customOverlayContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
176
183
|
errorSource?: import("../image").ImageSourceType;
|
|
177
|
-
imageId?: string | undefined;
|
|
178
|
-
* Listener-callback for when an image's (uri) loading
|
|
179
|
-
* fails (equiv. to Image.onError()).
|
|
180
|
-
*/
|
|
184
|
+
imageId?: string | undefined;
|
|
181
185
|
useBackgroundContainer?: boolean | undefined;
|
|
182
186
|
width?: string | number | undefined;
|
|
183
187
|
height?: string | number | undefined;
|
|
184
|
-
source: import("../image").ImageSourceType;
|
|
185
|
-
* Hash the name (or label) to get a color, so each name will have a specific color.
|
|
186
|
-
* Default is false.
|
|
187
|
-
*/
|
|
188
|
+
source: import("../image").ImageSourceType;
|
|
188
189
|
} & AnimatedImageProps> | undefined;
|
|
189
190
|
/**
|
|
190
191
|
* Image style object used to pass additional style props
|
|
@@ -290,29 +291,30 @@ declare const _default: React.ForwardRefExoticComponent<Pick<AccessibilityProps,
|
|
|
290
291
|
* Image props object
|
|
291
292
|
*/
|
|
292
293
|
imageProps?: Partial<Omit<import("react-native").ImageProps, "source"> & Pick<import("react-native").ImageBackgroundProps, "imageStyle"> & Partial<Record<"margin" | "marginL" | "marginT" | "marginR" | "marginB" | "marginH" | "marginV", boolean>> & import("../..").RecorderProps & {
|
|
294
|
+
/**
|
|
295
|
+
* Avatar colors to be used when useAutoColors is true
|
|
296
|
+
*/
|
|
293
297
|
sourceTransformer?: ((props: any) => import("../image").ImageSourceType) | undefined;
|
|
294
298
|
assetName?: string | undefined;
|
|
295
299
|
assetGroup?: string | undefined;
|
|
296
300
|
tintColor?: string | undefined;
|
|
297
|
-
supportRTL?: boolean | undefined;
|
|
301
|
+
supportRTL?: boolean | undefined; /**
|
|
302
|
+
* Background color for Avatar
|
|
303
|
+
*/
|
|
298
304
|
cover?: boolean | undefined;
|
|
299
305
|
aspectRatio?: number | undefined;
|
|
300
|
-
overlayType?: string | undefined;
|
|
306
|
+
overlayType?: string | undefined; /**
|
|
307
|
+
* Image props object
|
|
308
|
+
*/
|
|
301
309
|
overlayIntensity?: import("../overlay").OverlayIntensityType | undefined;
|
|
302
310
|
overlayColor?: string | undefined;
|
|
303
311
|
customOverlayContent?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ReactElement<any, string | React.JSXElementConstructor<any>>[] | undefined;
|
|
304
312
|
errorSource?: import("../image").ImageSourceType;
|
|
305
|
-
imageId?: string | undefined;
|
|
306
|
-
* Listener-callback for when an image's (uri) loading
|
|
307
|
-
* fails (equiv. to Image.onError()).
|
|
308
|
-
*/
|
|
313
|
+
imageId?: string | undefined;
|
|
309
314
|
useBackgroundContainer?: boolean | undefined;
|
|
310
315
|
width?: string | number | undefined;
|
|
311
316
|
height?: string | number | undefined;
|
|
312
|
-
source: import("../image").ImageSourceType;
|
|
313
|
-
* Hash the name (or label) to get a color, so each name will have a specific color.
|
|
314
|
-
* Default is false.
|
|
315
|
-
*/
|
|
317
|
+
source: import("../image").ImageSourceType;
|
|
316
318
|
} & AnimatedImageProps> | undefined;
|
|
317
319
|
/**
|
|
318
320
|
* Image style object used to pass additional style props
|
|
@@ -16,6 +16,7 @@ import AnimatedImage from "../animatedImage";
|
|
|
16
16
|
import * as AvatarHelper from "../../helpers/AvatarHelper";
|
|
17
17
|
import { useThemeProps } from "../../hooks";
|
|
18
18
|
import { isSvg } from "../../utils/imageUtils";
|
|
19
|
+
import Constants from "../../commons/Constants";
|
|
19
20
|
export let BadgePosition = /*#__PURE__*/function (BadgePosition) {
|
|
20
21
|
BadgePosition["TOP_RIGHT"] = "TOP_RIGHT";
|
|
21
22
|
BadgePosition["TOP_LEFT"] = "TOP_LEFT";
|
|
@@ -149,7 +150,7 @@ const Avatar = forwardRef((props, ref) => {
|
|
|
149
150
|
const renderImage = () => {
|
|
150
151
|
if (source !== undefined) {
|
|
151
152
|
// Looks like reanimated does not support SVG
|
|
152
|
-
const ImageContainer = animate && !isSvg(source) ? AnimatedImage : Image;
|
|
153
|
+
const ImageContainer = animate && !isSvg(source) && !Constants.isWeb ? AnimatedImage : Image;
|
|
153
154
|
return <ImageContainer style={_imageStyle} source={source} onLoadStart={onImageLoadStart} onLoadEnd={onImageLoadEnd} onError={onImageLoadError} testID={`${testID}.image`} width={size} height={size} containerStyle={_baseContainerStyle} {...imageProps} />;
|
|
154
155
|
}
|
|
155
156
|
};
|