@xhub-reels/sdk 0.2.16 → 0.2.17
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.cjs +4 -4
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1267,7 +1267,7 @@ function usePointerGesture(config = {}) {
|
|
|
1267
1267
|
};
|
|
1268
1268
|
}
|
|
1269
1269
|
function useSnapAnimation(config = {}) {
|
|
1270
|
-
const { duration = 280, easing = "
|
|
1270
|
+
const { duration = 280, easing = "ease-out" } = config;
|
|
1271
1271
|
const activeAnimations = react.useRef([]);
|
|
1272
1272
|
const cancelAnimation = react.useCallback(() => {
|
|
1273
1273
|
for (const anim of activeAnimations.current) {
|
|
@@ -2584,7 +2584,7 @@ function ReelsFeed({
|
|
|
2584
2584
|
activeIndexRef.current = focusedIndex;
|
|
2585
2585
|
const { animateSnap, animateBounceBack, cancelAnimation } = useSnapAnimation({
|
|
2586
2586
|
duration: snapConfig?.duration ?? 260,
|
|
2587
|
-
easing: snapConfig?.easing ?? "
|
|
2587
|
+
easing: snapConfig?.easing ?? "ease-out"
|
|
2588
2588
|
});
|
|
2589
2589
|
react.useEffect(() => {
|
|
2590
2590
|
loadInitial();
|
|
@@ -3163,12 +3163,12 @@ function ReelsModal({
|
|
|
3163
3163
|
const panel = panelRef.current;
|
|
3164
3164
|
if (!panel) return;
|
|
3165
3165
|
const first = panel.querySelector(FOCUSABLE);
|
|
3166
|
-
(first ?? panel).focus();
|
|
3166
|
+
(first ?? panel).focus({ preventScroll: true });
|
|
3167
3167
|
});
|
|
3168
3168
|
return () => cancelAnimationFrame(id);
|
|
3169
3169
|
}
|
|
3170
3170
|
if (phase === "closed") {
|
|
3171
|
-
previouslyFocusedRef.current?.focus?.();
|
|
3171
|
+
previouslyFocusedRef.current?.focus?.({ preventScroll: true });
|
|
3172
3172
|
previouslyFocusedRef.current = null;
|
|
3173
3173
|
}
|
|
3174
3174
|
return void 0;
|
package/dist/index.d.cts
CHANGED
|
@@ -858,7 +858,7 @@ declare function usePointerGesture(config?: PointerGestureConfig): {
|
|
|
858
858
|
interface SnapAnimationConfig {
|
|
859
859
|
/** Duration in ms (default: 280) */
|
|
860
860
|
duration?: number;
|
|
861
|
-
/** CSS easing (default: '
|
|
861
|
+
/** CSS easing (default: 'ease-out') */
|
|
862
862
|
easing?: string;
|
|
863
863
|
}
|
|
864
864
|
interface SnapTarget {
|
package/dist/index.d.ts
CHANGED
|
@@ -858,7 +858,7 @@ declare function usePointerGesture(config?: PointerGestureConfig): {
|
|
|
858
858
|
interface SnapAnimationConfig {
|
|
859
859
|
/** Duration in ms (default: 280) */
|
|
860
860
|
duration?: number;
|
|
861
|
-
/** CSS easing (default: '
|
|
861
|
+
/** CSS easing (default: 'ease-out') */
|
|
862
862
|
easing?: string;
|
|
863
863
|
}
|
|
864
864
|
interface SnapTarget {
|
package/dist/index.js
CHANGED
|
@@ -1261,7 +1261,7 @@ function usePointerGesture(config = {}) {
|
|
|
1261
1261
|
};
|
|
1262
1262
|
}
|
|
1263
1263
|
function useSnapAnimation(config = {}) {
|
|
1264
|
-
const { duration = 280, easing = "
|
|
1264
|
+
const { duration = 280, easing = "ease-out" } = config;
|
|
1265
1265
|
const activeAnimations = useRef([]);
|
|
1266
1266
|
const cancelAnimation = useCallback(() => {
|
|
1267
1267
|
for (const anim of activeAnimations.current) {
|
|
@@ -2578,7 +2578,7 @@ function ReelsFeed({
|
|
|
2578
2578
|
activeIndexRef.current = focusedIndex;
|
|
2579
2579
|
const { animateSnap, animateBounceBack, cancelAnimation } = useSnapAnimation({
|
|
2580
2580
|
duration: snapConfig?.duration ?? 260,
|
|
2581
|
-
easing: snapConfig?.easing ?? "
|
|
2581
|
+
easing: snapConfig?.easing ?? "ease-out"
|
|
2582
2582
|
});
|
|
2583
2583
|
useEffect(() => {
|
|
2584
2584
|
loadInitial();
|
|
@@ -3157,12 +3157,12 @@ function ReelsModal({
|
|
|
3157
3157
|
const panel = panelRef.current;
|
|
3158
3158
|
if (!panel) return;
|
|
3159
3159
|
const first = panel.querySelector(FOCUSABLE);
|
|
3160
|
-
(first ?? panel).focus();
|
|
3160
|
+
(first ?? panel).focus({ preventScroll: true });
|
|
3161
3161
|
});
|
|
3162
3162
|
return () => cancelAnimationFrame(id);
|
|
3163
3163
|
}
|
|
3164
3164
|
if (phase === "closed") {
|
|
3165
|
-
previouslyFocusedRef.current?.focus?.();
|
|
3165
|
+
previouslyFocusedRef.current?.focus?.({ preventScroll: true });
|
|
3166
3166
|
previouslyFocusedRef.current = null;
|
|
3167
3167
|
}
|
|
3168
3168
|
return void 0;
|