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

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
@@ -2,25 +2,20 @@ import type * as React from "react";
2
2
  import {
3
3
  codegenNativeCommands,
4
4
  codegenNativeComponent,
5
+ type CodegenTypes,
5
6
  type ColorValue,
6
7
  type HostComponent,
7
8
  type ViewProps,
8
9
  } from "react-native";
9
10
 
10
- import type {
11
- DirectEventHandler,
12
- Double,
13
- Int32,
14
- WithDefault,
15
- } from "react-native/Libraries/Types/CodegenTypes";
16
11
 
17
12
  export type OnPageScrollEventData = Readonly<{
18
- position: Double;
19
- offset: Double;
13
+ position: CodegenTypes.Double;
14
+ offset: CodegenTypes.Double;
20
15
  }>;
21
16
 
22
17
  export type OnPageSelectedEventData = Readonly<{
23
- position: Double;
18
+ position: CodegenTypes.Double;
24
19
  }>;
25
20
 
26
21
  export type OnPageScrollStateChangedEventData = Readonly<{
@@ -28,11 +23,11 @@ export type OnPageScrollStateChangedEventData = Readonly<{
28
23
  }>;
29
24
 
30
25
  export type OnCollapsibleStateChangedEventData = Readonly<{
31
- position: Int32;
32
- headerOffset: Double;
33
- nativePageCount: Int32;
34
- attachedPageCount: Int32;
35
- observedScrollableCount: Int32;
26
+ position: CodegenTypes.Int32;
27
+ headerOffset: CodegenTypes.Double;
28
+ nativePageCount: CodegenTypes.Int32;
29
+ attachedPageCount: CodegenTypes.Int32;
30
+ observedScrollableCount: CodegenTypes.Int32;
36
31
  retainedPages: string;
37
32
  reason: string;
38
33
  pageKey: string;
@@ -40,9 +35,13 @@ export type OnCollapsibleStateChangedEventData = Readonly<{
40
35
  }>;
41
36
 
42
37
  export type OnNativeTabPressEventData = Readonly<{
43
- position: Int32;
38
+ position: CodegenTypes.Int32;
44
39
  key: string;
45
40
  }>;
41
+ export type OnNativeToolbarPressEventData = Readonly<{
42
+ key: string;
43
+ anchorRect: Readonly<{ x: CodegenTypes.Double; y: CodegenTypes.Double; width: CodegenTypes.Double; height: CodegenTypes.Double }>;
44
+ }>;
46
45
  export type OnScrollEdgeCapabilityEventData = Readonly<{ available: boolean }>;
47
46
 
48
47
  /**
@@ -50,59 +49,73 @@ export type OnScrollEdgeCapabilityEventData = Readonly<{ available: boolean }>;
50
49
  * CollapsiblePagerView instead of mounting this host component directly.
51
50
  */
52
51
  export interface NativeProps extends ViewProps {
53
- scrollEnabled?: WithDefault<boolean, true>;
54
- layoutDirection?: WithDefault<"ltr" | "rtl", "ltr">;
55
- initialPage?: Int32;
56
- offscreenPageLimit?: Int32;
52
+ scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
53
+ layoutDirection?: CodegenTypes.WithDefault<"ltr" | "rtl", "ltr">;
54
+ initialPage?: CodegenTypes.Int32;
55
+ offscreenPageLimit?: CodegenTypes.Int32;
57
56
  // OneKey patch: Preserve nested pager gesture coordination for collapsible pages.
58
- nestedScrollEnabled?: WithDefault<boolean, false>;
59
- nativeSmoothHeaderScrollEnabled?: WithDefault<boolean, false>;
60
- headerHeight?: Int32;
61
- stickyHeaderHeight?: Int32;
62
- topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
57
+ nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
58
+ nativeSmoothHeaderScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
59
+ headerHeight?: CodegenTypes.Int32;
60
+ stickyHeaderHeight?: CodegenTypes.Int32;
61
+ stickyHeaderHeights?: string;
62
+ topScrollEdgeEffect?: CodegenTypes.WithDefault<"none" | "hard" | "soft", "none">;
63
63
  topOverlayColorScheme?: string;
64
- topOverlayHeight?: WithDefault<Double, 0>;
65
- externalTopOverlayTag?: WithDefault<Int32, 0>;
64
+ topOverlayHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
65
+ externalTopOverlayTag?: CodegenTypes.WithDefault<CodegenTypes.Int32, 0>;
66
66
  pageKeys?: string;
67
67
  retainedPages?: string;
68
+ nativeTabBarConfig?: string;
68
69
  nativeTabBarItems?: string;
69
- nativeTabBarHeight?: Double;
70
- nativeTabBarContentPaddingHorizontal?: Double;
71
- nativeTabBarItemSpacing?: Double;
72
- nativeTabBarFontSize?: Double;
70
+ nativeTabBarHeight?: CodegenTypes.Double;
71
+ nativeTabBarVariant?: string;
72
+ nativeTabBarTrailingReservedWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
73
+ nativeTabBarContentPaddingHorizontal?: CodegenTypes.Double;
74
+ nativeTabBarContentPaddingVertical?: CodegenTypes.Double;
75
+ nativeTabBarItemSpacing?: CodegenTypes.Double;
76
+ nativeTabBarFontSize?: CodegenTypes.Double;
73
77
  nativeTabBarFontFamily?: string;
74
78
  nativeTabBarBackgroundColor?: ColorValue;
75
79
  nativeTabBarActiveTextColor?: ColorValue;
76
80
  nativeTabBarInactiveTextColor?: ColorValue;
77
81
  nativeTabBarIndicatorColor?: ColorValue;
78
- nativeTabBarIndicatorHeight?: Double;
79
- nativeTabBarIndicatorBottom?: Double;
82
+ nativeTabBarIndicatorHeight?: CodegenTypes.Double;
83
+ nativeTabBarIndicatorBottom?: CodegenTypes.Double;
80
84
  nativeSubHeaderConfig?: string;
81
85
  nativeSubHeaderSelectedBackgroundColor?: ColorValue;
82
- onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
83
- onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
84
- onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
85
- onCollapsibleStateChanged?: DirectEventHandler<OnCollapsibleStateChangedEventData>;
86
- onNativeTabPress?: DirectEventHandler<OnNativeTabPressEventData>;
87
- onNativeSubHeaderPress?: DirectEventHandler<OnNativeTabPressEventData>;
88
- onScrollEdgeCapability?: DirectEventHandler<OnScrollEdgeCapabilityEventData>;
86
+ onPageScroll?: CodegenTypes.DirectEventHandler<OnPageScrollEventData>;
87
+ onPageSelected?: CodegenTypes.DirectEventHandler<OnPageSelectedEventData>;
88
+ onPageScrollStateChanged?: CodegenTypes.DirectEventHandler<OnPageScrollStateChangedEventData>;
89
+ onCollapsibleStateChanged?: CodegenTypes.DirectEventHandler<OnCollapsibleStateChangedEventData>;
90
+ onNativeToolbarPress?: CodegenTypes.DirectEventHandler<OnNativeToolbarPressEventData>;
91
+ onNativeTabPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
92
+ onNativeSubHeaderPress?: CodegenTypes.DirectEventHandler<OnNativeTabPressEventData>;
93
+ onScrollEdgeCapability?: CodegenTypes.DirectEventHandler<OnScrollEdgeCapabilityEventData>;
89
94
  }
90
95
 
91
96
  type CollapsiblePagerViewNativeType = HostComponent<NativeProps>;
92
97
 
93
98
  export interface NativeCommands {
99
+ scrollHeaderToOffset: (
100
+ viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
101
+ offset: CodegenTypes.Double
102
+ ) => void;
103
+ scrollHeaderBy: (
104
+ viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
105
+ delta: CodegenTypes.Double
106
+ ) => void;
94
107
  scrollToTop: (
95
108
  viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
96
- target: Int32,
109
+ target: CodegenTypes.Int32,
97
110
  animated: boolean
98
111
  ) => void;
99
112
  setPage: (
100
113
  viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
101
- selectedPage: Int32
114
+ selectedPage: CodegenTypes.Int32
102
115
  ) => void;
103
116
  setPageWithoutAnimation: (
104
117
  viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
105
- selectedPage: Int32
118
+ selectedPage: CodegenTypes.Int32
106
119
  ) => void;
107
120
  setScrollEnabledImperatively: (
108
121
  viewRef: React.ElementRef<CollapsiblePagerViewNativeType>,
@@ -112,6 +125,8 @@ export interface NativeCommands {
112
125
 
113
126
  export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
114
127
  supportedCommands: [
128
+ "scrollHeaderToOffset",
129
+ "scrollHeaderBy",
115
130
  "scrollToTop",
116
131
  "setPage",
117
132
  "setPageWithoutAnimation",
@@ -9,8 +9,10 @@ export const NativeScroller = /*#__PURE__*/React.forwardRef(function NativeScrol
9
9
  pagerScrollKey,
10
10
  topOverlay: _topOverlay,
11
11
  topScrollEdgeEffect: _topScrollEdgeEffect,
12
+ keyboardShouldPersistTaps,
12
13
  ...props
13
14
  } = inputProps;
15
+ const persistTaps = keyboardShouldPersistTaps === true ? "always" : keyboardShouldPersistTaps === false ? "never" : keyboardShouldPersistTaps;
14
16
  const scrollRef = React.useRef(null);
15
17
  const setRef = React.useCallback(node => {
16
18
  scrollRef.current = node;
@@ -32,6 +34,7 @@ export const NativeScroller = /*#__PURE__*/React.forwardRef(function NativeScrol
32
34
  };
33
35
  return /*#__PURE__*/_jsx(ScrollView, {
34
36
  ...props,
37
+ keyboardShouldPersistTaps: persistTaps,
35
38
  ref: setRef,
36
39
  ...webDataProps
37
40
  });
@@ -2,69 +2,65 @@ import type * as React from "react";
2
2
  import {
3
3
  codegenNativeCommands,
4
4
  codegenNativeComponent,
5
+ type CodegenTypes,
5
6
  type ColorValue,
6
7
  type HostComponent,
7
8
  type ViewProps,
8
9
  } from "react-native";
9
- import type {
10
- DirectEventHandler,
11
- Double,
12
- WithDefault,
13
- } from "react-native/Libraries/Types/CodegenTypes";
14
10
 
15
11
  export type NativeScrollerScrollEvent = Readonly<{
16
12
  contentInset: Readonly<{
17
- top: Double;
18
- right: Double;
19
- bottom: Double;
20
- left: Double;
13
+ top: CodegenTypes.Double;
14
+ right: CodegenTypes.Double;
15
+ bottom: CodegenTypes.Double;
16
+ left: CodegenTypes.Double;
21
17
  }>;
22
- contentOffset: Readonly<{ x: Double; y: Double }>;
23
- contentSize: Readonly<{ width: Double; height: Double }>;
24
- layoutMeasurement: Readonly<{ width: Double; height: Double }>;
25
- velocity: Readonly<{ x: Double; y: Double }>;
26
- targetContentOffset: Readonly<{ x: Double; y: Double }>;
27
- zoomScale: Double;
18
+ contentOffset: Readonly<{ x: CodegenTypes.Double; y: CodegenTypes.Double }>;
19
+ contentSize: Readonly<{ width: CodegenTypes.Double; height: CodegenTypes.Double }>;
20
+ layoutMeasurement: Readonly<{ width: CodegenTypes.Double; height: CodegenTypes.Double }>;
21
+ velocity: Readonly<{ x: CodegenTypes.Double; y: CodegenTypes.Double }>;
22
+ targetContentOffset: Readonly<{ x: CodegenTypes.Double; y: CodegenTypes.Double }>;
23
+ zoomScale: CodegenTypes.Double;
28
24
  }>;
29
25
 
30
26
  export interface NativeProps extends ViewProps {
31
- contentWidth?: WithDefault<Double, 0>;
32
- contentHeight?: WithDefault<Double, 0>;
33
- scrollEnabled?: WithDefault<boolean, true>;
34
- nestedScrollEnabled?: WithDefault<boolean, true>;
35
- showsVerticalScrollIndicator?: WithDefault<boolean, true>;
36
- showsHorizontalScrollIndicator?: WithDefault<boolean, false>;
37
- bounces?: WithDefault<boolean, true>;
38
- alwaysBounceVertical?: WithDefault<boolean, true>;
39
- keyboardDismissMode?: WithDefault<"none" | "on-drag" | "interactive", "none">;
40
- keyboardShouldPersistTaps?: WithDefault<
27
+ contentWidth?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
28
+ contentHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
29
+ scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
30
+ nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
31
+ showsVerticalScrollIndicator?: CodegenTypes.WithDefault<boolean, true>;
32
+ showsHorizontalScrollIndicator?: CodegenTypes.WithDefault<boolean, false>;
33
+ bounces?: CodegenTypes.WithDefault<boolean, true>;
34
+ alwaysBounceVertical?: CodegenTypes.WithDefault<boolean, true>;
35
+ keyboardDismissMode?: CodegenTypes.WithDefault<"none" | "on-drag" | "interactive", "none">;
36
+ keyboardShouldPersistTaps?: CodegenTypes.WithDefault<
41
37
  "never" | "always" | "handled",
42
38
  "never"
43
39
  >;
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>;
40
+ scrollEventThrottle?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
41
+ decelerationRate?: CodegenTypes.WithDefault<CodegenTypes.Double, 0.998>;
42
+ contentInsetTop?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
43
+ contentInsetRight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
44
+ contentInsetBottom?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
45
+ contentInsetLeft?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
46
+ topScrollEdgeEffect?: CodegenTypes.WithDefault<"none" | "hard" | "soft", "none">;
47
+ topOverlayHeight?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
48
+ refreshEnabled?: CodegenTypes.WithDefault<boolean, false>;
49
+ refreshing?: CodegenTypes.WithDefault<boolean, false>;
54
50
  refreshTintColor?: ColorValue;
55
51
  refreshColors?: ReadonlyArray<ColorValue>;
56
52
  refreshProgressBackgroundColor?: ColorValue;
57
- refreshProgressViewOffset?: WithDefault<Double, 0>;
53
+ refreshProgressViewOffset?: CodegenTypes.WithDefault<CodegenTypes.Double, 0>;
58
54
  refreshTitle?: string;
59
55
  refreshTitleColor?: ColorValue;
60
- refreshSize?: WithDefault<"default" | "large", "default">;
61
- onContentViewportChange?: DirectEventHandler<Readonly<{ height: Double }>>;
62
- onRefresh?: DirectEventHandler<null>;
63
- onScroll?: DirectEventHandler<NativeScrollerScrollEvent>;
64
- onScrollBeginDrag?: DirectEventHandler<NativeScrollerScrollEvent>;
65
- onScrollEndDrag?: DirectEventHandler<NativeScrollerScrollEvent>;
66
- onMomentumScrollBegin?: DirectEventHandler<NativeScrollerScrollEvent>;
67
- onMomentumScrollEnd?: DirectEventHandler<NativeScrollerScrollEvent>;
56
+ refreshSize?: CodegenTypes.WithDefault<"default" | "large", "default">;
57
+ onContentViewportChange?: CodegenTypes.DirectEventHandler<Readonly<{ height: CodegenTypes.Double }>>;
58
+ onRefresh?: CodegenTypes.DirectEventHandler<null>;
59
+ onScroll?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
60
+ onScrollBeginDrag?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
61
+ onScrollEndDrag?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
62
+ onMomentumScrollBegin?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
63
+ onMomentumScrollEnd?: CodegenTypes.DirectEventHandler<NativeScrollerScrollEvent>;
68
64
  }
69
65
 
70
66
  type NativeScrollerHost = HostComponent<NativeProps>;
@@ -72,8 +68,8 @@ type NativeScrollerHost = HostComponent<NativeProps>;
72
68
  export interface NativeCommands {
73
69
  scrollTo: (
74
70
  viewRef: React.ElementRef<NativeScrollerHost>,
75
- x: Double,
76
- y: Double,
71
+ x: CodegenTypes.Double,
72
+ y: CodegenTypes.Double,
77
73
  animated: boolean
78
74
  ) => void;
79
75
  scrollToEnd: (
@@ -2,24 +2,19 @@ import type * as React from 'react';
2
2
  import {
3
3
  codegenNativeCommands,
4
4
  codegenNativeComponent,
5
+ type CodegenTypes,
5
6
  type HostComponent,
6
7
  type ViewProps,
7
8
  } from 'react-native';
8
9
 
9
- import type {
10
- DirectEventHandler,
11
- Double,
12
- Int32,
13
- WithDefault,
14
- } from 'react-native/Libraries/Types/CodegenTypes';
15
10
 
16
11
  export type OnPageScrollEventData = Readonly<{
17
- position: Double;
18
- offset: Double;
12
+ position: CodegenTypes.Double;
13
+ offset: CodegenTypes.Double;
19
14
  }>;
20
15
 
21
16
  export type OnPageSelectedEventData = Readonly<{
22
- position: Double;
17
+ position: CodegenTypes.Double;
23
18
  }>;
24
19
 
25
20
  export type OnPageScrollStateChangedEventData = Readonly<{
@@ -27,32 +22,32 @@ export type OnPageScrollStateChangedEventData = Readonly<{
27
22
  }>;
28
23
 
29
24
  export interface NativeProps extends ViewProps {
30
- scrollEnabled?: WithDefault<boolean, true>;
31
- layoutDirection?: WithDefault<'ltr' | 'rtl', 'ltr'>;
32
- initialPage?: Int32;
33
- orientation?: WithDefault<'horizontal' | 'vertical', 'horizontal'>;
34
- offscreenPageLimit?: Int32;
35
- pageMargin?: Int32;
36
- overScrollMode?: WithDefault<'auto' | 'always' | 'never', 'auto'>;
37
- overdrag?: WithDefault<boolean, false>;
38
- keyboardDismissMode?: WithDefault<'none' | 'on-drag', 'none'>;
25
+ scrollEnabled?: CodegenTypes.WithDefault<boolean, true>;
26
+ layoutDirection?: CodegenTypes.WithDefault<'ltr' | 'rtl', 'ltr'>;
27
+ initialPage?: CodegenTypes.Int32;
28
+ orientation?: CodegenTypes.WithDefault<'horizontal' | 'vertical', 'horizontal'>;
29
+ offscreenPageLimit?: CodegenTypes.Int32;
30
+ pageMargin?: CodegenTypes.Int32;
31
+ overScrollMode?: CodegenTypes.WithDefault<'auto' | 'always' | 'never', 'auto'>;
32
+ overdrag?: CodegenTypes.WithDefault<boolean, false>;
33
+ keyboardDismissMode?: CodegenTypes.WithDefault<'none' | 'on-drag', 'none'>;
39
34
  /**
40
35
  * Controls the sensitivity of scroll gestures on Android.
41
36
  * Higher values make scrolling less sensitive.
42
37
  * Valid range: 2 - 8
43
38
  * @platform android
44
39
  */
45
- scrollSensitivity?: Int32;
40
+ scrollSensitivity?: CodegenTypes.Int32;
46
41
  /**
47
42
  * When true on an inner PagerView, enables gesture coordination with
48
43
  * a parent (outer) PagerView. At sub-tab boundaries the inner pager's
49
44
  * gesture recognizer will not begin, allowing the outer pager to take over.
50
45
  * @platform ios
51
46
  */
52
- nestedScrollEnabled?: WithDefault<boolean, false>;
53
- onPageScroll?: DirectEventHandler<OnPageScrollEventData>;
54
- onPageSelected?: DirectEventHandler<OnPageSelectedEventData>;
55
- onPageScrollStateChanged?: DirectEventHandler<OnPageScrollStateChangedEventData>;
47
+ nestedScrollEnabled?: CodegenTypes.WithDefault<boolean, false>;
48
+ onPageScroll?: CodegenTypes.DirectEventHandler<OnPageScrollEventData>;
49
+ onPageSelected?: CodegenTypes.DirectEventHandler<OnPageSelectedEventData>;
50
+ onPageScrollStateChanged?: CodegenTypes.DirectEventHandler<OnPageScrollStateChangedEventData>;
56
51
  }
57
52
 
58
53
  type PagerViewViewType = HostComponent<NativeProps>;
@@ -60,11 +55,11 @@ type PagerViewViewType = HostComponent<NativeProps>;
60
55
  export interface NativeCommands {
61
56
  setPage: (
62
57
  viewRef: React.ElementRef<PagerViewViewType>,
63
- selectedPage: Int32
58
+ selectedPage: CodegenTypes.Int32
64
59
  ) => void;
65
60
  setPageWithoutAnimation: (
66
61
  viewRef: React.ElementRef<PagerViewViewType>,
67
- selectedPage: Int32
62
+ selectedPage: CodegenTypes.Int32
68
63
  ) => void;
69
64
  setScrollEnabledImperatively: (
70
65
  viewRef: React.ElementRef<PagerViewViewType>,
@@ -148,7 +148,12 @@ export function WebCollapsiblePagerPage({
148
148
  owner.addEventListener("keydown", handleKey);
149
149
  owner.addEventListener("ok-collapsible-pager-user-scroll", handleUserInput);
150
150
  owner.addEventListener("ok-collapsible-pager-insets-changed", requestMeasure);
151
- requestMeasure();
151
+ // Measure synchronously while still inside the layout phase: the metrics
152
+ // start at width 0, and deferring this first measurement to the next
153
+ // animation frame let the page paint once at width 0, which collapsed
154
+ // shrinkable page content (a fiat hero wrapped one character per line,
155
+ // OK-66299). Resize and scroll updates stay frame-coalesced.
156
+ measure();
152
157
  return () => {
153
158
  observer.disconnect();
154
159
  observerRef.current = null;
@@ -162,7 +167,7 @@ export function WebCollapsiblePagerPage({
162
167
  if (frameRef.current !== null) cancelAnimationFrame(frameRef.current);
163
168
  frameRef.current = null;
164
169
  };
165
- }, [owner, requestMeasure, syncContentObservation]);
170
+ }, [owner, measure, requestMeasure, syncContentObservation]);
166
171
  React.useLayoutEffect(requestMeasure, [isFocused, isRouteActive, headerHeight, stickyHeaderHeight, requestMeasure]);
167
172
  const value = React.useMemo(() => ({
168
173
  isFocused,
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ import { PagerView } from "./PagerView";
4
+ export default PagerView;
5
+ export * from "./usePagerView.js";
6
+ export * from "./CollapsiblePagerView";
7
+ export * from "./NativeScroller";
8
+ export { ScrollEdgeEffect } from "./ScrollEdgeEffect.js";
9
+ //# sourceMappingURL=index.native.js.map
@@ -16,11 +16,15 @@ export type CollapsiblePagerNativeTabBarItem = Readonly<{
16
16
  testID?: string;
17
17
  }>;
18
18
  export type CollapsiblePagerNativeTabBarStyle = Readonly<{
19
+ variant?: "underline" | "segmented" | "text";
19
20
  height?: number;
21
+ trailingReservedWidth?: number;
20
22
  contentPaddingHorizontal?: number;
23
+ contentPaddingVertical?: number;
21
24
  itemSpacing?: number;
22
25
  fontSize?: number;
23
26
  fontFamily?: string;
27
+ activeFontFamily?: string;
24
28
  backgroundColor?: ReactNative.ColorValue;
25
29
  activeTextColor?: ReactNative.ColorValue;
26
30
  inactiveTextColor?: ReactNative.ColorValue;
@@ -28,7 +32,33 @@ export type CollapsiblePagerNativeTabBarStyle = Readonly<{
28
32
  indicatorHeight?: number;
29
33
  indicatorBottom?: number;
30
34
  }>;
35
+ export type CollapsiblePagerToolbarItem = Readonly<{
36
+ iconName: string;
37
+ selected?: boolean;
38
+ accessibilityLabel?: string;
39
+ testID?: string;
40
+ iconColor?: string;
41
+ selectedBackgroundColor?: string;
42
+ hoverBackgroundColor?: string;
43
+ pressedBackgroundColor?: string;
44
+ size?: number;
45
+ iconSize?: number;
46
+ contentWidth?: number;
47
+ trailingInset?: number;
48
+ }>;
49
+ export type CollapsiblePagerToolbarPress = Readonly<{
50
+ key: string;
51
+ anchorRect: Readonly<{
52
+ x: number;
53
+ y: number;
54
+ width: number;
55
+ height: number;
56
+ }>;
57
+ }>;
31
58
  export type CollapsiblePagerNativeTabBarConfig = Readonly<{
59
+ controlled?: boolean;
60
+ selectedKey?: string;
61
+ toolbar?: Readonly<Record<string, CollapsiblePagerToolbarItem>>;
32
62
  items: readonly CollapsiblePagerNativeTabBarItem[];
33
63
  style?: CollapsiblePagerNativeTabBarStyle;
34
64
  }>;
@@ -56,7 +86,7 @@ export type CollapsiblePagerNativeSubHeaderConfig = Readonly<{
56
86
  }>;
57
87
  export type CollapsiblePagerViewOnNativeTabPressEvent = ReactNative.NativeSyntheticEvent<OnNativeTabPressEventData>;
58
88
  export type CollapsiblePagerViewOnNativeSubHeaderPressEvent = ReactNative.NativeSyntheticEvent<OnNativeTabPressEventData>;
59
- export interface CollapsiblePagerViewProps extends Omit<NativeProps, "children" | "headerHeight" | "stickyHeaderHeight" | "topScrollEdgeEffect" | "topOverlayHeight" | "externalTopOverlayTag" | "pageKeys" | "retainedPages" | "nativeTabBarItems" | "nativeTabBarHeight" | "nativeTabBarContentPaddingHorizontal" | "nativeTabBarItemSpacing" | "nativeTabBarFontSize" | "nativeTabBarFontFamily" | "nativeTabBarBackgroundColor" | "nativeTabBarActiveTextColor" | "nativeTabBarInactiveTextColor" | "nativeTabBarIndicatorColor" | "nativeTabBarIndicatorHeight" | "nativeTabBarIndicatorBottom" | "nativeSubHeaderConfig" | "nativeSubHeaderSelectedBackgroundColor" | "onNativeTabPress" | "onNativeSubHeaderPress" | "layoutDirection"> {
89
+ export interface CollapsiblePagerViewProps extends Omit<NativeProps, "children" | "headerHeight" | "stickyHeaderHeight" | "stickyHeaderHeights" | "topScrollEdgeEffect" | "topOverlayHeight" | "externalTopOverlayTag" | "pageKeys" | "retainedPages" | "nativeTabBarConfig" | "onNativeToolbarPress" | "nativeTabBarItems" | "nativeTabBarHeight" | "nativeTabBarVariant" | "nativeTabBarTrailingReservedWidth" | "nativeTabBarContentPaddingHorizontal" | "nativeTabBarContentPaddingVertical" | "nativeTabBarItemSpacing" | "nativeTabBarFontSize" | "nativeTabBarFontFamily" | "nativeTabBarBackgroundColor" | "nativeTabBarActiveTextColor" | "nativeTabBarInactiveTextColor" | "nativeTabBarIndicatorColor" | "nativeTabBarIndicatorHeight" | "nativeTabBarIndicatorBottom" | "nativeSubHeaderConfig" | "nativeSubHeaderSelectedBackgroundColor" | "onNativeTabPress" | "onNativeSubHeaderPress" | "layoutDirection"> {
60
90
  /** Collapsible content rendered above the sticky bar. */
61
91
  header: React.ReactNode;
62
92
  /** Bar which remains pinned after the header has collapsed. */
@@ -65,8 +95,12 @@ export interface CollapsiblePagerViewProps extends Omit<NativeProps, "children"
65
95
  headerHeight: number;
66
96
  /** Measured sticky bar height. */
67
97
  stickyHeaderHeight: number;
98
+ /** iOS only. Sticky heights in child order, applied before each page is displayed. */
99
+ stickyHeaderHeights?: readonly number[];
68
100
  /** Fixed content above the collapsible header on iOS 26 and newer. */
69
101
  topOverlay?: React.ReactNode;
102
+ /** Known overlay height to reserve until its first layout measurement. */
103
+ topOverlayHeightHint?: number;
70
104
  /** Existing fixed header shared with a parent pager on iOS 26 and newer. */
71
105
  externalTopOverlayTag?: number;
72
106
  /** Selects UIKit's top scroll-edge effect on iOS 26 and newer. */
@@ -87,6 +121,7 @@ export interface CollapsiblePagerViewProps extends Omit<NativeProps, "children"
87
121
  layoutDirection?: "ltr" | "rtl" | "locale";
88
122
  /** Optional native tab bar for iOS and Android. */
89
123
  nativeTabBar?: CollapsiblePagerNativeTabBarConfig;
124
+ onNativeToolbarPress?: (event: ReactNative.NativeSyntheticEvent<CollapsiblePagerToolbarPress>) => void;
90
125
  onNativeTabPress?: (event: CollapsiblePagerViewOnNativeTabPressEvent) => void;
91
126
  /**
92
127
  * Defaults to animating adjacent native tab presses and jumping directly to
@@ -102,7 +137,7 @@ export interface CollapsiblePagerViewProps extends Omit<NativeProps, "children"
102
137
  type State = {
103
138
  selectedPage: number;
104
139
  transientRetainedPages: readonly number[];
105
- topOverlayHeight: number;
140
+ topOverlayHeight: number | null;
106
141
  };
107
142
  /**
108
143
  * Pager variant whose vertical header coordination is performed by the native
@@ -120,12 +155,14 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
120
155
  private nativePagerScrollState;
121
156
  private nativeTabCommandQueuedDuringScroll;
122
157
  componentDidMount(): void;
123
- componentDidUpdate(): void;
158
+ componentDidUpdate(previousProps: CollapsiblePagerViewProps): void;
124
159
  setPage: (selectedPage: number) => void;
125
160
  setPageWithoutAnimation: (selectedPage: number) => void;
126
161
  scrollToPageTop: (options?: Readonly<{
127
162
  animated?: boolean;
128
163
  }>) => void;
164
+ scrollHeaderBy: (delta: number) => void;
165
+ scrollHeaderToOffset: (offset: number) => void;
129
166
  scrollToStickyTop: (options?: Readonly<{
130
167
  animated?: boolean;
131
168
  }>) => void;
@@ -139,8 +176,9 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
139
176
  private onPageSelected;
140
177
  private onPageScrollStateChanged;
141
178
  private onNativeTabPress;
179
+ private onNativeToolbarPress;
142
180
  private onNativeSubHeaderPress;
143
- render(): import("react/jsx-runtime").JSX.Element;
181
+ render(): React.JSX.Element;
144
182
  }
145
183
  export type CollapsiblePagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<OnPageScrollEventData>;
146
184
  export type CollapsiblePagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>;
@@ -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,10 @@ 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;
69
80
  private headerSlot;
70
81
  private stickySlot;
71
82
  private cssTimelineSupported;
@@ -98,6 +109,7 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
98
109
  private configureFrame;
99
110
  private pendingTopFrame;
100
111
  private transitionTimer;
112
+ private transitionGeneration;
101
113
  private pageScrollState;
102
114
  private configuredScrollElement;
103
115
  private readonly timelineName;
@@ -132,6 +144,8 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
132
144
  scrollToPageTop: (options?: Readonly<{
133
145
  animated?: boolean;
134
146
  }>) => void;
147
+ scrollHeaderBy: (delta: number) => void;
148
+ scrollHeaderToOffset: (offset: number) => void;
135
149
  scrollToStickyTop: (options?: Readonly<{
136
150
  animated?: boolean;
137
151
  }>) => void;
@@ -150,6 +164,13 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
150
164
  private beginPageTransition;
151
165
  private onTrackTransitionEnd;
152
166
  private setTrack;
167
+ private cancelTabProgressFrame;
168
+ private readTabProgress;
169
+ private startTabProgressFrames;
170
+ private tabColorWeights;
171
+ private tabFontOwnerKey;
172
+ private tabColor;
173
+ private syncTabColors;
153
174
  private pageScrollElement;
154
175
  private setRoot;
155
176
  private overlayTarget;
@@ -178,10 +199,35 @@ export declare class CollapsiblePagerView extends React.PureComponent<Collapsibl
178
199
  private onTouchMove;
179
200
  private onTouchEnd;
180
201
  private onTouchCancel;
181
- render(): import("react/jsx-runtime").JSX.Element;
202
+ private toolbarSlot;
203
+ private toolbarButton;
204
+ private toolbarOwnerKey;
205
+ private toolbarOwnerEntry;
206
+ private toolbarIconIdentity;
207
+ private toolbarLoadedIcon;
208
+ private toolbarPendingIdentity;
209
+ private toolbarReadyIcon;
210
+ private toolbarFailedIdentity;
211
+ private toolbarAnimation;
212
+ private toolbarPresence;
213
+ private toolbarPresenceInterrupted;
214
+ private toolbarImage;
215
+ private toolbarGeneration;
216
+ private toolbarTouchKey;
217
+ private ownsSettledToolbar;
218
+ private toolbarCanCommit;
219
+ private cancelToolbarPending;
220
+ private setToolbarInteractive;
221
+ private suspendToolbar;
222
+ private setToolbarSlot;
223
+ private animateToolbar;
224
+ private hideToolbar;
225
+ private commitToolbar;
226
+ private syncToolbar;
227
+ private renderNativeTabBar;
228
+ render(): React.JSX.Element;
182
229
  }
183
230
  export type CollapsiblePagerViewOnPageScrollEvent = ReactNative.NativeSyntheticEvent<OnPageScrollEventData>;
184
231
  export type CollapsiblePagerViewOnPageSelectedEvent = ReactNative.NativeSyntheticEvent<OnPageSelectedEventData>;
185
232
  export type CollapsiblePagerViewOnPageScrollStateChangedEvent = ReactNative.NativeSyntheticEvent<OnPageScrollStateChangedEventData>;
186
- export {};
187
233
  //# sourceMappingURL=CollapsiblePagerView.web.d.ts.map