react-native-drawer-layout 4.0.0-alpha.8 → 4.0.0-rc.0

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.
Files changed (73) hide show
  1. package/lib/commonjs/index.js +0 -7
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/types.js.map +1 -1
  4. package/lib/commonjs/utils/DrawerProgressContext.js +1 -1
  5. package/lib/commonjs/utils/DrawerProgressContext.js.map +1 -1
  6. package/lib/commonjs/utils/getDrawerWidth.js +7 -9
  7. package/lib/commonjs/utils/getDrawerWidth.js.map +1 -1
  8. package/lib/commonjs/utils/useDrawerProgress.js +1 -1
  9. package/lib/commonjs/utils/useDrawerProgress.js.map +1 -1
  10. package/lib/commonjs/utils/useFakeSharedValue.js +1 -1
  11. package/lib/commonjs/utils/useFakeSharedValue.js.map +1 -1
  12. package/lib/commonjs/views/Drawer.js +36 -21
  13. package/lib/commonjs/views/Drawer.js.map +1 -1
  14. package/lib/commonjs/views/Drawer.native.js +60 -74
  15. package/lib/commonjs/views/Drawer.native.js.map +1 -1
  16. package/lib/commonjs/views/GestureHandler.android.js.map +1 -1
  17. package/lib/commonjs/views/GestureHandler.ios.js.map +1 -1
  18. package/lib/commonjs/views/GestureHandler.js +13 -8
  19. package/lib/commonjs/views/GestureHandler.js.map +1 -1
  20. package/lib/commonjs/views/GestureHandlerNative.js +12 -17
  21. package/lib/commonjs/views/GestureHandlerNative.js.map +1 -1
  22. package/lib/commonjs/views/Overlay.js +9 -10
  23. package/lib/commonjs/views/Overlay.js.map +1 -1
  24. package/lib/commonjs/views/Overlay.native.js +9 -10
  25. package/lib/commonjs/views/Overlay.native.js.map +1 -1
  26. package/lib/module/index.js +0 -1
  27. package/lib/module/index.js.map +1 -1
  28. package/lib/module/types.js.map +1 -1
  29. package/lib/module/utils/DrawerProgressContext.js.map +1 -1
  30. package/lib/module/utils/getDrawerWidth.js +7 -9
  31. package/lib/module/utils/getDrawerWidth.js.map +1 -1
  32. package/lib/module/utils/useDrawerProgress.js.map +1 -1
  33. package/lib/module/utils/useFakeSharedValue.js.map +1 -1
  34. package/lib/module/views/Drawer.js +34 -19
  35. package/lib/module/views/Drawer.js.map +1 -1
  36. package/lib/module/views/Drawer.native.js +60 -74
  37. package/lib/module/views/Drawer.native.js.map +1 -1
  38. package/lib/module/views/GestureHandler.android.js.map +1 -1
  39. package/lib/module/views/GestureHandler.ios.js.map +1 -1
  40. package/lib/module/views/GestureHandler.js +11 -6
  41. package/lib/module/views/GestureHandler.js.map +1 -1
  42. package/lib/module/views/GestureHandlerNative.js +1 -10
  43. package/lib/module/views/GestureHandlerNative.js.map +1 -1
  44. package/lib/module/views/Overlay.js +8 -9
  45. package/lib/module/views/Overlay.js.map +1 -1
  46. package/lib/module/views/Overlay.native.js +8 -9
  47. package/lib/module/views/Overlay.native.js.map +1 -1
  48. package/lib/typescript/src/index.d.ts +0 -1
  49. package/lib/typescript/src/index.d.ts.map +1 -1
  50. package/lib/typescript/src/types.d.ts +8 -4
  51. package/lib/typescript/src/types.d.ts.map +1 -1
  52. package/lib/typescript/src/views/Drawer.d.ts +1 -1
  53. package/lib/typescript/src/views/Drawer.d.ts.map +1 -1
  54. package/lib/typescript/src/views/Drawer.native.d.ts +1 -1
  55. package/lib/typescript/src/views/Drawer.native.d.ts.map +1 -1
  56. package/lib/typescript/src/views/GestureHandler.d.ts +9 -3
  57. package/lib/typescript/src/views/GestureHandler.d.ts.map +1 -1
  58. package/lib/typescript/src/views/GestureHandlerNative.d.ts +1 -4
  59. package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +1 -1
  60. package/package.json +4 -4
  61. package/src/index.tsx +0 -1
  62. package/src/types.tsx +9 -4
  63. package/src/views/Drawer.native.tsx +44 -43
  64. package/src/views/Drawer.tsx +26 -15
  65. package/src/views/GestureHandler.tsx +20 -14
  66. package/src/views/GestureHandlerNative.tsx +2 -19
  67. package/lib/commonjs/utils/DrawerGestureContext.js +0 -11
  68. package/lib/commonjs/utils/DrawerGestureContext.js.map +0 -1
  69. package/lib/module/utils/DrawerGestureContext.js +0 -3
  70. package/lib/module/utils/DrawerGestureContext.js.map +0 -1
  71. package/lib/typescript/src/utils/DrawerGestureContext.d.ts +0 -3
  72. package/lib/typescript/src/utils/DrawerGestureContext.d.ts.map +0 -1
  73. package/src/utils/DrawerGestureContext.tsx +0 -4
@@ -1,14 +1,19 @@
1
1
  import * as React from 'react';
2
2
  import { View } from 'react-native';
3
- const Dummy = _ref => {
4
- let {
5
- children
6
- } = _ref;
3
+
4
+ // FIXME: Inline this type instead of getting it from react-native-gesture-handler
5
+ // Otherwise, we get a type error:
6
+ // Exported variable 'GestureDetector' has or is using name 'GestureDetectorProps' from external module ".." but cannot be named.
7
+
8
+ export const GestureDetector = ({
9
+ gesture: _0,
10
+ userSelect: _1,
11
+ children
12
+ }) => {
7
13
  return /*#__PURE__*/React.createElement(React.Fragment, null, children);
8
14
  };
9
- export const PanGestureHandler = Dummy;
10
- export const TapGestureHandler = Dummy;
11
15
  export const GestureHandlerRootView = View;
16
+ export const Gesture = undefined;
12
17
  export let GestureState = /*#__PURE__*/function (GestureState) {
13
18
  GestureState[GestureState["UNDETERMINED"] = 0] = "UNDETERMINED";
14
19
  GestureState[GestureState["FAILED"] = 1] = "FAILED";
@@ -1 +1 @@
1
- {"version":3,"names":["React","View","Dummy","_ref","children","createElement","Fragment","PanGestureHandler","TapGestureHandler","GestureHandlerRootView","GestureState"],"sourceRoot":"../../../src","sources":["views/GestureHandler.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAQ,cAAc;AAMnC,MAAMC,KAAU,GAAGC,IAAA;EAAA,IAAC;IAAEC;EAAwC,CAAC,GAAAD,IAAA;EAAA,oBAC7DH,KAAA,CAAAK,aAAA,CAAAL,KAAA,CAAAM,QAAA,QAAGF,QAAW,CAAC;AAAA,CAChB;AAED,OAAO,MAAMG,iBAAiB,GAC5BL,KAAyD;AAE3D,OAAO,MAAMM,iBAAiB,GAC5BN,KAAyD;AAE3D,OAAO,MAAMO,sBAAsB,GAAGR,IAAI;AAE1C,WAAkBS,YAAY,0BAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA"}
1
+ {"version":3,"names":["React","View","GestureDetector","gesture","_0","userSelect","_1","children","createElement","Fragment","GestureHandlerRootView","Gesture","undefined","GestureState"],"sourceRoot":"../../../src","sources":["views/GestureHandler.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,IAAI,QAAQ,cAAc;;AAGnC;AACA;AACA;;AAOA,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAC9BC,OAAO,EAAEC,EAAE;EACXC,UAAU,EAAEC,EAAE;EACdC;AACoB,CAAC,KAAK;EAC1B,oBAAOP,KAAA,CAAAQ,aAAA,CAAAR,KAAA,CAAAS,QAAA,QAAGF,QAAW,CAAC;AACxB,CAAC;AAED,OAAO,MAAMG,sBAAsB,GAAGT,IAAI;AAE1C,OAAO,MAAMU,OAEA,GAAGC,SAAS;AAEzB,WAAkBC,YAAY,0BAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAZA,YAAY,CAAZA,YAAY;EAAA,OAAZA,YAAY;AAAA","ignoreList":[]}
@@ -1,11 +1,2 @@
1
- import * as React from 'react';
2
- import { PanGestureHandler as PanGestureHandlerNative } from 'react-native-gesture-handler';
3
- import { DrawerGestureContext } from '../utils/DrawerGestureContext';
4
- export function PanGestureHandler(props) {
5
- const gestureRef = React.useRef(null);
6
- return /*#__PURE__*/React.createElement(DrawerGestureContext.Provider, {
7
- value: gestureRef
8
- }, /*#__PURE__*/React.createElement(PanGestureHandlerNative, props));
9
- }
10
- export { GestureHandlerRootView, State as GestureState, TapGestureHandler } from 'react-native-gesture-handler';
1
+ export { Gesture, GestureDetector, GestureHandlerRootView, State as GestureState } from 'react-native-gesture-handler';
11
2
  //# sourceMappingURL=GestureHandlerNative.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","PanGestureHandler","PanGestureHandlerNative","DrawerGestureContext","props","gestureRef","useRef","createElement","Provider","value","GestureHandlerRootView","State","GestureState","TapGestureHandler"],"sourceRoot":"../../../src","sources":["views/GestureHandlerNative.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SACEC,iBAAiB,IAAIC,uBAAuB,QAEvC,8BAA8B;AAErC,SAASC,oBAAoB,QAAQ,+BAA+B;AAEpE,OAAO,SAASF,iBAAiBA,CAACG,KAAkC,EAAE;EACpE,MAAMC,UAAU,GAAGL,KAAK,CAACM,MAAM,CAA0B,IAAI,CAAC;EAE9D,oBACEN,KAAA,CAAAO,aAAA,CAACJ,oBAAoB,CAACK,QAAQ;IAACC,KAAK,EAAEJ;EAAW,gBAC/CL,KAAA,CAAAO,aAAA,CAACL,uBAAuB,EAAKE,KAAQ,CACR,CAAC;AAEpC;AAGA,SACEM,sBAAsB,EACtBC,KAAK,IAAIC,YAAY,EACrBC,iBAAiB,QACZ,8BAA8B"}
1
+ {"version":3,"names":["Gesture","GestureDetector","GestureHandlerRootView","State","GestureState"],"sourceRoot":"../../../src","sources":["views/GestureHandlerNative.tsx"],"mappings":"AACA,SACEA,OAAO,EACPC,eAAe,EACfC,sBAAsB,EACtBC,KAAK,IAAIC,YAAY,QAChB,8BAA8B","ignoreList":[]}
@@ -1,14 +1,13 @@
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); }
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import * as React from 'react';
3
3
  import { Pressable, StyleSheet, View } from 'react-native';
4
- export function Overlay(_ref) {
5
- let {
6
- open,
7
- onPress,
8
- style,
9
- accessibilityLabel = 'Close drawer',
10
- ...rest
11
- } = _ref;
4
+ export function Overlay({
5
+ open,
6
+ onPress,
7
+ style,
8
+ accessibilityLabel = 'Close drawer',
9
+ ...rest
10
+ }) {
12
11
  return /*#__PURE__*/React.createElement(View, _extends({}, rest, {
13
12
  style: [styles.overlay, {
14
13
  opacity: open ? 1 : 0,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Pressable","StyleSheet","View","Overlay","_ref","open","onPress","style","accessibilityLabel","rest","createElement","_extends","styles","overlay","opacity","pointerEvents","accessibilityElementsHidden","importantForAccessibility","pressable","accessibilityRole","create","absoluteFillObject","backgroundColor","WebkitTapHighlightColor","transition","flex"],"sourceRoot":"../../../src","sources":["views/Overlay.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAI1D,OAAO,SAASC,OAAOA,CAAAC,IAAA,EAMN;EAAA,IANO;IACtBC,IAAI;IACJC,OAAO;IACPC,KAAK;IACLC,kBAAkB,GAAG,cAAc;IACnC,GAAGC;EACS,CAAC,GAAAL,IAAA;EACb,oBACEL,KAAA,CAAAW,aAAA,CAACR,IAAI,EAAAS,QAAA,KACCF,IAAI;IACRF,KAAK,EAAE,CACLK,MAAM,CAACC,OAAO,EACd;MAAEC,OAAO,EAAET,IAAI,GAAG,CAAC,GAAG,CAAC;MAAEU,aAAa,EAAEV,IAAI,GAAG,MAAM,GAAG;IAAO,CAAC,EAChEE,KAAK,CACL;IACFS,2BAA2B,EAAE,CAACX,IAAK;IACnCY,yBAAyB,EAAEZ,IAAI,GAAG,MAAM,GAAG;EAAsB,iBAEjEN,KAAA,CAAAW,aAAA,CAACV,SAAS;IACRM,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAE,CAACK,MAAM,CAACM,SAAS,EAAE;MAAEH,aAAa,EAAEV,IAAI,GAAG,MAAM,GAAG;IAAO,CAAC,CAAE;IACrEc,iBAAiB,EAAC,QAAQ;IAC1BX,kBAAkB,EAAEA;EAAmB,CACxC,CACG,CAAC;AAEX;AAEA,MAAMI,MAAM,GAAGX,UAAU,CAACmB,MAAM,CAAC;EAC/BP,OAAO,EAAE;IACP,GAAGZ,UAAU,CAACoB,kBAAkB;IAChCC,eAAe,EAAE,oBAAoB;IACrC;IACA;IACA;IACAC,uBAAuB,EAAE,aAAa;IACtCC,UAAU,EAAE;EACd,CAAC;EACDN,SAAS,EAAE;IACTO,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["React","Pressable","StyleSheet","View","Overlay","open","onPress","style","accessibilityLabel","rest","createElement","_extends","styles","overlay","opacity","pointerEvents","accessibilityElementsHidden","importantForAccessibility","pressable","accessibilityRole","create","absoluteFillObject","backgroundColor","WebkitTapHighlightColor","transition","flex"],"sourceRoot":"../../../src","sources":["views/Overlay.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAI1D,OAAO,SAASC,OAAOA,CAAC;EACtBC,IAAI;EACJC,OAAO;EACPC,KAAK;EACLC,kBAAkB,GAAG,cAAc;EACnC,GAAGC;AACS,CAAC,EAAE;EACf,oBACET,KAAA,CAAAU,aAAA,CAACP,IAAI,EAAAQ,QAAA,KACCF,IAAI;IACRF,KAAK,EAAE,CACLK,MAAM,CAACC,OAAO,EACd;MAAEC,OAAO,EAAET,IAAI,GAAG,CAAC,GAAG,CAAC;MAAEU,aAAa,EAAEV,IAAI,GAAG,MAAM,GAAG;IAAO,CAAC,EAChEE,KAAK,CACL;IACFS,2BAA2B,EAAE,CAACX,IAAK;IACnCY,yBAAyB,EAAEZ,IAAI,GAAG,MAAM,GAAG;EAAsB,iBAEjEL,KAAA,CAAAU,aAAA,CAACT,SAAS;IACRK,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAE,CAACK,MAAM,CAACM,SAAS,EAAE;MAAEH,aAAa,EAAEV,IAAI,GAAG,MAAM,GAAG;IAAO,CAAC,CAAE;IACrEc,iBAAiB,EAAC,QAAQ;IAC1BX,kBAAkB,EAAEA;EAAmB,CACxC,CACG,CAAC;AAEX;AAEA,MAAMI,MAAM,GAAGV,UAAU,CAACkB,MAAM,CAAC;EAC/BP,OAAO,EAAE;IACP,GAAGX,UAAU,CAACmB,kBAAkB;IAChCC,eAAe,EAAE,oBAAoB;IACrC;IACA;IACA;IACAC,uBAAuB,EAAE,aAAa;IACtCC,UAAU,EAAE;EACd,CAAC;EACDN,SAAS,EAAE;IACTO,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,16 +1,15 @@
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); }
1
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
2
2
  import * as React from 'react';
3
3
  import { Pressable, StyleSheet } from 'react-native';
4
4
  import Animated, { useAnimatedProps, useAnimatedStyle } from 'react-native-reanimated';
5
5
  const PROGRESS_EPSILON = 0.05;
6
- export function Overlay(_ref) {
7
- let {
8
- progress,
9
- onPress,
10
- style,
11
- accessibilityLabel = 'Close drawer',
12
- ...rest
13
- } = _ref;
6
+ export function Overlay({
7
+ progress,
8
+ onPress,
9
+ style,
10
+ accessibilityLabel = 'Close drawer',
11
+ ...rest
12
+ }) {
14
13
  const animatedStyle = useAnimatedStyle(() => {
15
14
  return {
16
15
  opacity: progress.value,
@@ -1 +1 @@
1
- {"version":3,"names":["React","Pressable","StyleSheet","Animated","useAnimatedProps","useAnimatedStyle","PROGRESS_EPSILON","Overlay","_ref","progress","onPress","style","accessibilityLabel","rest","animatedStyle","opacity","value","zIndex","animatedProps","active","pointerEvents","accessibilityElementsHidden","importantForAccessibility","createElement","View","_extends","styles","overlay","pressable","accessibilityRole","create","absoluteFillObject","backgroundColor","flex"],"sourceRoot":"../../../src","sources":["views/Overlay.native.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AACpD,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,QACX,yBAAyB;AAIhC,MAAMC,gBAAgB,GAAG,IAAI;AAE7B,OAAO,SAASC,OAAOA,CAAAC,IAAA,EAMN;EAAA,IANO;IACtBC,QAAQ;IACRC,OAAO;IACPC,KAAK;IACLC,kBAAkB,GAAG,cAAc;IACnC,GAAGC;EACS,CAAC,GAAAL,IAAA;EACb,MAAMM,aAAa,GAAGT,gBAAgB,CAAC,MAAM;IAC3C,OAAO;MACLU,OAAO,EAAEN,QAAQ,CAACO,KAAK;MACvB;MACA;MACAC,MAAM,EAAER,QAAQ,CAACO,KAAK,GAAGV,gBAAgB,GAAG,CAAC,GAAG,CAAC;IACnD,CAAC;EACH,CAAC,CAAC;EAEF,MAAMY,aAAa,GAAGd,gBAAgB,CAAC,MAAM;IAC3C,MAAMe,MAAM,GAAGV,QAAQ,CAACO,KAAK,GAAGV,gBAAgB;IAEhD,OAAO;MACLc,aAAa,EAAED,MAAM,GAAG,MAAM,GAAG,MAAM;MACvCE,2BAA2B,EAAE,CAACF,MAAM;MACpCG,yBAAyB,EAAEH,MAAM,GAAG,MAAM,GAAG;IAC/C,CAAC;EACH,CAAC,CAAC;EAEF,oBACEnB,KAAA,CAAAuB,aAAA,CAACpB,QAAQ,CAACqB,IAAI,EAAAC,QAAA,KACRZ,IAAI;IACRF,KAAK,EAAE,CAACe,MAAM,CAACC,OAAO,EAAEb,aAAa,EAAEH,KAAK,CAAE;IAC9CO,aAAa,EAAEA;EAAc,iBAE7BlB,KAAA,CAAAuB,aAAA,CAACtB,SAAS;IACRS,OAAO,EAAEA,OAAQ;IACjBC,KAAK,EAAEe,MAAM,CAACE,SAAU;IACxBC,iBAAiB,EAAC,QAAQ;IAC1BjB,kBAAkB,EAAEA;EAAmB,CACxC,CACY,CAAC;AAEpB;AAEA,MAAMc,MAAM,GAAGxB,UAAU,CAAC4B,MAAM,CAAC;EAC/BH,OAAO,EAAE;IACP,GAAGzB,UAAU,CAAC6B,kBAAkB;IAChCC,eAAe,EAAE;EACnB,CAAC;EACDJ,SAAS,EAAE;IACTK,IAAI,EAAE,CAAC;IACPb,aAAa,EAAE;EACjB;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["React","Pressable","StyleSheet","Animated","useAnimatedProps","useAnimatedStyle","PROGRESS_EPSILON","Overlay","progress","onPress","style","accessibilityLabel","rest","animatedStyle","opacity","value","zIndex","animatedProps","active","pointerEvents","accessibilityElementsHidden","importantForAccessibility","createElement","View","_extends","styles","overlay","pressable","accessibilityRole","create","absoluteFillObject","backgroundColor","flex"],"sourceRoot":"../../../src","sources":["views/Overlay.native.tsx"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AACpD,OAAOC,QAAQ,IACbC,gBAAgB,EAChBC,gBAAgB,QACX,yBAAyB;AAIhC,MAAMC,gBAAgB,GAAG,IAAI;AAE7B,OAAO,SAASC,OAAO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 +1,3 @@
1
- export { DrawerGestureContext } from './utils/DrawerGestureContext';
2
1
  export { DrawerProgressContext } from './utils/DrawerProgressContext';
3
2
  export { useDrawerProgress } from './utils/useDrawerProgress';
4
3
  export { Drawer } from './views/Drawer';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { StyleProp, View, ViewStyle } from 'react-native';
3
- import type { PanGestureHandler } from 'react-native-gesture-handler';
3
+ import type { PanGesture } from 'react-native-gesture-handler';
4
4
  import type { SharedValue } from 'react-native-reanimated';
5
5
  export type Layout = {
6
6
  width: number;
@@ -51,6 +51,11 @@ export type DrawerProps = {
51
51
  width: number;
52
52
  height: number;
53
53
  };
54
+ /**
55
+ * Locale direction of the drawer.
56
+ * Defaults to `rtl` when `I18nManager.isRTL` is `true` on Android & iOS, otherwise `ltr`.
57
+ */
58
+ direction?: 'ltr' | 'rtl';
54
59
  /**
55
60
  * Position of the drawer on the screen.
56
61
  * Defaults to `right` in RTL mode, otherwise `left`.
@@ -119,10 +124,9 @@ export type DrawerProps = {
119
124
  */
120
125
  swipeMinVelocity?: number;
121
126
  /**
122
- * Props to pass to the underlying pan gesture handler.
123
- * This is not supported on Web.
127
+ * Function to modify the pan gesture handler via RNGH properties API.
124
128
  */
125
- gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
129
+ configureGestureHandler?: (gesture: PanGesture) => PanGesture;
126
130
  /**
127
131
  * Style object for the wrapper view.
128
132
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D,MAAM,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IAEd;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,OAAO,EAAE,MAAM,IAAI,CAAC;IAEpB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAE5B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAE7B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B;;OAEG;IACH,iBAAiB,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAE/C;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAE7C;;OAEG;IACH,mBAAmB,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IAE3C;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,M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';
3
- export declare function Drawer({ layout: customLayout, drawerPosition, drawerStyle, drawerType, onClose, onTransitionStart, onTransitionEnd, open, overlayStyle, overlayAccessibilityLabel, renderDrawerContent, children, style, }: DrawerProps): React.JSX.Element;
3
+ export declare function Drawer({ layout: customLayout, direction, drawerPosition, drawerStyle, drawerType, onClose, onTransitionStart, onTransitionEnd, open, overlayStyle, overlayAccessibilityLabel, renderDrawerContent, children, style, }: DrawerProps): React.JSX.Element;
4
4
  //# sourceMappingURL=Drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../src/views/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAM5C,wBAAgB,MAAM,CAAC,EACrB,MAAM,EAAE,YAAY,EACpB,cAAuB,EACvB,WAAW,EACX,UAAoB,EACpB,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,EACnB,QAAQ,EACR,KAAK,GACN,EAAE,WAAW,qBA4Hb"}
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../../src/views/Drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAM5C,wBAAgB,MAAM,CAAC,EACrB,MAAM,EAAE,YAAY,EACpB,SAAiB,EACjB,cAAuD,EACvD,WAAW,EACX,UAAoB,EACpB,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,yBAAyB,EACzB,mBAAmB,EACnB,QAAQ,EACR,KAAK,GACN,EAAE,WAAW,qBAsIb"}
@@ -1,4 +1,4 @@
1
1
  import * as React from 'react';
2
2
  import type { DrawerProps } from '../types';
3
- export declare function Drawer({ layout: customLayout, drawerPosition, drawerStyle, drawerType, gestureHandlerProps, hideStatusBarOnOpen, keyboardDismissMode, onClose, onOpen, onGestureStart, onGestureCancel, onGestureEnd, onTransitionStart, onTransitionEnd, open, overlayStyle, overlayAccessibilityLabel, statusBarAnimation, swipeEnabled, swipeEdgeWidth, swipeMinDistance, swipeMinVelocity, renderDrawerContent, children, style, }: DrawerProps): React.JSX.Element;
3
+ export declare function Drawer({ layout: customLayout, direction, drawerPosition, drawerStyle, drawerType, configureGestureHandler, hideStatusBarOnOpen, keyboardDismissMode, onClose, onOpen, onGestureStart, onGestureCancel, onGestureEnd, onTransitionStart, onTransitionEnd, open, overlayStyle, overlayAccessibilityLabel, statusBarAnimation, swipeEnabled, swipeEdgeWidth, swipeMinDistance, swipeMinVelocity, renderDrawerContent, children, style, }: DrawerProps): React.JSX.Element;
4
4
  //# sourceMappingURL=Drawer.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Drawer.native.d.ts","sourceRoot":"","sources":["../../../../src/views/Drawer.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAsB/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAsB5C,wBAAgB,MAAM,CAAC,EACrB,MAAM,EAAE,YAAY,EACpB,cAAoE,EACpE,WAAW,EACX,UAAoB,EACpB,mBAAmB,EACnB,mBAA2B,EAC3B,mBAA+B,EAC/B,OAAO,EACP,MAAM,EACN,cAAc,EACd,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,yBAAyB,EACzB,kBAA4B,EAC5B,YAEyB,EACzB,cAAiC,EACjC,gBAAqC,EACrC,gBAAqC,EACrC,mBAAmB,EACnB,QAAQ,EACR,KAAK,GACN,EAAE,WAAW,qBAiWb"}
1
+ {"version":3,"file":"Drawer.native.d.ts","sourceRoot":"","sources":["../../../../src/views/Drawer.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAsB5C,wBAAgB,MAAM,CAAC,EACrB,MAAM,EAAE,YAAY,EACpB,SAA4D,EAC5D,cAAuD,EACvD,WAAW,EACX,UAAoB,EACpB,uBAAuB,EACvB,mBAA2B,EAC3B,mBAA+B,EAC/B,OAAO,EACP,MAAM,EACN,cAAc,EACd,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,IAAI,EACJ,YAAY,EACZ,yBAAyB,EACzB,kBAA4B,EAC5B,YAEyB,EACzB,cAAiC,EACjC,gBAAqC,EACrC,gBAAqC,EACrC,mBAAmB,EACnB,QAAQ,EACR,KAAK,GACN,EAAE,WAAW,qBAkWb"}
@@ -1,8 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { View } from 'react-native';
3
- export declare const PanGestureHandler: React.ComponentType<import("react-native-gesture-handler").PanGestureHandlerProps>;
4
- export declare const TapGestureHandler: React.ComponentType<import("react-native-gesture-handler").TapGestureHandlerProps>;
3
+ import type { GestureType } from 'react-native-gesture-handler';
4
+ type GestureDetectorProps = {
5
+ gesture: GestureType | undefined;
6
+ userSelect?: 'none' | 'auto' | 'text';
7
+ children: React.ReactNode;
8
+ };
9
+ export declare const GestureDetector: ({ gesture: _0, userSelect: _1, children, }: GestureDetectorProps) => React.JSX.Element;
5
10
  export declare const GestureHandlerRootView: typeof View;
11
+ export declare const Gesture: typeof import('react-native-gesture-handler').Gesture | undefined;
6
12
  export declare const enum GestureState {
7
13
  UNDETERMINED = 0,
8
14
  FAILED = 1,
@@ -11,5 +17,5 @@ export declare const enum GestureState {
11
17
  ACTIVE = 4,
12
18
  END = 5
13
19
  }
14
- export type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
20
+ export {};
15
21
  //# sourceMappingURL=GestureHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GestureHandler.d.ts","sourceRoot":"","sources":["../../../../src/views/GestureHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAUpC,eAAO,MAAM,iBAAiB,oFAC6B,CAAC;AAE5D,eAAO,MAAM,iBAAiB,oFAC6B,CAAC;AAE5D,eAAO,MAAM,sBAAsB,aAAO,CAAC;AAE3C,0BAAkB,YAAY;IAC5B,YAAY,IAAI;IAChB,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,MAAM,IAAI;IACV,GAAG,IAAI;CACR;AAED,YAAY,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"GestureHandler.d.ts","sourceRoot":"","sources":["../../../../src/views/GestureHandler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAKhE,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,WAAW,GAAG,SAAS,CAAC;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IACtC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,eAAe,+CAIzB,oBAAoB,sBAEtB,CAAC;AAEF,eAAO,MAAM,sBAAsB,aAAO,CAAC;AAE3C,eAAO,MAAM,OAAO,EAChB,cAAc,8BAA8B,EAAE,OAAO,GACrD,SAAqB,CAAC;AAE1B,0BAAkB,YAAY;IAC5B,YAAY,IAAI;IAChB,MAAM,IAAI;IACV,KAAK,IAAI;IACT,SAAS,IAAI;IACb,MAAM,IAAI;IACV,GAAG,IAAI;CACR"}
@@ -1,6 +1,3 @@
1
- import * as React from 'react';
2
- import { type PanGestureHandlerProperties } from 'react-native-gesture-handler';
3
- export declare function PanGestureHandler(props: PanGestureHandlerProperties): React.JSX.Element;
4
1
  export type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
5
- export { GestureHandlerRootView, State as GestureState, TapGestureHandler, } from 'react-native-gesture-handler';
2
+ export { Gesture, GestureDetector, GestureHandlerRootView, State as GestureState, } from 'react-native-gesture-handler';
6
3
  //# sourceMappingURL=GestureHandlerNative.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GestureHandlerNative.d.ts","sourceRoot":"","sources":["../../../../src/views/GestureHandlerNative.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,2BAA2B,EACjC,MAAM,8BAA8B,CAAC;AAItC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,2BAA2B,qBAQnE;AAED,YAAY,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EACL,sBAAsB,EACtB,KAAK,IAAI,YAAY,EACrB,iBAAiB,GAClB,MAAM,8BAA8B,CAAC"}
1
+ {"version":3,"file":"GestureHandlerNative.d.ts","sourceRoot":"","sources":["../../../../src/views/GestureHandlerNative.tsx"],"names":[],"mappings":"AAAA,YAAY,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EACL,OAAO,EACP,eAAe,EACf,sBAAsB,EACtB,KAAK,IAAI,YAAY,GACtB,MAAM,8BAA8B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-drawer-layout",
3
3
  "description": "Drawer component for React Native",
4
- "version": "4.0.0-alpha.8",
4
+ "version": "4.0.0-rc.0",
5
5
  "keywords": [
6
6
  "react-native-component",
7
7
  "react-component",
@@ -42,9 +42,9 @@
42
42
  "devDependencies": {
43
43
  "del-cli": "^5.1.0",
44
44
  "react": "18.2.0",
45
- "react-native": "0.73.2",
45
+ "react-native": "0.74.2",
46
46
  "react-native-builder-bob": "^0.23.2",
47
- "typescript": "^5.3.3"
47
+ "typescript": "^5.5.2"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "react": ">= 18.2.0",
@@ -66,5 +66,5 @@
66
66
  ]
67
67
  ]
68
68
  },
69
- "gitHead": "b1ed6b0d299189c62f0dc8d7171c243adc674a30"
69
+ "gitHead": "2a1d67089eea2a3d87e38a870ccee35a79c55d7d"
70
70
  }
package/src/index.tsx CHANGED
@@ -1,4 +1,3 @@
1
- export { DrawerGestureContext } from './utils/DrawerGestureContext';
2
1
  export { DrawerProgressContext } from './utils/DrawerProgressContext';
3
2
  export { useDrawerProgress } from './utils/useDrawerProgress';
4
3
  export { Drawer } from './views/Drawer';
package/src/types.tsx CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { StyleProp, View, ViewStyle } from 'react-native';
3
- import type { PanGestureHandler } from 'react-native-gesture-handler';
3
+ import type { PanGesture } from 'react-native-gesture-handler';
4
4
  import type { SharedValue } from 'react-native-reanimated';
5
5
 
6
6
  export type Layout = { width: number; height: number };
@@ -57,6 +57,12 @@ export type DrawerProps = {
57
57
  */
58
58
  layout?: { width: number; height: number };
59
59
 
60
+ /**
61
+ * Locale direction of the drawer.
62
+ * Defaults to `rtl` when `I18nManager.isRTL` is `true` on Android & iOS, otherwise `ltr`.
63
+ */
64
+ direction?: 'ltr' | 'rtl';
65
+
60
66
  /**
61
67
  * Position of the drawer on the screen.
62
68
  * Defaults to `right` in RTL mode, otherwise `left`.
@@ -137,10 +143,9 @@ export type DrawerProps = {
137
143
  swipeMinVelocity?: number;
138
144
 
139
145
  /**
140
- * Props to pass to the underlying pan gesture handler.
141
- * This is not supported on Web.
146
+ * Function to modify the pan gesture handler via RNGH properties API.
142
147
  */
143
- gestureHandlerProps?: React.ComponentProps<typeof PanGestureHandler>;
148
+ configureGestureHandler?: (gesture: PanGesture) => PanGesture;
144
149
 
145
150
  /**
146
151
  * Style object for the wrapper view.
@@ -12,7 +12,6 @@ import {
12
12
  import Animated, {
13
13
  interpolate,
14
14
  runOnJS,
15
- useAnimatedGestureHandler,
16
15
  useAnimatedStyle,
17
16
  useDerivedValue,
18
17
  useSharedValue,
@@ -24,10 +23,10 @@ import type { DrawerProps } from '../types';
24
23
  import { DrawerProgressContext } from '../utils/DrawerProgressContext';
25
24
  import { getDrawerWidth } from '../utils/getDrawerWidth';
26
25
  import {
26
+ Gesture,
27
+ GestureDetector,
27
28
  GestureHandlerRootView,
28
29
  GestureState,
29
- PanGestureHandler,
30
- type PanGestureHandlerGestureEvent,
31
30
  } from './GestureHandler';
32
31
  import { Overlay } from './Overlay';
33
32
 
@@ -44,10 +43,11 @@ const minmax = (value: number, start: number, end: number) => {
44
43
 
45
44
  export function Drawer({
46
45
  layout: customLayout,
47
- drawerPosition = I18nManager.getConstants().isRTL ? 'right' : 'left',
46
+ direction = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr',
47
+ drawerPosition = direction === 'rtl' ? 'right' : 'left',
48
48
  drawerStyle,
49
49
  drawerType = 'front',
50
- gestureHandlerProps,
50
+ configureGestureHandler,
51
51
  hideStatusBarOnOpen = false,
52
52
  keyboardDismissMode = 'on-drag',
53
53
  onClose,
@@ -213,34 +213,28 @@ export function Drawer({
213
213
 
214
214
  React.useEffect(() => toggleDrawer(open), [open, toggleDrawer]);
215
215
 
216
- const onGestureEvent = useAnimatedGestureHandler<
217
- PanGestureHandlerGestureEvent,
218
- { startX: number; hasCalledOnStart: boolean }
219
- >({
220
- onStart: (event, ctx) => {
221
- ctx.hasCalledOnStart = false;
222
- ctx.startX = translationX.value;
216
+ const startX = useSharedValue(0);
217
+
218
+ let pan = Gesture?.Pan()
219
+ .onBegin((event) => {
220
+ startX.value = translationX.value;
223
221
  gestureState.value = event.state;
224
222
  touchStartX.value = event.x;
225
- },
226
- onCancel: () => {
227
- runOnJS(onGestureAbort)();
228
- },
229
- onActive: (event, ctx) => {
223
+ })
224
+ .onStart(() => {
225
+ runOnJS(onGestureBegin)();
226
+ })
227
+ .onChange((event) => {
230
228
  touchX.value = event.x;
231
- translationX.value = ctx.startX + event.translationX;
229
+ translationX.value = startX.value + event.translationX;
230
+ gestureState.value = event.state;
231
+ })
232
+ .onEnd((event, success) => {
232
233
  gestureState.value = event.state;
233
234
 
234
- // onStart will _always_ be called, even when the activation
235
- // criteria isn't met yet. This makes sure onGestureBegin is only
236
- // called when the criteria is really met.
237
- if (!ctx.hasCalledOnStart) {
238
- ctx.hasCalledOnStart = true;
239
- runOnJS(onGestureBegin)();
235
+ if (!success) {
236
+ runOnJS(onGestureAbort)();
240
237
  }
241
- },
242
- onEnd: (event) => {
243
- gestureState.value = event.state;
244
238
 
245
239
  const nextOpen =
246
240
  (Math.abs(event.translationX) > SWIPE_MIN_OFFSET &&
@@ -254,11 +248,16 @@ export function Drawer({
254
248
  : open;
255
249
 
256
250
  toggleDrawer(nextOpen, event.velocityX);
257
- },
258
- onFinish: () => {
259
251
  runOnJS(onGestureFinish)();
260
- },
261
- });
252
+ })
253
+ .activeOffsetX([-SWIPE_MIN_OFFSET, SWIPE_MIN_OFFSET])
254
+ .failOffsetY([-SWIPE_MIN_OFFSET, SWIPE_MIN_OFFSET])
255
+ .hitSlop(hitSlop)
256
+ .enabled(drawerType !== 'permanent' && swipeEnabled);
257
+
258
+ if (pan && configureGestureHandler) {
259
+ pan = configureGestureHandler(pan);
260
+ }
262
261
 
263
262
  const translateX = useDerivedValue(() => {
264
263
  // Comment stolen from react-native-gesture-handler/DrawerLayout
@@ -319,7 +318,13 @@ export function Drawer({
319
318
  translateX:
320
319
  // The drawer stays in place when `drawerType` is `back`
321
320
  (drawerType === 'back' ? 0 : translateX.value) +
322
- (drawerPosition === 'left' ? 0 : distanceFromEdge),
321
+ (direction === 'rtl'
322
+ ? drawerPosition === 'left'
323
+ ? -distanceFromEdge
324
+ : 0
325
+ : drawerPosition === 'left'
326
+ ? 0
327
+ : distanceFromEdge),
323
328
  },
324
329
  ],
325
330
  };
@@ -358,22 +363,18 @@ export function Drawer({
358
363
  return (
359
364
  <GestureHandlerRootView style={[styles.container, style]}>
360
365
  <DrawerProgressContext.Provider value={progress}>
361
- <PanGestureHandler
362
- activeOffsetX={[-SWIPE_MIN_OFFSET, SWIPE_MIN_OFFSET]}
363
- failOffsetY={[-SWIPE_MIN_OFFSET, SWIPE_MIN_OFFSET]}
364
- hitSlop={hitSlop}
365
- enabled={drawerType !== 'permanent' && swipeEnabled}
366
- onGestureEvent={onGestureEvent}
367
- {...gestureHandlerProps}
368
- >
366
+ <GestureDetector gesture={pan}>
369
367
  {/* Immediate child of gesture handler needs to be an Animated.View */}
370
368
  <Animated.View
371
369
  style={[
372
370
  styles.main,
373
371
  {
374
372
  flexDirection:
375
- drawerType === 'permanent' && !isRight
376
- ? 'row-reverse'
373
+ drawerType === 'permanent'
374
+ ? (isRight && direction === 'ltr') ||
375
+ (!isRight && direction === 'rtl')
376
+ ? 'row'
377
+ : 'row-reverse'
377
378
  : 'row',
378
379
  },
379
380
  ]}
@@ -419,7 +420,7 @@ export function Drawer({
419
420
  {renderDrawerContent()}
420
421
  </Animated.View>
421
422
  </Animated.View>
422
- </PanGestureHandler>
423
+ </GestureDetector>
423
424
  </DrawerProgressContext.Provider>
424
425
  </GestureHandlerRootView>
425
426
  );
@@ -10,7 +10,8 @@ import { Overlay } from './Overlay';
10
10
 
11
11
  export function Drawer({
12
12
  layout: customLayout,
13
- drawerPosition = 'left',
13
+ direction = 'ltr',
14
+ drawerPosition = direction === 'rtl' ? 'right' : 'left',
14
15
  drawerStyle,
15
16
  drawerType = 'front',
16
17
  onClose,
@@ -56,23 +57,28 @@ export function Drawer({
56
57
  const isOpen = drawerType === 'permanent' ? true : open;
57
58
  const isRight = drawerPosition === 'right';
58
59
 
60
+ let translateX = 0;
61
+
62
+ // The drawer stays in place at open position when `drawerType` is `back`
63
+ if (open || drawerType === 'back') {
64
+ if (direction === 'rtl') {
65
+ translateX = drawerPosition === 'left' ? drawerWidth - layout.width : 0;
66
+ } else {
67
+ translateX = drawerPosition === 'left' ? 0 : layout.width - drawerWidth;
68
+ }
69
+ } else {
70
+ if (direction === 'rtl') {
71
+ translateX = drawerPosition === 'left' ? -layout.width : drawerWidth;
72
+ } else {
73
+ translateX = drawerPosition === 'left' ? -drawerWidth : layout.width;
74
+ }
75
+ }
76
+
59
77
  const drawerAnimatedStyle =
60
78
  drawerType !== 'permanent'
61
79
  ? {
62
80
  transition: 'transform 0.3s',
63
- transform: [
64
- {
65
- // The drawer stays in place at open position when `drawerType` is `back`
66
- translateX:
67
- open || drawerType === 'back'
68
- ? drawerPosition === 'left'
69
- ? 0
70
- : layout.width - drawerWidth
71
- : drawerPosition === 'left'
72
- ? -drawerWidth
73
- : layout.width,
74
- },
75
- ],
81
+ transform: [{ translateX }],
76
82
  }
77
83
  : null;
78
84
 
@@ -101,7 +107,12 @@ export function Drawer({
101
107
  styles.main,
102
108
  {
103
109
  flexDirection:
104
- drawerType === 'permanent' && !isRight ? 'row-reverse' : 'row',
110
+ drawerType === 'permanent'
111
+ ? (isRight && direction === 'ltr') ||
112
+ (!isRight && direction === 'rtl')
113
+ ? 'row'
114
+ : 'row-reverse'
115
+ : 'row',
105
116
  },
106
117
  ]}
107
118
  >
@@ -1,22 +1,30 @@
1
1
  import * as React from 'react';
2
2
  import { View } from 'react-native';
3
- import type {
4
- PanGestureHandlerProperties,
5
- TapGestureHandlerProperties,
6
- } from 'react-native-gesture-handler';
3
+ import type { GestureType } from 'react-native-gesture-handler';
7
4
 
8
- const Dummy: any = ({ children }: { children: React.ReactNode }) => (
9
- <>{children}</>
10
- );
5
+ // FIXME: Inline this type instead of getting it from react-native-gesture-handler
6
+ // Otherwise, we get a type error:
7
+ // Exported variable 'GestureDetector' has or is using name 'GestureDetectorProps' from external module ".." but cannot be named.
8
+ type GestureDetectorProps = {
9
+ gesture: GestureType | undefined;
10
+ userSelect?: 'none' | 'auto' | 'text';
11
+ children: React.ReactNode;
12
+ };
11
13
 
12
- export const PanGestureHandler =
13
- Dummy as React.ComponentType<PanGestureHandlerProperties>;
14
-
15
- export const TapGestureHandler =
16
- Dummy as React.ComponentType<TapGestureHandlerProperties>;
14
+ export const GestureDetector = ({
15
+ gesture: _0,
16
+ userSelect: _1,
17
+ children,
18
+ }: GestureDetectorProps) => {
19
+ return <>{children}</>;
20
+ };
17
21
 
18
22
  export const GestureHandlerRootView = View;
19
23
 
24
+ export const Gesture:
25
+ | typeof import('react-native-gesture-handler').Gesture
26
+ | undefined = undefined;
27
+
20
28
  export const enum GestureState {
21
29
  UNDETERMINED = 0,
22
30
  FAILED = 1,
@@ -25,5 +33,3 @@ export const enum GestureState {
25
33
  ACTIVE = 4,
26
34
  END = 5,
27
35
  }
28
-
29
- export type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
@@ -1,24 +1,7 @@
1
- import * as React from 'react';
2
- import {
3
- PanGestureHandler as PanGestureHandlerNative,
4
- type PanGestureHandlerProperties,
5
- } from 'react-native-gesture-handler';
6
-
7
- import { DrawerGestureContext } from '../utils/DrawerGestureContext';
8
-
9
- export function PanGestureHandler(props: PanGestureHandlerProperties) {
10
- const gestureRef = React.useRef<PanGestureHandlerNative>(null);
11
-
12
- return (
13
- <DrawerGestureContext.Provider value={gestureRef}>
14
- <PanGestureHandlerNative {...props} />
15
- </DrawerGestureContext.Provider>
16
- );
17
- }
18
-
19
1
  export type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler';
20
2
  export {
3
+ Gesture,
4
+ GestureDetector,
21
5
  GestureHandlerRootView,
22
6
  State as GestureState,
23
- TapGestureHandler,
24
7
  } from 'react-native-gesture-handler';