@papyrus-sdk/ui-react-native 0.2.30 → 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 +56 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +56 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -25801,6 +25801,16 @@ var resolvePageScrubberThumbTopFromPosition = ({
|
|
|
25801
25801
|
trackHeight,
|
|
25802
25802
|
thumbHeight
|
|
25803
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));
|
|
25804
25814
|
var resolvePageScrubberThumbTop = ({
|
|
25805
25815
|
currentPage,
|
|
25806
25816
|
trackHeight,
|
|
@@ -32018,10 +32028,11 @@ function ProgressPill({
|
|
|
32018
32028
|
const { height: windowHeight } = useWindowDimensions7();
|
|
32019
32029
|
const windowHeightRef = useRef9(windowHeight);
|
|
32020
32030
|
windowHeightRef.current = windowHeight;
|
|
32021
|
-
const trackHeight =
|
|
32022
|
-
|
|
32023
|
-
|
|
32024
|
-
|
|
32031
|
+
const trackHeight = resolvePageScrubberTrackHeight({
|
|
32032
|
+
windowHeight,
|
|
32033
|
+
topOffset: offsets.progress,
|
|
32034
|
+
bottomOffset: offsets.bottom
|
|
32035
|
+
});
|
|
32025
32036
|
const thumbHeight = 44;
|
|
32026
32037
|
const trackYRef = useRef9(0);
|
|
32027
32038
|
const scrubberRef = useRef9(null);
|
|
@@ -32069,6 +32080,8 @@ function ProgressPill({
|
|
|
32069
32080
|
const thumbTopSnapshotRef = useRef9(thumbTop);
|
|
32070
32081
|
thumbTopSnapshotRef.current = thumbTop;
|
|
32071
32082
|
const scrubStartThumbTopRef = useRef9(0);
|
|
32083
|
+
const trackReveal = useRef9(new Animated3.Value(0)).current;
|
|
32084
|
+
const [trackOriginY, setTrackOriginY] = useState12(0);
|
|
32072
32085
|
const scrubberMetricsRef = useRef9({ trackHeight, thumbHeight, pageCount });
|
|
32073
32086
|
scrubberMetricsRef.current = { trackHeight, thumbHeight, pageCount };
|
|
32074
32087
|
useEffect11(() => {
|
|
@@ -32137,6 +32150,19 @@ function ProgressPill({
|
|
|
32137
32150
|
hasMovedRef.current = false;
|
|
32138
32151
|
longPressTriggeredRef.current = false;
|
|
32139
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();
|
|
32140
32166
|
scrubNavigationControllerRef.current.begin();
|
|
32141
32167
|
pendingReleasedScrubPageRef.current = null;
|
|
32142
32168
|
setScrubPreviewPage(currentPageRef.current);
|
|
@@ -32178,6 +32204,11 @@ function ProgressPill({
|
|
|
32178
32204
|
}
|
|
32179
32205
|
isScrubbingRef.current = false;
|
|
32180
32206
|
onScrubbingChangeRef.current?.(false);
|
|
32207
|
+
Animated3.timing(trackReveal, {
|
|
32208
|
+
toValue: 0,
|
|
32209
|
+
duration: 140,
|
|
32210
|
+
useNativeDriver: false
|
|
32211
|
+
}).start();
|
|
32181
32212
|
const releasedPage = scrubNavigationControllerRef.current.release();
|
|
32182
32213
|
const releaseAction = resolvePageScrubberReleaseAction({
|
|
32183
32214
|
hasMoved: hasMovedRef.current,
|
|
@@ -32204,6 +32235,11 @@ function ProgressPill({
|
|
|
32204
32235
|
}
|
|
32205
32236
|
isScrubbingRef.current = false;
|
|
32206
32237
|
onScrubbingChangeRef.current?.(false);
|
|
32238
|
+
Animated3.timing(trackReveal, {
|
|
32239
|
+
toValue: 0,
|
|
32240
|
+
duration: 140,
|
|
32241
|
+
useNativeDriver: false
|
|
32242
|
+
}).start();
|
|
32207
32243
|
scrubNavigationControllerRef.current.cancel();
|
|
32208
32244
|
pendingReleasedScrubPageRef.current = null;
|
|
32209
32245
|
setScrubPreviewPage(null);
|
|
@@ -32242,7 +32278,21 @@ function ProgressPill({
|
|
|
32242
32278
|
});
|
|
32243
32279
|
},
|
|
32244
32280
|
children: [
|
|
32245
|
-
/* @__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
|
+
),
|
|
32246
32296
|
/* @__PURE__ */ jsx20(Animated3.View, { style: [styles17.thumb, { top: thumbTopRef.current }], children: /* @__PURE__ */ jsxs17(
|
|
32247
32297
|
View17,
|
|
32248
32298
|
{
|
|
@@ -32290,7 +32340,7 @@ var styles17 = StyleSheet17.create({
|
|
|
32290
32340
|
track: {
|
|
32291
32341
|
position: "absolute",
|
|
32292
32342
|
top: 0,
|
|
32293
|
-
right:
|
|
32343
|
+
right: 0,
|
|
32294
32344
|
bottom: 0,
|
|
32295
32345
|
width: 3,
|
|
32296
32346
|
borderRadius: 2,
|