react-native-drawer-layout 4.0.0-alpha.7 → 4.0.0-alpha.9

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 (51) hide show
  1. package/lib/commonjs/index.js +0 -7
  2. package/lib/commonjs/index.js.map +1 -1
  3. package/lib/commonjs/utils/getDrawerWidth.js +9 -10
  4. package/lib/commonjs/utils/getDrawerWidth.js.map +1 -1
  5. package/lib/commonjs/views/Drawer.js +1 -9
  6. package/lib/commonjs/views/Drawer.js.map +1 -1
  7. package/lib/commonjs/views/Drawer.native.js +31 -56
  8. package/lib/commonjs/views/Drawer.native.js.map +1 -1
  9. package/lib/commonjs/views/GestureHandler.js +10 -4
  10. package/lib/commonjs/views/GestureHandler.js.map +1 -1
  11. package/lib/commonjs/views/GestureHandlerNative.js +12 -17
  12. package/lib/commonjs/views/GestureHandlerNative.js.map +1 -1
  13. package/lib/module/index.js +0 -1
  14. package/lib/module/index.js.map +1 -1
  15. package/lib/module/utils/getDrawerWidth.js +10 -11
  16. package/lib/module/utils/getDrawerWidth.js.map +1 -1
  17. package/lib/module/views/Drawer.js +1 -9
  18. package/lib/module/views/Drawer.js.map +1 -1
  19. package/lib/module/views/Drawer.native.js +33 -58
  20. package/lib/module/views/Drawer.native.js.map +1 -1
  21. package/lib/module/views/GestureHandler.js +8 -3
  22. package/lib/module/views/GestureHandler.js.map +1 -1
  23. package/lib/module/views/GestureHandlerNative.js +1 -10
  24. package/lib/module/views/GestureHandlerNative.js.map +1 -1
  25. package/lib/typescript/src/index.d.ts +0 -1
  26. package/lib/typescript/src/index.d.ts.map +1 -1
  27. package/lib/typescript/src/types.d.ts +3 -4
  28. package/lib/typescript/src/types.d.ts.map +1 -1
  29. package/lib/typescript/src/utils/getDrawerWidth.d.ts.map +1 -1
  30. package/lib/typescript/src/views/Drawer.d.ts.map +1 -1
  31. package/lib/typescript/src/views/Drawer.native.d.ts +1 -1
  32. package/lib/typescript/src/views/Drawer.native.d.ts.map +1 -1
  33. package/lib/typescript/src/views/GestureHandler.d.ts +9 -3
  34. package/lib/typescript/src/views/GestureHandler.d.ts.map +1 -1
  35. package/lib/typescript/src/views/GestureHandlerNative.d.ts +1 -4
  36. package/lib/typescript/src/views/GestureHandlerNative.d.ts.map +1 -1
  37. package/package.json +2 -2
  38. package/src/index.tsx +0 -1
  39. package/src/types.tsx +3 -4
  40. package/src/utils/getDrawerWidth.tsx +12 -22
  41. package/src/views/Drawer.native.tsx +31 -56
  42. package/src/views/Drawer.tsx +0 -16
  43. package/src/views/GestureHandler.tsx +20 -14
  44. package/src/views/GestureHandlerNative.tsx +2 -19
  45. package/lib/commonjs/utils/DrawerGestureContext.js +0 -11
  46. package/lib/commonjs/utils/DrawerGestureContext.js.map +0 -1
  47. package/lib/module/utils/DrawerGestureContext.js +0 -3
  48. package/lib/module/utils/DrawerGestureContext.js.map +0 -1
  49. package/lib/typescript/src/utils/DrawerGestureContext.d.ts +0 -3
  50. package/lib/typescript/src/utils/DrawerGestureContext.d.ts.map +0 -1
  51. package/src/utils/DrawerGestureContext.tsx +0 -4
@@ -8,8 +8,6 @@ import { getDrawerWidth } from '../utils/getDrawerWidth';
8
8
  import { useFakeSharedValue } from '../utils/useFakeSharedValue';
9
9
  import { Overlay } from './Overlay';
10
10
 
11
- const DRAWER_BORDER_RADIUS = 16;
12
-
13
11
  export function Drawer({
14
12
  layout: customLayout,
15
13
  drawerPosition = 'left',
@@ -58,19 +56,6 @@ export function Drawer({
58
56
  const isOpen = drawerType === 'permanent' ? true : open;
59
57
  const isRight = drawerPosition === 'right';
60
58
 
61
- const borderRadiiStyle =
62
- drawerType !== 'permanent'
63
- ? isRight
64
- ? {
65
- borderTopLeftRadius: DRAWER_BORDER_RADIUS,
66
- borderBottomLeftRadius: DRAWER_BORDER_RADIUS,
67
- }
68
- : {
69
- borderTopRightRadius: DRAWER_BORDER_RADIUS,
70
- borderBottomRightRadius: DRAWER_BORDER_RADIUS,
71
- }
72
- : null;
73
-
74
59
  const drawerAnimatedStyle =
75
60
  drawerType !== 'permanent'
76
61
  ? {
@@ -151,7 +136,6 @@ export function Drawer({
151
136
  position: drawerType === 'permanent' ? 'relative' : 'absolute',
152
137
  zIndex: drawerType === 'back' ? -1 : 0,
153
138
  },
154
- borderRadiiStyle,
155
139
  drawerAnimatedStyle,
156
140
  drawerStyle,
157
141
  ]}
@@ -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';
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DrawerGestureContext = void 0;
7
- var React = _interopRequireWildcard(require("react"));
8
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
9
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
10
- const DrawerGestureContext = exports.DrawerGestureContext = /*#__PURE__*/React.createContext(null);
11
- //# sourceMappingURL=DrawerGestureContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","DrawerGestureContext","exports","createContext"],"sourceRoot":"../../../src","sources":["utils/DrawerGestureContext.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAExB,MAAMY,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,gBAC/BxB,KAAK,CAAC0B,aAAa,CAA8B,IAAI,CAAC"}
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- export const DrawerGestureContext = /*#__PURE__*/React.createContext(null);
3
- //# sourceMappingURL=DrawerGestureContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","DrawerGestureContext","createContext"],"sourceRoot":"../../../src","sources":["utils/DrawerGestureContext.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAO,MAAMC,oBAAoB,gBAC/BD,KAAK,CAACE,aAAa,CAA8B,IAAI,CAAC"}
@@ -1,3 +0,0 @@
1
- import * as React from 'react';
2
- export declare const DrawerGestureContext: React.Context<React.RefObject<any> | null>;
3
- //# sourceMappingURL=DrawerGestureContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DrawerGestureContext.d.ts","sourceRoot":"","sources":["../../../../src/utils/DrawerGestureContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,eAAO,MAAM,oBAAoB,4CACuB,CAAC"}
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
-
3
- export const DrawerGestureContext =
4
- React.createContext<React.RefObject<any> | null>(null);