@papyrus-sdk/ui-react-native 0.2.29 → 0.2.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.
- package/dist/index.js +215 -97
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +215 -97
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -25757,12 +25757,17 @@ var shouldEnableViewerScrollForPageScrub = ({
|
|
|
25757
25757
|
isScrubbing
|
|
25758
25758
|
}) => viewerScrollEnabled && !isScrubbing;
|
|
25759
25759
|
var resolvePageScrubberTouchPolicy = () => ({
|
|
25760
|
-
responderTarget: "
|
|
25760
|
+
responderTarget: "track",
|
|
25761
25761
|
claimOnStart: true,
|
|
25762
25762
|
captureOnStart: true,
|
|
25763
25763
|
captureOnMove: true,
|
|
25764
25764
|
childConsumesTouch: false
|
|
25765
25765
|
});
|
|
25766
|
+
var resolvePageScrubberOverlayStyle = () => ({
|
|
25767
|
+
zIndex: 30,
|
|
25768
|
+
elevation: 30
|
|
25769
|
+
});
|
|
25770
|
+
var resolvePageScrubberPointerEvents = () => "box-only";
|
|
25766
25771
|
var resolvePageScrubberReleaseAction = ({
|
|
25767
25772
|
hasMoved,
|
|
25768
25773
|
pendingPage
|
|
@@ -25796,6 +25801,16 @@ var resolvePageScrubberThumbTopFromPosition = ({
|
|
|
25796
25801
|
trackHeight,
|
|
25797
25802
|
thumbHeight
|
|
25798
25803
|
}) => Math.max(0, Math.min(trackHeight - thumbHeight, position - thumbHeight / 2));
|
|
25804
|
+
var resolvePageScrubberTrackRevealOrigin = ({
|
|
25805
|
+
thumbTop,
|
|
25806
|
+
thumbHeight,
|
|
25807
|
+
trackHeight
|
|
25808
|
+
}) => Math.max(0, Math.min(trackHeight, thumbTop + thumbHeight / 2));
|
|
25809
|
+
var resolvePageScrubberTrackHeight = ({
|
|
25810
|
+
windowHeight,
|
|
25811
|
+
topOffset,
|
|
25812
|
+
bottomOffset
|
|
25813
|
+
}) => Math.max(180, Math.min(720, windowHeight - topOffset - bottomOffset - 56));
|
|
25799
25814
|
var resolvePageScrubberThumbTop = ({
|
|
25800
25815
|
currentPage,
|
|
25801
25816
|
trackHeight,
|
|
@@ -25826,6 +25841,23 @@ var resolvePageScrubberPage = ({
|
|
|
25826
25841
|
Math.min(pageCount, Math.round(ratio * (pageCount - 1)) + 1)
|
|
25827
25842
|
);
|
|
25828
25843
|
};
|
|
25844
|
+
var isPageScrubberTrackYTrusted = (trackY, windowHeight) => Number.isFinite(trackY) && Number.isFinite(windowHeight) && trackY >= 0 && trackY <= windowHeight;
|
|
25845
|
+
var resolvePageScrubberGesturePosition = ({
|
|
25846
|
+
moveY,
|
|
25847
|
+
dy,
|
|
25848
|
+
trackY,
|
|
25849
|
+
windowHeight,
|
|
25850
|
+
trackHeight,
|
|
25851
|
+
thumbHeight,
|
|
25852
|
+
startThumbTop
|
|
25853
|
+
}) => {
|
|
25854
|
+
if (isPageScrubberTrackYTrusted(trackY, windowHeight)) {
|
|
25855
|
+
return moveY - trackY;
|
|
25856
|
+
}
|
|
25857
|
+
const travel = Math.max(0, trackHeight - thumbHeight);
|
|
25858
|
+
const nextThumbTop = Math.max(0, Math.min(travel, startThumbTop + dy));
|
|
25859
|
+
return nextThumbTop + thumbHeight / 2;
|
|
25860
|
+
};
|
|
25829
25861
|
|
|
25830
25862
|
// components/viewerNavigation.ts
|
|
25831
25863
|
var resolveViewerScrollTarget = (pageIndex, isDouble) => ({
|
|
@@ -25880,6 +25912,15 @@ var resolvePositiveInt = (value, fallback, min, max) => {
|
|
|
25880
25912
|
const rounded = Math.round(value);
|
|
25881
25913
|
return Math.max(min, Math.min(max, rounded));
|
|
25882
25914
|
};
|
|
25915
|
+
var scrollViewerListToOffset = (list, offset, animated) => {
|
|
25916
|
+
if (list === null) return;
|
|
25917
|
+
const nativeScrollRef = list.getNativeScrollRef?.();
|
|
25918
|
+
if (nativeScrollRef?.scrollTo) {
|
|
25919
|
+
nativeScrollRef.scrollTo({ y: offset, animated });
|
|
25920
|
+
return;
|
|
25921
|
+
}
|
|
25922
|
+
list.scrollToOffset?.({ offset, animated });
|
|
25923
|
+
};
|
|
25883
25924
|
var Viewer = ({
|
|
25884
25925
|
engine,
|
|
25885
25926
|
virtualWindowSize,
|
|
@@ -25952,6 +25993,7 @@ var Viewer = ({
|
|
|
25952
25993
|
const pendingScrollTimeoutRef = useRef4(
|
|
25953
25994
|
null
|
|
25954
25995
|
);
|
|
25996
|
+
const pendingScrollFrameRef = useRef4(null);
|
|
25955
25997
|
const pendingChromeShowTimeoutRef = useRef4(null);
|
|
25956
25998
|
const chromeVisibleRef = useRef4(mobileChromeVisible);
|
|
25957
25999
|
const lastScrollOffsetYRef = useRef4(0);
|
|
@@ -25959,6 +26001,7 @@ var Viewer = ({
|
|
|
25959
26001
|
const scrollUpAccumRef = useRef4(0);
|
|
25960
26002
|
const [layoutRevision, setLayoutRevision] = useState4(0);
|
|
25961
26003
|
const [selectionDragActive, setSelectionDragActive] = useState4(false);
|
|
26004
|
+
const [programmaticScrollActive, setProgrammaticScrollActive] = useState4(false);
|
|
25962
26005
|
const selectionDragActiveRef = useRef4(false);
|
|
25963
26006
|
const [gestureScrollLockActive, setGestureScrollLockActive] = useState4(false);
|
|
25964
26007
|
const gestureScrollLockActiveRef = useRef4(false);
|
|
@@ -26053,6 +26096,7 @@ var Viewer = ({
|
|
|
26053
26096
|
pendingScrollTargetRef.current = null;
|
|
26054
26097
|
pendingScrollAttemptsRef.current = 0;
|
|
26055
26098
|
clearPendingScrollRetry();
|
|
26099
|
+
setProgrammaticScrollActive(false);
|
|
26056
26100
|
}, [clearPendingScrollRetry]);
|
|
26057
26101
|
const clearPendingChromeShow = useCallback3(() => {
|
|
26058
26102
|
if (pendingChromeShowTimeoutRef.current) {
|
|
@@ -26107,6 +26151,10 @@ var Viewer = ({
|
|
|
26107
26151
|
cancelAnimationFrame(pinchAnchorRestoreFrameRef.current);
|
|
26108
26152
|
}
|
|
26109
26153
|
clearPendingScrollRetry();
|
|
26154
|
+
if (pendingScrollFrameRef.current !== null) {
|
|
26155
|
+
cancelAnimationFrame(pendingScrollFrameRef.current);
|
|
26156
|
+
pendingScrollFrameRef.current = null;
|
|
26157
|
+
}
|
|
26110
26158
|
clearPendingChromeShow();
|
|
26111
26159
|
},
|
|
26112
26160
|
[clearPendingChromeShow, clearPendingScrollRetry]
|
|
@@ -26960,12 +27008,20 @@ var Viewer = ({
|
|
|
26960
27008
|
(animated) => {
|
|
26961
27009
|
const target = pendingScrollTargetRef.current;
|
|
26962
27010
|
if (target === null || listRef.current === null) return;
|
|
26963
|
-
|
|
26964
|
-
|
|
26965
|
-
|
|
27011
|
+
setViewerScrollEnabledNative(true);
|
|
27012
|
+
if (pendingScrollFrameRef.current !== null) {
|
|
27013
|
+
cancelAnimationFrame(pendingScrollFrameRef.current);
|
|
27014
|
+
}
|
|
27015
|
+
pendingScrollFrameRef.current = requestAnimationFrame(() => {
|
|
27016
|
+
pendingScrollFrameRef.current = null;
|
|
27017
|
+
const nextTarget = pendingScrollTargetRef.current;
|
|
27018
|
+
const list = listRef.current;
|
|
27019
|
+
if (nextTarget === null || list === null) return;
|
|
27020
|
+
const offset = getFallbackOffsetForIndex(nextTarget.listIndex);
|
|
27021
|
+
scrollViewerListToOffset(list, offset, animated);
|
|
26966
27022
|
});
|
|
26967
27023
|
},
|
|
26968
|
-
[getFallbackOffsetForIndex]
|
|
27024
|
+
[getFallbackOffsetForIndex, setViewerScrollEnabledNative]
|
|
26969
27025
|
);
|
|
26970
27026
|
const restoreOrientationScrollOffset = useCallback3(() => {
|
|
26971
27027
|
if (pendingOrientationRestoreWidthRef.current !== windowWidth || pageCount <= 0 || isSingle || isWebView) {
|
|
@@ -27064,6 +27120,7 @@ var Viewer = ({
|
|
|
27064
27120
|
const target = resolveViewerScrollTarget(scrollToPageSignal, isDouble);
|
|
27065
27121
|
pendingScrollTargetRef.current = target;
|
|
27066
27122
|
pendingScrollAttemptsRef.current = 0;
|
|
27123
|
+
setProgrammaticScrollActive(true);
|
|
27067
27124
|
clearPendingScrollRetry();
|
|
27068
27125
|
setDocumentStateTracked(
|
|
27069
27126
|
{
|
|
@@ -27319,6 +27376,89 @@ var Viewer = ({
|
|
|
27319
27376
|
windowWidth
|
|
27320
27377
|
]
|
|
27321
27378
|
);
|
|
27379
|
+
const continuousList = /* @__PURE__ */ jsx6(
|
|
27380
|
+
FlatList,
|
|
27381
|
+
{
|
|
27382
|
+
ref: listRef,
|
|
27383
|
+
nestedScrollEnabled: true,
|
|
27384
|
+
data: isDouble ? rows : pages,
|
|
27385
|
+
style: { width: documentSurfaceWidth },
|
|
27386
|
+
initialNumToRender: FLATLIST_INITIAL_NUM_TO_RENDER,
|
|
27387
|
+
windowSize: resolvedWindowSize,
|
|
27388
|
+
maxToRenderPerBatch: resolvedMaxToRenderPerBatch,
|
|
27389
|
+
updateCellsBatchingPeriod: FLATLIST_UPDATE_CELLS_BATCHING_PERIOD,
|
|
27390
|
+
removeClippedSubviews: resolvedRemoveClippedSubviews,
|
|
27391
|
+
getItemLayout,
|
|
27392
|
+
keyExtractor,
|
|
27393
|
+
contentContainerStyle: styles4.listContent,
|
|
27394
|
+
renderItem,
|
|
27395
|
+
onViewableItemsChanged,
|
|
27396
|
+
viewabilityConfig: { itemVisiblePercentThreshold: 60 },
|
|
27397
|
+
scrollEnabled: pageScrubResolvedScrollEnabled || programmaticScrollActive,
|
|
27398
|
+
onLayout: () => {
|
|
27399
|
+
captureViewerFrame(listRef.current);
|
|
27400
|
+
restoreOrientationScrollOffset();
|
|
27401
|
+
scrollToPendingTarget(false);
|
|
27402
|
+
},
|
|
27403
|
+
onContentSizeChange: (_, height) => {
|
|
27404
|
+
viewerContentHeightRef.current = height;
|
|
27405
|
+
scrollToPendingTarget(false);
|
|
27406
|
+
},
|
|
27407
|
+
onScrollToIndexFailed: ({ index, averageItemLength }) => {
|
|
27408
|
+
const dataLength = isDouble ? rows.length : pages.length;
|
|
27409
|
+
if (index < 0 || index >= dataLength) return;
|
|
27410
|
+
const existingTarget = pendingScrollTargetRef.current;
|
|
27411
|
+
pendingScrollTargetRef.current = isDouble ? existingTarget?.listIndex === index ? existingTarget : resolveViewerScrollTarget(rows[index]?.left ?? index * 2, true) : resolveViewerScrollTarget(index, false);
|
|
27412
|
+
const offset = Math.max(0, getFallbackOffsetForIndex(index));
|
|
27413
|
+
scrollViewerListToOffset(listRef.current, offset, false);
|
|
27414
|
+
if (!isDouble) {
|
|
27415
|
+
ensurePageDimensions(index);
|
|
27416
|
+
} else {
|
|
27417
|
+
const row = rows[index];
|
|
27418
|
+
if (row) {
|
|
27419
|
+
ensurePageDimensions(row.left);
|
|
27420
|
+
if (row.right !== null) {
|
|
27421
|
+
ensurePageDimensions(row.right);
|
|
27422
|
+
}
|
|
27423
|
+
}
|
|
27424
|
+
}
|
|
27425
|
+
scheduleScrollRetry("onScrollToIndexFailed");
|
|
27426
|
+
if (perfEnabled) {
|
|
27427
|
+
logPerfEvent("Viewer", "scrollToIndexFailed", {
|
|
27428
|
+
index,
|
|
27429
|
+
averageItemLength,
|
|
27430
|
+
fallbackOffset: offset,
|
|
27431
|
+
fallbackSource: "cached-item-layout",
|
|
27432
|
+
itemCount: dataLength,
|
|
27433
|
+
retryAttempt: pendingScrollAttemptsRef.current
|
|
27434
|
+
});
|
|
27435
|
+
}
|
|
27436
|
+
},
|
|
27437
|
+
onScroll: (event) => handleViewerScroll(event, "continuous"),
|
|
27438
|
+
onScrollBeginDrag: perfEnabled ? () => {
|
|
27439
|
+
scrollMonitorRef.current.begin("continuous.beginDrag");
|
|
27440
|
+
} : void 0,
|
|
27441
|
+
onMomentumScrollBegin: perfEnabled ? () => {
|
|
27442
|
+
scrollMonitorRef.current.begin("continuous.momentumBegin");
|
|
27443
|
+
} : void 0,
|
|
27444
|
+
onScrollEndDrag: perfEnabled ? () => {
|
|
27445
|
+
scrollMonitorRef.current.end("continuous.endDrag");
|
|
27446
|
+
endViewerScroll("continuous.endDrag");
|
|
27447
|
+
sampleMemory("Viewer", "continuous.endDrag", {
|
|
27448
|
+
pageCount
|
|
27449
|
+
});
|
|
27450
|
+
} : void 0,
|
|
27451
|
+
onMomentumScrollEnd: perfEnabled ? () => {
|
|
27452
|
+
scrollMonitorRef.current.end("continuous.momentumEnd");
|
|
27453
|
+
endViewerScroll("continuous.momentumEnd");
|
|
27454
|
+
sampleMemory("Viewer", "continuous.momentumEnd", {
|
|
27455
|
+
pageCount
|
|
27456
|
+
});
|
|
27457
|
+
} : void 0,
|
|
27458
|
+
scrollEventThrottle: 16,
|
|
27459
|
+
showsVerticalScrollIndicator: false
|
|
27460
|
+
}
|
|
27461
|
+
);
|
|
27322
27462
|
if (isWebView) {
|
|
27323
27463
|
return /* @__PURE__ */ jsx6(View4, { style: [styles4.container, isDark && styles4.containerDark], children: /* @__PURE__ */ jsx6(
|
|
27324
27464
|
WebViewViewer_default,
|
|
@@ -27353,6 +27493,7 @@ var Viewer = ({
|
|
|
27353
27493
|
{
|
|
27354
27494
|
ref: horizontalScrollRef,
|
|
27355
27495
|
horizontal: true,
|
|
27496
|
+
nestedScrollEnabled: true,
|
|
27356
27497
|
scrollEnabled: !gestureScrollLockActive && !pageScrubActive && documentSurfaceWidth > windowWidth,
|
|
27357
27498
|
showsHorizontalScrollIndicator: false,
|
|
27358
27499
|
onScroll: (event) => {
|
|
@@ -27437,101 +27578,21 @@ var Viewer = ({
|
|
|
27437
27578
|
]
|
|
27438
27579
|
}
|
|
27439
27580
|
],
|
|
27440
|
-
children: /* @__PURE__ */ jsx6(
|
|
27581
|
+
children: documentSurfaceWidth > windowWidth + 1 ? /* @__PURE__ */ jsx6(
|
|
27441
27582
|
ScrollView,
|
|
27442
27583
|
{
|
|
27443
27584
|
ref: horizontalScrollRef,
|
|
27444
27585
|
horizontal: true,
|
|
27445
|
-
|
|
27586
|
+
nestedScrollEnabled: true,
|
|
27587
|
+
scrollEnabled: !gestureScrollLockActive && !pageScrubActive,
|
|
27446
27588
|
showsHorizontalScrollIndicator: false,
|
|
27447
27589
|
onScroll: (event) => {
|
|
27448
27590
|
horizontalScrollOffsetRef.current = event.nativeEvent.contentOffset?.x ?? 0;
|
|
27449
27591
|
},
|
|
27450
27592
|
scrollEventThrottle: 16,
|
|
27451
|
-
children:
|
|
27452
|
-
FlatList,
|
|
27453
|
-
{
|
|
27454
|
-
ref: listRef,
|
|
27455
|
-
data: isDouble ? rows : pages,
|
|
27456
|
-
style: { width: documentSurfaceWidth },
|
|
27457
|
-
initialNumToRender: FLATLIST_INITIAL_NUM_TO_RENDER,
|
|
27458
|
-
windowSize: resolvedWindowSize,
|
|
27459
|
-
maxToRenderPerBatch: resolvedMaxToRenderPerBatch,
|
|
27460
|
-
updateCellsBatchingPeriod: FLATLIST_UPDATE_CELLS_BATCHING_PERIOD,
|
|
27461
|
-
removeClippedSubviews: resolvedRemoveClippedSubviews,
|
|
27462
|
-
getItemLayout,
|
|
27463
|
-
keyExtractor,
|
|
27464
|
-
contentContainerStyle: styles4.listContent,
|
|
27465
|
-
renderItem,
|
|
27466
|
-
onViewableItemsChanged,
|
|
27467
|
-
viewabilityConfig: { itemVisiblePercentThreshold: 60 },
|
|
27468
|
-
scrollEnabled: pageScrubResolvedScrollEnabled,
|
|
27469
|
-
onLayout: () => {
|
|
27470
|
-
captureViewerFrame(listRef.current);
|
|
27471
|
-
restoreOrientationScrollOffset();
|
|
27472
|
-
scrollToPendingTarget(false);
|
|
27473
|
-
},
|
|
27474
|
-
onContentSizeChange: (_, height) => {
|
|
27475
|
-
viewerContentHeightRef.current = height;
|
|
27476
|
-
scrollToPendingTarget(false);
|
|
27477
|
-
},
|
|
27478
|
-
onScrollToIndexFailed: ({ index, averageItemLength }) => {
|
|
27479
|
-
const dataLength = isDouble ? rows.length : pages.length;
|
|
27480
|
-
if (index < 0 || index >= dataLength) return;
|
|
27481
|
-
const existingTarget = pendingScrollTargetRef.current;
|
|
27482
|
-
pendingScrollTargetRef.current = isDouble ? existingTarget?.listIndex === index ? existingTarget : resolveViewerScrollTarget(rows[index]?.left ?? index * 2, true) : resolveViewerScrollTarget(index, false);
|
|
27483
|
-
const offset = Math.max(0, getFallbackOffsetForIndex(index));
|
|
27484
|
-
listRef.current?.scrollToOffset({ offset, animated: false });
|
|
27485
|
-
if (!isDouble) {
|
|
27486
|
-
ensurePageDimensions(index);
|
|
27487
|
-
} else {
|
|
27488
|
-
const row = rows[index];
|
|
27489
|
-
if (row) {
|
|
27490
|
-
ensurePageDimensions(row.left);
|
|
27491
|
-
if (row.right !== null) {
|
|
27492
|
-
ensurePageDimensions(row.right);
|
|
27493
|
-
}
|
|
27494
|
-
}
|
|
27495
|
-
}
|
|
27496
|
-
scheduleScrollRetry("onScrollToIndexFailed");
|
|
27497
|
-
if (perfEnabled) {
|
|
27498
|
-
logPerfEvent("Viewer", "scrollToIndexFailed", {
|
|
27499
|
-
index,
|
|
27500
|
-
averageItemLength,
|
|
27501
|
-
fallbackOffset: offset,
|
|
27502
|
-
fallbackSource: "cached-item-layout",
|
|
27503
|
-
itemCount: dataLength,
|
|
27504
|
-
retryAttempt: pendingScrollAttemptsRef.current
|
|
27505
|
-
});
|
|
27506
|
-
}
|
|
27507
|
-
},
|
|
27508
|
-
onScroll: (event) => handleViewerScroll(event, "continuous"),
|
|
27509
|
-
onScrollBeginDrag: perfEnabled ? () => {
|
|
27510
|
-
scrollMonitorRef.current.begin("continuous.beginDrag");
|
|
27511
|
-
} : void 0,
|
|
27512
|
-
onMomentumScrollBegin: perfEnabled ? () => {
|
|
27513
|
-
scrollMonitorRef.current.begin("continuous.momentumBegin");
|
|
27514
|
-
} : void 0,
|
|
27515
|
-
onScrollEndDrag: perfEnabled ? () => {
|
|
27516
|
-
scrollMonitorRef.current.end("continuous.endDrag");
|
|
27517
|
-
endViewerScroll("continuous.endDrag");
|
|
27518
|
-
sampleMemory("Viewer", "continuous.endDrag", {
|
|
27519
|
-
pageCount
|
|
27520
|
-
});
|
|
27521
|
-
} : void 0,
|
|
27522
|
-
onMomentumScrollEnd: perfEnabled ? () => {
|
|
27523
|
-
scrollMonitorRef.current.end("continuous.momentumEnd");
|
|
27524
|
-
endViewerScroll("continuous.momentumEnd");
|
|
27525
|
-
sampleMemory("Viewer", "continuous.momentumEnd", {
|
|
27526
|
-
pageCount
|
|
27527
|
-
});
|
|
27528
|
-
} : void 0,
|
|
27529
|
-
scrollEventThrottle: 16,
|
|
27530
|
-
showsVerticalScrollIndicator: false
|
|
27531
|
-
}
|
|
27532
|
-
)
|
|
27593
|
+
children: continuousList
|
|
27533
27594
|
}
|
|
27534
|
-
)
|
|
27595
|
+
) : continuousList
|
|
27535
27596
|
}
|
|
27536
27597
|
) }) });
|
|
27537
27598
|
};
|
|
@@ -31965,10 +32026,13 @@ function ProgressPill({
|
|
|
31965
32026
|
const isDark = uiTheme === "dark";
|
|
31966
32027
|
const offsets = resolveMobileChromeOffsets(usePapyrusSafeAreaInsets());
|
|
31967
32028
|
const { height: windowHeight } = useWindowDimensions7();
|
|
31968
|
-
const
|
|
31969
|
-
|
|
31970
|
-
|
|
31971
|
-
|
|
32029
|
+
const windowHeightRef = useRef9(windowHeight);
|
|
32030
|
+
windowHeightRef.current = windowHeight;
|
|
32031
|
+
const trackHeight = resolvePageScrubberTrackHeight({
|
|
32032
|
+
windowHeight,
|
|
32033
|
+
topOffset: offsets.progress,
|
|
32034
|
+
bottomOffset: offsets.bottom
|
|
32035
|
+
});
|
|
31972
32036
|
const thumbHeight = 44;
|
|
31973
32037
|
const trackYRef = useRef9(0);
|
|
31974
32038
|
const scrubberRef = useRef9(null);
|
|
@@ -32015,6 +32079,9 @@ function ProgressPill({
|
|
|
32015
32079
|
const thumbTopRef = useRef9(new Animated3.Value(thumbTop));
|
|
32016
32080
|
const thumbTopSnapshotRef = useRef9(thumbTop);
|
|
32017
32081
|
thumbTopSnapshotRef.current = thumbTop;
|
|
32082
|
+
const scrubStartThumbTopRef = useRef9(0);
|
|
32083
|
+
const trackReveal = useRef9(new Animated3.Value(0)).current;
|
|
32084
|
+
const [trackOriginY, setTrackOriginY] = useState12(0);
|
|
32018
32085
|
const scrubberMetricsRef = useRef9({ trackHeight, thumbHeight, pageCount });
|
|
32019
32086
|
scrubberMetricsRef.current = { trackHeight, thumbHeight, pageCount };
|
|
32020
32087
|
useEffect11(() => {
|
|
@@ -32082,6 +32149,20 @@ function ProgressPill({
|
|
|
32082
32149
|
onScrubbingChangeRef.current?.(true);
|
|
32083
32150
|
hasMovedRef.current = false;
|
|
32084
32151
|
longPressTriggeredRef.current = false;
|
|
32152
|
+
scrubStartThumbTopRef.current = thumbTopSnapshotRef.current;
|
|
32153
|
+
setTrackOriginY(
|
|
32154
|
+
resolvePageScrubberTrackRevealOrigin({
|
|
32155
|
+
thumbTop: thumbTopSnapshotRef.current,
|
|
32156
|
+
thumbHeight,
|
|
32157
|
+
trackHeight: scrubberMetricsRef.current.trackHeight
|
|
32158
|
+
})
|
|
32159
|
+
);
|
|
32160
|
+
trackReveal.setValue(0);
|
|
32161
|
+
Animated3.timing(trackReveal, {
|
|
32162
|
+
toValue: 1,
|
|
32163
|
+
duration: 180,
|
|
32164
|
+
useNativeDriver: false
|
|
32165
|
+
}).start();
|
|
32085
32166
|
scrubNavigationControllerRef.current.begin();
|
|
32086
32167
|
pendingReleasedScrubPageRef.current = null;
|
|
32087
32168
|
setScrubPreviewPage(currentPageRef.current);
|
|
@@ -32103,7 +32184,18 @@ function ProgressPill({
|
|
|
32103
32184
|
clearTimeout(longPressTimerRef.current);
|
|
32104
32185
|
longPressTimerRef.current = null;
|
|
32105
32186
|
}
|
|
32106
|
-
|
|
32187
|
+
const { trackHeight: trackHeight2, thumbHeight: thumbHeight2 } = scrubberMetricsRef.current;
|
|
32188
|
+
scrubToPositionRef.current(
|
|
32189
|
+
resolvePageScrubberGesturePosition({
|
|
32190
|
+
moveY: gestureState.moveY,
|
|
32191
|
+
dy: gestureState.dy,
|
|
32192
|
+
trackY: trackYRef.current,
|
|
32193
|
+
windowHeight: windowHeightRef.current,
|
|
32194
|
+
trackHeight: trackHeight2,
|
|
32195
|
+
thumbHeight: thumbHeight2,
|
|
32196
|
+
startThumbTop: scrubStartThumbTopRef.current
|
|
32197
|
+
})
|
|
32198
|
+
);
|
|
32107
32199
|
},
|
|
32108
32200
|
onPanResponderRelease: () => {
|
|
32109
32201
|
if (longPressTimerRef.current !== null) {
|
|
@@ -32112,6 +32204,11 @@ function ProgressPill({
|
|
|
32112
32204
|
}
|
|
32113
32205
|
isScrubbingRef.current = false;
|
|
32114
32206
|
onScrubbingChangeRef.current?.(false);
|
|
32207
|
+
Animated3.timing(trackReveal, {
|
|
32208
|
+
toValue: 0,
|
|
32209
|
+
duration: 140,
|
|
32210
|
+
useNativeDriver: false
|
|
32211
|
+
}).start();
|
|
32115
32212
|
const releasedPage = scrubNavigationControllerRef.current.release();
|
|
32116
32213
|
const releaseAction = resolvePageScrubberReleaseAction({
|
|
32117
32214
|
hasMoved: hasMovedRef.current,
|
|
@@ -32138,6 +32235,11 @@ function ProgressPill({
|
|
|
32138
32235
|
}
|
|
32139
32236
|
isScrubbingRef.current = false;
|
|
32140
32237
|
onScrubbingChangeRef.current?.(false);
|
|
32238
|
+
Animated3.timing(trackReveal, {
|
|
32239
|
+
toValue: 0,
|
|
32240
|
+
duration: 140,
|
|
32241
|
+
useNativeDriver: false
|
|
32242
|
+
}).start();
|
|
32141
32243
|
scrubNavigationControllerRef.current.cancel();
|
|
32142
32244
|
pendingReleasedScrubPageRef.current = null;
|
|
32143
32245
|
setScrubPreviewPage(null);
|
|
@@ -32157,6 +32259,7 @@ function ProgressPill({
|
|
|
32157
32259
|
pointerEvents: "box-none",
|
|
32158
32260
|
style: [
|
|
32159
32261
|
styles17.frame,
|
|
32262
|
+
resolvePageScrubberOverlayStyle(),
|
|
32160
32263
|
{
|
|
32161
32264
|
top: offsets.progress,
|
|
32162
32265
|
right: offsets.right
|
|
@@ -32166,6 +32269,7 @@ function ProgressPill({
|
|
|
32166
32269
|
View17,
|
|
32167
32270
|
{
|
|
32168
32271
|
ref: scrubberRef,
|
|
32272
|
+
pointerEvents: resolvePageScrubberPointerEvents(),
|
|
32169
32273
|
style: [styles17.scrubber, { height: trackHeight }],
|
|
32170
32274
|
...scrubberPanHandlers,
|
|
32171
32275
|
onLayout: () => {
|
|
@@ -32174,7 +32278,21 @@ function ProgressPill({
|
|
|
32174
32278
|
});
|
|
32175
32279
|
},
|
|
32176
32280
|
children: [
|
|
32177
|
-
/* @__PURE__ */ jsx20(
|
|
32281
|
+
/* @__PURE__ */ jsx20(
|
|
32282
|
+
Animated3.View,
|
|
32283
|
+
{
|
|
32284
|
+
style: [
|
|
32285
|
+
styles17.track,
|
|
32286
|
+
isDark && styles17.trackDark,
|
|
32287
|
+
{
|
|
32288
|
+
transformOrigin: [0, trackOriginY, 0],
|
|
32289
|
+
opacity: trackReveal,
|
|
32290
|
+
transform: [{ scaleY: trackReveal }],
|
|
32291
|
+
elevation: 6
|
|
32292
|
+
}
|
|
32293
|
+
]
|
|
32294
|
+
}
|
|
32295
|
+
),
|
|
32178
32296
|
/* @__PURE__ */ jsx20(Animated3.View, { style: [styles17.thumb, { top: thumbTopRef.current }], children: /* @__PURE__ */ jsxs17(
|
|
32179
32297
|
View17,
|
|
32180
32298
|
{
|
|
@@ -32222,7 +32340,7 @@ var styles17 = StyleSheet17.create({
|
|
|
32222
32340
|
track: {
|
|
32223
32341
|
position: "absolute",
|
|
32224
32342
|
top: 0,
|
|
32225
|
-
right:
|
|
32343
|
+
right: 0,
|
|
32226
32344
|
bottom: 0,
|
|
32227
32345
|
width: 3,
|
|
32228
32346
|
borderRadius: 2,
|