react-native-toast-message 2.1.0 → 2.1.3
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/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,24 @@ Headers are one of:
|
|
|
9
9
|
|
|
10
10
|
- `Added`, `Changed`, `Removed`, `Fixed` or `Breaking`.
|
|
11
11
|
|
|
12
|
+
## [2.1.3]
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- chore(deps): bump minimist from 1.2.5 to 1.2.6 by [dependabot](https://github.com/dependabot) in [#338](https://github.com/calintamas/react-native-toast-message/pull/338)
|
|
17
|
+
|
|
18
|
+
## [2.1.2]
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- Fixes `useNativeDriver` warning on web by [jpaas](https://github.com/jpaas) in [#334](https://github.com/calintamas/react-native-toast-message/pull/334)
|
|
23
|
+
|
|
24
|
+
## [2.1.1]
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- Tapping a View / Button behind the Toast is not possible ([b9d191e](https://github.com/calintamas/react-native-toast-message/commit/b9d191e1dcc4d331fd5159ca9aabd54d7d0ecb97)) (fixes [#282](https://github.com/calintamas/react-native-toast-message/issues/282))
|
|
29
|
+
|
|
12
30
|
## [2.1.0]
|
|
13
31
|
|
|
14
32
|
### Fixed
|
|
@@ -16,7 +34,7 @@ Headers are one of:
|
|
|
16
34
|
- After a Toast is shown within a Modal, the main instance outside of Modal doesn't work anymore ([#293](https://github.com/calintamas/react-native-toast-message/pull/293))
|
|
17
35
|
- A previously set timer is not cleared when `autoHide` changes from `true` to `false`. This can make a newly shown Toast auto hide (even if it was shown with `autoHide: false`) ([#294](https://github.com/calintamas/react-native-toast-message/pull/294))
|
|
18
36
|
|
|
19
|
-
Big thanks go to [jstheoriginal](https://github.com/jstheoriginal) for all the work on fixing two issues above 🙌.
|
|
37
|
+
Big thanks go to [jstheoriginal](https://github.com/jstheoriginal) for all the work on fixing the two issues above 🙌.
|
|
20
38
|
|
|
21
39
|
- Flexbox not working for setting Toast width or alignment ([3400f00](https://github.com/calintamas/react-native-toast-message/commit/3400f0074116f5acb37ca2eb696ea50b0c669ddc))
|
|
22
40
|
|
|
@@ -72,7 +72,10 @@ export function AnimatedContainer({ children, isVisible, position, topOffset, bo
|
|
|
72
72
|
const newAnimationValue = isVisible ? 1 : 0;
|
|
73
73
|
animate(newAnimationValue);
|
|
74
74
|
}, [animate, isVisible]);
|
|
75
|
-
return (<Animated.View testID={getTestId('AnimatedContainer')} onLayout={computeViewDimensions} style={[styles.base, styles[position], animationStyles]}
|
|
75
|
+
return (<Animated.View testID={getTestId('AnimatedContainer')} onLayout={computeViewDimensions} style={[styles.base, styles[position], animationStyles]}
|
|
76
|
+
// This container View is never the target of touch events but its subviews can be.
|
|
77
|
+
// By doing this, tapping buttons behind the Toast is allowed
|
|
78
|
+
pointerEvents='box-none' {...panResponder.panHandlers}>
|
|
76
79
|
{children}
|
|
77
80
|
</Animated.View>);
|
|
78
81
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Animated } from 'react-native';
|
|
2
|
+
import { Animated, Platform } from 'react-native';
|
|
3
3
|
import { additiveInverseArray } from '../utils/array';
|
|
4
4
|
import { useKeyboard } from './useKeyboard';
|
|
5
5
|
export function translateYOutputRangeFor({ position, height, topOffset, bottomOffset, keyboardHeight, keyboardOffset }) {
|
|
@@ -9,13 +9,14 @@ export function translateYOutputRangeFor({ position, height, topOffset, bottomOf
|
|
|
9
9
|
const outputRange = position === 'bottom' ? additiveInverseArray(range) : range;
|
|
10
10
|
return outputRange;
|
|
11
11
|
}
|
|
12
|
+
const useNativeDriver = Platform.select({ native: true, default: false });
|
|
12
13
|
export function useSlideAnimation({ position, height, topOffset, bottomOffset, keyboardOffset }) {
|
|
13
14
|
const animatedValue = React.useRef(new Animated.Value(0));
|
|
14
15
|
const { keyboardHeight } = useKeyboard();
|
|
15
16
|
const animate = React.useCallback((toValue) => {
|
|
16
17
|
Animated.spring(animatedValue.current, {
|
|
17
18
|
toValue,
|
|
18
|
-
useNativeDriver
|
|
19
|
+
useNativeDriver,
|
|
19
20
|
friction: 8
|
|
20
21
|
}).start();
|
|
21
22
|
}, []);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-toast-message",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Toast message component for React Native",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"@babel/core": "^7.15.8",
|
|
32
32
|
"@testing-library/jest-native": "^4.0.4",
|
|
33
33
|
"@testing-library/react-hooks": "^7.0.2",
|
|
34
|
-
"@testing-library/react-native": "^
|
|
34
|
+
"@testing-library/react-native": "^9.0.0",
|
|
35
35
|
"@types/jest": "^27.0.1",
|
|
36
|
-
"@types/react-native": "^0.
|
|
37
|
-
"eslint-config-backpacker-react-ts": "^0.
|
|
36
|
+
"@types/react-native": "^0.67.3",
|
|
37
|
+
"eslint-config-backpacker-react-ts": "^0.3.0",
|
|
38
38
|
"husky": "^7.0.2",
|
|
39
39
|
"import-sort-style-module": "^6.0.0",
|
|
40
40
|
"jest": "^27.1.1",
|
|
41
41
|
"lint-staged": "^12.1.2",
|
|
42
|
-
"metro-react-native-babel-preset": "^0.
|
|
42
|
+
"metro-react-native-babel-preset": "^0.69.0",
|
|
43
43
|
"prettier": "^2.4.1",
|
|
44
44
|
"prettier-plugin-import-sort": "^0.0.7",
|
|
45
45
|
"react-test-renderer": "^17.0.2",
|