@react-navigation/drawer 8.0.0-alpha.22 → 8.0.0-alpha.24
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/module/views/DrawerContentScrollView.js +33 -25
- package/lib/module/views/DrawerContentScrollView.js.map +1 -1
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts +5 -2
- package/lib/typescript/src/views/DrawerContentScrollView.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/views/DrawerContentScrollView.tsx +41 -35
|
@@ -2,46 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
import { UNSTABLE_CornerInset, useLocale } from '@react-navigation/native';
|
|
4
4
|
import * as React from 'react';
|
|
5
|
-
import { ScrollView, StyleSheet } from 'react-native';
|
|
5
|
+
import { Platform, ScrollView, StyleSheet } from 'react-native';
|
|
6
6
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
7
7
|
import { DrawerPositionContext } from "../utils/DrawerPositionContext.js";
|
|
8
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
8
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
const SPACING = 12;
|
|
10
|
-
function
|
|
10
|
+
export function DrawerContentScrollView({
|
|
11
|
+
contentInsetAdjustmentBehavior = 'automatic',
|
|
11
12
|
contentContainerStyle,
|
|
12
13
|
style,
|
|
13
14
|
children,
|
|
15
|
+
ref,
|
|
14
16
|
...rest
|
|
15
|
-
}
|
|
17
|
+
}) {
|
|
16
18
|
const drawerPosition = React.use(DrawerPositionContext);
|
|
17
19
|
const insets = useSafeAreaInsets();
|
|
18
20
|
const {
|
|
19
21
|
direction
|
|
20
22
|
} = useLocale();
|
|
21
23
|
const isRight = direction === 'rtl' ? drawerPosition === 'left' : drawerPosition === 'right';
|
|
22
|
-
return /*#__PURE__*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
24
|
+
return /*#__PURE__*/_jsxs(ScrollView, {
|
|
25
|
+
...rest,
|
|
26
|
+
ref: ref,
|
|
27
|
+
contentInsetAdjustmentBehavior: contentInsetAdjustmentBehavior,
|
|
28
|
+
contentContainerStyle: [{
|
|
29
|
+
paddingTop: SPACING + Platform.select({
|
|
30
|
+
ios: 0,
|
|
31
|
+
default: insets.top
|
|
32
|
+
}),
|
|
33
|
+
paddingBottom: SPACING + Platform.select({
|
|
34
|
+
ios: 0,
|
|
35
|
+
default: insets.bottom
|
|
36
|
+
}),
|
|
37
|
+
paddingStart: SPACING + (!isRight ? Platform.select({
|
|
38
|
+
ios: 0,
|
|
39
|
+
default: insets.left
|
|
40
|
+
}) : 0),
|
|
41
|
+
paddingEnd: SPACING + (isRight ? Platform.select({
|
|
42
|
+
ios: 0,
|
|
43
|
+
default: insets.right
|
|
44
|
+
}) : 0)
|
|
45
|
+
}, contentContainerStyle],
|
|
46
|
+
style: [styles.container, style],
|
|
47
|
+
children: [Platform.OS === 'ios' && contentInsetAdjustmentBehavior !== 'never' && /*#__PURE__*/_jsx(UNSTABLE_CornerInset, {
|
|
48
|
+
direction: "vertical",
|
|
49
|
+
edge: "top"
|
|
50
|
+
}), children]
|
|
42
51
|
});
|
|
43
52
|
}
|
|
44
|
-
export const DrawerContentScrollView = /*#__PURE__*/React.forwardRef(DrawerContentScrollViewInner);
|
|
45
53
|
const styles = StyleSheet.create({
|
|
46
54
|
container: {
|
|
47
55
|
flex: 1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["UNSTABLE_CornerInset","useLocale","React","ScrollView","StyleSheet","useSafeAreaInsets","DrawerPositionContext","jsx","_jsx","jsxs","_jsxs","
|
|
1
|
+
{"version":3,"names":["UNSTABLE_CornerInset","useLocale","React","Platform","ScrollView","StyleSheet","useSafeAreaInsets","DrawerPositionContext","jsx","_jsx","jsxs","_jsxs","SPACING","DrawerContentScrollView","contentInsetAdjustmentBehavior","contentContainerStyle","style","children","ref","rest","drawerPosition","use","insets","direction","isRight","paddingTop","select","ios","default","top","paddingBottom","bottom","paddingStart","left","paddingEnd","right","styles","container","OS","edge","create","flex"],"sourceRoot":"../../../src","sources":["views/DrawerContentScrollView.tsx"],"mappings":";;AAAA,SAASA,oBAAoB,EAAEC,SAAS,QAAQ,0BAA0B;AAC1E,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SACEC,QAAQ,EACRC,UAAU,EAEVC,UAAU,QACL,cAAc;AACrB,SAASC,iBAAiB,QAAQ,gCAAgC;AAElE,SAASC,qBAAqB,QAAQ,mCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAOvE,MAAMC,OAAO,GAAG,EAAE;AAElB,OAAO,SAASC,uBAAuBA,CAAC;EACtCC,8BAA8B,GAAG,WAAW;EAC5CC,qBAAqB;EACrBC,KAAK;EACLC,QAAQ;EACRC,GAAG;EACH,GAAGC;AACE,CAAC,EAAE;EACR,MAAMC,cAAc,GAAGlB,KAAK,CAACmB,GAAG,CAACd,qBAAqB,CAAC;EACvD,MAAMe,MAAM,GAAGhB,iBAAiB,CAAC,CAAC;EAClC,MAAM;IAAEiB;EAAU,CAAC,GAAGtB,SAAS,CAAC,CAAC;EAEjC,MAAMuB,OAAO,GACXD,SAAS,KAAK,KAAK,GACfH,cAAc,KAAK,MAAM,GACzBA,cAAc,KAAK,OAAO;EAEhC,oBACET,KAAA,CAACP,UAAU;IAAA,GACLe,IAAI;IACRD,GAAG,EAAEA,GAAI;IACTJ,8BAA8B,EAAEA,8BAA+B;IAC/DC,qBAAqB,EAAE,CACrB;MACEU,UAAU,EACRb,OAAO,GAAGT,QAAQ,CAACuB,MAAM,CAAC;QAAEC,GAAG,EAAE,CAAC;QAAEC,OAAO,EAAEN,MAAM,CAACO;MAAI,CAAC,CAAC;MAC5DC,aAAa,EACXlB,OAAO,GAAGT,QAAQ,CAACuB,MAAM,CAAC;QAAEC,GAAG,EAAE,CAAC;QAAEC,OAAO,EAAEN,MAAM,CAACS;MAAO,CAAC,CAAC;MAC/DC,YAAY,EACVpB,OAAO,IACN,CAACY,OAAO,GAAGrB,QAAQ,CAACuB,MAAM,CAAC;QAAEC,GAAG,EAAE,CAAC;QAAEC,OAAO,EAAEN,MAAM,CAACW;MAAK,CAAC,CAAC,GAAG,CAAC,CAAC;MACpEC,UAAU,EACRtB,OAAO,IACNY,OAAO,GAAGrB,QAAQ,CAACuB,MAAM,CAAC;QAAEC,GAAG,EAAE,CAAC;QAAEC,OAAO,EAAEN,MAAM,CAACa;MAAM,CAAC,CAAC,GAAG,CAAC;IACrE,CAAC,EACDpB,qBAAqB,CACrB;IACFC,KAAK,EAAE,CAACoB,MAAM,CAACC,SAAS,EAAErB,KAAK,CAAE;IAAAC,QAAA,GAEhCd,QAAQ,CAACmC,EAAE,KAAK,KAAK,IAAIxB,8BAA8B,KAAK,OAAO,iBAClEL,IAAA,CAACT,oBAAoB;MAACuB,SAAS,EAAC,UAAU;MAACgB,IAAI,EAAC;IAAK,CAAE,CACxD,EACAtB,QAAQ;EAAA,CACC,CAAC;AAEjB;AAEA,MAAMmB,MAAM,GAAG/B,UAAU,CAACmC,MAAM,CAAC;EAC/BH,SAAS,EAAE;IACTI,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ScrollView, type ScrollViewProps } from 'react-native';
|
|
3
|
-
|
|
3
|
+
type Props = ScrollViewProps & {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
|
|
5
|
+
ref?: React.Ref<ScrollView>;
|
|
6
|
+
};
|
|
7
|
+
export declare function DrawerContentScrollView({ contentInsetAdjustmentBehavior, contentContainerStyle, style, children, ref, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
6
9
|
//# sourceMappingURL=DrawerContentScrollView.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,
|
|
1
|
+
{"version":3,"file":"DrawerContentScrollView.d.ts","sourceRoot":"","sources":["../../../../src/views/DrawerContentScrollView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,UAAU,EACV,KAAK,eAAe,EAErB,MAAM,cAAc,CAAC;AAKtB,KAAK,KAAK,GAAG,eAAe,GAAG;IAC7B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;CAC7B,CAAC;AAIF,wBAAgB,uBAAuB,CAAC,EACtC,8BAA4C,EAC5C,qBAAqB,EACrB,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACR,EAAE,KAAK,2CAsCP"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-navigation/drawer",
|
|
3
3
|
"description": "Integration for the drawer component from react-native-drawer-layout",
|
|
4
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.24",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react-native-component",
|
|
7
7
|
"react-component",
|
|
@@ -46,20 +46,20 @@
|
|
|
46
46
|
"clean": "del lib"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@react-navigation/elements": "^3.0.0-alpha.
|
|
50
|
-
"color": "^
|
|
51
|
-
"react-native-drawer-layout": "^5.0.0-alpha.
|
|
52
|
-
"use-latest-callback": "^0.3.
|
|
49
|
+
"@react-navigation/elements": "^3.0.0-alpha.22",
|
|
50
|
+
"color": "^5.0.3",
|
|
51
|
+
"react-native-drawer-layout": "^5.0.0-alpha.6",
|
|
52
|
+
"use-latest-callback": "^0.3.3"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@jest/globals": "^30.
|
|
56
|
-
"@react-navigation/native": "^8.0.0-alpha.
|
|
55
|
+
"@jest/globals": "^30.3.0",
|
|
56
|
+
"@react-navigation/native": "^8.0.0-alpha.19",
|
|
57
57
|
"@testing-library/react-native": "^13.3.3",
|
|
58
58
|
"@types/react": "~19.2.2",
|
|
59
|
-
"del-cli": "^
|
|
59
|
+
"del-cli": "^7.0.0",
|
|
60
60
|
"react": "19.2.0",
|
|
61
|
-
"react-native": "0.83.
|
|
62
|
-
"react-native-builder-bob": "^0.
|
|
61
|
+
"react-native": "0.83.4",
|
|
62
|
+
"react-native-builder-bob": "^0.41.0",
|
|
63
63
|
"react-native-gesture-handler": "~2.30.0",
|
|
64
64
|
"react-native-reanimated": "~4.2.1",
|
|
65
65
|
"react-native-safe-area-context": "~5.6.2",
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
"typescript": "^6.0.2"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
|
-
"@react-navigation/native": "^8.0.0-alpha.
|
|
72
|
+
"@react-navigation/native": "^8.0.0-alpha.19",
|
|
73
73
|
"react": ">= 19.2.0",
|
|
74
74
|
"react-native": "*",
|
|
75
75
|
"react-native-gesture-handler": ">= 2.0.0",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
]
|
|
97
97
|
]
|
|
98
98
|
},
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "d7d3b8f648421eff0bf832ec9b2759651c12fc98"
|
|
100
100
|
}
|
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
import { UNSTABLE_CornerInset, useLocale } from '@react-navigation/native';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Platform,
|
|
5
|
+
ScrollView,
|
|
6
|
+
type ScrollViewProps,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
} from 'react-native';
|
|
4
9
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
5
10
|
|
|
6
11
|
import { DrawerPositionContext } from '../utils/DrawerPositionContext';
|
|
7
12
|
|
|
8
13
|
type Props = ScrollViewProps & {
|
|
9
14
|
children: React.ReactNode;
|
|
15
|
+
ref?: React.Ref<ScrollView>;
|
|
10
16
|
};
|
|
11
17
|
|
|
12
18
|
const SPACING = 12;
|
|
13
19
|
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
export function DrawerContentScrollView({
|
|
21
|
+
contentInsetAdjustmentBehavior = 'automatic',
|
|
22
|
+
contentContainerStyle,
|
|
23
|
+
style,
|
|
24
|
+
children,
|
|
25
|
+
ref,
|
|
26
|
+
...rest
|
|
27
|
+
}: Props) {
|
|
18
28
|
const drawerPosition = React.use(DrawerPositionContext);
|
|
19
29
|
const insets = useSafeAreaInsets();
|
|
20
30
|
const { direction } = useLocale();
|
|
@@ -25,39 +35,35 @@ function DrawerContentScrollViewInner(
|
|
|
25
35
|
: drawerPosition === 'right';
|
|
26
36
|
|
|
27
37
|
return (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
/>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
<ScrollView
|
|
39
|
+
{...rest}
|
|
40
|
+
ref={ref}
|
|
41
|
+
contentInsetAdjustmentBehavior={contentInsetAdjustmentBehavior}
|
|
42
|
+
contentContainerStyle={[
|
|
43
|
+
{
|
|
44
|
+
paddingTop:
|
|
45
|
+
SPACING + Platform.select({ ios: 0, default: insets.top }),
|
|
46
|
+
paddingBottom:
|
|
47
|
+
SPACING + Platform.select({ ios: 0, default: insets.bottom }),
|
|
48
|
+
paddingStart:
|
|
49
|
+
SPACING +
|
|
50
|
+
(!isRight ? Platform.select({ ios: 0, default: insets.left }) : 0),
|
|
51
|
+
paddingEnd:
|
|
52
|
+
SPACING +
|
|
53
|
+
(isRight ? Platform.select({ ios: 0, default: insets.right }) : 0),
|
|
54
|
+
},
|
|
55
|
+
contentContainerStyle,
|
|
56
|
+
]}
|
|
57
|
+
style={[styles.container, style]}
|
|
58
|
+
>
|
|
59
|
+
{Platform.OS === 'ios' && contentInsetAdjustmentBehavior !== 'never' && (
|
|
60
|
+
<UNSTABLE_CornerInset direction="vertical" edge="top" />
|
|
61
|
+
)}
|
|
62
|
+
{children}
|
|
63
|
+
</ScrollView>
|
|
54
64
|
);
|
|
55
65
|
}
|
|
56
66
|
|
|
57
|
-
export const DrawerContentScrollView = React.forwardRef(
|
|
58
|
-
DrawerContentScrollViewInner
|
|
59
|
-
);
|
|
60
|
-
|
|
61
67
|
const styles = StyleSheet.create({
|
|
62
68
|
container: {
|
|
63
69
|
flex: 1,
|