@react-navigation/drawer 6.6.2 → 7.0.0-alpha.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/lib/commonjs/index.js +24 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigators/createDrawerNavigator.js +8 -49
- package/lib/commonjs/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/commonjs/utils/DrawerPositionContext.js +3 -3
- package/lib/commonjs/utils/DrawerPositionContext.js.map +1 -1
- package/lib/commonjs/utils/DrawerStatusContext.js +2 -3
- package/lib/commonjs/utils/DrawerStatusContext.js.map +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js +1 -1
- package/lib/commonjs/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/commonjs/utils/useDrawerStatus.js +3 -4
- package/lib/commonjs/utils/useDrawerStatus.js.map +1 -1
- package/lib/commonjs/views/DrawerContent.js +5 -6
- package/lib/commonjs/views/DrawerContent.js.map +1 -1
- package/lib/commonjs/views/DrawerContentScrollView.js +6 -7
- package/lib/commonjs/views/DrawerContentScrollView.js.map +1 -1
- package/lib/commonjs/views/DrawerItem.js +14 -10
- package/lib/commonjs/views/DrawerItem.js.map +1 -1
- package/lib/commonjs/views/DrawerItemList.js +9 -10
- package/lib/commonjs/views/DrawerItemList.js.map +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js +1 -1
- package/lib/commonjs/views/DrawerToggleButton.js.map +1 -1
- package/lib/commonjs/views/DrawerView.js +78 -73
- package/lib/commonjs/views/DrawerView.js.map +1 -1
- package/lib/module/index.js +11 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigators/createDrawerNavigator.js +5 -45
- package/lib/module/navigators/createDrawerNavigator.js.map +1 -1
- package/lib/module/utils/DrawerPositionContext.js +1 -1
- package/lib/module/utils/DrawerPositionContext.js.map +1 -1
- package/lib/module/utils/DrawerStatusContext.js +1 -2
- package/lib/module/utils/DrawerStatusContext.js.map +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js +1 -1
- package/lib/module/utils/getDrawerStatusFromState.js.map +1 -1
- package/lib/module/utils/useDrawerStatus.js +2 -2
- package/lib/module/utils/useDrawerStatus.js.map +1 -1
- package/lib/module/views/DrawerContent.js +3 -3
- package/lib/module/views/DrawerContent.js.map +1 -1
- package/lib/module/views/DrawerContentScrollView.js +3 -3
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/module/views/DrawerItem.js +15 -11
- package/lib/module/views/DrawerItem.js.map +1 -1
- package/lib/module/views/DrawerItemList.js +9 -9
- package/lib/module/views/DrawerItemList.js.map +1 -1
- package/lib/module/views/DrawerToggleButton.js +1 -1
- package/lib/module/views/DrawerToggleButton.js.map +1 -1
- package/lib/module/views/DrawerView.js +72 -67
- package/lib/module/views/DrawerView.js.map +1 -1
- package/lib/typescript/src/index.d.ts +11 -13
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts +9 -4
- package/lib/typescript/src/navigators/createDrawerNavigator.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +51 -16
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerPositionContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts +1 -2
- package/lib/typescript/src/utils/DrawerStatusContext.d.ts.map +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts +1 -1
- package/lib/typescript/src/utils/getDrawerStatusFromState.d.ts.map +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts +1 -1
- package/lib/typescript/src/utils/useDrawerStatus.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts +1 -1
- package/lib/typescript/src/views/DrawerContent.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +1 -2
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItem.d.ts +11 -6
- package/lib/typescript/src/views/DrawerItem.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerItemList.d.ts +2 -2
- package/lib/typescript/src/views/DrawerItemList.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerToggleButton.d.ts +2 -2
- package/lib/typescript/src/views/DrawerToggleButton.d.ts.map +1 -1
- package/lib/typescript/src/views/DrawerView.d.ts +2 -2
- package/lib/typescript/src/views/DrawerView.d.ts.map +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts +1 -1
- package/lib/typescript/src/views/ScreenFallback.d.ts.map +1 -1
- package/package.json +15 -14
- package/src/index.tsx +15 -13
- package/src/navigators/createDrawerNavigator.tsx +4 -74
- package/src/types.tsx +24 -3
- package/src/utils/DrawerPositionContext.tsx +3 -1
- package/src/utils/DrawerStatusContext.tsx +3 -5
- package/src/utils/getDrawerStatusFromState.tsx +1 -1
- package/src/utils/useDrawerStatus.tsx +2 -2
- package/src/views/DrawerContent.tsx +3 -3
- package/src/views/DrawerContentScrollView.tsx +5 -3
- package/src/views/DrawerItem.tsx +23 -20
- package/src/views/DrawerItemList.tsx +7 -10
- package/src/views/DrawerToggleButton.tsx +1 -1
- package/src/views/DrawerView.tsx +68 -78
- package/lib/commonjs/utils/DrawerGestureContext.js +0 -12
- package/lib/commonjs/utils/DrawerGestureContext.js.map +0 -1
- package/lib/commonjs/utils/DrawerProgressContext.js +0 -12
- package/lib/commonjs/utils/DrawerProgressContext.js.map +0 -1
- package/lib/commonjs/utils/useDrawerProgress.js +0 -19
- package/lib/commonjs/utils/useDrawerProgress.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.android.js +0 -17
- package/lib/commonjs/views/GestureHandler.android.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.ios.js +0 -17
- package/lib/commonjs/views/GestureHandler.ios.js.map +0 -1
- package/lib/commonjs/views/GestureHandler.js +0 -32
- package/lib/commonjs/views/GestureHandler.js.map +0 -1
- package/lib/commonjs/views/GestureHandlerNative.js +0 -37
- package/lib/commonjs/views/GestureHandlerNative.js.map +0 -1
- package/lib/commonjs/views/legacy/Drawer.js +0 -438
- package/lib/commonjs/views/legacy/Drawer.js.map +0 -1
- package/lib/commonjs/views/legacy/Overlay.js +0 -74
- package/lib/commonjs/views/legacy/Overlay.js.map +0 -1
- package/lib/commonjs/views/modern/Drawer.js +0 -304
- package/lib/commonjs/views/modern/Drawer.js.map +0 -1
- package/lib/commonjs/views/modern/Overlay.js +0 -69
- package/lib/commonjs/views/modern/Overlay.js.map +0 -1
- package/lib/module/utils/DrawerGestureContext.js +0 -3
- package/lib/module/utils/DrawerGestureContext.js.map +0 -1
- package/lib/module/utils/DrawerProgressContext.js +0 -3
- package/lib/module/utils/DrawerProgressContext.js.map +0 -1
- package/lib/module/utils/useDrawerProgress.js +0 -10
- package/lib/module/utils/useDrawerProgress.js.map +0 -1
- package/lib/module/views/GestureHandler.android.js +0 -2
- package/lib/module/views/GestureHandler.android.js.map +0 -1
- package/lib/module/views/GestureHandler.ios.js +0 -2
- package/lib/module/views/GestureHandler.ios.js.map +0 -1
- package/lib/module/views/GestureHandler.js +0 -20
- package/lib/module/views/GestureHandler.js.map +0 -1
- package/lib/module/views/GestureHandlerNative.js +0 -11
- package/lib/module/views/GestureHandlerNative.js.map +0 -1
- package/lib/module/views/legacy/Drawer.js +0 -428
- package/lib/module/views/legacy/Drawer.js.map +0 -1
- package/lib/module/views/legacy/Overlay.js +0 -64
- package/lib/module/views/legacy/Overlay.js.map +0 -1
- package/lib/module/views/modern/Drawer.js +0 -295
- package/lib/module/views/modern/Drawer.js.map +0 -1
- package/lib/module/views/modern/Overlay.js +0 -60
- package/lib/module/views/modern/Overlay.js.map +0 -1
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts +0 -4
- package/lib/typescript/src/utils/DrawerGestureContext.d.ts.map +0 -1
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts +0 -5
- package/lib/typescript/src/utils/DrawerProgressContext.d.ts.map +0 -1
- package/lib/typescript/src/utils/useDrawerProgress.d.ts +0 -3
- package/lib/typescript/src/utils/useDrawerProgress.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.android.d.ts +0 -2
- package/lib/typescript/src/views/GestureHandler.android.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.d.ts +0 -15
- package/lib/typescript/src/views/GestureHandler.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandler.ios.d.ts +0 -2
- package/lib/typescript/src/views/GestureHandler.ios.d.ts.map +0 -1
- package/lib/typescript/src/views/GestureHandlerNative.d.ts +0 -6
- package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +0 -1
- package/lib/typescript/src/views/legacy/Drawer.d.ts +0 -45
- package/lib/typescript/src/views/legacy/Drawer.d.ts.map +0 -1
- package/lib/typescript/src/views/legacy/Overlay.d.ts +0 -75
- package/lib/typescript/src/views/legacy/Overlay.d.ts.map +0 -1
- package/lib/typescript/src/views/modern/Drawer.d.ts +0 -4
- package/lib/typescript/src/views/modern/Drawer.d.ts.map +0 -1
- package/lib/typescript/src/views/modern/Overlay.d.ts +0 -75
- package/lib/typescript/src/views/modern/Overlay.d.ts.map +0 -1
- package/src/utils/DrawerGestureContext.tsx +0 -3
- package/src/utils/DrawerProgressContext.tsx +0 -6
- package/src/utils/useDrawerProgress.tsx +0 -18
- package/src/views/GestureHandler.android.tsx +0 -1
- package/src/views/GestureHandler.ios.tsx +0 -1
- package/src/views/GestureHandler.tsx +0 -29
- package/src/views/GestureHandlerNative.tsx +0 -24
- package/src/views/legacy/Drawer.tsx +0 -672
- package/src/views/legacy/Overlay.tsx +0 -87
- package/src/views/modern/Drawer.tsx +0 -425
- package/src/views/modern/Overlay.tsx +0 -82
|
@@ -1,428 +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 { I18nManager, InteractionManager, Keyboard, Platform, StatusBar, StyleSheet, View } from 'react-native';
|
|
4
|
-
import Animated from 'react-native-reanimated';
|
|
5
|
-
import DrawerProgressContext from '../../utils/DrawerProgressContext';
|
|
6
|
-
import { GestureState, PanGestureHandler } from '../GestureHandler';
|
|
7
|
-
import Overlay from './Overlay';
|
|
8
|
-
const {
|
|
9
|
-
Clock,
|
|
10
|
-
Value,
|
|
11
|
-
onChange,
|
|
12
|
-
clockRunning,
|
|
13
|
-
startClock,
|
|
14
|
-
stopClock,
|
|
15
|
-
spring,
|
|
16
|
-
abs,
|
|
17
|
-
add,
|
|
18
|
-
and,
|
|
19
|
-
block,
|
|
20
|
-
call,
|
|
21
|
-
cond,
|
|
22
|
-
divide,
|
|
23
|
-
eq,
|
|
24
|
-
event,
|
|
25
|
-
greaterThan,
|
|
26
|
-
lessThan,
|
|
27
|
-
max,
|
|
28
|
-
min,
|
|
29
|
-
multiply,
|
|
30
|
-
neq,
|
|
31
|
-
or,
|
|
32
|
-
set,
|
|
33
|
-
sub
|
|
34
|
-
} = Animated;
|
|
35
|
-
const TRUE = 1;
|
|
36
|
-
const FALSE = 0;
|
|
37
|
-
const NOOP = 0;
|
|
38
|
-
const UNSET = -1;
|
|
39
|
-
const DIRECTION_LEFT = 1;
|
|
40
|
-
const DIRECTION_RIGHT = -1;
|
|
41
|
-
const SWIPE_DISTANCE_MINIMUM = 5;
|
|
42
|
-
const DEFAULT_DRAWER_WIDTH = '80%';
|
|
43
|
-
const SPRING_CONFIG = {
|
|
44
|
-
stiffness: 1000,
|
|
45
|
-
damping: 500,
|
|
46
|
-
mass: 3,
|
|
47
|
-
overshootClamping: true,
|
|
48
|
-
restDisplacementThreshold: 0.01,
|
|
49
|
-
restSpeedThreshold: 0.01
|
|
50
|
-
};
|
|
51
|
-
const ANIMATED_ZERO = new Animated.Value(0);
|
|
52
|
-
const ANIMATED_ONE = new Animated.Value(1);
|
|
53
|
-
export default class DrawerView extends React.Component {
|
|
54
|
-
componentDidUpdate(prevProps) {
|
|
55
|
-
const {
|
|
56
|
-
open,
|
|
57
|
-
drawerPosition,
|
|
58
|
-
drawerType,
|
|
59
|
-
swipeDistanceThreshold,
|
|
60
|
-
swipeVelocityThreshold,
|
|
61
|
-
hideStatusBarOnOpen: hideStatusBar
|
|
62
|
-
} = this.props;
|
|
63
|
-
if (
|
|
64
|
-
// If we're not in the middle of a transition, sync the drawer's open state
|
|
65
|
-
typeof this.pendingOpenValue !== 'boolean' || open !== this.pendingOpenValue) {
|
|
66
|
-
this.toggleDrawer(open);
|
|
67
|
-
}
|
|
68
|
-
this.pendingOpenValue = undefined;
|
|
69
|
-
if (open !== prevProps.open && hideStatusBar) {
|
|
70
|
-
this.toggleStatusBar(open);
|
|
71
|
-
}
|
|
72
|
-
if (prevProps.drawerPosition !== drawerPosition) {
|
|
73
|
-
this.drawerPosition.setValue(drawerPosition === 'right' ? DIRECTION_RIGHT : DIRECTION_LEFT);
|
|
74
|
-
}
|
|
75
|
-
if (prevProps.drawerType !== drawerType) {
|
|
76
|
-
this.isDrawerTypeFront.setValue(drawerType === 'front' ? TRUE : FALSE);
|
|
77
|
-
}
|
|
78
|
-
if (prevProps.swipeDistanceThreshold !== swipeDistanceThreshold) {
|
|
79
|
-
this.swipeDistanceThreshold.setValue(swipeDistanceThreshold);
|
|
80
|
-
}
|
|
81
|
-
if (prevProps.swipeVelocityThreshold !== swipeVelocityThreshold) {
|
|
82
|
-
this.swipeVelocityThreshold.setValue(swipeVelocityThreshold);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
componentWillUnmount() {
|
|
86
|
-
this.toggleStatusBar(false);
|
|
87
|
-
this.handleEndInteraction();
|
|
88
|
-
}
|
|
89
|
-
handleEndInteraction = () => {
|
|
90
|
-
if (this.interactionHandle !== undefined) {
|
|
91
|
-
InteractionManager.clearInteractionHandle(this.interactionHandle);
|
|
92
|
-
this.interactionHandle = undefined;
|
|
93
|
-
}
|
|
94
|
-
};
|
|
95
|
-
handleStartInteraction = () => {
|
|
96
|
-
if (this.interactionHandle === undefined) {
|
|
97
|
-
this.interactionHandle = InteractionManager.createInteractionHandle();
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
getDrawerWidth = () => {
|
|
101
|
-
const {
|
|
102
|
-
drawerStyle,
|
|
103
|
-
dimensions
|
|
104
|
-
} = this.props;
|
|
105
|
-
const {
|
|
106
|
-
width = DEFAULT_DRAWER_WIDTH
|
|
107
|
-
} = StyleSheet.flatten(drawerStyle) || {};
|
|
108
|
-
if (typeof width === 'string' && width.endsWith('%')) {
|
|
109
|
-
// Try to calculate width if a percentage is given
|
|
110
|
-
const percentage = Number(width.replace(/%$/, ''));
|
|
111
|
-
if (Number.isFinite(percentage)) {
|
|
112
|
-
return dimensions.width * (percentage / 100);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return typeof width === 'number' ? width : 0;
|
|
116
|
-
};
|
|
117
|
-
clock = new Clock();
|
|
118
|
-
isDrawerTypeFront = new Value(this.props.drawerType === 'front' ? TRUE : FALSE);
|
|
119
|
-
isOpen = new Value(this.props.open ? TRUE : FALSE);
|
|
120
|
-
nextIsOpen = new Value(UNSET);
|
|
121
|
-
isSwiping = new Value(FALSE);
|
|
122
|
-
initialDrawerWidth = this.getDrawerWidth();
|
|
123
|
-
gestureState = new Value(GestureState.UNDETERMINED);
|
|
124
|
-
touchX = new Value(0);
|
|
125
|
-
velocityX = new Value(0);
|
|
126
|
-
gestureX = new Value(0);
|
|
127
|
-
offsetX = new Value(0);
|
|
128
|
-
position = new Value(this.props.open ? this.initialDrawerWidth * (this.props.drawerPosition === 'right' ? DIRECTION_RIGHT : DIRECTION_LEFT) : 0);
|
|
129
|
-
containerWidth = new Value(this.props.dimensions.width);
|
|
130
|
-
drawerWidth = new Value(this.initialDrawerWidth);
|
|
131
|
-
drawerOpacity = new Value(this.props.drawerType === 'permanent' ? 1 : 0);
|
|
132
|
-
drawerPosition = new Value(this.props.drawerPosition === 'right' ? DIRECTION_RIGHT : DIRECTION_LEFT);
|
|
133
|
-
|
|
134
|
-
// Comment stolen from react-native-gesture-handler/DrawerLayout
|
|
135
|
-
//
|
|
136
|
-
// While closing the drawer when user starts gesture outside of its area (in greyed
|
|
137
|
-
// out part of the window), we want the drawer to follow only once finger reaches the
|
|
138
|
-
// edge of the drawer.
|
|
139
|
-
// E.g. on the diagram below drawer is illustrate by X signs and the greyed out area by
|
|
140
|
-
// dots. The touch gesture starts at '*' and moves left, touch path is indicated by
|
|
141
|
-
// an arrow pointing left
|
|
142
|
-
// 1) +---------------+ 2) +---------------+ 3) +---------------+ 4) +---------------+
|
|
143
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
|
144
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
|
145
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
|
146
|
-
// |XXXXXXXX|......| |XXXXXXXX|.<-*..| |XXXXXXXX|<--*..| |XXXXX|<-----*..|
|
|
147
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
|
148
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
|
149
|
-
// |XXXXXXXX|......| |XXXXXXXX|......| |XXXXXXXX|......| |XXXXX|.........|
|
|
150
|
-
// +---------------+ +---------------+ +---------------+ +---------------+
|
|
151
|
-
//
|
|
152
|
-
// For the above to work properly we define animated value that will keep start position
|
|
153
|
-
// of the gesture. Then we use that value to calculate how much we need to subtract from
|
|
154
|
-
// the dragX. If the gesture started on the greyed out area we take the distance from the
|
|
155
|
-
// edge of the drawer to the start position. Otherwise we don't subtract at all and the
|
|
156
|
-
// drawer be pulled back as soon as you start the pan.
|
|
157
|
-
//
|
|
158
|
-
// This is used only when drawerType is "front"
|
|
159
|
-
touchDistanceFromDrawer = cond(this.isDrawerTypeFront, cond(eq(this.drawerPosition, DIRECTION_LEFT), max(
|
|
160
|
-
// Distance of touch start from left screen edge - Drawer width
|
|
161
|
-
sub(sub(this.touchX, this.gestureX), this.drawerWidth), 0), min(multiply(
|
|
162
|
-
// Distance of drawer from left screen edge - Touch start point
|
|
163
|
-
sub(sub(this.containerWidth, this.drawerWidth), sub(this.touchX, this.gestureX)), DIRECTION_RIGHT), 0)), 0);
|
|
164
|
-
swipeDistanceThreshold = new Value(this.props.swipeDistanceThreshold);
|
|
165
|
-
swipeVelocityThreshold = new Value(this.props.swipeVelocityThreshold);
|
|
166
|
-
currentOpenValue = this.props.open;
|
|
167
|
-
isStatusBarHidden = false;
|
|
168
|
-
manuallyTriggerSpring = new Value(FALSE);
|
|
169
|
-
transitionTo = isOpen => {
|
|
170
|
-
const toValue = new Value(0);
|
|
171
|
-
const frameTime = new Value(0);
|
|
172
|
-
const state = {
|
|
173
|
-
position: this.position,
|
|
174
|
-
time: new Value(0),
|
|
175
|
-
finished: new Value(FALSE),
|
|
176
|
-
velocity: new Value(0)
|
|
177
|
-
};
|
|
178
|
-
return block([cond(clockRunning(this.clock), NOOP, [
|
|
179
|
-
// Animation wasn't running before
|
|
180
|
-
// Set the initial values and start the clock
|
|
181
|
-
set(toValue, multiply(isOpen, this.drawerWidth, this.drawerPosition)), set(frameTime, 0), set(state.time, 0), set(state.finished, FALSE), set(state.velocity, this.velocityX), set(this.isOpen, isOpen), startClock(this.clock), call([], this.handleStartInteraction), set(this.manuallyTriggerSpring, FALSE)]), spring(this.clock, state, {
|
|
182
|
-
...SPRING_CONFIG,
|
|
183
|
-
toValue
|
|
184
|
-
}), cond(state.finished, [
|
|
185
|
-
// Reset gesture and velocity from previous gesture
|
|
186
|
-
set(this.touchX, 0), set(this.gestureX, 0), set(this.velocityX, 0), set(this.offsetX, 0),
|
|
187
|
-
// When the animation finishes, stop the clock
|
|
188
|
-
stopClock(this.clock), call([this.isOpen], _ref => {
|
|
189
|
-
let [value] = _ref;
|
|
190
|
-
const open = Boolean(value);
|
|
191
|
-
this.handleEndInteraction();
|
|
192
|
-
if (open !== this.props.open) {
|
|
193
|
-
// Sync drawer's state after animation finished
|
|
194
|
-
// This shouldn't be necessary, but there seems to be an issue on iOS
|
|
195
|
-
this.toggleDrawer(this.props.open);
|
|
196
|
-
}
|
|
197
|
-
})])]);
|
|
198
|
-
};
|
|
199
|
-
dragX = block([onChange(this.isOpen, call([this.isOpen], _ref2 => {
|
|
200
|
-
let [value] = _ref2;
|
|
201
|
-
const open = Boolean(value);
|
|
202
|
-
this.currentOpenValue = open;
|
|
203
|
-
|
|
204
|
-
// Without this check, the drawer can go to an infinite update <-> animate loop for sync updates
|
|
205
|
-
if (open !== this.props.open) {
|
|
206
|
-
// If the mode changed, update state
|
|
207
|
-
if (open) {
|
|
208
|
-
this.props.onOpen();
|
|
209
|
-
} else {
|
|
210
|
-
this.props.onClose();
|
|
211
|
-
}
|
|
212
|
-
this.pendingOpenValue = open;
|
|
213
|
-
|
|
214
|
-
// Force componentDidUpdate to fire, whether user does a setState or not
|
|
215
|
-
// This allows us to detect when the user drops the update and revert back
|
|
216
|
-
// It's necessary to make sure that the state stays in sync
|
|
217
|
-
this.forceUpdate();
|
|
218
|
-
}
|
|
219
|
-
})), onChange(this.nextIsOpen, cond(neq(this.nextIsOpen, UNSET), [
|
|
220
|
-
// Stop any running animations
|
|
221
|
-
cond(clockRunning(this.clock), stopClock(this.clock)),
|
|
222
|
-
// Update the open value to trigger the transition
|
|
223
|
-
set(this.isOpen, this.nextIsOpen), set(this.gestureX, 0), set(this.nextIsOpen, UNSET)])),
|
|
224
|
-
// This block must be after the this.isOpen listener since we check for current value
|
|
225
|
-
onChange(this.isSwiping,
|
|
226
|
-
// Listen to updates for this value only when it changes
|
|
227
|
-
// Without `onChange`, this will fire even if the value didn't change
|
|
228
|
-
// We don't want to call the listeners if the value didn't change
|
|
229
|
-
call([this.isSwiping], _ref3 => {
|
|
230
|
-
let [value] = _ref3;
|
|
231
|
-
const {
|
|
232
|
-
keyboardDismissMode
|
|
233
|
-
} = this.props;
|
|
234
|
-
if (value === TRUE) {
|
|
235
|
-
if (keyboardDismissMode === 'on-drag') {
|
|
236
|
-
Keyboard.dismiss();
|
|
237
|
-
}
|
|
238
|
-
this.toggleStatusBar(true);
|
|
239
|
-
} else {
|
|
240
|
-
this.toggleStatusBar(this.currentOpenValue);
|
|
241
|
-
}
|
|
242
|
-
})), onChange(this.gestureState, cond(eq(this.gestureState, GestureState.ACTIVE), call([], this.handleStartInteraction))), cond(eq(this.gestureState, GestureState.ACTIVE), [cond(this.isSwiping, NOOP, [
|
|
243
|
-
// We weren't dragging before, set it to true
|
|
244
|
-
set(this.isSwiping, TRUE),
|
|
245
|
-
// Also update the drag offset to the last position
|
|
246
|
-
set(this.offsetX, this.position)]),
|
|
247
|
-
// Update position with previous offset + gesture distance
|
|
248
|
-
set(this.position, add(this.offsetX, this.gestureX, this.touchDistanceFromDrawer)),
|
|
249
|
-
// Stop animations while we're dragging
|
|
250
|
-
stopClock(this.clock)], [set(this.isSwiping, FALSE), set(this.touchX, 0), this.transitionTo(cond(this.manuallyTriggerSpring, this.isOpen, cond(or(and(greaterThan(abs(this.gestureX), SWIPE_DISTANCE_MINIMUM), greaterThan(abs(this.velocityX), this.swipeVelocityThreshold)), greaterThan(abs(this.gestureX), this.swipeDistanceThreshold)), cond(eq(this.drawerPosition, DIRECTION_LEFT),
|
|
251
|
-
// If swiped to right, open the drawer, otherwise close it
|
|
252
|
-
greaterThan(cond(eq(this.velocityX, 0), this.gestureX, this.velocityX), 0),
|
|
253
|
-
// If swiped to left, open the drawer, otherwise close it
|
|
254
|
-
lessThan(cond(eq(this.velocityX, 0), this.gestureX, this.velocityX), 0)), this.isOpen)))]), this.position]);
|
|
255
|
-
translateX = cond(eq(this.drawerPosition, DIRECTION_RIGHT), min(max(multiply(this.drawerWidth, -1), this.dragX), 0), max(min(this.drawerWidth, this.dragX), 0));
|
|
256
|
-
progress = cond(
|
|
257
|
-
// Check if the drawer width is available to avoid division by zero
|
|
258
|
-
eq(this.drawerWidth, 0), 0, abs(divide(this.translateX, this.drawerWidth)));
|
|
259
|
-
handleGestureEvent = event([{
|
|
260
|
-
nativeEvent: {
|
|
261
|
-
x: this.touchX,
|
|
262
|
-
translationX: this.gestureX,
|
|
263
|
-
velocityX: this.velocityX
|
|
264
|
-
}
|
|
265
|
-
}]);
|
|
266
|
-
handleGestureStateChange = event([{
|
|
267
|
-
nativeEvent: {
|
|
268
|
-
state: s => set(this.gestureState, s)
|
|
269
|
-
}
|
|
270
|
-
}]);
|
|
271
|
-
handleContainerLayout = e => this.containerWidth.setValue(e.nativeEvent.layout.width);
|
|
272
|
-
handleDrawerLayout = e => {
|
|
273
|
-
this.drawerWidth.setValue(e.nativeEvent.layout.width);
|
|
274
|
-
this.toggleDrawer(this.props.open);
|
|
275
|
-
|
|
276
|
-
// Until layout is available, drawer is hidden with opacity: 0 by default
|
|
277
|
-
// Show it in the next frame when layout is available
|
|
278
|
-
// If we don't delay it until the next frame, there's a visible flicker
|
|
279
|
-
requestAnimationFrame(() => requestAnimationFrame(() => this.drawerOpacity.setValue(1)));
|
|
280
|
-
};
|
|
281
|
-
toggleDrawer = open => {
|
|
282
|
-
if (this.currentOpenValue !== open) {
|
|
283
|
-
this.nextIsOpen.setValue(open ? TRUE : FALSE);
|
|
284
|
-
|
|
285
|
-
// This value will also be set shortly after as changing this.nextIsOpen changes this.isOpen
|
|
286
|
-
// However, there's a race condition on Android, so we need to set a bit earlier
|
|
287
|
-
this.currentOpenValue = open;
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
toggleStatusBar = hidden => {
|
|
291
|
-
const {
|
|
292
|
-
hideStatusBarOnOpen: hideStatusBar,
|
|
293
|
-
statusBarAnimation
|
|
294
|
-
} = this.props;
|
|
295
|
-
if (hideStatusBar && this.isStatusBarHidden !== hidden) {
|
|
296
|
-
this.isStatusBarHidden = hidden;
|
|
297
|
-
StatusBar.setHidden(hidden, statusBarAnimation);
|
|
298
|
-
}
|
|
299
|
-
};
|
|
300
|
-
render() {
|
|
301
|
-
const {
|
|
302
|
-
open,
|
|
303
|
-
swipeEnabled,
|
|
304
|
-
drawerPosition,
|
|
305
|
-
drawerType,
|
|
306
|
-
swipeEdgeWidth,
|
|
307
|
-
drawerStyle,
|
|
308
|
-
overlayStyle,
|
|
309
|
-
renderDrawerContent,
|
|
310
|
-
renderSceneContent,
|
|
311
|
-
gestureHandlerProps,
|
|
312
|
-
overlayAccessibilityLabel
|
|
313
|
-
} = this.props;
|
|
314
|
-
const isOpen = drawerType === 'permanent' ? true : open;
|
|
315
|
-
const isRight = drawerPosition === 'right';
|
|
316
|
-
const contentTranslateX = drawerType === 'front' ? ANIMATED_ZERO : this.translateX;
|
|
317
|
-
const drawerTranslateX = drawerType === 'back' ? I18nManager.getConstants().isRTL ? multiply(sub(this.containerWidth, this.drawerWidth), isRight ? 1 : -1) : ANIMATED_ZERO : this.translateX;
|
|
318
|
-
const offset = drawerType === 'back' ? 0 : I18nManager.getConstants().isRTL ? '100%' : multiply(this.drawerWidth, -1);
|
|
319
|
-
|
|
320
|
-
// FIXME: Currently hitSlop is broken when on Android when drawer is on right
|
|
321
|
-
// https://github.com/software-mansion/react-native-gesture-handler/issues/569
|
|
322
|
-
const hitSlop = isRight ?
|
|
323
|
-
// Extend hitSlop to the side of the screen when drawer is closed
|
|
324
|
-
// This lets the user drag the drawer from the side of the screen
|
|
325
|
-
{
|
|
326
|
-
right: 0,
|
|
327
|
-
width: isOpen ? undefined : swipeEdgeWidth
|
|
328
|
-
} : {
|
|
329
|
-
left: 0,
|
|
330
|
-
width: isOpen ? undefined : swipeEdgeWidth
|
|
331
|
-
};
|
|
332
|
-
const progress = drawerType === 'permanent' ? ANIMATED_ONE : this.progress;
|
|
333
|
-
return /*#__PURE__*/React.createElement(DrawerProgressContext.Provider, {
|
|
334
|
-
value: progress
|
|
335
|
-
}, /*#__PURE__*/React.createElement(PanGestureHandler, _extends({
|
|
336
|
-
activeOffsetX: [-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM],
|
|
337
|
-
failOffsetY: [-SWIPE_DISTANCE_MINIMUM, SWIPE_DISTANCE_MINIMUM],
|
|
338
|
-
onGestureEvent: this.handleGestureEvent,
|
|
339
|
-
onHandlerStateChange: this.handleGestureStateChange,
|
|
340
|
-
hitSlop: hitSlop,
|
|
341
|
-
enabled: drawerType !== 'permanent' && swipeEnabled
|
|
342
|
-
}, gestureHandlerProps), /*#__PURE__*/React.createElement(Animated.View, {
|
|
343
|
-
onLayout: this.handleContainerLayout,
|
|
344
|
-
style: [styles.main, {
|
|
345
|
-
flexDirection: drawerType === 'permanent' && !isRight ? 'row-reverse' : 'row'
|
|
346
|
-
}]
|
|
347
|
-
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
348
|
-
style: [styles.content, {
|
|
349
|
-
transform: drawerType === 'permanent' ?
|
|
350
|
-
// Reanimated needs the property to be present, but it results in Browser bug
|
|
351
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=20574
|
|
352
|
-
[] : [{
|
|
353
|
-
translateX: contentTranslateX
|
|
354
|
-
}]
|
|
355
|
-
}]
|
|
356
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
357
|
-
accessibilityElementsHidden: isOpen && drawerType !== 'permanent',
|
|
358
|
-
importantForAccessibility: isOpen && drawerType !== 'permanent' ? 'no-hide-descendants' : 'auto',
|
|
359
|
-
style: styles.content
|
|
360
|
-
}, renderSceneContent()),
|
|
361
|
-
// Disable overlay if sidebar is permanent
|
|
362
|
-
drawerType === 'permanent' ? null : /*#__PURE__*/React.createElement(Overlay, {
|
|
363
|
-
progress: progress,
|
|
364
|
-
onPress: () => this.toggleDrawer(false),
|
|
365
|
-
accessibilityLabel: overlayAccessibilityLabel,
|
|
366
|
-
style: overlayStyle,
|
|
367
|
-
accessibilityElementsHidden: !isOpen,
|
|
368
|
-
importantForAccessibility: isOpen ? 'auto' : 'no-hide-descendants'
|
|
369
|
-
})), /*#__PURE__*/React.createElement(Animated.Code, {
|
|
370
|
-
// This is needed to make sure that container width updates with `setValue`
|
|
371
|
-
// Without this, it won't update when not used in styles
|
|
372
|
-
exec: this.containerWidth
|
|
373
|
-
}), drawerType === 'permanent' ? null : /*#__PURE__*/React.createElement(Animated.Code, {
|
|
374
|
-
exec: block([onChange(this.manuallyTriggerSpring, [cond(eq(this.manuallyTriggerSpring, TRUE), [set(this.nextIsOpen, FALSE), call([], () => this.currentOpenValue = false)])])])
|
|
375
|
-
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
376
|
-
removeClippedSubviews: Platform.OS !== 'ios',
|
|
377
|
-
onLayout: this.handleDrawerLayout,
|
|
378
|
-
style: [styles.container, {
|
|
379
|
-
transform: drawerType === 'permanent' ?
|
|
380
|
-
// Reanimated needs the property to be present, but it results in Browser bug
|
|
381
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=20574
|
|
382
|
-
[] : [{
|
|
383
|
-
translateX: drawerTranslateX
|
|
384
|
-
}],
|
|
385
|
-
opacity: this.drawerOpacity
|
|
386
|
-
}, drawerType === 'permanent' ?
|
|
387
|
-
// Without this, the `left`/`right` values don't get reset
|
|
388
|
-
isRight ? {
|
|
389
|
-
right: 0
|
|
390
|
-
} : {
|
|
391
|
-
left: 0
|
|
392
|
-
} : [styles.nonPermanent, isRight ? {
|
|
393
|
-
right: offset
|
|
394
|
-
} : {
|
|
395
|
-
left: offset
|
|
396
|
-
}, {
|
|
397
|
-
zIndex: drawerType === 'back' ? -1 : 0
|
|
398
|
-
}], drawerStyle]
|
|
399
|
-
}, renderDrawerContent()))));
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
const styles = StyleSheet.create({
|
|
403
|
-
container: {
|
|
404
|
-
backgroundColor: 'white',
|
|
405
|
-
maxWidth: '100%'
|
|
406
|
-
},
|
|
407
|
-
nonPermanent: {
|
|
408
|
-
position: 'absolute',
|
|
409
|
-
top: 0,
|
|
410
|
-
bottom: 0,
|
|
411
|
-
width: DEFAULT_DRAWER_WIDTH
|
|
412
|
-
},
|
|
413
|
-
content: {
|
|
414
|
-
flex: 1
|
|
415
|
-
},
|
|
416
|
-
main: {
|
|
417
|
-
flex: 1,
|
|
418
|
-
...Platform.select({
|
|
419
|
-
// FIXME: We need to hide `overflowX` on Web so the translated content doesn't show offscreen.
|
|
420
|
-
// But adding `overflowX: 'hidden'` prevents content from collapsing the URL bar.
|
|
421
|
-
web: null,
|
|
422
|
-
default: {
|
|
423
|
-
overflow: 'hidden'
|
|
424
|
-
}
|
|
425
|
-
})
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
//# sourceMappingURL=Drawer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","I18nManager","InteractionManager","Keyboard","Platform","StatusBar","StyleSheet","View","Animated","DrawerProgressContext","GestureState","PanGestureHandler","Overlay","Clock","Value","onChange","clockRunning","startClock","stopClock","spring","abs","add","and","block","call","cond","divide","eq","event","greaterThan","lessThan","max","min","multiply","neq","or","set","sub","TRUE","FALSE","NOOP","UNSET","DIRECTION_LEFT","DIRECTION_RIGHT","SWIPE_DISTANCE_MINIMUM","DEFAULT_DRAWER_WIDTH","SPRING_CONFIG","stiffness","damping","mass","overshootClamping","restDisplacementThreshold","restSpeedThreshold","ANIMATED_ZERO","ANIMATED_ONE","DrawerView","Component","componentDidUpdate","prevProps","open","drawerPosition","drawerType","swipeDistanceThreshold","swipeVelocityThreshold","hideStatusBarOnOpen","hideStatusBar","props","pendingOpenValue","toggleDrawer","undefined","toggleStatusBar","setValue","isDrawerTypeFront","componentWillUnmount","handleEndInteraction","interactionHandle","clearInteractionHandle","handleStartInteraction","createInteractionHandle","getDrawerWidth","drawerStyle","dimensions","width","flatten","endsWith","percentage","Number","replace","isFinite","clock","isOpen","nextIsOpen","isSwiping","initialDrawerWidth","gestureState","UNDETERMINED","touchX","velocityX","gestureX","offsetX","position","containerWidth","drawerWidth","drawerOpacity","touchDistanceFromDrawer","currentOpenValue","isStatusBarHidden","manuallyTriggerSpring","transitionTo","toValue","frameTime","state","time","finished","velocity","value","Boolean","dragX","onOpen","onClose","forceUpdate","keyboardDismissMode","dismiss","ACTIVE","translateX","progress","handleGestureEvent","nativeEvent","x","translationX","handleGestureStateChange","s","handleContainerLayout","e","layout","handleDrawerLayout","requestAnimationFrame","hidden","statusBarAnimation","setHidden","render","swipeEnabled","swipeEdgeWidth","overlayStyle","renderDrawerContent","renderSceneContent","gestureHandlerProps","overlayAccessibilityLabel","isRight","contentTranslateX","drawerTranslateX","getConstants","isRTL","offset","hitSlop","right","left","styles","main","flexDirection","content","transform","OS","container","opacity","nonPermanent","zIndex","create","backgroundColor","maxWidth","top","bottom","flex","select","web","default","overflow"],"sourceRoot":"../../../../src","sources":["views/legacy/Drawer.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,WAAW,EACXC,kBAAkB,EAClBC,QAAQ,EAERC,QAAQ,EACRC,SAAS,EACTC,UAAU,EACVC,IAAI,QACC,cAAc;AACrB,OAAOC,QAAQ,MAAM,yBAAyB;AAG9C,OAAOC,qBAAqB,MAAM,mCAAmC;AACrE,SAASC,YAAY,EAAEC,iBAAiB,QAAQ,mBAAmB;AACnE,OAAOC,OAAO,MAAM,WAAW;AAE/B,MAAM;EACJC,KAAK;EACLC,KAAK;EACLC,QAAQ;EACRC,YAAY;EACZC,UAAU;EACVC,SAAS;EACTC,MAAM;EACNC,GAAG;EACHC,GAAG;EACHC,GAAG;EACHC,KAAK;EACLC,IAAI;EACJC,IAAI;EACJC,MAAM;EACNC,EAAE;EACFC,KAAK;EACLC,WAAW;EACXC,QAAQ;EACRC,GAAG;EACHC,GAAG;EACHC,QAAQ;EACRC,GAAG;EACHC,EAAE;E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AE;IACTK,eAAe,EAAE,OAAO;IACxBC,QAAQ,EAAE;EACZ,CAAC;EACDJ,YAAY,EAAE;IACZjE,QAAQ,EAAE,UAAU;IACpBsE,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE,CAAC;IACTzF,KAAK,EAAErC;EACT,CAAC;EACDmH,OAAO,EAAE;IACPY,IAAI,EAAE;EACR,CAAC;EACDd,IAAI,EAAE;IACJc,IAAI,EAAE,CAAC;IACP,GAAGxK,QAAQ,CAACyK,MAAM,CAAC;MACjB;MACA;MACAC,GAAG,EAAE,IAAI;MACTC,OAAO,EAAE;QAAEC,QAAQ,EAAE;MAAS;IAChC,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1,64 +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 from 'react-native-reanimated';
|
|
5
|
-
const {
|
|
6
|
-
// @ts-expect-error: this is to support reanimated 1
|
|
7
|
-
interpolate: interpolateDeprecated,
|
|
8
|
-
interpolateNode,
|
|
9
|
-
cond,
|
|
10
|
-
greaterThan
|
|
11
|
-
} = Animated;
|
|
12
|
-
const interpolate = interpolateNode ?? interpolateDeprecated;
|
|
13
|
-
const PROGRESS_EPSILON = 0.05;
|
|
14
|
-
const Overlay = /*#__PURE__*/React.forwardRef(function Overlay(_ref, ref) {
|
|
15
|
-
let {
|
|
16
|
-
progress,
|
|
17
|
-
onPress,
|
|
18
|
-
style,
|
|
19
|
-
accessibilityLabel = 'Close drawer',
|
|
20
|
-
...props
|
|
21
|
-
} = _ref;
|
|
22
|
-
const animatedStyle = {
|
|
23
|
-
opacity: interpolate(progress, {
|
|
24
|
-
// Default input range is [PROGRESS_EPSILON, 1]
|
|
25
|
-
// On Windows, the output value is 1 when input value is out of range for some reason
|
|
26
|
-
// The default value 0 will be interpolated to 1 in this case, which is not what we want.
|
|
27
|
-
// Therefore changing input range on Windows to [0,1] instead.
|
|
28
|
-
inputRange: Platform.OS === 'windows' || Platform.OS === 'macos' ? [0, 1] : [PROGRESS_EPSILON, 1],
|
|
29
|
-
outputRange: [0, 1]
|
|
30
|
-
}),
|
|
31
|
-
// We don't want the user to be able to press through the overlay when drawer is open
|
|
32
|
-
// One approach is to adjust the pointerEvents based on the progress
|
|
33
|
-
// But we can also send the overlay behind the screen, which works, and is much less code
|
|
34
|
-
zIndex: cond(greaterThan(progress, PROGRESS_EPSILON), 0, -1)
|
|
35
|
-
};
|
|
36
|
-
return /*#__PURE__*/React.createElement(Animated.View, _extends({}, props, {
|
|
37
|
-
ref: ref,
|
|
38
|
-
style: [styles.overlay, overlayStyle, animatedStyle, style]
|
|
39
|
-
}), /*#__PURE__*/React.createElement(Pressable, {
|
|
40
|
-
onPress: onPress,
|
|
41
|
-
style: styles.pressable,
|
|
42
|
-
accessibilityRole: "button",
|
|
43
|
-
accessibilityLabel: accessibilityLabel
|
|
44
|
-
}));
|
|
45
|
-
});
|
|
46
|
-
const overlayStyle = Platform.select({
|
|
47
|
-
web: {
|
|
48
|
-
// Disable touch highlight on mobile Safari.
|
|
49
|
-
// WebkitTapHighlightColor must be used outside of StyleSheet.create because react-native-web will omit the property.
|
|
50
|
-
WebkitTapHighlightColor: 'transparent'
|
|
51
|
-
},
|
|
52
|
-
default: {}
|
|
53
|
-
});
|
|
54
|
-
const styles = StyleSheet.create({
|
|
55
|
-
overlay: {
|
|
56
|
-
...StyleSheet.absoluteFillObject,
|
|
57
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)'
|
|
58
|
-
},
|
|
59
|
-
pressable: {
|
|
60
|
-
flex: 1
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
export default Overlay;
|
|
64
|
-
//# sourceMappingURL=Overlay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","Pressable","StyleSheet","Animated","interpolate","interpolateDeprecated","interpolateNode","cond","greaterThan","PROGRESS_EPSILON","Overlay","forwardRef","ref","progress","onPress","style","accessibilityLabel","props","animatedStyle","opacity","inputRange","OS","outputRange","zIndex","styles","overlay","overlayStyle","pressable","select","web","WebkitTapHighlightColor","default","create","absoluteFillObject","backgroundColor","flex"],"sourceRoot":"../../../../src","sources":["views/legacy/Overlay.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AAC9D,OAAOC,QAAQ,MAAM,yBAAyB;AAE9C,MAAM;EACJ;EACAC,WAAW,EAAEC,qBAAqB;EAClCC,eAAe;EACfC,IAAI;EACJC;AACF,CAAC,GAAGL,QAAQ;AAEZ,MAAMC,WAAmC,GACvCE,eAAe,IAAID,qBAAqB;AAE1C,MAAMI,gBAAgB,GAAG,IAAI;AAQ7B,MAAMC,OAAO,gBAAGX,KAAK,CAACY,UAAU,CAAC,SAASD,OAAO,OAQ/CE,GAA6B,EAC7B;EAAA,IARA;IACEC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLC,kBAAkB,GAAG,cAAc;IACnC,GAAGC;EACE,CAAC;EAGR,MAAMC,aAAa,GAAG;IACpBC,OAAO,EAAEf,WAAW,CAACS,QAAQ,EAAE;MAC7B;MACA;MACA;MACA;MACAO,UAAU,EACRpB,QAAQ,CAACqB,EAAE,KAAK,SAAS,IAAIrB,QAAQ,CAACqB,EAAE,KAAK,OAAO,GAChD,CAAC,CAAC,EAAE,CAAC,CAAC,GACN,CAACZ,gBAAgB,EAAE,CAAC,CAAC;MAC3Ba,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC;IACpB,CAAC,CAAC;IACF;IACA;IACA;IACAC,MAAM,EAAEhB,IAAI,CAACC,WA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