@wavemaker/rn-codegen 11.13.0-rc.6255 → 11.14.0-rc.232

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,60 +0,0 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
- import * as React from 'react';
3
- import { Platform, Pressable, StyleSheet } from 'react-native';
4
- import Animated, { useAnimatedProps, useAnimatedStyle } from 'react-native-reanimated';
5
- const PROGRESS_EPSILON = 0.05;
6
- const Overlay = /*#__PURE__*/React.forwardRef(function Overlay(_ref, ref) {
7
- let {
8
- progress,
9
- onPress,
10
- style,
11
- accessibilityLabel = 'Close drawer',
12
- ...props
13
- } = _ref;
14
- const animatedStyle = useAnimatedStyle(() => {
15
- return {
16
- opacity: progress.value,
17
- // We don't want the user to be able to press through the overlay when drawer is open
18
- // We can send the overlay behind the screen to avoid it
19
- zIndex: progress.value > PROGRESS_EPSILON ? 0 : -1
20
- };
21
- }, [progress, PROGRESS_EPSILON]);
22
- const animatedProps = useAnimatedProps(() => {
23
- const active = progress.value > PROGRESS_EPSILON;
24
- return {
25
- pointerEvents: active ? 'auto' : 'none',
26
- accessibilityElementsHidden: !active,
27
- importantForAccessibility: active ? 'auto' : 'no-hide-descendants'
28
- };
29
- }, [progress, PROGRESS_EPSILON]);
30
- return /*#__PURE__*/React.createElement(Animated.View, _extends({}, props, {
31
- ref: ref,
32
- style: [styles.overlay, overlayStyle, animatedStyle, style],
33
- animatedProps: animatedProps
34
- }), /*#__PURE__*/React.createElement(Pressable, {
35
- onPress: onPress,
36
- style: styles.pressable,
37
- accessibilityRole: "button",
38
- accessibilityLabel: accessibilityLabel
39
- }));
40
- });
41
- const overlayStyle = Platform.select({
42
- web: {
43
- // Disable touch highlight on mobile Safari.
44
- // WebkitTapHighlightColor must be used outside of StyleSheet.create because react-native-web will omit the property.
45
- WebkitTapHighlightColor: 'transparent'
46
- },
47
- default: {}
48
- });
49
- const styles = StyleSheet.create({
50
- overlay: {
51
- ...StyleSheet.absoluteFillObject,
52
- backgroundColor: 'rgba(0, 0, 0, 0.5)'
53
- },
54
- pressable: {
55
- flex: 1,
56
- pointerEvents: 'auto'
57
- }
58
- });
59
- export default Overlay;
60
- //# sourceMappingURL=Overlay.js.map