@xhub-reels/sdk 0.2.14 → 0.2.16
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 +10 -7
- package/dist/index.d.cts +9 -5
- package/dist/index.d.ts +9 -5
- package/dist/index.js +10 -7
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3007,19 +3007,22 @@ function ReelsFeedThumbnail({
|
|
|
3007
3007
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: content });
|
|
3008
3008
|
}
|
|
3009
3009
|
var DEFAULT_DURATION = 300;
|
|
3010
|
-
var DEFAULT_EASING = "
|
|
3010
|
+
var DEFAULT_EASING = "ease-out";
|
|
3011
3011
|
var DEFAULT_DIRECTION = "up";
|
|
3012
3012
|
var DEFAULT_Z_INDEX = 1e3;
|
|
3013
3013
|
var DEFAULT_PREWARM_FORWARD = 2;
|
|
3014
|
+
var RESTING_TRANSFORM = "translate(0, 0)";
|
|
3014
3015
|
function offscreenTransform(direction) {
|
|
3015
3016
|
switch (direction) {
|
|
3016
3017
|
case "down":
|
|
3017
|
-
return "
|
|
3018
|
+
return "translate(0, -100%)";
|
|
3019
|
+
case "right-to-left":
|
|
3020
|
+
return "translate(100%, 0)";
|
|
3018
3021
|
case "fade":
|
|
3019
|
-
return
|
|
3022
|
+
return RESTING_TRANSFORM;
|
|
3020
3023
|
case "up":
|
|
3021
3024
|
default:
|
|
3022
|
-
return "
|
|
3025
|
+
return "translate(0, 100%)";
|
|
3023
3026
|
}
|
|
3024
3027
|
}
|
|
3025
3028
|
function prefersReducedMotion() {
|
|
@@ -3102,7 +3105,7 @@ function ReelsModal({
|
|
|
3102
3105
|
const reduce = prefersReducedMotion();
|
|
3103
3106
|
const enter = phase === "opening";
|
|
3104
3107
|
const offscreen2 = offscreenTransform(direction);
|
|
3105
|
-
const panelFrames = direction === "fade" ? enter ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }] : enter ? [{ transform: offscreen2 }, { transform:
|
|
3108
|
+
const panelFrames = direction === "fade" ? enter ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }] : enter ? [{ transform: offscreen2 }, { transform: RESTING_TRANSFORM }] : [{ transform: RESTING_TRANSFORM }, { transform: offscreen2 }];
|
|
3106
3109
|
const backdropFrames = enter ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }];
|
|
3107
3110
|
const animDuration = reduce ? 0 : duration;
|
|
3108
3111
|
let cancelled = false;
|
|
@@ -3128,7 +3131,7 @@ function ReelsModal({
|
|
|
3128
3131
|
if (cancelled) return;
|
|
3129
3132
|
if (enter) {
|
|
3130
3133
|
if (direction === "fade") panel.style.opacity = "1";
|
|
3131
|
-
else panel.style.transform =
|
|
3134
|
+
else panel.style.transform = RESTING_TRANSFORM;
|
|
3132
3135
|
if (backdrop) backdrop.style.opacity = "1";
|
|
3133
3136
|
} else {
|
|
3134
3137
|
if (direction === "fade") panel.style.opacity = "0";
|
|
@@ -3210,7 +3213,7 @@ function ReelsModal({
|
|
|
3210
3213
|
if (!target) return null;
|
|
3211
3214
|
const enterStart = phase === "opening";
|
|
3212
3215
|
const offscreen = offscreenTransform(direction);
|
|
3213
|
-
const panelInitialTransform = direction === "fade" ?
|
|
3216
|
+
const panelInitialTransform = direction === "fade" ? RESTING_TRANSFORM : enterStart ? offscreen : RESTING_TRANSFORM;
|
|
3214
3217
|
const panelInitialOpacity = direction === "fade" ? enterStart ? 0 : 1 : 1;
|
|
3215
3218
|
const backdropInitialOpacity = enterStart ? 0 : 1;
|
|
3216
3219
|
const rootStyle = {
|
package/dist/index.d.cts
CHANGED
|
@@ -951,15 +951,19 @@ declare function ReelsFeedThumbnail({ renderThumbnail, onThumbnailClick, renderL
|
|
|
951
951
|
interface ReelsModalAnimationConfig {
|
|
952
952
|
/** Enter/exit duration in ms (default: 300) */
|
|
953
953
|
duration?: number;
|
|
954
|
-
/** CSS easing (default: '
|
|
954
|
+
/** CSS easing (default: 'ease-out') */
|
|
955
955
|
easing?: string;
|
|
956
956
|
/**
|
|
957
957
|
* Panel travel direction:
|
|
958
|
-
* - 'up'
|
|
959
|
-
*
|
|
960
|
-
* - '
|
|
958
|
+
* - 'up' (default): slides up from the bottom edge (bottom-sheet drawer).
|
|
959
|
+
* Exit: slides down back to the bottom edge.
|
|
960
|
+
* - 'down': slides down from the top edge. Exit: slides up.
|
|
961
|
+
* - 'right-to-left': slides in from the right edge (motion goes right→left).
|
|
962
|
+
* Exit: slides back out to the right edge (motion goes left→right) — the
|
|
963
|
+
* panel returns to where it came from, like a side drawer.
|
|
964
|
+
* - 'fade': no translate, opacity only.
|
|
961
965
|
*/
|
|
962
|
-
direction?: 'up' | 'down' | 'fade';
|
|
966
|
+
direction?: 'up' | 'down' | 'right-to-left' | 'fade';
|
|
963
967
|
}
|
|
964
968
|
/** State handed to render-prop customisation callbacks. */
|
|
965
969
|
interface ReelsModalRenderState {
|
package/dist/index.d.ts
CHANGED
|
@@ -951,15 +951,19 @@ declare function ReelsFeedThumbnail({ renderThumbnail, onThumbnailClick, renderL
|
|
|
951
951
|
interface ReelsModalAnimationConfig {
|
|
952
952
|
/** Enter/exit duration in ms (default: 300) */
|
|
953
953
|
duration?: number;
|
|
954
|
-
/** CSS easing (default: '
|
|
954
|
+
/** CSS easing (default: 'ease-out') */
|
|
955
955
|
easing?: string;
|
|
956
956
|
/**
|
|
957
957
|
* Panel travel direction:
|
|
958
|
-
* - 'up'
|
|
959
|
-
*
|
|
960
|
-
* - '
|
|
958
|
+
* - 'up' (default): slides up from the bottom edge (bottom-sheet drawer).
|
|
959
|
+
* Exit: slides down back to the bottom edge.
|
|
960
|
+
* - 'down': slides down from the top edge. Exit: slides up.
|
|
961
|
+
* - 'right-to-left': slides in from the right edge (motion goes right→left).
|
|
962
|
+
* Exit: slides back out to the right edge (motion goes left→right) — the
|
|
963
|
+
* panel returns to where it came from, like a side drawer.
|
|
964
|
+
* - 'fade': no translate, opacity only.
|
|
961
965
|
*/
|
|
962
|
-
direction?: 'up' | 'down' | 'fade';
|
|
966
|
+
direction?: 'up' | 'down' | 'right-to-left' | 'fade';
|
|
963
967
|
}
|
|
964
968
|
/** State handed to render-prop customisation callbacks. */
|
|
965
969
|
interface ReelsModalRenderState {
|
package/dist/index.js
CHANGED
|
@@ -3001,19 +3001,22 @@ function ReelsFeedThumbnail({
|
|
|
3001
3001
|
return /* @__PURE__ */ jsx("div", { className, children: content });
|
|
3002
3002
|
}
|
|
3003
3003
|
var DEFAULT_DURATION = 300;
|
|
3004
|
-
var DEFAULT_EASING = "
|
|
3004
|
+
var DEFAULT_EASING = "ease-out";
|
|
3005
3005
|
var DEFAULT_DIRECTION = "up";
|
|
3006
3006
|
var DEFAULT_Z_INDEX = 1e3;
|
|
3007
3007
|
var DEFAULT_PREWARM_FORWARD = 2;
|
|
3008
|
+
var RESTING_TRANSFORM = "translate(0, 0)";
|
|
3008
3009
|
function offscreenTransform(direction) {
|
|
3009
3010
|
switch (direction) {
|
|
3010
3011
|
case "down":
|
|
3011
|
-
return "
|
|
3012
|
+
return "translate(0, -100%)";
|
|
3013
|
+
case "right-to-left":
|
|
3014
|
+
return "translate(100%, 0)";
|
|
3012
3015
|
case "fade":
|
|
3013
|
-
return
|
|
3016
|
+
return RESTING_TRANSFORM;
|
|
3014
3017
|
case "up":
|
|
3015
3018
|
default:
|
|
3016
|
-
return "
|
|
3019
|
+
return "translate(0, 100%)";
|
|
3017
3020
|
}
|
|
3018
3021
|
}
|
|
3019
3022
|
function prefersReducedMotion() {
|
|
@@ -3096,7 +3099,7 @@ function ReelsModal({
|
|
|
3096
3099
|
const reduce = prefersReducedMotion();
|
|
3097
3100
|
const enter = phase === "opening";
|
|
3098
3101
|
const offscreen2 = offscreenTransform(direction);
|
|
3099
|
-
const panelFrames = direction === "fade" ? enter ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }] : enter ? [{ transform: offscreen2 }, { transform:
|
|
3102
|
+
const panelFrames = direction === "fade" ? enter ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }] : enter ? [{ transform: offscreen2 }, { transform: RESTING_TRANSFORM }] : [{ transform: RESTING_TRANSFORM }, { transform: offscreen2 }];
|
|
3100
3103
|
const backdropFrames = enter ? [{ opacity: 0 }, { opacity: 1 }] : [{ opacity: 1 }, { opacity: 0 }];
|
|
3101
3104
|
const animDuration = reduce ? 0 : duration;
|
|
3102
3105
|
let cancelled = false;
|
|
@@ -3122,7 +3125,7 @@ function ReelsModal({
|
|
|
3122
3125
|
if (cancelled) return;
|
|
3123
3126
|
if (enter) {
|
|
3124
3127
|
if (direction === "fade") panel.style.opacity = "1";
|
|
3125
|
-
else panel.style.transform =
|
|
3128
|
+
else panel.style.transform = RESTING_TRANSFORM;
|
|
3126
3129
|
if (backdrop) backdrop.style.opacity = "1";
|
|
3127
3130
|
} else {
|
|
3128
3131
|
if (direction === "fade") panel.style.opacity = "0";
|
|
@@ -3204,7 +3207,7 @@ function ReelsModal({
|
|
|
3204
3207
|
if (!target) return null;
|
|
3205
3208
|
const enterStart = phase === "opening";
|
|
3206
3209
|
const offscreen = offscreenTransform(direction);
|
|
3207
|
-
const panelInitialTransform = direction === "fade" ?
|
|
3210
|
+
const panelInitialTransform = direction === "fade" ? RESTING_TRANSFORM : enterStart ? offscreen : RESTING_TRANSFORM;
|
|
3208
3211
|
const panelInitialOpacity = direction === "fade" ? enterStart ? 0 : 1 : 1;
|
|
3209
3212
|
const backdropInitialOpacity = enterStart ? 0 : 1;
|
|
3210
3213
|
const rootStyle = {
|