@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.js
CHANGED
|
@@ -25983,6 +25983,16 @@ var resolvePageScrubberThumbTopFromPosition = ({
|
|
|
25983
25983
|
trackHeight,
|
|
25984
25984
|
thumbHeight
|
|
25985
25985
|
}) => Math.max(0, Math.min(trackHeight - thumbHeight, position - thumbHeight / 2));
|
|
25986
|
+
var resolvePageScrubberTrackRevealOrigin = ({
|
|
25987
|
+
thumbTop,
|
|
25988
|
+
thumbHeight,
|
|
25989
|
+
trackHeight
|
|
25990
|
+
}) => Math.max(0, Math.min(trackHeight, thumbTop + thumbHeight / 2));
|
|
25991
|
+
var resolvePageScrubberTrackHeight = ({
|
|
25992
|
+
windowHeight,
|
|
25993
|
+
topOffset,
|
|
25994
|
+
bottomOffset
|
|
25995
|
+
}) => Math.max(180, Math.min(720, windowHeight - topOffset - bottomOffset - 56));
|
|
25986
25996
|
var resolvePageScrubberThumbTop = ({
|
|
25987
25997
|
currentPage,
|
|
25988
25998
|
trackHeight,
|
|
@@ -32137,10 +32147,11 @@ function ProgressPill({
|
|
|
32137
32147
|
const { height: windowHeight } = (0, import_react_native17.useWindowDimensions)();
|
|
32138
32148
|
const windowHeightRef = (0, import_react14.useRef)(windowHeight);
|
|
32139
32149
|
windowHeightRef.current = windowHeight;
|
|
32140
|
-
const trackHeight =
|
|
32141
|
-
|
|
32142
|
-
|
|
32143
|
-
|
|
32150
|
+
const trackHeight = resolvePageScrubberTrackHeight({
|
|
32151
|
+
windowHeight,
|
|
32152
|
+
topOffset: offsets.progress,
|
|
32153
|
+
bottomOffset: offsets.bottom
|
|
32154
|
+
});
|
|
32144
32155
|
const thumbHeight = 44;
|
|
32145
32156
|
const trackYRef = (0, import_react14.useRef)(0);
|
|
32146
32157
|
const scrubberRef = (0, import_react14.useRef)(null);
|
|
@@ -32188,6 +32199,8 @@ function ProgressPill({
|
|
|
32188
32199
|
const thumbTopSnapshotRef = (0, import_react14.useRef)(thumbTop);
|
|
32189
32200
|
thumbTopSnapshotRef.current = thumbTop;
|
|
32190
32201
|
const scrubStartThumbTopRef = (0, import_react14.useRef)(0);
|
|
32202
|
+
const trackReveal = (0, import_react14.useRef)(new import_react_native17.Animated.Value(0)).current;
|
|
32203
|
+
const [trackOriginY, setTrackOriginY] = (0, import_react14.useState)(0);
|
|
32191
32204
|
const scrubberMetricsRef = (0, import_react14.useRef)({ trackHeight, thumbHeight, pageCount });
|
|
32192
32205
|
scrubberMetricsRef.current = { trackHeight, thumbHeight, pageCount };
|
|
32193
32206
|
(0, import_react14.useEffect)(() => {
|
|
@@ -32256,6 +32269,19 @@ function ProgressPill({
|
|
|
32256
32269
|
hasMovedRef.current = false;
|
|
32257
32270
|
longPressTriggeredRef.current = false;
|
|
32258
32271
|
scrubStartThumbTopRef.current = thumbTopSnapshotRef.current;
|
|
32272
|
+
setTrackOriginY(
|
|
32273
|
+
resolvePageScrubberTrackRevealOrigin({
|
|
32274
|
+
thumbTop: thumbTopSnapshotRef.current,
|
|
32275
|
+
thumbHeight,
|
|
32276
|
+
trackHeight: scrubberMetricsRef.current.trackHeight
|
|
32277
|
+
})
|
|
32278
|
+
);
|
|
32279
|
+
trackReveal.setValue(0);
|
|
32280
|
+
import_react_native17.Animated.timing(trackReveal, {
|
|
32281
|
+
toValue: 1,
|
|
32282
|
+
duration: 180,
|
|
32283
|
+
useNativeDriver: false
|
|
32284
|
+
}).start();
|
|
32259
32285
|
scrubNavigationControllerRef.current.begin();
|
|
32260
32286
|
pendingReleasedScrubPageRef.current = null;
|
|
32261
32287
|
setScrubPreviewPage(currentPageRef.current);
|
|
@@ -32297,6 +32323,11 @@ function ProgressPill({
|
|
|
32297
32323
|
}
|
|
32298
32324
|
isScrubbingRef.current = false;
|
|
32299
32325
|
onScrubbingChangeRef.current?.(false);
|
|
32326
|
+
import_react_native17.Animated.timing(trackReveal, {
|
|
32327
|
+
toValue: 0,
|
|
32328
|
+
duration: 140,
|
|
32329
|
+
useNativeDriver: false
|
|
32330
|
+
}).start();
|
|
32300
32331
|
const releasedPage = scrubNavigationControllerRef.current.release();
|
|
32301
32332
|
const releaseAction = resolvePageScrubberReleaseAction({
|
|
32302
32333
|
hasMoved: hasMovedRef.current,
|
|
@@ -32323,6 +32354,11 @@ function ProgressPill({
|
|
|
32323
32354
|
}
|
|
32324
32355
|
isScrubbingRef.current = false;
|
|
32325
32356
|
onScrubbingChangeRef.current?.(false);
|
|
32357
|
+
import_react_native17.Animated.timing(trackReveal, {
|
|
32358
|
+
toValue: 0,
|
|
32359
|
+
duration: 140,
|
|
32360
|
+
useNativeDriver: false
|
|
32361
|
+
}).start();
|
|
32326
32362
|
scrubNavigationControllerRef.current.cancel();
|
|
32327
32363
|
pendingReleasedScrubPageRef.current = null;
|
|
32328
32364
|
setScrubPreviewPage(null);
|
|
@@ -32361,7 +32397,21 @@ function ProgressPill({
|
|
|
32361
32397
|
});
|
|
32362
32398
|
},
|
|
32363
32399
|
children: [
|
|
32364
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
32400
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
32401
|
+
import_react_native17.Animated.View,
|
|
32402
|
+
{
|
|
32403
|
+
style: [
|
|
32404
|
+
styles17.track,
|
|
32405
|
+
isDark && styles17.trackDark,
|
|
32406
|
+
{
|
|
32407
|
+
transformOrigin: [0, trackOriginY, 0],
|
|
32408
|
+
opacity: trackReveal,
|
|
32409
|
+
transform: [{ scaleY: trackReveal }],
|
|
32410
|
+
elevation: 6
|
|
32411
|
+
}
|
|
32412
|
+
]
|
|
32413
|
+
}
|
|
32414
|
+
),
|
|
32365
32415
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react_native17.Animated.View, { style: [styles17.thumb, { top: thumbTopRef.current }], children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
32366
32416
|
import_react_native17.View,
|
|
32367
32417
|
{
|
|
@@ -32409,7 +32459,7 @@ var styles17 = import_react_native17.StyleSheet.create({
|
|
|
32409
32459
|
track: {
|
|
32410
32460
|
position: "absolute",
|
|
32411
32461
|
top: 0,
|
|
32412
|
-
right:
|
|
32462
|
+
right: 0,
|
|
32413
32463
|
bottom: 0,
|
|
32414
32464
|
width: 3,
|
|
32415
32465
|
borderRadius: 2,
|