@onekeyfe/react-native-pager-view 6.7.0-3 → 6.7.0-31

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 (52) hide show
  1. package/README.md +21 -0
  2. package/android/build.gradle +1 -0
  3. package/android/src/androidTest/AndroidManifest.xml +7 -0
  4. package/android/src/androidTest/java/com/reactnativepagerview/CollapsiblePagerTabReservationTest.kt +476 -0
  5. package/android/src/main/java/com/reactnativepagerview/CollapsiblePagerHost.kt +215 -39
  6. package/android/src/main/java/com/reactnativepagerview/CollapsiblePagerNativeHeaders.kt +518 -21
  7. package/android/src/main/java/com/reactnativepagerview/CollapsiblePagerViewManager.kt +40 -0
  8. package/android/src/main/java/com/reactnativepagerview/NativeScrollerScrollAwayInsets.kt +19 -0
  9. package/android/src/main/java/com/reactnativepagerview/NativeScrollerView.kt +50 -6
  10. package/android/src/main/java/com/reactnativepagerview/NestedScrollableHost.kt +8 -2
  11. package/android/src/main/java/com/reactnativepagerview/event/NativeHeaderPressEvent.kt +8 -0
  12. package/android/src/test/java/com/reactnativepagerview/NativeScrollerScrollAwayInsetsTest.kt +40 -0
  13. package/docs/SPEC.md +606 -10
  14. package/ios/RNCCollapsiblePagerViewComponentView.mm +1903 -91
  15. package/ios/RNCNativeScrollerComponentView.h +2 -0
  16. package/ios/RNCNativeScrollerComponentView.mm +42 -0
  17. package/ios/tests/RNCCollapsiblePagerFirstFrameTests.mm +562 -1
  18. package/ios/tests/RNCCollapsiblePagerHitTestTests.mm +1116 -0
  19. package/ios/tests/RNCCollapsiblePagerPressCancellationTests.mm +74 -9
  20. package/ios/tests/RNCCollapsiblePagerRefreshControlTests.mm +50 -0
  21. package/lib/module/CollapsiblePagerView.js +70 -11
  22. package/lib/module/CollapsiblePagerView.web.js +532 -8
  23. package/lib/module/CollapsiblePagerViewNativeComponent.ts +57 -42
  24. package/lib/module/NativeScroller.web.js +3 -0
  25. package/lib/module/NativeScrollerNativeComponent.ts +42 -46
  26. package/lib/module/PagerViewNativeComponent.ts +20 -25
  27. package/lib/module/WebCollapsiblePagerPage.js +7 -2
  28. package/lib/module/index.native.js +9 -0
  29. package/lib/typescript/src/CollapsiblePagerView.d.ts +42 -4
  30. package/lib/typescript/src/CollapsiblePagerView.web.d.ts +48 -2
  31. package/lib/typescript/src/CollapsiblePagerViewNativeComponent.d.ts +54 -38
  32. package/lib/typescript/src/NativeScroller.d.ts +5 -3
  33. package/lib/typescript/src/NativeScroller.web.d.ts +1 -1
  34. package/lib/typescript/src/NativeScrollerNativeComponent.d.ts +47 -48
  35. package/lib/typescript/src/PagerView.d.ts +1 -1
  36. package/lib/typescript/src/PagerView.web.d.ts +1 -1
  37. package/lib/typescript/src/PagerViewNativeComponent.d.ts +20 -21
  38. package/lib/typescript/src/WebCollapsiblePagerPage.d.ts +1 -1
  39. package/lib/typescript/src/index.native.d.ts +13 -0
  40. package/lib/typescript/src/usePagerView.d.ts +2 -2
  41. package/lib/typescript/src/utils.d.ts +2 -2
  42. package/package.json +22 -7
  43. package/react-native-pager-view.podspec +1 -0
  44. package/src/CollapsiblePagerView.tsx +179 -12
  45. package/src/CollapsiblePagerView.web.tsx +486 -7
  46. package/src/CollapsiblePagerViewNativeComponent.ts +57 -42
  47. package/src/NativeScroller.tsx +14 -4
  48. package/src/NativeScroller.web.tsx +15 -1
  49. package/src/NativeScrollerNativeComponent.ts +42 -46
  50. package/src/PagerViewNativeComponent.ts +20 -25
  51. package/src/WebCollapsiblePagerPage.tsx +7 -2
  52. package/src/index.native.tsx +30 -0
@@ -1,31 +1,39 @@
1
1
  import type * as React from "react";
2
- import { type ColorValue, type HostComponent, type ViewProps } from "react-native";
3
- import type { DirectEventHandler, Double, Int32, WithDefault } from "react-native/Libraries/Types/CodegenTypes";
2
+ import { type CodegenTypes, type ColorValue, type HostComponent, type ViewProps } from "react-native";
4
3
  export type OnPageScrollEventData = Readonly<{
5
- position: Double;
6
- offset: Double;
4
+ position: CodegenTypes.Double;
5
+ offset: CodegenTypes.Double;
7
6
  }>;
8
7
  export type OnPageSelectedEventData = Readonly<{
9
- position: Double;
8
+ position: CodegenTypes.Double;
10
9
  }>;
11
10
  export type OnPageScrollStateChangedEventData = Readonly<{
12
11
  pageScrollState: "idle" | "dragging" | "settling";
13
12
  }>;
14
13
  export type OnCollapsibleStateChangedEventData = Readonly<{
15
- position: Int32;
16
- headerOffset: Double;
17
- nativePageCount: Int32;
18
- attachedPageCount: Int32;
19
- observedScrollableCount: Int32;
14
+ position: CodegenTypes.Int32;
15
+ headerOffset: CodegenTypes.Double;
16
+ nativePageCount: CodegenTypes.Int32;
17
+ attachedPageCount: CodegenTypes.Int32;
18
+ observedScrollableCount: CodegenTypes.Int32;
20
19
  retainedPages: string;
21
20
  reason: string;
22
21
  pageKey: string;
23
22
  headerSettledAtTop: boolean;
24
23
  }>;
25
24
  export type OnNativeTabPressEventData = Readonly<{
26
- position: Int32;
25
+ position: CodegenTypes.Int32;
27
26
  key: string;
28
27
  }>;
28
+ export type OnNativeToolbarPressEventData = Readonly<{
29
+ key: string;
30
+ anchorRect: Readonly<{
31
+ x: CodegenTypes.Double;
32
+ y: CodegenTypes.Double;
33
+ width: CodegenTypes.Double;
34
+ height: CodegenTypes.Double;
35
+ }>;
36
+ }>;
29
37
  export type OnScrollEdgeCapabilityEventData = Readonly<{
30
38
  available: boolean;
31
39
  }>;
@@ -34,47 +42,55 @@ export type OnScrollEdgeCapabilityEventData = Readonly<{
34
42
  * CollapsiblePagerView instead of mounting this host component directly.
35
43
  */
36
44
  export interface NativeProps extends ViewProps {
37
- scrollEnabled?: WithDefault<boolean, true>;
38
- layoutDirection?: WithDefault<"ltr" | "rtl", "ltr">;
39
- initialPage?: Int32;
40
- offscreenPageLimit?: Int32;
41
- nestedScrollEnabled?: WithDefault<boolean, false>;
42
- nativeSmoothHeaderScrollEnabled?: WithDefault<boolean, false>;
43
- headerHeight?: Int32;
44
- stickyHeaderHeight?: Int32;
45
- topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
45
+ scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
46
+ layoutDirection?: CodegenTypes.WithDefault<"ltr" | "rtl", "ltr">;
47
+ initialPage?: CodegenTypes.Int32;
48
+ offscreenPageLimit?: CodegenTypes.Int32;
49
+ nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
50
+ nativeSmoothHeaderScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
51
+ headerHeight?: CodegenTypes.Int32;
52
+ stickyHeaderHeight?: CodegenTypes.Int32;
53
+ stickyHeaderHeights?: string;
54
+ topScrollEdgeEffect?: CodegenTypes.WithDefault<"none" | "hard" | "soft", "none">;
46
55
  topOverlayColorScheme?: string;
47
- topOverlayHeight?: WithDefault<Double, 0>;
48
- externalTopOverlayTag?: WithDefault<Int32, 0>;
56
+ topOverlayHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
57
+ externalTopOverlayTag?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
49
58
  pageKeys?: string;
50
59
  retainedPages?: string;
60
+ nativeTabBarConfig?: string;
51
61
  nativeTabBarItems?: string;
52
- nativeTabBarHeight?: Double;
53
- nativeTabBarContentPaddingHorizontal?: Double;
54
- nativeTabBarItemSpacing?: Double;
55
- nativeTabBarFontSize?: Double;
62
+ nativeTabBarHeight?: CodegenTypes.Double;
63
+ nativeTabBarVariant?: string;
64
+ nativeTabBarTrailingReservedWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
65
+ nativeTabBarContentPaddingHorizontal?: CodegenTypes.Double;
66
+ nativeTabBarContentPaddingVertical?: CodegenTypes.Double;
67
+ nativeTabBarItemSpacing?: CodegenTypes.Double;
68
+ nativeTabBarFontSize?: CodegenTypes.Double;
56
69
  nativeTabBarFontFamily?: string;
57
70
  nativeTabBarBackgroundColor?: ColorValue;
58
71
  nativeTabBarActiveTextColor?: ColorValue;
59
72
  nativeTabBarInactiveTextColor?: ColorValue;
60
73
  nativeTabBarIndicatorColor?: ColorValue;
61
- nativeTabBarIndicatorHeight?: Double;
62
- nativeTabBarIndicatorBottom?: Double;
74
+ nativeTabBarIndicatorHeight?: CodegenTypes.Double;
75
+ nativeTabBarIndicatorBottom?: CodegenTypes.Double;
63
76
  nativeSubHeaderConfig?: string;
64
77
  nativeSubHeaderSelectedBackgroundColor?: ColorValue;
65
- onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
66
- onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
67
- onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
68
- onCollapsibleStateChanged?: DirectEventHandler<OnCollapsibleStateChangedEventData>;
69
- onNativeTabPress?: DirectEventHandler<OnNativeTabPressEventData>;
70
- onNativeSubHeaderPress?: DirectEventHandler<OnNativeTabPressEventData>;
71
- onScrollEdgeCapability?: DirectEventHandler<OnScrollEdgeCapabilityEventData>;
78
+ onPageScroll?: CodegenTypes.DirectEventHandler<OnPageScrollEventData>;
79
+ onPageSelected?: CodegenTypes.DirectEventHandler<OnPageSelectedEventData>;
80
+ onPageScrollStateChanged?: CodegenTypes.DirectEventHandler<OnPageScrollStateChangedEventData>;
81
+ onCollapsibleStateChanged?: CodegenTypes.DirectEventHandler<OnCollapsibleStateChangedEventData>;
82
+ onNativeToolbarPress?: CodegenTypes.DirectEventHandler<OnNativeToolbarPressEventData>;
83
+ onNativeTabPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
84
+ onNativeSubHeaderPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
85
+ onScrollEdgeCapability?: CodegenTypes.DirectEventHandler<OnScrollEdgeCapabilityEventData>;
72
86
  }
73
87
  type CollapsiblePagerViewNativeType = HostComponent<NativeProps>;
74
88
  export interface NativeCommands {
75
- scrollToTop: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, target: Int32, animated: boolean) => void;
76
- setPage: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: Int32) => void;
77
- setPageWithoutAnimation: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: Int32) => void;
89
+ scrollHeaderToOffset: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, offset: CodegenTypes.Double) => void;
90
+ scrollHeaderBy: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, delta: CodegenTypes.Double) => void;
91
+ scrollToTop: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, target: CodegenTypes.Int32, animated: boolean) => void;
92
+ setPage: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: CodegenTypes.Int32) => void;
93
+ setPageWithoutAnimation: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, selectedPage: CodegenTypes.Int32) => void;
78
94
  setScrollEnabledImperatively: (viewRef: React.ElementRef<CollapsiblePagerViewNativeType>, scrollEnabled: boolean) => void;
79
95
  }
80
96
  export declare const Commands: NativeCommands;
@@ -1,10 +1,10 @@
1
1
  import * as React from "react";
2
- import { type NativeMethods, type RefreshControlProps, type ScrollView, type ScrollViewProps, type ViewProps } from "react-native";
2
+ import { type RefreshControlProps, type ScrollView, type ScrollViewProps, type ViewProps } from "react-native";
3
3
  import NativeScrollerHost from "./NativeScrollerNativeComponent";
4
4
  import type { ScrollEdgeEffect } from "./ScrollEdgeEffect";
5
5
  export declare const NATIVE_SCROLLER_NATIVE_ID_PREFIX = "rnc-collapsible-pager-native-scroller";
6
6
  /** Supported vertical subset; horizontal, snapping, zoom and sticky rows are not supported. */
7
- export interface NativeScrollerProps extends ViewProps, Pick<ScrollViewProps, "contentContainerStyle" | "onContentSizeChange" | "scrollEnabled" | "nestedScrollEnabled" | "showsVerticalScrollIndicator" | "showsHorizontalScrollIndicator" | "bounces" | "alwaysBounceVertical" | "contentInset" | "keyboardDismissMode" | "keyboardShouldPersistTaps" | "scrollEventThrottle" | "decelerationRate" | "onScroll" | "onScrollBeginDrag" | "onScrollEndDrag" | "onMomentumScrollBegin" | "onMomentumScrollEnd"> {
7
+ export interface NativeScrollerProps extends ViewProps, Pick<ScrollViewProps, "contentContainerStyle" | "onContentSizeChange" | "scrollEnabled" | "nestedScrollEnabled" | "showsVerticalScrollIndicator" | "showsHorizontalScrollIndicator" | "bounces" | "alwaysBounceVertical" | "contentInset" | "keyboardDismissMode" | "scrollEventThrottle" | "decelerationRate" | "onScroll" | "onScrollBeginDrag" | "onScrollEndDrag" | "onMomentumScrollBegin" | "onMomentumScrollEnd"> {
8
8
  pagerScrollKey?: string;
9
9
  /** Fixed overlay above scrolling content on iOS 26 and newer. */
10
10
  topOverlay?: React.ReactNode;
@@ -14,9 +14,11 @@ export interface NativeScrollerProps extends ViewProps, Pick<ScrollViewProps, "c
14
14
  decelerationRate?: ScrollViewProps["decelerationRate"];
15
15
  /** Standard RefreshControl props are mapped to the independently owned native controller. */
16
16
  refreshControl?: React.ReactElement<RefreshControlProps>;
17
+ /** Boolean values are deprecated compatibility aliases (`true` -> `always`, `false` -> `never`). */
18
+ keyboardShouldPersistTaps?: ScrollViewProps["keyboardShouldPersistTaps"] | boolean;
17
19
  }
18
20
  type HostRef = React.ElementRef<typeof NativeScrollerHost>;
19
- export interface NativeScrollerRef extends NativeMethods, Pick<React.ElementRef<typeof ScrollView>, "scrollTo" | "scrollToEnd" | "flashScrollIndicators"> {
21
+ export interface NativeScrollerRef extends Pick<HostRef, "measure" | "measureInWindow" | "measureLayout" | "setNativeProps" | "focus" | "blur">, Pick<React.ElementRef<typeof ScrollView>, "scrollTo" | "scrollToEnd" | "flashScrollIndicators"> {
20
22
  getNativeScrollRef(): HostRef | null;
21
23
  getScrollableNode(): number | null;
22
24
  }
@@ -1,5 +1,5 @@
1
1
  import * as React from "react";
2
2
  import type { NativeScrollerProps } from "./NativeScroller";
3
- export declare const NativeScroller: React.ForwardRefExoticComponent<NativeScrollerProps & React.RefAttributes<import("react-native/types_generated/Libraries/Components/ScrollView/ScrollView").PublicScrollViewInstance>>;
3
+ export declare const NativeScroller: React.ForwardRefExoticComponent<NativeScrollerProps & React.RefAttributes<import("react-native").ScrollViewInstance>>;
4
4
  export type { NativeScrollerProps } from "./NativeScroller";
5
5
  //# sourceMappingURL=NativeScroller.web.d.ts.map
@@ -1,76 +1,75 @@
1
1
  import type * as React from "react";
2
- import { type ColorValue, type HostComponent, type ViewProps } from "react-native";
3
- import type { DirectEventHandler, Double, WithDefault } from "react-native/Libraries/Types/CodegenTypes";
2
+ import { type CodegenTypes, type ColorValue, type HostComponent, type ViewProps } from "react-native";
4
3
  export type NativeScrollerScrollEvent = Readonly<{
5
4
  contentInset: Readonly<{
6
- top: Double;
7
- right: Double;
8
- bottom: Double;
9
- left: Double;
5
+ top: CodegenTypes.Double;
6
+ right: CodegenTypes.Double;
7
+ bottom: CodegenTypes.Double;
8
+ left: CodegenTypes.Double;
10
9
  }>;
11
10
  contentOffset: Readonly<{
12
- x: Double;
13
- y: Double;
11
+ x: CodegenTypes.Double;
12
+ y: CodegenTypes.Double;
14
13
  }>;
15
14
  contentSize: Readonly<{
16
- width: Double;
17
- height: Double;
15
+ width: CodegenTypes.Double;
16
+ height: CodegenTypes.Double;
18
17
  }>;
19
18
  layoutMeasurement: Readonly<{
20
- width: Double;
21
- height: Double;
19
+ width: CodegenTypes.Double;
20
+ height: CodegenTypes.Double;
22
21
  }>;
23
22
  velocity: Readonly<{
24
- x: Double;
25
- y: Double;
23
+ x: CodegenTypes.Double;
24
+ y: CodegenTypes.Double;
26
25
  }>;
27
26
  targetContentOffset: Readonly<{
28
- x: Double;
29
- y: Double;
27
+ x: CodegenTypes.Double;
28
+ y: CodegenTypes.Double;
30
29
  }>;
31
- zoomScale: Double;
30
+ zoomScale: CodegenTypes.Double;
32
31
  }>;
33
32
  export interface NativeProps extends ViewProps {
34
- contentWidth?: WithDefault<Double, 0>;
35
- contentHeight?: WithDefault<Double, 0>;
36
- scrollEnabled?: WithDefault<boolean, true>;
37
- nestedScrollEnabled?: WithDefault<boolean, true>;
38
- showsVerticalScrollIndicator?: WithDefault<boolean, true>;
39
- showsHorizontalScrollIndicator?: WithDefault<boolean, false>;
40
- bounces?: WithDefault<boolean, true>;
41
- alwaysBounceVertical?: WithDefault<boolean, true>;
42
- keyboardDismissMode?: WithDefault<"none" | "on-drag" | "interactive", "none">;
43
- keyboardShouldPersistTaps?: WithDefault<"never" | "always" | "handled", "never">;
44
- scrollEventThrottle?: WithDefault<Double, 0>;
45
- decelerationRate?: WithDefault<Double, 0.998>;
46
- contentInsetTop?: WithDefault<Double, 0>;
47
- contentInsetRight?: WithDefault<Double, 0>;
48
- contentInsetBottom?: WithDefault<Double, 0>;
49
- contentInsetLeft?: WithDefault<Double, 0>;
50
- topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
51
- topOverlayHeight?: WithDefault<Double, 0>;
52
- refreshEnabled?: WithDefault<boolean, false>;
53
- refreshing?: WithDefault<boolean, false>;
33
+ contentWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
34
+ contentHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
35
+ scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
36
+ nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
37
+ showsVerticalScrollIndicator?: CodegenTypes.WithDefault<boolean, true>;
38
+ showsHorizontalScrollIndicator?: CodegenTypes.WithDefault<boolean, false>;
39
+ bounces?: CodegenTypes.WithDefault<boolean, true>;
40
+ alwaysBounceVertical?: CodegenTypes.WithDefault<boolean, true>;
41
+ keyboardDismissMode?: CodegenTypes.WithDefault<"none" | "on-drag" | "interactive", "none">;
42
+ keyboardShouldPersistTaps?: CodegenTypes.WithDefault<"never" | "always" | "handled", "never">;
43
+ scrollEventThrottle?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
44
+ decelerationRate?: CodegenTypes.WithDefault<CodegenTypes.Double, 0.998>;
45
+ contentInsetTop?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
46
+ contentInsetRight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
47
+ contentInsetBottom?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
48
+ contentInsetLeft?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
49
+ topScrollEdgeEffect?: CodegenTypes.WithDefault<"none" | "hard" | "soft", "none">;
50
+ topOverlayHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
51
+ refreshEnabled?: CodegenTypes.WithDefault<boolean, false>;
52
+ refreshing?: CodegenTypes.WithDefault<boolean, false>;
54
53
  refreshTintColor?: ColorValue;
55
54
  refreshColors?: ReadonlyArray<ColorValue>;
56
55
  refreshProgressBackgroundColor?: ColorValue;
57
- refreshProgressViewOffset?: WithDefault<Double, 0>;
56
+ refreshProgressViewOffset?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
58
57
  refreshTitle?: string;
59
58
  refreshTitleColor?: ColorValue;
60
- refreshSize?: WithDefault<"default" | "large", "default">;
61
- onContentViewportChange?: DirectEventHandler<Readonly<{
62
- height: Double;
59
+ refreshSize?: CodegenTypes.WithDefault<"default" | "large", "default">;
60
+ onContentViewportChange?: CodegenTypes.DirectEventHandler<Readonly<{
61
+ height: CodegenTypes.Double;
63
62
  }>>;
64
- onRefresh?: DirectEventHandler<null>;
65
- onScroll?: DirectEventHandler<NativeScrollerScrollEvent>;
66
- onScrollBeginDrag?: DirectEventHandler<NativeScrollerScrollEvent>;
67
- onScrollEndDrag?: DirectEventHandler<NativeScrollerScrollEvent>;
68
- onMomentumScrollBegin?: DirectEventHandler<NativeScrollerScrollEvent>;
69
- onMomentumScrollEnd?: DirectEventHandler<NativeScrollerScrollEvent>;
63
+ onRefresh?: CodegenTypes.DirectEventHandler<null>;
64
+ onScroll?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
65
+ onScrollBeginDrag?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
66
+ onScrollEndDrag?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
67
+ onMomentumScrollBegin?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
68
+ onMomentumScrollEnd?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
70
69
  }
71
70
  type NativeScrollerHost = HostComponent<NativeProps>;
72
71
  export interface NativeCommands {
73
- scrollTo: (viewRef: React.ElementRef<NativeScrollerHost>, x: Double, y: Double, animated: boolean) => void;
72
+ scrollTo: (viewRef: React.ElementRef<NativeScrollerHost>, x: CodegenTypes.Double, y: CodegenTypes.Double, animated: boolean) => void;
74
73
  scrollToEnd: (viewRef: React.ElementRef<NativeScrollerHost>, animated: boolean) => void;
75
74
  flashScrollIndicators: (viewRef: React.ElementRef<NativeScrollerHost>) => void;
76
75
  setRefreshState: (viewRef: React.ElementRef<NativeScrollerHost>, refreshing: boolean) => void;
@@ -65,6 +65,6 @@ export declare class PagerView extends React.Component<NativeProps> {
65
65
  * imperative solution is more useful (e.g. for not blocking an animation)
66
66
  */
67
67
  setScrollEnabled: (scrollEnabled: boolean) => void;
68
- render(): import("react/jsx-runtime").JSX.Element;
68
+ render(): React.JSX.Element;
69
69
  }
70
70
  //# sourceMappingURL=PagerView.d.ts.map
@@ -47,7 +47,7 @@ export declare class PagerView extends React.Component<PagerViewProps, State> {
47
47
  private selectPage;
48
48
  private onTouchStart;
49
49
  private onTouchEnd;
50
- render(): import("react/jsx-runtime").JSX.Element;
50
+ render(): React.JSX.Element;
51
51
  }
52
52
  export type PagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageScrollEventData>;
53
53
  export type PagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageSelectedEventData>;
@@ -1,48 +1,47 @@
1
1
  import type * as React from 'react';
2
- import { type HostComponent, type ViewProps } from 'react-native';
3
- import type { DirectEventHandler, Double, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
2
+ import { type CodegenTypes, type HostComponent, type ViewProps } from 'react-native';
4
3
  export type OnPageScrollEventData = Readonly<{
5
- position: Double;
6
- offset: Double;
4
+ position: CodegenTypes.Double;
5
+ offset: CodegenTypes.Double;
7
6
  }>;
8
7
  export type OnPageSelectedEventData = Readonly<{
9
- position: Double;
8
+ position: CodegenTypes.Double;
10
9
  }>;
11
10
  export type OnPageScrollStateChangedEventData = Readonly<{
12
11
  pageScrollState: 'idle' | 'dragging' | 'settling';
13
12
  }>;
14
13
  export interface NativeProps extends ViewProps {
15
- scrollEnabled?: WithDefault<boolean, true>;
16
- layoutDirection?: WithDefault<'ltr' | 'rtl', 'ltr'>;
17
- initialPage?: Int32;
18
- orientation?: WithDefault<'horizontal' | 'vertical', 'horizontal'>;
19
- offscreenPageLimit?: Int32;
20
- pageMargin?: Int32;
21
- overScrollMode?: WithDefault<'auto' | 'always' | 'never', 'auto'>;
22
- overdrag?: WithDefault<boolean, false>;
23
- keyboardDismissMode?: WithDefault<'none' | 'on-drag', 'none'>;
14
+ scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
15
+ layoutDirection?: CodegenTypes.WithDefault<'ltr' | 'rtl', 'ltr'>;
16
+ initialPage?: CodegenTypes.Int32;
17
+ orientation?: CodegenTypes.WithDefault<'horizontal' | 'vertical', 'horizontal'>;
18
+ offscreenPageLimit?: CodegenTypes.Int32;
19
+ pageMargin?: CodegenTypes.Int32;
20
+ overScrollMode?: CodegenTypes.WithDefault<'auto' | 'always' | 'never', 'auto'>;
21
+ overdrag?: CodegenTypes.WithDefault<boolean, false>;
22
+ keyboardDismissMode?: CodegenTypes.WithDefault<'none' | 'on-drag', 'none'>;
24
23
  /**
25
24
  * Controls the sensitivity of scroll gestures on Android.
26
25
  * Higher values make scrolling less sensitive.
27
26
  * Valid range: 2 - 8
28
27
  * @platform android
29
28
  */
30
- scrollSensitivity?: Int32;
29
+ scrollSensitivity?: CodegenTypes.Int32;
31
30
  /**
32
31
  * When true on an inner PagerView, enables gesture coordination with
33
32
  * a parent (outer) PagerView. At sub-tab boundaries the inner pager's
34
33
  * gesture recognizer will not begin, allowing the outer pager to take over.
35
34
  * @platform ios
36
35
  */
37
- nestedScrollEnabled?: WithDefault<boolean, false>;
38
- onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
39
- onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
40
- onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
36
+ nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
37
+ onPageScroll?: CodegenTypes.DirectEventHandler<OnPageScrollEventData>;
38
+ onPageSelected?: CodegenTypes.DirectEventHandler<OnPageSelectedEventData>;
39
+ onPageScrollStateChanged?: CodegenTypes.DirectEventHandler<OnPageScrollStateChangedEventData>;
41
40
  }
42
41
  type PagerViewViewType = HostComponent<NativeProps>;
43
42
  export interface NativeCommands {
44
- setPage: (viewRef: React.ElementRef<PagerViewViewType>, selectedPage: Int32) => void;
45
- setPageWithoutAnimation: (viewRef: React.ElementRef<PagerViewViewType>, selectedPage: Int32) => void;
43
+ setPage: (viewRef: React.ElementRef<PagerViewViewType>, selectedPage: CodegenTypes.Int32) => void;
44
+ setPageWithoutAnimation: (viewRef: React.ElementRef<PagerViewViewType>, selectedPage: CodegenTypes.Int32) => void;
46
45
  setScrollEnabledImperatively: (viewRef: React.ElementRef<PagerViewViewType>, scrollEnabled: boolean) => void;
47
46
  }
48
47
  export declare const Commands: NativeCommands;
@@ -38,5 +38,5 @@ export declare function WebCollapsiblePagerPage({ children, pageKey, isFocused,
38
38
  onGeometryChange: (key: string) => void;
39
39
  onScroll: (key: string, top: number) => void;
40
40
  onUserInput: (key: string) => void;
41
- }>): import("react/jsx-runtime").JSX.Element;
41
+ }>): React.JSX.Element;
42
42
  //# sourceMappingURL=WebCollapsiblePagerPage.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type * as ReactNative from "react-native";
2
+ import { PagerView } from "./PagerView";
3
+ export default PagerView;
4
+ export * from "./usePagerView";
5
+ export * from "./CollapsiblePagerView";
6
+ export * from "./NativeScroller";
7
+ import type { OnPageScrollEventData as PagerViewOnPageScrollEventData, OnPageSelectedEventData as PagerViewOnPageSelectedEventData, OnPageScrollStateChangedEventData as PageScrollStateChangedNativeEventData, NativeProps } from "./PagerViewNativeComponent";
8
+ export type { PagerViewOnPageScrollEventData, PagerViewOnPageSelectedEventData, PageScrollStateChangedNativeEventData, NativeProps as PagerViewProps, };
9
+ export type PagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageScrollEventData>;
10
+ export type PagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<PagerViewOnPageSelectedEventData>;
11
+ export type PageScrollStateChangedNativeEvent = ReactNative.NativeSyntheticEvent<PageScrollStateChangedNativeEventData>;
12
+ export { ScrollEdgeEffect } from "./ScrollEdgeEffect";
13
+ //# sourceMappingURL=index.native.d.ts.map
@@ -27,8 +27,8 @@ export declare function usePagerView({ pagesAmount }?: UsePagerViewParams): {
27
27
  position: number;
28
28
  offset: number;
29
29
  }>>;
30
- onPageScroll: any;
31
- onPageSelected: any;
30
+ onPageScroll: (...args: Array<any>) => void;
31
+ onPageSelected: (...args: Array<any>) => void;
32
32
  onPageScrollStateChanged: (e: PageScrollStateChangedNativeEvent) => void;
33
33
  toggleOverdrag: () => void;
34
34
  AnimatedPagerView: ReactNative.Animated.AnimatedComponent<Readonly<import("./PagerViewNativeComponent").NativeProps>, PagerView>;
@@ -1,3 +1,3 @@
1
- import { ReactNode } from 'react';
2
- export declare const childrenWithOverriddenStyle: (children?: ReactNode) => import("react/jsx-runtime").JSX.Element[] | null | undefined;
1
+ import React, { ReactNode } from 'react';
2
+ export declare const childrenWithOverriddenStyle: (children?: ReactNode) => React.JSX.Element[] | null | undefined;
3
3
  //# sourceMappingURL=utils.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/react-native-pager-view",
3
- "version": "6.7.0-3",
3
+ "version": "6.7.0-31",
4
4
  "description": "React Native wrapper for Android and iOS ViewPager",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
@@ -9,8 +9,9 @@
9
9
  "sideEffects": false,
10
10
  "exports": {
11
11
  ".": {
12
- "source": "./src/index.tsx",
13
12
  "types": "./lib/typescript/src/index.d.ts",
13
+ "react-native": "./lib/module/index.native.js",
14
+ "source": "./src/index.tsx",
14
15
  "browser": "./lib/module/index.web.js",
15
16
  "default": "./lib/module/index.js"
16
17
  },
@@ -42,7 +43,8 @@
42
43
  "prepare": "rm -rf lib && bob build",
43
44
  "typecheck": "tsc -b",
44
45
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
45
- "release": "yarn prepare && npm whoami && npm publish --access public"
46
+ "release": "yarn prepare && npm whoami && npm publish --access public",
47
+ "test": "jest"
46
48
  },
47
49
  "keywords": [
48
50
  "react-native",
@@ -65,14 +67,15 @@
65
67
  "access": "public"
66
68
  },
67
69
  "devDependencies": {
68
- "@types/react": "^19.2.0",
69
- "react": "19.2.3",
70
- "react-native": "patch:react-native@npm%3A0.86.2#~/.yarn/patches/react-native-npm-0.86.2-c9d546616f.patch",
70
+ "@types/react": "^19.3.0",
71
+ "react": "19.3.0",
72
+ "react-native": "patch:react-native@npm%3A0.88.0#~/.yarn/patches/react-native-npm-0.88.0-60c6201dd2.patch",
71
73
  "react-native-builder-bob": "^0.40.13",
72
74
  "typescript": "^5.9.2"
73
75
  },
74
76
  "peerDependencies": {
75
- "@onekeyfe/react-native-native-logger": "6.7.0-3",
77
+ "@onekeyfe/react-native-image": "*",
78
+ "@onekeyfe/react-native-native-logger": "*",
76
79
  "react": "*",
77
80
  "react-native": "*"
78
81
  },
@@ -108,5 +111,17 @@
108
111
  "RNCNativeScroller": "RNCNativeScrollerComponentView"
109
112
  }
110
113
  }
114
+ },
115
+ "react-native": "./lib/module/index.native.js",
116
+ "jest": {
117
+ "preset": "react-native",
118
+ "modulePathIgnorePatterns": [
119
+ "<rootDir>/example/node_modules",
120
+ "<rootDir>/lib/"
121
+ ],
122
+ "watchman": false,
123
+ "testMatch": [
124
+ "<rootDir>/src/**/__tests__/*.test.ts?(x)"
125
+ ]
111
126
  }
112
127
  }
@@ -19,6 +19,7 @@ Pod::Spec.new do |s|
19
19
 
20
20
  s.test_spec "Tests" do |test_spec|
21
21
  test_spec.source_files = "ios/tests/**/*.{m,mm}"
22
+ test_spec.dependency "react-native-native-list"
22
23
  end
23
24
 
24
25
  install_modules_dependencies(s)