@xhub-reels/sdk 0.2.14 → 0.2.15

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 CHANGED
@@ -3011,15 +3011,18 @@ var DEFAULT_EASING = "cubic-bezier(0.22, 1, 0.36, 1)";
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 "translateY(-100%)";
3018
+ return "translate(0, -100%)";
3019
+ case "right-to-left":
3020
+ return "translate(100%, 0)";
3018
3021
  case "fade":
3019
- return "translateY(0)";
3022
+ return RESTING_TRANSFORM;
3020
3023
  case "up":
3021
3024
  default:
3022
- return "translateY(100%)";
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: "translateY(0)" }] : [{ transform: "translateY(0)" }, { transform: offscreen2 }];
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 = "translateY(0)";
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" ? "translateY(0)" : enterStart ? offscreen : "translateY(0)";
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
@@ -955,11 +955,15 @@ interface ReelsModalAnimationConfig {
955
955
  easing?: string;
956
956
  /**
957
957
  * Panel travel direction:
958
- * - 'up' (default): slides up from the bottom edge (bottom-sheet drawer)
959
- * - 'down': slides down from the top edge
960
- * - 'fade': no translate, opacity only
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
@@ -955,11 +955,15 @@ interface ReelsModalAnimationConfig {
955
955
  easing?: string;
956
956
  /**
957
957
  * Panel travel direction:
958
- * - 'up' (default): slides up from the bottom edge (bottom-sheet drawer)
959
- * - 'down': slides down from the top edge
960
- * - 'fade': no translate, opacity only
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
@@ -3005,15 +3005,18 @@ var DEFAULT_EASING = "cubic-bezier(0.22, 1, 0.36, 1)";
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 "translateY(-100%)";
3012
+ return "translate(0, -100%)";
3013
+ case "right-to-left":
3014
+ return "translate(100%, 0)";
3012
3015
  case "fade":
3013
- return "translateY(0)";
3016
+ return RESTING_TRANSFORM;
3014
3017
  case "up":
3015
3018
  default:
3016
- return "translateY(100%)";
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: "translateY(0)" }] : [{ transform: "translateY(0)" }, { transform: offscreen2 }];
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 = "translateY(0)";
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" ? "translateY(0)" : enterStart ? offscreen : "translateY(0)";
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 = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xhub-reels/sdk",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "High-performance Short Video / Reels SDK for React — optimized for Flutter WebView",
5
5
  "license": "MIT",
6
6
  "type": "module",