@onekeyfe/react-native-pager-view 6.7.0-6 → 6.7.0-60

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 (49) hide show
  1. package/README.md +159 -115
  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 +233 -43
  6. package/android/src/main/java/com/reactnativepagerview/CollapsiblePagerNativeHeaders.kt +596 -27
  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 +716 -10
  14. package/ios/RNCCollapsiblePagerViewComponentView.mm +2246 -97
  15. package/ios/RNCNativeScrollerComponentView.h +2 -0
  16. package/ios/RNCNativeScrollerComponentView.mm +42 -0
  17. package/ios/tests/RNCCollapsiblePagerFirstFrameTests.mm +723 -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 +75 -11
  22. package/lib/module/CollapsiblePagerView.web.js +653 -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/typescript/src/CollapsiblePagerView.d.ts +62 -4
  29. package/lib/typescript/src/CollapsiblePagerView.web.d.ts +56 -2
  30. package/lib/typescript/src/CollapsiblePagerViewNativeComponent.d.ts +54 -38
  31. package/lib/typescript/src/NativeScroller.d.ts +5 -3
  32. package/lib/typescript/src/NativeScroller.web.d.ts +1 -1
  33. package/lib/typescript/src/NativeScrollerNativeComponent.d.ts +47 -48
  34. package/lib/typescript/src/PagerView.d.ts +1 -1
  35. package/lib/typescript/src/PagerView.web.d.ts +1 -1
  36. package/lib/typescript/src/PagerViewNativeComponent.d.ts +20 -21
  37. package/lib/typescript/src/WebCollapsiblePagerPage.d.ts +1 -1
  38. package/lib/typescript/src/usePagerView.d.ts +2 -2
  39. package/lib/typescript/src/utils.d.ts +2 -2
  40. package/package.json +20 -7
  41. package/react-native-pager-view.podspec +1 -0
  42. package/src/CollapsiblePagerView.tsx +208 -12
  43. package/src/CollapsiblePagerView.web.tsx +587 -7
  44. package/src/CollapsiblePagerViewNativeComponent.ts +57 -42
  45. package/src/NativeScroller.tsx +14 -4
  46. package/src/NativeScroller.web.tsx +15 -1
  47. package/src/NativeScrollerNativeComponent.ts +42 -46
  48. package/src/PagerViewNativeComponent.ts +20 -25
  49. package/src/WebCollapsiblePagerPage.tsx +7 -2
@@ -1,5 +1,7 @@
1
1
  import type { ScrollEdgeEffect } from "./ScrollEdgeEffect";
2
2
  import React from "react";
3
+ import type { CollapsiblePagerNativeTabBarConfig, CollapsiblePagerToolbarPress, CollapsiblePagerViewOnNativeTabPressEvent } from "./CollapsiblePagerView";
4
+ export type { CollapsiblePagerNativeTabBarConfig, CollapsiblePagerNativeTabBarItem, CollapsiblePagerNativeTabBarStyle, CollapsiblePagerToolbarItem, CollapsiblePagerToolbarPress } from "./CollapsiblePagerView";
3
5
  import type * as ReactNative from "react-native";
4
6
  export type OnPageScrollEventData = Readonly<{
5
7
  position: number;
@@ -36,10 +38,15 @@ export type CollapsiblePagerMountState = Readonly<{
36
38
  pageKeys: readonly string[];
37
39
  }>;
38
40
  export interface CollapsiblePagerViewProps extends Omit<WebCollapsiblePagerNativeProps, "children" | "headerHeight" | "stickyHeaderHeight" | "pageKeys" | "retainedPages" | "layoutDirection"> {
41
+ nativeTabBar?: CollapsiblePagerNativeTabBarConfig;
42
+ nativeTabPressAnimationEnabled?: boolean;
43
+ onNativeTabPress?: (event: CollapsiblePagerViewOnNativeTabPressEvent) => void;
44
+ onNativeToolbarPress?: (event: ReactNative.NativeSyntheticEvent<CollapsiblePagerToolbarPress>) => void;
39
45
  header: React.ReactNode;
40
46
  stickyHeader: React.ReactNode;
41
47
  headerHeight?: number;
42
48
  stickyHeaderHeight?: number;
49
+ stickyHeaderHeights?: readonly number[];
43
50
  isActive?: boolean;
44
51
  topOverlay?: React.ReactNode;
45
52
  topScrollEdgeEffect?: `${ScrollEdgeEffect}`;
@@ -66,6 +73,13 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
66
73
  state: State;
67
74
  private root;
68
75
  private track;
76
+ private tabProgress;
77
+ private tabProgressFrame;
78
+ private tabProgressGeneration;
79
+ private tabButtons;
80
+ private tabList;
81
+ private tabButtonRefs;
82
+ private tabPill;
69
83
  private headerSlot;
70
84
  private stickySlot;
71
85
  private cssTimelineSupported;
@@ -98,6 +112,7 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
98
112
  private configureFrame;
99
113
  private pendingTopFrame;
100
114
  private transitionTimer;
115
+ private transitionGeneration;
101
116
  private pageScrollState;
102
117
  private configuredScrollElement;
103
118
  private readonly timelineName;
@@ -132,6 +147,8 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
132
147
  scrollToPageTop: (options?: Readonly<{
133
148
  animated?: boolean;
134
149
  }>) => void;
150
+ scrollHeaderBy: (delta: number) => void;
151
+ scrollHeaderToOffset: (offset: number) => void;
135
152
  scrollToStickyTop: (options?: Readonly<{
136
153
  animated?: boolean;
137
154
  }>) => void;
@@ -150,6 +167,18 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
150
167
  private beginPageTransition;
151
168
  private onTrackTransitionEnd;
152
169
  private setTrack;
170
+ private cancelTabProgressFrame;
171
+ private readTabProgress;
172
+ private startTabProgressFrames;
173
+ private tabColorWeights;
174
+ private tabFontOwnerKey;
175
+ private tabColor;
176
+ private syncTabColors;
177
+ private syncTabPill;
178
+ private setTabList;
179
+ private setTabPill;
180
+ private tabButtonRef;
181
+ private setTabButton;
153
182
  private pageScrollElement;
154
183
  private setRoot;
155
184
  private overlayTarget;
@@ -178,10 +207,35 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
178
207
  private onTouchMove;
179
208
  private onTouchEnd;
180
209
  private onTouchCancel;
181
- render(): import("react/jsx-runtime").JSX.Element;
210
+ private toolbarSlot;
211
+ private toolbarButton;
212
+ private toolbarOwnerKey;
213
+ private toolbarOwnerEntry;
214
+ private toolbarIconIdentity;
215
+ private toolbarLoadedIcon;
216
+ private toolbarPendingIdentity;
217
+ private toolbarReadyIcon;
218
+ private toolbarFailedIdentity;
219
+ private toolbarAnimation;
220
+ private toolbarPresence;
221
+ private toolbarPresenceInterrupted;
222
+ private toolbarImage;
223
+ private toolbarGeneration;
224
+ private toolbarTouchKey;
225
+ private ownsSettledToolbar;
226
+ private toolbarCanCommit;
227
+ private cancelToolbarPending;
228
+ private setToolbarInteractive;
229
+ private suspendToolbar;
230
+ private setToolbarSlot;
231
+ private animateToolbar;
232
+ private hideToolbar;
233
+ private commitToolbar;
234
+ private syncToolbar;
235
+ private renderNativeTabBar;
236
+ render(): React.JSX.Element;
182
237
  }
183
238
  export type CollapsiblePagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<OnPageScrollEventData>;
184
239
  export type CollapsiblePagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>;
185
240
  export type CollapsiblePagerViewOnPageScrollStateChangedEvent = ReactNative.NativeSyntheticEvent<OnPageScrollStateChangedEventData>;
186
- export {};
187
241
  //# sourceMappingURL=CollapsiblePagerView.web.d.ts.map
@@ -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
@@ -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-6",
3
+ "version": "6.7.0-60",
4
4
  "description": "React Native wrapper for Android and iOS ViewPager",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
@@ -43,7 +43,8 @@
43
43
  "prepare": "rm -rf lib && bob build",
44
44
  "typecheck": "tsc -b",
45
45
  "lint": "eslint \"**/*.{js,ts,tsx}\"",
46
- "release": "yarn prepare && npm whoami && npm publish --access public"
46
+ "release": "yarn prepare && npm whoami && npm publish --access public",
47
+ "test": "jest"
47
48
  },
48
49
  "keywords": [
49
50
  "react-native",
@@ -66,14 +67,15 @@
66
67
  "access": "public"
67
68
  },
68
69
  "devDependencies": {
69
- "@types/react": "^19.2.0",
70
- "react": "19.2.3",
71
- "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",
72
73
  "react-native-builder-bob": "^0.40.13",
73
74
  "typescript": "^5.9.2"
74
75
  },
75
76
  "peerDependencies": {
76
- "@onekeyfe/react-native-native-logger": "6.7.0-6",
77
+ "@onekeyfe/react-native-image": "*",
78
+ "@onekeyfe/react-native-native-logger": "*",
77
79
  "react": "*",
78
80
  "react-native": "*"
79
81
  },
@@ -110,5 +112,16 @@
110
112
  }
111
113
  }
112
114
  },
113
- "react-native": "./lib/module/index.native.js"
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
+ ]
126
+ }
114
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)