@hero-design/rn 8.78.0 → 8.78.1
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/.turbo/turbo-build.log +2 -2
- package/CHANGELOG.md +6 -0
- package/es/index.js +14 -12
- package/lib/index.js +14 -12
- package/package.json +1 -1
- package/src/components/BottomSheet/index.tsx +13 -14
- package/stats/8.78.1/rn-stats.html +4842 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
(node:
|
|
1
|
+
(node:2844) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
2
2
|
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
3
|
[36m
|
|
4
4
|
[1msrc/index.ts[22m → [1mlib/index.js, es/index.js[22m...[39m
|
|
5
5
|
[1m[33m(!) [plugin replace] @rollup/plugin-replace: 'preventAssignment' currently defaults to false. It is recommended to set this option to `true`, as the next major version will default this option to `true`.[39m[22m
|
|
6
6
|
[1m[33m(!) [plugin node-resolve] preferring built-in module 'events' over local alternative at '/home/runner/work/hero-design/hero-design/node_modules/events/events.js', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.[39m[22m
|
|
7
|
-
[32mcreated [1mlib/index.js, es/index.js[22m in [1m50.
|
|
7
|
+
[32mcreated [1mlib/index.js, es/index.js[22m in [1m50.4s[22m[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @hero-design/rn
|
|
2
2
|
|
|
3
|
+
## 8.78.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3487](https://github.com/Thinkei/hero-design/pull/3487) [`5bcbcf14116726514e58aef14c9f7758cd8d1683`](https://github.com/Thinkei/hero-design/commit/5bcbcf14116726514e58aef14c9f7758cd8d1683) Thanks [@vinhphan-eh](https://github.com/vinhphan-eh)! - [BottomSheet] Add missing dependencies
|
|
8
|
+
|
|
3
9
|
## 8.78.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/es/index.js
CHANGED
|
@@ -9718,16 +9718,24 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
9718
9718
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
9719
9719
|
internalShowDivider = _useState4[0],
|
|
9720
9720
|
setInternalShowDivider = _useState4[1];
|
|
9721
|
-
var canCallOnDismiss = useRef(false);
|
|
9722
9721
|
useEffect(function () {
|
|
9723
|
-
// Prevent calling onDismiss when the component has not yet opened
|
|
9724
|
-
if (open && !canCallOnDismiss.current) {
|
|
9725
|
-
canCallOnDismiss.current = true;
|
|
9726
|
-
}
|
|
9727
9722
|
// Show the modal before the open animation start
|
|
9728
9723
|
if (open && !visible) {
|
|
9729
9724
|
setVisibility(open);
|
|
9730
9725
|
}
|
|
9726
|
+
// Delay closing the modal until after the closing animation end
|
|
9727
|
+
animatedValue.current.removeAllListeners();
|
|
9728
|
+
animatedValue.current.addListener(function (_ref2) {
|
|
9729
|
+
var value = _ref2.value;
|
|
9730
|
+
var endValueOfTransition = open ? 1 : 0;
|
|
9731
|
+
if (endValueOfTransition === 0 && value === endValueOfTransition) {
|
|
9732
|
+
setVisibility(false);
|
|
9733
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
9734
|
+
}
|
|
9735
|
+
});
|
|
9736
|
+
return function () {
|
|
9737
|
+
return animatedValue.current.removeAllListeners();
|
|
9738
|
+
};
|
|
9731
9739
|
}, [open]);
|
|
9732
9740
|
// Animation
|
|
9733
9741
|
useEffect(function () {
|
|
@@ -9736,13 +9744,7 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
9736
9744
|
easing: Easing.inOut(Easing.cubic),
|
|
9737
9745
|
useNativeDriver: true
|
|
9738
9746
|
});
|
|
9739
|
-
animation.start(
|
|
9740
|
-
if (!open && canCallOnDismiss.current) {
|
|
9741
|
-
setVisibility(false);
|
|
9742
|
-
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
9743
|
-
}
|
|
9744
|
-
onAnimationEnd === null || onAnimationEnd === void 0 || onAnimationEnd();
|
|
9745
|
-
});
|
|
9747
|
+
animation.start(onAnimationEnd);
|
|
9746
9748
|
return function () {
|
|
9747
9749
|
return animation.stop();
|
|
9748
9750
|
};
|
package/lib/index.js
CHANGED
|
@@ -9745,16 +9745,24 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
9745
9745
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
9746
9746
|
internalShowDivider = _useState4[0],
|
|
9747
9747
|
setInternalShowDivider = _useState4[1];
|
|
9748
|
-
var canCallOnDismiss = React.useRef(false);
|
|
9749
9748
|
React.useEffect(function () {
|
|
9750
|
-
// Prevent calling onDismiss when the component has not yet opened
|
|
9751
|
-
if (open && !canCallOnDismiss.current) {
|
|
9752
|
-
canCallOnDismiss.current = true;
|
|
9753
|
-
}
|
|
9754
9749
|
// Show the modal before the open animation start
|
|
9755
9750
|
if (open && !visible) {
|
|
9756
9751
|
setVisibility(open);
|
|
9757
9752
|
}
|
|
9753
|
+
// Delay closing the modal until after the closing animation end
|
|
9754
|
+
animatedValue.current.removeAllListeners();
|
|
9755
|
+
animatedValue.current.addListener(function (_ref2) {
|
|
9756
|
+
var value = _ref2.value;
|
|
9757
|
+
var endValueOfTransition = open ? 1 : 0;
|
|
9758
|
+
if (endValueOfTransition === 0 && value === endValueOfTransition) {
|
|
9759
|
+
setVisibility(false);
|
|
9760
|
+
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
9761
|
+
}
|
|
9762
|
+
});
|
|
9763
|
+
return function () {
|
|
9764
|
+
return animatedValue.current.removeAllListeners();
|
|
9765
|
+
};
|
|
9758
9766
|
}, [open]);
|
|
9759
9767
|
// Animation
|
|
9760
9768
|
React.useEffect(function () {
|
|
@@ -9763,13 +9771,7 @@ var BottomSheet = function BottomSheet(_ref) {
|
|
|
9763
9771
|
easing: reactNative.Easing.inOut(reactNative.Easing.cubic),
|
|
9764
9772
|
useNativeDriver: true
|
|
9765
9773
|
});
|
|
9766
|
-
animation.start(
|
|
9767
|
-
if (!open && canCallOnDismiss.current) {
|
|
9768
|
-
setVisibility(false);
|
|
9769
|
-
onDismiss === null || onDismiss === void 0 || onDismiss();
|
|
9770
|
-
}
|
|
9771
|
-
onAnimationEnd === null || onAnimationEnd === void 0 || onAnimationEnd();
|
|
9772
|
-
});
|
|
9774
|
+
animation.start(onAnimationEnd);
|
|
9773
9775
|
return function () {
|
|
9774
9776
|
return animation.stop();
|
|
9775
9777
|
};
|
package/package.json
CHANGED
|
@@ -115,18 +115,24 @@ const BottomSheet = ({
|
|
|
115
115
|
const animatedValue = useRef(new Animated.Value(open ? 0 : 1));
|
|
116
116
|
const [internalShowDivider, setInternalShowDivider] =
|
|
117
117
|
useState<boolean>(showDivider);
|
|
118
|
-
const canCallOnDismiss = useRef(false);
|
|
119
118
|
|
|
120
119
|
useEffect(() => {
|
|
121
|
-
// Prevent calling onDismiss when the component has not yet opened
|
|
122
|
-
if (open && !canCallOnDismiss.current) {
|
|
123
|
-
canCallOnDismiss.current = true;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
120
|
// Show the modal before the open animation start
|
|
127
121
|
if (open && !visible) {
|
|
128
122
|
setVisibility(open);
|
|
129
123
|
}
|
|
124
|
+
|
|
125
|
+
// Delay closing the modal until after the closing animation end
|
|
126
|
+
animatedValue.current.removeAllListeners();
|
|
127
|
+
animatedValue.current.addListener(({ value }) => {
|
|
128
|
+
const endValueOfTransition = open ? 1 : 0;
|
|
129
|
+
if (endValueOfTransition === 0 && value === endValueOfTransition) {
|
|
130
|
+
setVisibility(false);
|
|
131
|
+
onDismiss?.();
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
return () => animatedValue.current.removeAllListeners();
|
|
130
136
|
}, [open]);
|
|
131
137
|
|
|
132
138
|
// Animation
|
|
@@ -137,14 +143,7 @@ const BottomSheet = ({
|
|
|
137
143
|
useNativeDriver: true,
|
|
138
144
|
});
|
|
139
145
|
|
|
140
|
-
animation.start(
|
|
141
|
-
if (!open && canCallOnDismiss.current) {
|
|
142
|
-
setVisibility(false);
|
|
143
|
-
onDismiss?.();
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
onAnimationEnd?.();
|
|
147
|
-
});
|
|
146
|
+
animation.start(onAnimationEnd);
|
|
148
147
|
|
|
149
148
|
return () => animation.stop();
|
|
150
149
|
}, [open]);
|