react-native-ui-lib 7.46.3-snapshot.7370 → 7.46.3-snapshot.7383
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/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-ui-lib",
|
|
3
|
-
"version": "7.46.3-snapshot.
|
|
3
|
+
"version": "7.46.3-snapshot.7383",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"types": "src/index.d.ts",
|
|
6
6
|
"author": "Ethan Sharabi <ethan.shar@gmail.com>",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"url": "https://github.com/wix/react-native-ui-lib"
|
|
15
15
|
},
|
|
16
16
|
"scripts": {
|
|
17
|
-
"start": "watchman watch-del-all && react-native start",
|
|
17
|
+
"start": "watchman watch-del-all && react-native start --client-logs",
|
|
18
18
|
"start:web": "npm --prefix webDemo run start",
|
|
19
19
|
"ios": "react-native run-ios",
|
|
20
20
|
"android": "react-native run-android",
|
|
@@ -56,7 +56,6 @@
|
|
|
56
56
|
"react-native-redash": "^12.0.3",
|
|
57
57
|
"semver": "^5.5.0",
|
|
58
58
|
"tinycolor2": "^1.4.2",
|
|
59
|
-
"uilib-native": "5.0.0-snapshot.7358",
|
|
60
59
|
"url-parse": "^1.2.0",
|
|
61
60
|
"wix-react-native-text-size": "1.0.9"
|
|
62
61
|
},
|
|
@@ -129,14 +128,16 @@
|
|
|
129
128
|
"reassure": "^0.4.1",
|
|
130
129
|
"setimmediate": "^1.0.5",
|
|
131
130
|
"shell-utils": "^1.0.10",
|
|
132
|
-
"typescript": "5.0.4"
|
|
131
|
+
"typescript": "5.0.4",
|
|
132
|
+
"uilib-native": "5.0.0-snapshot.7358"
|
|
133
133
|
},
|
|
134
134
|
"peerDependencies": {
|
|
135
135
|
"react": ">=18.3.1",
|
|
136
136
|
"react-native": ">=0.77.3",
|
|
137
137
|
"react-native-gesture-handler": ">=2.24.0",
|
|
138
138
|
"react-native-reanimated": ">=3.17.5",
|
|
139
|
-
"react-native-ui-lib": "*"
|
|
139
|
+
"react-native-ui-lib": "*",
|
|
140
|
+
"uilib-native": "5.0.0-snapshot.7358"
|
|
140
141
|
},
|
|
141
142
|
"jest": {
|
|
142
143
|
"preset": "react-native",
|
|
@@ -5,6 +5,7 @@ import Animated, { useSharedValue, useAnimatedStyle, withTiming } from 'react-na
|
|
|
5
5
|
import View from "../../components/view";
|
|
6
6
|
import Image from "../../components/image";
|
|
7
7
|
import { useDidUpdate } from "../../hooks";
|
|
8
|
+
import Constants from "../../commons/Constants";
|
|
8
9
|
const UIAnimatedImage = Animated.createAnimatedComponent(Image);
|
|
9
10
|
/**
|
|
10
11
|
* @description: Image component that fades-in the image with animation once it's loaded
|
|
@@ -32,8 +33,10 @@ const AnimatedImage = props => {
|
|
|
32
33
|
}
|
|
33
34
|
}, [loader]);
|
|
34
35
|
useEffect(() => {
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
if (Constants.isIOS) {
|
|
37
|
+
setIsLoading(true);
|
|
38
|
+
propsOnLoadStart?.();
|
|
39
|
+
}
|
|
37
40
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
38
41
|
}, [source]);
|
|
39
42
|
const onLoad = useCallback(event => {
|
|
@@ -49,12 +52,11 @@ const AnimatedImage = props => {
|
|
|
49
52
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
50
53
|
[setIsLoading, propsOnLoad, animationDuration]);
|
|
51
54
|
|
|
52
|
-
// TODO: revert to this solution when iOS is fixed
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
// TODO: RN 77 - revert to this solution when iOS is fixed in future RN releases
|
|
56
|
+
const onLoadStart = useCallback(() => {
|
|
57
|
+
setIsLoading(true);
|
|
58
|
+
propsOnLoadStart?.();
|
|
59
|
+
}, [setIsLoading, propsOnLoadStart, animationDuration]);
|
|
58
60
|
const fadeInStyle = useAnimatedStyle(() => {
|
|
59
61
|
return {
|
|
60
62
|
opacity: opacity.value
|
|
@@ -64,9 +66,7 @@ const AnimatedImage = props => {
|
|
|
64
66
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
67
|
const _style = useMemo(() => [style, fadeInStyle], [style]);
|
|
66
68
|
return <View style={containerStyle}>
|
|
67
|
-
<UIAnimatedImage {...others} style={_style} source={source} onLoad={onLoad}
|
|
68
|
-
// onLoadStart={onLoadStart}
|
|
69
|
-
testID={testID} imageStyle={undefined} />
|
|
69
|
+
<UIAnimatedImage {...others} style={_style} source={source} onLoad={onLoad} onLoadStart={Constants.isAndroid ? onLoadStart : undefined} testID={testID} imageStyle={undefined} />
|
|
70
70
|
{isLoading && loader && <View style={styles.loader}>{loader}</View>}
|
|
71
71
|
</View>;
|
|
72
72
|
};
|
|
@@ -95,6 +95,10 @@ class Image extends PureComponent {
|
|
|
95
95
|
};
|
|
96
96
|
onError = event => {
|
|
97
97
|
if (event.nativeEvent.error) {
|
|
98
|
+
// TODO: RN 77 hack - test in future releases (ticket 4835)
|
|
99
|
+
if (Constants.isIOS && this.props.source === undefined) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
98
102
|
this.setState({
|
|
99
103
|
error: true
|
|
100
104
|
});
|