@onekeyfe/react-native-pager-view 6.7.0-alpha.324 → 6.7.0-alpha.335
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/android/src/main/java/com/reactnativepagerview/CollapsiblePagerViewManager.kt +2 -2
- package/android/src/main/java/com/reactnativepagerview/NativeScrollerViewManager.kt +2 -2
- package/docs/SPEC.md +107 -6
- package/ios/RNCCollapsiblePagerViewComponentView.mm +341 -23
- package/ios/RNCNativeScrollerComponentView.mm +30 -5
- package/ios/tests/RNCCollapsiblePagerFirstFrameTests.mm +124 -0
- package/ios/tests/RNCCollapsiblePagerHitTestTests.mm +186 -1
- package/ios/tests/RNCCollapsiblePagerRefreshControlTests.mm +50 -0
- package/ios/tests/RNCNativeScrollerTests.mm +39 -0
- package/lib/module/CollapsiblePagerView.js +16 -7
- package/lib/module/CollapsiblePagerView.web.js +428 -37
- package/lib/module/CollapsiblePagerViewNativeComponent.ts +1 -1
- package/lib/module/NativeScroller.js +2 -2
- package/lib/module/NativeScroller.web.js +16 -3
- package/lib/module/NativeScrollerNativeComponent.ts +1 -1
- package/lib/module/ScrollEdgeEffect.js +8 -0
- package/lib/module/WebCollapsiblePagerPage.js +182 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.native.js +9 -0
- package/lib/module/index.web.js +3 -0
- package/lib/typescript/src/CollapsiblePagerView.d.ts +8 -5
- package/lib/typescript/src/CollapsiblePagerView.web.d.ts +66 -4
- package/lib/typescript/src/CollapsiblePagerViewNativeComponent.d.ts +1 -1
- package/lib/typescript/src/NativeScroller.d.ts +3 -2
- package/lib/typescript/src/NativeScrollerNativeComponent.d.ts +1 -1
- package/lib/typescript/src/ScrollEdgeEffect.d.ts +5 -0
- package/lib/typescript/src/WebCollapsiblePagerPage.d.ts +42 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.native.d.ts +13 -0
- package/lib/typescript/src/index.web.d.ts +5 -0
- package/package.json +6 -4
- package/src/CollapsiblePagerView.tsx +43 -11
- package/src/CollapsiblePagerView.web.tsx +640 -50
- package/src/CollapsiblePagerViewNativeComponent.ts +1 -1
- package/src/NativeScroller.tsx +6 -4
- package/src/NativeScroller.web.tsx +24 -2
- package/src/NativeScrollerNativeComponent.ts +1 -1
- package/src/ScrollEdgeEffect.ts +4 -0
- package/src/WebCollapsiblePagerPage.tsx +258 -0
- package/src/index.native.tsx +30 -0
- package/src/index.tsx +6 -0
- package/src/index.web.tsx +6 -0
|
@@ -59,7 +59,7 @@ export interface NativeProps extends ViewProps {
|
|
|
59
59
|
nativeSmoothHeaderScrollEnabled?: WithDefault<boolean, false>;
|
|
60
60
|
headerHeight?: Int32;
|
|
61
61
|
stickyHeaderHeight?: Int32;
|
|
62
|
-
|
|
62
|
+
topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
|
|
63
63
|
topOverlayColorScheme?: string;
|
|
64
64
|
topOverlayHeight?: WithDefault<Double, 0>;
|
|
65
65
|
externalTopOverlayTag?: WithDefault<Int32, 0>;
|
package/src/NativeScroller.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
} from "react-native";
|
|
16
16
|
|
|
17
17
|
import NativeScrollerHost, { Commands } from "./NativeScrollerNativeComponent";
|
|
18
|
+
import type { ScrollEdgeEffect } from "./ScrollEdgeEffect";
|
|
18
19
|
|
|
19
20
|
export const NATIVE_SCROLLER_NATIVE_ID_PREFIX =
|
|
20
21
|
"rnc-collapsible-pager-native-scroller";
|
|
@@ -46,8 +47,8 @@ export interface NativeScrollerProps
|
|
|
46
47
|
pagerScrollKey?: string;
|
|
47
48
|
/** Fixed overlay above scrolling content on iOS 26 and newer. */
|
|
48
49
|
topOverlay?: React.ReactNode;
|
|
49
|
-
/**
|
|
50
|
-
topScrollEdgeEffect?:
|
|
50
|
+
/** Selects UIKit's top scroll-edge effect on iOS 26 and newer. */
|
|
51
|
+
topScrollEdgeEffect?: `${ScrollEdgeEffect}`;
|
|
51
52
|
/** iOS only. Android retains AndroidX's native fling physics. */
|
|
52
53
|
decelerationRate?: ScrollViewProps["decelerationRate"];
|
|
53
54
|
/** Standard RefreshControl props are mapped to the independently owned native controller. */
|
|
@@ -118,7 +119,8 @@ export const NativeScroller = React.forwardRef<
|
|
|
118
119
|
const [topOverlayHeight, setTopOverlayHeight] = React.useState(0);
|
|
119
120
|
const hasTopOverlay =
|
|
120
121
|
Platform.OS === "ios" && parseInt(String(Platform.Version), 10) >= 26 &&
|
|
121
|
-
topScrollEdgeEffect === "hard"
|
|
122
|
+
(topScrollEdgeEffect === "hard" || topScrollEdgeEffect === "soft") &&
|
|
123
|
+
topOverlay != null;
|
|
122
124
|
const [refreshEpoch, requestRefreshSync] = React.useReducer(
|
|
123
125
|
(value: number) => value + 1,
|
|
124
126
|
0
|
|
@@ -212,7 +214,7 @@ export const NativeScroller = React.forwardRef<
|
|
|
212
214
|
contentInsetRight={contentInset?.right ?? 0}
|
|
213
215
|
contentInsetBottom={contentInset?.bottom ?? 0}
|
|
214
216
|
contentInsetLeft={contentInset?.left ?? 0}
|
|
215
|
-
|
|
217
|
+
topScrollEdgeEffect={hasTopOverlay ? topScrollEdgeEffect : "none"}
|
|
216
218
|
topOverlayHeight={hasTopOverlay ? topOverlayHeight : 0}
|
|
217
219
|
decelerationRate={rate}
|
|
218
220
|
keyboardShouldPersistTaps={persistTaps}
|
|
@@ -13,19 +13,41 @@ export const NativeScroller = React.forwardRef<
|
|
|
13
13
|
>(function NativeScroller(inputProps, ref) {
|
|
14
14
|
const {
|
|
15
15
|
dataSet,
|
|
16
|
-
pagerScrollKey
|
|
16
|
+
pagerScrollKey,
|
|
17
17
|
topOverlay: _topOverlay,
|
|
18
18
|
topScrollEdgeEffect: _topScrollEdgeEffect,
|
|
19
19
|
...props
|
|
20
20
|
} = inputProps as NativeScrollerWebProps;
|
|
21
|
+
const scrollRef = React.useRef<React.ElementRef<typeof ScrollView>>(null);
|
|
22
|
+
const setRef = React.useCallback(
|
|
23
|
+
(node: React.ElementRef<typeof ScrollView> | null) => {
|
|
24
|
+
scrollRef.current = node;
|
|
25
|
+
if (typeof ref === "function") ref(node);
|
|
26
|
+
else if (ref) ref.current = node;
|
|
27
|
+
},
|
|
28
|
+
[ref]
|
|
29
|
+
);
|
|
30
|
+
React.useLayoutEffect(() => {
|
|
31
|
+
const element = scrollRef.current?.getScrollableNode() as unknown as
|
|
32
|
+
| HTMLElement
|
|
33
|
+
| undefined;
|
|
34
|
+
const EventConstructor = element?.ownerDocument?.defaultView?.Event;
|
|
35
|
+
if (EventConstructor)
|
|
36
|
+
element.dispatchEvent(
|
|
37
|
+
new EventConstructor("ok-collapsible-pager-scroll-key-changed", {
|
|
38
|
+
bubbles: true,
|
|
39
|
+
})
|
|
40
|
+
);
|
|
41
|
+
}, [pagerScrollKey]);
|
|
21
42
|
const webDataProps = {
|
|
22
43
|
dataSet: {
|
|
23
44
|
...dataSet,
|
|
24
45
|
collapsiblePagerScroll: "true",
|
|
46
|
+
collapsiblePagerScrollKey: pagerScrollKey ?? "",
|
|
25
47
|
},
|
|
26
48
|
};
|
|
27
49
|
|
|
28
|
-
return <ScrollView {...props} ref={
|
|
50
|
+
return <ScrollView {...props} ref={setRef} {...webDataProps} />;
|
|
29
51
|
});
|
|
30
52
|
|
|
31
53
|
NativeScroller.displayName = "NativeScroller";
|
|
@@ -47,7 +47,7 @@ export interface NativeProps extends ViewProps {
|
|
|
47
47
|
contentInsetRight?: WithDefault<Double, 0>;
|
|
48
48
|
contentInsetBottom?: WithDefault<Double, 0>;
|
|
49
49
|
contentInsetLeft?: WithDefault<Double, 0>;
|
|
50
|
-
|
|
50
|
+
topScrollEdgeEffect?: WithDefault<"none" | "hard" | "soft", "none">;
|
|
51
51
|
topOverlayHeight?: WithDefault<Double, 0>;
|
|
52
52
|
refreshEnabled?: WithDefault<boolean, false>;
|
|
53
53
|
refreshing?: WithDefault<boolean, false>;
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
export type WebCollapsiblePagerPageState = Readonly<{
|
|
4
|
+
isFocused: boolean;
|
|
5
|
+
isRouteActive: boolean;
|
|
6
|
+
owner: HTMLElement | null;
|
|
7
|
+
content: HTMLElement | null;
|
|
8
|
+
contentHeight?: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
scrollTop: number;
|
|
12
|
+
pendingRouteScrollTop: number | null;
|
|
13
|
+
registerContent: (element: HTMLElement, explicitHeight?: number) => () => void;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export type WebCollapsiblePagerPageBridge = Readonly<{
|
|
17
|
+
setOwner: (owner: HTMLElement | null) => void;
|
|
18
|
+
requestMeasure: () => void;
|
|
19
|
+
setPendingRouteScrollTop: (top: number | null) => void;
|
|
20
|
+
}>;
|
|
21
|
+
|
|
22
|
+
const PageContext = React.createContext<WebCollapsiblePagerPageState | null>(null);
|
|
23
|
+
|
|
24
|
+
export function useWebCollapsiblePagerPage() {
|
|
25
|
+
return React.useContext(PageContext);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function WebCollapsiblePagerPage({
|
|
29
|
+
children,
|
|
30
|
+
pageKey,
|
|
31
|
+
isFocused,
|
|
32
|
+
isRouteActive,
|
|
33
|
+
headerHeight,
|
|
34
|
+
stickyHeaderHeight,
|
|
35
|
+
onBridge,
|
|
36
|
+
onGeometryChange,
|
|
37
|
+
onScroll,
|
|
38
|
+
onUserInput,
|
|
39
|
+
}: React.PropsWithChildren<{
|
|
40
|
+
pageKey: string;
|
|
41
|
+
isFocused: boolean;
|
|
42
|
+
isRouteActive: boolean;
|
|
43
|
+
headerHeight: number;
|
|
44
|
+
stickyHeaderHeight: number;
|
|
45
|
+
onBridge: (key: string, bridge: WebCollapsiblePagerPageBridge | null) => void;
|
|
46
|
+
onGeometryChange: (key: string) => void;
|
|
47
|
+
onScroll: (key: string, top: number) => void;
|
|
48
|
+
onUserInput: (key: string) => void;
|
|
49
|
+
}>) {
|
|
50
|
+
const [owner, setOwner] = React.useState<HTMLElement | null>(null);
|
|
51
|
+
const ownerRef = React.useRef<HTMLElement | null>(null);
|
|
52
|
+
const [registered, setRegistered] = React.useState<{
|
|
53
|
+
element: HTMLElement;
|
|
54
|
+
height?: number;
|
|
55
|
+
} | null>(null);
|
|
56
|
+
const registeredRef = React.useRef(registered);
|
|
57
|
+
const observerRef = React.useRef<ResizeObserver | null>(null);
|
|
58
|
+
const observedContentRef = React.useRef<HTMLElement | null>(null);
|
|
59
|
+
const frameRef = React.useRef<number | null>(null);
|
|
60
|
+
const disposedRef = React.useRef(false);
|
|
61
|
+
const [pendingRouteScrollTop, setPendingRouteScrollTop] = React.useState<
|
|
62
|
+
number | null
|
|
63
|
+
>(null);
|
|
64
|
+
const [metrics, setMetrics] = React.useState({
|
|
65
|
+
width: 0,
|
|
66
|
+
height: 0,
|
|
67
|
+
scrollTop: 0,
|
|
68
|
+
});
|
|
69
|
+
const inputsRef = React.useRef({
|
|
70
|
+
pageKey,
|
|
71
|
+
headerHeight,
|
|
72
|
+
stickyHeaderHeight,
|
|
73
|
+
onGeometryChange,
|
|
74
|
+
onScroll,
|
|
75
|
+
onUserInput,
|
|
76
|
+
});
|
|
77
|
+
inputsRef.current = {
|
|
78
|
+
pageKey,
|
|
79
|
+
headerHeight,
|
|
80
|
+
stickyHeaderHeight,
|
|
81
|
+
onGeometryChange,
|
|
82
|
+
onScroll,
|
|
83
|
+
onUserInput,
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const measure = React.useCallback(() => {
|
|
87
|
+
frameRef.current = null;
|
|
88
|
+
if (disposedRef.current) return;
|
|
89
|
+
const current = ownerRef.current;
|
|
90
|
+
if (!current?.isConnected) return;
|
|
91
|
+
const ownerRect = current.getBoundingClientRect();
|
|
92
|
+
const candidate = registeredRef.current?.element;
|
|
93
|
+
const content = candidate?.isConnected && current.contains(candidate) ? candidate : null;
|
|
94
|
+
const contentRect = (content ?? current.firstElementChild)?.getBoundingClientRect();
|
|
95
|
+
const inputs = inputsRef.current;
|
|
96
|
+
const pinnedBottom =
|
|
97
|
+
ownerRect.top +
|
|
98
|
+
Math.max(0, inputs.headerHeight - current.scrollTop) +
|
|
99
|
+
inputs.stickyHeaderHeight;
|
|
100
|
+
const visibleTop = Math.max(
|
|
101
|
+
ownerRect.top,
|
|
102
|
+
pinnedBottom,
|
|
103
|
+
contentRect?.top ?? 0,
|
|
104
|
+
);
|
|
105
|
+
const next = {
|
|
106
|
+
width: current.clientWidth,
|
|
107
|
+
height: Math.max(0, ownerRect.bottom - visibleTop),
|
|
108
|
+
scrollTop: Math.max(0, pinnedBottom - (contentRect?.top ?? pinnedBottom)),
|
|
109
|
+
};
|
|
110
|
+
setMetrics((previous) =>
|
|
111
|
+
previous.width === next.width &&
|
|
112
|
+
previous.height === next.height &&
|
|
113
|
+
previous.scrollTop === next.scrollTop
|
|
114
|
+
? previous
|
|
115
|
+
: next,
|
|
116
|
+
);
|
|
117
|
+
inputs.onGeometryChange(inputs.pageKey);
|
|
118
|
+
}, []);
|
|
119
|
+
|
|
120
|
+
const requestMeasure = React.useCallback(() => {
|
|
121
|
+
if (!disposedRef.current && frameRef.current === null)
|
|
122
|
+
frameRef.current = requestAnimationFrame(measure);
|
|
123
|
+
}, [measure]);
|
|
124
|
+
|
|
125
|
+
const syncContentObservation = React.useCallback(() => {
|
|
126
|
+
const observer = observerRef.current;
|
|
127
|
+
const current = ownerRef.current;
|
|
128
|
+
if (!observer || !current) return;
|
|
129
|
+
const candidate = registeredRef.current?.element;
|
|
130
|
+
const content = candidate?.isConnected && current.contains(candidate)
|
|
131
|
+
? candidate
|
|
132
|
+
: current.firstElementChild;
|
|
133
|
+
const next =
|
|
134
|
+
typeof HTMLElement !== "undefined" && content instanceof HTMLElement
|
|
135
|
+
? content
|
|
136
|
+
: null;
|
|
137
|
+
if (observedContentRef.current === next) return;
|
|
138
|
+
if (observedContentRef.current) observer.unobserve(observedContentRef.current);
|
|
139
|
+
observedContentRef.current = next;
|
|
140
|
+
if (next) observer.observe(next);
|
|
141
|
+
}, []);
|
|
142
|
+
|
|
143
|
+
const registerContent = React.useCallback<
|
|
144
|
+
WebCollapsiblePagerPageState["registerContent"]
|
|
145
|
+
>(
|
|
146
|
+
(element, height) => {
|
|
147
|
+
const entry = {
|
|
148
|
+
element,
|
|
149
|
+
height: height !== undefined && Number.isFinite(height) && height >= 0
|
|
150
|
+
? height
|
|
151
|
+
: undefined,
|
|
152
|
+
};
|
|
153
|
+
registeredRef.current = entry;
|
|
154
|
+
setRegistered(entry);
|
|
155
|
+
syncContentObservation();
|
|
156
|
+
requestMeasure();
|
|
157
|
+
return () => {
|
|
158
|
+
if (registeredRef.current !== entry) return;
|
|
159
|
+
registeredRef.current = null;
|
|
160
|
+
setRegistered(null);
|
|
161
|
+
syncContentObservation();
|
|
162
|
+
requestMeasure();
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
[requestMeasure, syncContentObservation],
|
|
166
|
+
);
|
|
167
|
+
|
|
168
|
+
const bridge = React.useMemo<WebCollapsiblePagerPageBridge>(
|
|
169
|
+
() => ({
|
|
170
|
+
setOwner: (next) => {
|
|
171
|
+
if (ownerRef.current === next) return;
|
|
172
|
+
ownerRef.current = next;
|
|
173
|
+
setOwner(next);
|
|
174
|
+
requestMeasure();
|
|
175
|
+
},
|
|
176
|
+
requestMeasure,
|
|
177
|
+
setPendingRouteScrollTop,
|
|
178
|
+
}),
|
|
179
|
+
[requestMeasure],
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
React.useLayoutEffect(() => {
|
|
183
|
+
disposedRef.current = false;
|
|
184
|
+
return () => {
|
|
185
|
+
disposedRef.current = true;
|
|
186
|
+
if (frameRef.current !== null) cancelAnimationFrame(frameRef.current);
|
|
187
|
+
frameRef.current = null;
|
|
188
|
+
};
|
|
189
|
+
}, []);
|
|
190
|
+
|
|
191
|
+
React.useLayoutEffect(() => {
|
|
192
|
+
onBridge(pageKey, bridge);
|
|
193
|
+
return () => onBridge(pageKey, null);
|
|
194
|
+
}, [bridge, onBridge, pageKey]);
|
|
195
|
+
|
|
196
|
+
React.useLayoutEffect(() => {
|
|
197
|
+
if (!owner) return undefined;
|
|
198
|
+
const observer = new ResizeObserver(requestMeasure);
|
|
199
|
+
observerRef.current = observer;
|
|
200
|
+
observer.observe(owner);
|
|
201
|
+
syncContentObservation();
|
|
202
|
+
const handleScroll = () => {
|
|
203
|
+
if (ownerRef.current !== owner) return;
|
|
204
|
+
const inputs = inputsRef.current;
|
|
205
|
+
inputs.onScroll(inputs.pageKey, owner.scrollTop);
|
|
206
|
+
requestMeasure();
|
|
207
|
+
};
|
|
208
|
+
const handleKey = (event: KeyboardEvent) => {
|
|
209
|
+
if (
|
|
210
|
+
["ArrowUp", "ArrowDown", "PageUp", "PageDown", "Home", "End", " "].includes(
|
|
211
|
+
event.key,
|
|
212
|
+
)
|
|
213
|
+
)
|
|
214
|
+
inputsRef.current.onUserInput(inputsRef.current.pageKey);
|
|
215
|
+
};
|
|
216
|
+
const handleUserInput = () =>
|
|
217
|
+
inputsRef.current.onUserInput(inputsRef.current.pageKey);
|
|
218
|
+
owner.addEventListener("scroll", handleScroll, { passive: true });
|
|
219
|
+
owner.addEventListener("touchstart", handleUserInput, { passive: true });
|
|
220
|
+
owner.addEventListener("pointerdown", handleUserInput);
|
|
221
|
+
owner.addEventListener("keydown", handleKey);
|
|
222
|
+
owner.addEventListener("ok-collapsible-pager-user-scroll", handleUserInput);
|
|
223
|
+
owner.addEventListener("ok-collapsible-pager-insets-changed", requestMeasure);
|
|
224
|
+
requestMeasure();
|
|
225
|
+
return () => {
|
|
226
|
+
observer.disconnect();
|
|
227
|
+
observerRef.current = null;
|
|
228
|
+
observedContentRef.current = null;
|
|
229
|
+
owner.removeEventListener("scroll", handleScroll);
|
|
230
|
+
owner.removeEventListener("touchstart", handleUserInput);
|
|
231
|
+
owner.removeEventListener("pointerdown", handleUserInput);
|
|
232
|
+
owner.removeEventListener("keydown", handleKey);
|
|
233
|
+
owner.removeEventListener("ok-collapsible-pager-user-scroll", handleUserInput);
|
|
234
|
+
owner.removeEventListener("ok-collapsible-pager-insets-changed", requestMeasure);
|
|
235
|
+
if (frameRef.current !== null) cancelAnimationFrame(frameRef.current);
|
|
236
|
+
frameRef.current = null;
|
|
237
|
+
};
|
|
238
|
+
}, [owner, requestMeasure, syncContentObservation]);
|
|
239
|
+
|
|
240
|
+
React.useLayoutEffect(requestMeasure, [isFocused, isRouteActive, headerHeight, stickyHeaderHeight, requestMeasure]);
|
|
241
|
+
|
|
242
|
+
const value = React.useMemo<WebCollapsiblePagerPageState>(
|
|
243
|
+
() => ({
|
|
244
|
+
isFocused,
|
|
245
|
+
isRouteActive,
|
|
246
|
+
owner,
|
|
247
|
+
content: registered?.element.isConnected && owner?.contains(registered.element)
|
|
248
|
+
? registered.element
|
|
249
|
+
: null,
|
|
250
|
+
contentHeight: registered?.height,
|
|
251
|
+
...metrics,
|
|
252
|
+
pendingRouteScrollTop,
|
|
253
|
+
registerContent,
|
|
254
|
+
}),
|
|
255
|
+
[isFocused, isRouteActive, owner, registered, metrics, pendingRouteScrollTop, registerContent],
|
|
256
|
+
);
|
|
257
|
+
return <PageContext.Provider value={value}>{children}</PageContext.Provider>;
|
|
258
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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 {
|
|
8
|
+
OnPageScrollEventData as PagerViewOnPageScrollEventData,
|
|
9
|
+
OnPageSelectedEventData as PagerViewOnPageSelectedEventData,
|
|
10
|
+
OnPageScrollStateChangedEventData as PageScrollStateChangedNativeEventData,
|
|
11
|
+
NativeProps,
|
|
12
|
+
} from "./PagerViewNativeComponent";
|
|
13
|
+
|
|
14
|
+
export type {
|
|
15
|
+
PagerViewOnPageScrollEventData,
|
|
16
|
+
PagerViewOnPageSelectedEventData,
|
|
17
|
+
PageScrollStateChangedNativeEventData,
|
|
18
|
+
NativeProps as PagerViewProps,
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type PagerViewOnPageScrollEvent =
|
|
22
|
+
ReactNative.NativeSyntheticEvent<PagerViewOnPageScrollEventData>;
|
|
23
|
+
|
|
24
|
+
export type PagerViewOnPageSelectedEvent =
|
|
25
|
+
ReactNative.NativeSyntheticEvent<PagerViewOnPageSelectedEventData>;
|
|
26
|
+
|
|
27
|
+
export type PageScrollStateChangedNativeEvent =
|
|
28
|
+
ReactNative.NativeSyntheticEvent<PageScrollStateChangedNativeEventData>;
|
|
29
|
+
|
|
30
|
+
export { ScrollEdgeEffect } from "./ScrollEdgeEffect";
|
package/src/index.tsx
CHANGED
|
@@ -4,6 +4,10 @@ export default PagerView;
|
|
|
4
4
|
export * from './usePagerView';
|
|
5
5
|
export * from './CollapsiblePagerView';
|
|
6
6
|
export * from './NativeScroller';
|
|
7
|
+
export { CollapsiblePagerView as WebCollapsiblePagerView } from './CollapsiblePagerView.web';
|
|
8
|
+
export type { CollapsiblePagerViewProps as WebCollapsiblePagerViewProps } from './CollapsiblePagerView.web';
|
|
9
|
+
export { useWebCollapsiblePagerPage } from './WebCollapsiblePagerPage';
|
|
10
|
+
export type { WebCollapsiblePagerPageState } from './WebCollapsiblePagerPage';
|
|
7
11
|
|
|
8
12
|
import type {
|
|
9
13
|
OnPageScrollEventData as PagerViewOnPageScrollEventData,
|
|
@@ -27,3 +31,5 @@ export type PagerViewOnPageSelectedEvent =
|
|
|
27
31
|
|
|
28
32
|
export type PageScrollStateChangedNativeEvent =
|
|
29
33
|
ReactNative.NativeSyntheticEvent<PageScrollStateChangedNativeEventData>;
|
|
34
|
+
|
|
35
|
+
export { ScrollEdgeEffect } from './ScrollEdgeEffect';
|
package/src/index.web.tsx
CHANGED
|
@@ -11,3 +11,9 @@ export type {
|
|
|
11
11
|
export * from "./usePagerView";
|
|
12
12
|
export * from "./CollapsiblePagerView.web";
|
|
13
13
|
export * from "./NativeScroller.web";
|
|
14
|
+
export { CollapsiblePagerView as WebCollapsiblePagerView } from "./CollapsiblePagerView.web";
|
|
15
|
+
export type { CollapsiblePagerViewProps as WebCollapsiblePagerViewProps } from "./CollapsiblePagerView.web";
|
|
16
|
+
export { useWebCollapsiblePagerPage } from "./WebCollapsiblePagerPage";
|
|
17
|
+
export type { WebCollapsiblePagerPageState } from "./WebCollapsiblePagerPage";
|
|
18
|
+
|
|
19
|
+
export { ScrollEdgeEffect } from "./ScrollEdgeEffect";
|