@cleartrip/ct-design-image 5.24.0-SNAPSHOT-native-main.57 → 5.24.0-SNAPSHOT-native-main.59
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.native.d.ts","sourceRoot":"","sources":["../packages/components/Image/src/Image.native.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAqBrC,QAAA,MAAM,KAAK;2HAaR,WAAW;;
|
|
1
|
+
{"version":3,"file":"Image.native.d.ts","sourceRoot":"","sources":["../packages/components/Image/src/Image.native.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAqBrC,QAAA,MAAM,KAAK;2HAaR,WAAW;;CAgGb,CAAC;AAIF,eAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cleartrip/ct-design-image",
|
|
3
|
-
"version": "5.24.0-SNAPSHOT-native-main.
|
|
3
|
+
"version": "5.24.0-SNAPSHOT-native-main.59",
|
|
4
4
|
"description": "Image component — web <img>/custom component, native FastImage + SvgUri.",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "./dist/ct-design-image.cjs.js",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@cleartrip/ct-design-conditional-wrap": "5.24.0-SNAPSHOT-native-main.
|
|
28
|
-
"@cleartrip/ct-design-event-propagation": "5.24.0-SNAPSHOT-native-main.
|
|
29
|
-
"@cleartrip/ct-design-style-manager": "5.24.0-SNAPSHOT-native-main.
|
|
30
|
-
"@cleartrip/ct-design-
|
|
31
|
-
"@cleartrip/ct-design-
|
|
27
|
+
"@cleartrip/ct-design-conditional-wrap": "5.24.0-SNAPSHOT-native-main.59",
|
|
28
|
+
"@cleartrip/ct-design-event-propagation": "5.24.0-SNAPSHOT-native-main.59",
|
|
29
|
+
"@cleartrip/ct-design-style-manager": "5.24.0-SNAPSHOT-native-main.59",
|
|
30
|
+
"@cleartrip/ct-design-common-utils": "5.24.0-SNAPSHOT-native-main.59",
|
|
31
|
+
"@cleartrip/ct-design-theme": "5.24.0-SNAPSHOT-native-main.59"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"next": "16.3.0",
|
|
35
|
-
"@cleartrip/ct-design-types": "5.24.0-SNAPSHOT-native-main.
|
|
35
|
+
"@cleartrip/ct-design-types": "5.24.0-SNAPSHOT-native-main.59"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"react": ">=16.8.0",
|
package/src/Image.native.tsx
CHANGED
|
@@ -47,6 +47,8 @@ const Image = ({
|
|
|
47
47
|
});
|
|
48
48
|
const { root: customRootStyles = [] } = styleConfig || {};
|
|
49
49
|
|
|
50
|
+
const rootTestID = testID ? `${testID}-Image` : undefined;
|
|
51
|
+
|
|
50
52
|
const aspectRatio = customRootStyles.find((style) => style.aspectRatio);
|
|
51
53
|
|
|
52
54
|
const nodeElement = useRef<number | null>(null);
|
|
@@ -81,7 +83,7 @@ const Image = ({
|
|
|
81
83
|
|
|
82
84
|
// `.svg` URLs go through react-native-svg — FastImage can't decode them.
|
|
83
85
|
if (isSvg(src)) {
|
|
84
|
-
return <SvgUri testID={
|
|
86
|
+
return <SvgUri testID={rootTestID} width={width || 0} height={height || 0} uri={src} style={mergedImageStyles} />;
|
|
85
87
|
}
|
|
86
88
|
|
|
87
89
|
const onImageError = () => {
|
|
@@ -105,7 +107,7 @@ const Image = ({
|
|
|
105
107
|
const imageElement = (
|
|
106
108
|
<FastImage
|
|
107
109
|
// When pressable, the wrapping Pressable owns the testID so queries resolve to a single node.
|
|
108
|
-
testID={onClick ? undefined :
|
|
110
|
+
testID={onClick ? undefined : rootTestID}
|
|
109
111
|
source={imageSource}
|
|
110
112
|
style={mergedImageStyles as FastImageStyle}
|
|
111
113
|
accessibilityLabel={alt}
|
|
@@ -122,7 +124,7 @@ const Image = ({
|
|
|
122
124
|
return (
|
|
123
125
|
<EventCollectorProvider value={mergedEvents}>
|
|
124
126
|
<Pressable
|
|
125
|
-
testID={
|
|
127
|
+
testID={rootTestID}
|
|
126
128
|
ref={(ref) => {
|
|
127
129
|
if (isIOS()) {
|
|
128
130
|
nodeElement.current = findNodeHandle(ref);
|