@sesionario/blocks 1.17.1 → 1.18.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 +109 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +108 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -676,6 +676,11 @@ interface VideoPlayerProps {
|
|
|
676
676
|
labels?: VideoPlayerLabels;
|
|
677
677
|
/** Show the resolution picker when multiple levels exist. Default true. */
|
|
678
678
|
showQualitySelector?: boolean;
|
|
679
|
+
/**
|
|
680
|
+
* When true, force-pauses the media element. Clearing it does not
|
|
681
|
+
* auto-resume — the user must press play again.
|
|
682
|
+
*/
|
|
683
|
+
paused?: boolean;
|
|
679
684
|
onPlayingChange?: (playing: boolean) => void;
|
|
680
685
|
/** Fires once, the first time playback actually starts — wire your view
|
|
681
686
|
* beacon here. */
|
|
@@ -692,7 +697,30 @@ interface VideoPlayerProps {
|
|
|
692
697
|
*
|
|
693
698
|
* hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
|
|
694
699
|
*/
|
|
695
|
-
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
700
|
+
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
701
|
+
|
|
702
|
+
interface FeedVideoPlayerProps extends VideoPlayerProps {
|
|
703
|
+
/** Stable id for exclusive playback (typically the feed post id). */
|
|
704
|
+
playbackId: string;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
|
|
708
|
+
* playback autopauses when the card leaves the viewport or the tab is hidden.
|
|
709
|
+
*/
|
|
710
|
+
declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
|
|
711
|
+
|
|
712
|
+
interface UseFeedExclusivePlaybackResult {
|
|
713
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
714
|
+
paused: boolean;
|
|
715
|
+
onPlayingChange: (playing: boolean) => void;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Coordinates exclusive feed playback: claims the global slot on play,
|
|
719
|
+
* force-pauses when another feed video plays, when the player leaves the
|
|
720
|
+
* viewport, or when the tab is hidden. Picture-in-Picture is exempt from
|
|
721
|
+
* scroll/visibility autopause.
|
|
722
|
+
*/
|
|
723
|
+
declare function useFeedExclusivePlayback(playbackId: string): UseFeedExclusivePlaybackResult;
|
|
696
724
|
|
|
697
725
|
type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
|
|
698
726
|
/** Autoplay overlay state once the manifest is parsed. */
|
|
@@ -1261,4 +1289,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
|
|
|
1261
1289
|
|
|
1262
1290
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1263
1291
|
|
|
1264
|
-
export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
1292
|
+
export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, FeedVideoPlayer, type FeedVideoPlayerProps, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
package/dist/index.d.ts
CHANGED
|
@@ -676,6 +676,11 @@ interface VideoPlayerProps {
|
|
|
676
676
|
labels?: VideoPlayerLabels;
|
|
677
677
|
/** Show the resolution picker when multiple levels exist. Default true. */
|
|
678
678
|
showQualitySelector?: boolean;
|
|
679
|
+
/**
|
|
680
|
+
* When true, force-pauses the media element. Clearing it does not
|
|
681
|
+
* auto-resume — the user must press play again.
|
|
682
|
+
*/
|
|
683
|
+
paused?: boolean;
|
|
679
684
|
onPlayingChange?: (playing: boolean) => void;
|
|
680
685
|
/** Fires once, the first time playback actually starts — wire your view
|
|
681
686
|
* beacon here. */
|
|
@@ -692,7 +697,30 @@ interface VideoPlayerProps {
|
|
|
692
697
|
*
|
|
693
698
|
* hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
|
|
694
699
|
*/
|
|
695
|
-
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
700
|
+
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
701
|
+
|
|
702
|
+
interface FeedVideoPlayerProps extends VideoPlayerProps {
|
|
703
|
+
/** Stable id for exclusive playback (typically the feed post id). */
|
|
704
|
+
playbackId: string;
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
|
|
708
|
+
* playback autopauses when the card leaves the viewport or the tab is hidden.
|
|
709
|
+
*/
|
|
710
|
+
declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
|
|
711
|
+
|
|
712
|
+
interface UseFeedExclusivePlaybackResult {
|
|
713
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
714
|
+
paused: boolean;
|
|
715
|
+
onPlayingChange: (playing: boolean) => void;
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Coordinates exclusive feed playback: claims the global slot on play,
|
|
719
|
+
* force-pauses when another feed video plays, when the player leaves the
|
|
720
|
+
* viewport, or when the tab is hidden. Picture-in-Picture is exempt from
|
|
721
|
+
* scroll/visibility autopause.
|
|
722
|
+
*/
|
|
723
|
+
declare function useFeedExclusivePlayback(playbackId: string): UseFeedExclusivePlaybackResult;
|
|
696
724
|
|
|
697
725
|
type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
|
|
698
726
|
/** Autoplay overlay state once the manifest is parsed. */
|
|
@@ -1261,4 +1289,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
|
|
|
1261
1289
|
|
|
1262
1290
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1263
1291
|
|
|
1264
|
-
export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
1292
|
+
export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, FeedVideoPlayer, type FeedVideoPlayerProps, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
package/dist/index.js
CHANGED
|
@@ -3757,7 +3757,7 @@ function insertAtCaret(element, value, text) {
|
|
|
3757
3757
|
}
|
|
3758
3758
|
|
|
3759
3759
|
// src/components/emoji/emoji-field-shared.ts
|
|
3760
|
-
var emojiFieldWrapperClassName = "relative w-full rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 has-[:disabled]:opacity-50 dark:bg-input/30 dark:has-[[aria-invalid=true]]:ring-destructive/40";
|
|
3760
|
+
var emojiFieldWrapperClassName = "relative w-full rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 has-[[data-slot=textarea]:disabled]:opacity-50 has-[[data-slot=input]:disabled]:opacity-50 dark:bg-input/30 dark:has-[[aria-invalid=true]]:ring-destructive/40";
|
|
3761
3761
|
var emojiFieldResetClassName = "border-0 bg-transparent shadow-none focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent";
|
|
3762
3762
|
function mergeRefs(...refs) {
|
|
3763
3763
|
return (node) => {
|
|
@@ -4483,6 +4483,7 @@ function VideoPlayer({
|
|
|
4483
4483
|
stats,
|
|
4484
4484
|
labels,
|
|
4485
4485
|
showQualitySelector = true,
|
|
4486
|
+
paused = false,
|
|
4486
4487
|
onPlayingChange,
|
|
4487
4488
|
onFirstPlay,
|
|
4488
4489
|
onError,
|
|
@@ -4574,6 +4575,11 @@ function VideoPlayer({
|
|
|
4574
4575
|
video.removeEventListener("ratechange", onRate);
|
|
4575
4576
|
};
|
|
4576
4577
|
}, [videoRef, active, mode]);
|
|
4578
|
+
React7.useEffect(() => {
|
|
4579
|
+
const video = videoRef.current;
|
|
4580
|
+
if (!paused || !video || !isPlaying) return;
|
|
4581
|
+
video.pause();
|
|
4582
|
+
}, [paused, videoRef, isPlaying]);
|
|
4577
4583
|
React7.useEffect(() => {
|
|
4578
4584
|
setWebkitFullscreenSupported(hasWebkitVideoFullscreen(videoRef.current));
|
|
4579
4585
|
}, [videoRef, active]);
|
|
@@ -5081,6 +5087,106 @@ function MenuItem({
|
|
|
5081
5087
|
}
|
|
5082
5088
|
);
|
|
5083
5089
|
}
|
|
5090
|
+
|
|
5091
|
+
// src/components/video/feedPlaybackCoordinator.ts
|
|
5092
|
+
var players = /* @__PURE__ */ new Map();
|
|
5093
|
+
function registerFeedPlayer(id, pause) {
|
|
5094
|
+
players.set(id, pause);
|
|
5095
|
+
return () => {
|
|
5096
|
+
if (players.get(id) === pause) {
|
|
5097
|
+
players.delete(id);
|
|
5098
|
+
}
|
|
5099
|
+
};
|
|
5100
|
+
}
|
|
5101
|
+
function claimFeedPlaying(id) {
|
|
5102
|
+
for (const [otherId, pause] of players) {
|
|
5103
|
+
if (otherId !== id) pause();
|
|
5104
|
+
}
|
|
5105
|
+
}
|
|
5106
|
+
|
|
5107
|
+
// src/components/video/useFeedExclusivePlayback.ts
|
|
5108
|
+
var VISIBILITY_THRESHOLDS = [0, 0.5, 1];
|
|
5109
|
+
var MIN_VISIBLE_RATIO = 0.5;
|
|
5110
|
+
function videoInPictureInPicture(container) {
|
|
5111
|
+
if (typeof document === "undefined" || !container) return false;
|
|
5112
|
+
const pip = document.pictureInPictureElement;
|
|
5113
|
+
if (!pip) return false;
|
|
5114
|
+
return container.contains(pip);
|
|
5115
|
+
}
|
|
5116
|
+
function useFeedExclusivePlayback(playbackId) {
|
|
5117
|
+
const containerRef = React7.useRef(null);
|
|
5118
|
+
const [forcePaused, setForcePaused] = React7.useState(false);
|
|
5119
|
+
const requestPause = React7.useCallback(() => {
|
|
5120
|
+
if (videoInPictureInPicture(containerRef.current)) return;
|
|
5121
|
+
setForcePaused(true);
|
|
5122
|
+
}, []);
|
|
5123
|
+
React7.useEffect(() => {
|
|
5124
|
+
return registerFeedPlayer(playbackId, requestPause);
|
|
5125
|
+
}, [playbackId, requestPause]);
|
|
5126
|
+
React7.useEffect(() => {
|
|
5127
|
+
const node = containerRef.current;
|
|
5128
|
+
if (!node || typeof IntersectionObserver === "undefined") return;
|
|
5129
|
+
const observer = new IntersectionObserver(
|
|
5130
|
+
(entries) => {
|
|
5131
|
+
const entry = entries[0];
|
|
5132
|
+
if (!entry) return;
|
|
5133
|
+
if (!entry.isIntersecting || entry.intersectionRatio < MIN_VISIBLE_RATIO) {
|
|
5134
|
+
requestPause();
|
|
5135
|
+
}
|
|
5136
|
+
},
|
|
5137
|
+
{ threshold: [...VISIBILITY_THRESHOLDS] }
|
|
5138
|
+
);
|
|
5139
|
+
observer.observe(node);
|
|
5140
|
+
return () => observer.disconnect();
|
|
5141
|
+
}, [requestPause]);
|
|
5142
|
+
React7.useEffect(() => {
|
|
5143
|
+
const onVisibility = () => {
|
|
5144
|
+
if (document.hidden) requestPause();
|
|
5145
|
+
};
|
|
5146
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
5147
|
+
return () => document.removeEventListener("visibilitychange", onVisibility);
|
|
5148
|
+
}, [requestPause]);
|
|
5149
|
+
const onPlayingChange = React7.useCallback(
|
|
5150
|
+
(playing) => {
|
|
5151
|
+
if (!playing) return;
|
|
5152
|
+
setForcePaused(false);
|
|
5153
|
+
claimFeedPlaying(playbackId);
|
|
5154
|
+
},
|
|
5155
|
+
[playbackId]
|
|
5156
|
+
);
|
|
5157
|
+
return {
|
|
5158
|
+
containerRef,
|
|
5159
|
+
paused: forcePaused,
|
|
5160
|
+
onPlayingChange
|
|
5161
|
+
};
|
|
5162
|
+
}
|
|
5163
|
+
function FeedVideoPlayer({
|
|
5164
|
+
playbackId,
|
|
5165
|
+
onPlayingChange,
|
|
5166
|
+
paused: pausedProp,
|
|
5167
|
+
...playerProps
|
|
5168
|
+
}) {
|
|
5169
|
+
const {
|
|
5170
|
+
containerRef,
|
|
5171
|
+
paused: exclusivePaused,
|
|
5172
|
+
onPlayingChange: onExclusivePlayingChange
|
|
5173
|
+
} = useFeedExclusivePlayback(playbackId);
|
|
5174
|
+
const handlePlayingChange = React7.useCallback(
|
|
5175
|
+
(playing) => {
|
|
5176
|
+
onExclusivePlayingChange(playing);
|
|
5177
|
+
onPlayingChange?.(playing);
|
|
5178
|
+
},
|
|
5179
|
+
[onExclusivePlayingChange, onPlayingChange]
|
|
5180
|
+
);
|
|
5181
|
+
return /* @__PURE__ */ jsx("div", { ref: containerRef, "data-slot": "feed-video-player", children: /* @__PURE__ */ jsx(
|
|
5182
|
+
VideoPlayer,
|
|
5183
|
+
{
|
|
5184
|
+
...playerProps,
|
|
5185
|
+
paused: pausedProp || exclusivePaused,
|
|
5186
|
+
onPlayingChange: handlePlayingChange
|
|
5187
|
+
}
|
|
5188
|
+
) });
|
|
5189
|
+
}
|
|
5084
5190
|
function usePlaybackStats(statsUrl, { intervalMs = 15e3, enabled = true } = {}) {
|
|
5085
5191
|
const [stats, setStats] = React7.useState({});
|
|
5086
5192
|
React7.useEffect(() => {
|
|
@@ -7703,6 +7809,6 @@ function useRealtimeChannel({
|
|
|
7703
7809
|
}, [enabled, reconnectDelayMs]);
|
|
7704
7810
|
}
|
|
7705
7811
|
|
|
7706
|
-
export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DropdownMenuItem, DropdownMenuSeparator, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
7812
|
+
export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DropdownMenuItem, DropdownMenuSeparator, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, FeedVideoPlayer, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
7707
7813
|
//# sourceMappingURL=index.js.map
|
|
7708
7814
|
//# sourceMappingURL=index.js.map
|