@sesionario/blocks 1.24.0 → 1.26.0
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 +26 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +26 -8
- package/dist/index.js.map +1 -1
- package/dist/pdf.cjs +6 -4
- package/dist/pdf.cjs.map +1 -1
- package/dist/pdf.js +6 -4
- package/dist/pdf.js.map +1 -1
- package/package.json +1 -1
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
|
|
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,10 @@ function VideoPlayer({
|
|
|
5432
5435
|
{
|
|
5433
5436
|
ref: videoRef,
|
|
5434
5437
|
playsInline: true,
|
|
5435
|
-
className:
|
|
5438
|
+
className: cn(
|
|
5439
|
+
"h-full w-full bg-black",
|
|
5440
|
+
fit === "contain" && "object-contain"
|
|
5441
|
+
),
|
|
5436
5442
|
onClick: active ? togglePlay : void 0,
|
|
5437
5443
|
poster
|
|
5438
5444
|
}
|
|
@@ -5810,6 +5816,8 @@ function FeedVideoPlayer({
|
|
|
5810
5816
|
playbackId,
|
|
5811
5817
|
onPlayingChange,
|
|
5812
5818
|
paused: pausedProp,
|
|
5819
|
+
fit = "aspect-video",
|
|
5820
|
+
className,
|
|
5813
5821
|
...playerProps
|
|
5814
5822
|
}) {
|
|
5815
5823
|
const {
|
|
@@ -5824,14 +5832,24 @@ function FeedVideoPlayer({
|
|
|
5824
5832
|
},
|
|
5825
5833
|
[onExclusivePlayingChange, onPlayingChange]
|
|
5826
5834
|
);
|
|
5827
|
-
return /* @__PURE__ */ jsx(
|
|
5828
|
-
|
|
5835
|
+
return /* @__PURE__ */ jsx(
|
|
5836
|
+
"div",
|
|
5829
5837
|
{
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5838
|
+
ref: containerRef,
|
|
5839
|
+
"data-slot": "feed-video-player",
|
|
5840
|
+
className: cn(fit === "contain" && "h-full min-h-0 w-full", className),
|
|
5841
|
+
children: /* @__PURE__ */ jsx(
|
|
5842
|
+
VideoPlayer,
|
|
5843
|
+
{
|
|
5844
|
+
...playerProps,
|
|
5845
|
+
fit,
|
|
5846
|
+
paused: pausedProp || exclusivePaused,
|
|
5847
|
+
onPlayingChange: handlePlayingChange,
|
|
5848
|
+
className: fit === "contain" ? "h-full min-h-0" : void 0
|
|
5849
|
+
}
|
|
5850
|
+
)
|
|
5833
5851
|
}
|
|
5834
|
-
)
|
|
5852
|
+
);
|
|
5835
5853
|
}
|
|
5836
5854
|
function usePlaybackStats(statsUrl, { intervalMs = 15e3, enabled = true } = {}) {
|
|
5837
5855
|
const [stats, setStats] = React7.useState({});
|