@sesionario/blocks 1.25.0 → 1.26.1

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.d.cts CHANGED
@@ -914,6 +914,12 @@ interface VideoPlayerProps {
914
914
  * beacon here. */
915
915
  onFirstPlay?: () => void;
916
916
  onError?: (error: DescribedPlaybackError) => void;
917
+ /**
918
+ * Default `aspect-video` for feed cards. Use `contain` in fullscreen
919
+ * viewers so portrait sources fill the pane with object-fit and controls
920
+ * stay at the bottom of the pane.
921
+ */
922
+ fit?: "aspect-video" | "contain";
917
923
  className?: string;
918
924
  }
919
925
  /**
@@ -925,7 +931,7 @@ interface VideoPlayerProps {
925
931
  *
926
932
  * hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
927
933
  */
928
- declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
934
+ declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, fit, className, }: VideoPlayerProps): React.JSX.Element;
929
935
 
930
936
  interface FeedVideoPlayerProps extends VideoPlayerProps {
931
937
  /** Stable id for exclusive playback (typically the feed post id). */
@@ -935,7 +941,7 @@ interface FeedVideoPlayerProps extends VideoPlayerProps {
935
941
  * Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
936
942
  * playback autopauses when the card leaves the viewport or the tab is hidden.
937
943
  */
938
- declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
944
+ declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, fit, className, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
939
945
 
940
946
  interface UseFeedExclusivePlaybackResult {
941
947
  containerRef: React.RefObject<HTMLDivElement | null>;
package/dist/index.d.ts CHANGED
@@ -914,6 +914,12 @@ interface VideoPlayerProps {
914
914
  * beacon here. */
915
915
  onFirstPlay?: () => void;
916
916
  onError?: (error: DescribedPlaybackError) => void;
917
+ /**
918
+ * Default `aspect-video` for feed cards. Use `contain` in fullscreen
919
+ * viewers so portrait sources fill the pane with object-fit and controls
920
+ * stay at the bottom of the pane.
921
+ */
922
+ fit?: "aspect-video" | "contain";
917
923
  className?: string;
918
924
  }
919
925
  /**
@@ -925,7 +931,7 @@ interface VideoPlayerProps {
925
931
  *
926
932
  * hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
927
933
  */
928
- declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
934
+ declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, fit, className, }: VideoPlayerProps): React.JSX.Element;
929
935
 
930
936
  interface FeedVideoPlayerProps extends VideoPlayerProps {
931
937
  /** Stable id for exclusive playback (typically the feed post id). */
@@ -935,7 +941,7 @@ interface FeedVideoPlayerProps extends VideoPlayerProps {
935
941
  * Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
936
942
  * playback autopauses when the card leaves the viewport or the tab is hidden.
937
943
  */
938
- declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
944
+ declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, fit, className, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
939
945
 
940
946
  interface UseFeedExclusivePlaybackResult {
941
947
  containerRef: React.RefObject<HTMLDivElement | null>;
package/dist/index.js CHANGED
@@ -5133,6 +5133,7 @@ function VideoPlayer({
5133
5133
  onPlayingChange,
5134
5134
  onFirstPlay,
5135
5135
  onError,
5136
+ fit = "aspect-video",
5136
5137
  className
5137
5138
  }) {
5138
5139
  const t = { ...DEFAULT_LABELS2, ...labels };
@@ -5414,8 +5415,10 @@ function VideoPlayer({
5414
5415
  ref: containerRef,
5415
5416
  "data-slot": "video-player",
5416
5417
  "data-mode": mode,
5418
+ "data-fit": fit,
5417
5419
  className: cn(
5418
- "group relative aspect-video w-full overflow-hidden rounded-lg bg-black text-white select-none",
5420
+ "group relative w-full overflow-hidden rounded-lg bg-black text-white select-none",
5421
+ fit === "contain" ? "h-full min-h-0 aspect-auto" : "aspect-video",
5419
5422
  className
5420
5423
  ),
5421
5424
  onMouseMove: revealControls,
@@ -5432,7 +5435,7 @@ function VideoPlayer({
5432
5435
  {
5433
5436
  ref: videoRef,
5434
5437
  playsInline: true,
5435
- className: "h-full w-full bg-black",
5438
+ className: "h-full w-full bg-black object-contain",
5436
5439
  onClick: active ? togglePlay : void 0,
5437
5440
  poster
5438
5441
  }
@@ -5810,6 +5813,8 @@ function FeedVideoPlayer({
5810
5813
  playbackId,
5811
5814
  onPlayingChange,
5812
5815
  paused: pausedProp,
5816
+ fit = "aspect-video",
5817
+ className,
5813
5818
  ...playerProps
5814
5819
  }) {
5815
5820
  const {
@@ -5824,14 +5829,24 @@ function FeedVideoPlayer({
5824
5829
  },
5825
5830
  [onExclusivePlayingChange, onPlayingChange]
5826
5831
  );
5827
- return /* @__PURE__ */ jsx("div", { ref: containerRef, "data-slot": "feed-video-player", children: /* @__PURE__ */ jsx(
5828
- VideoPlayer,
5832
+ return /* @__PURE__ */ jsx(
5833
+ "div",
5829
5834
  {
5830
- ...playerProps,
5831
- paused: pausedProp || exclusivePaused,
5832
- onPlayingChange: handlePlayingChange
5835
+ ref: containerRef,
5836
+ "data-slot": "feed-video-player",
5837
+ className: cn(fit === "contain" && "h-full min-h-0 w-full", className),
5838
+ children: /* @__PURE__ */ jsx(
5839
+ VideoPlayer,
5840
+ {
5841
+ ...playerProps,
5842
+ fit,
5843
+ paused: pausedProp || exclusivePaused,
5844
+ onPlayingChange: handlePlayingChange,
5845
+ className: fit === "contain" ? "h-full min-h-0" : void 0
5846
+ }
5847
+ )
5833
5848
  }
5834
- ) });
5849
+ );
5835
5850
  }
5836
5851
  function usePlaybackStats(statsUrl, { intervalMs = 15e3, enabled = true } = {}) {
5837
5852
  const [stats, setStats] = React7.useState({});