@sesionario/blocks 1.17.0 → 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.d.cts CHANGED
@@ -246,8 +246,11 @@ type LanguageSwitcherProps = {
246
246
  declare function LanguageSwitcher({ languages: propLanguages, currentLanguage: propCurrentLanguage, onLanguageChange: propOnLanguageChange, labels, className, size, shape, variant, showIcon, align, side, }: LanguageSwitcherProps): React.JSX.Element;
247
247
 
248
248
  type PlatformNavbarProps = {
249
- /** Brand mark (isotype). Typically a link to the member app home. */
250
- logo: ReactNode;
249
+ /**
250
+ * Brand mark (isotype). Typically a link to the member app home.
251
+ * Omit in shells that already brand the sidebar.
252
+ */
253
+ logo?: ReactNode;
251
254
  /** Optional control before the center (e.g. SidebarTrigger). */
252
255
  leading?: ReactNode;
253
256
  /** Flex-growing center slot (tabs, subtitle). Horizontally scrollable. */
@@ -259,7 +262,7 @@ type PlatformNavbarProps = {
259
262
  innerClassName?: string;
260
263
  };
261
264
  /**
262
- * Shared sticky top chrome: logo | optional leading | scrollable center | fixed right.
265
+ * Shared sticky top chrome: optional logo | optional leading | scrollable center | fixed right.
263
266
  * Apps inject search, notifications, and the account menu into `right`.
264
267
  */
265
268
  declare function PlatformNavbar({ logo, leading, center, right, className, innerClassName, }: PlatformNavbarProps): React.JSX.Element;
@@ -293,7 +296,6 @@ type PlatformAccountMenuUrls = {
293
296
  authAppUrl: string;
294
297
  appUrl: string;
295
298
  adminUrl: string;
296
- backofficeUrl: string;
297
299
  loginPath?: string;
298
300
  accountPath?: string;
299
301
  activityPath?: string;
@@ -305,15 +307,6 @@ type PlatformAccountMenuLabels = {
305
307
  personalProfile: string;
306
308
  activity: string;
307
309
  professionalProfile: string;
308
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
309
- mainApp: string;
310
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
311
- orgManagement: string;
312
- backoffice: string;
313
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
314
- memberOrgs: string;
315
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
316
- managementOrgs: string;
317
310
  showMoreOrgs: string;
318
311
  showLessOrgs: string;
319
312
  manageOrg: string;
@@ -339,8 +332,6 @@ type PlatformAccountMenuProps = {
339
332
  /** While session is resolving. */
340
333
  isPending?: boolean;
341
334
  user?: PlatformAccountMenuUser | null;
342
- /** Platform admin (JWT role includes admin). Enables Backoffice link. */
343
- isAdmin?: boolean;
344
335
  verificationStatus?: ProfessionalVerificationStatus;
345
336
  urls: PlatformAccountMenuUrls;
346
337
  memberOrgs?: PlatformAccountMenuOrg[];
@@ -368,7 +359,7 @@ type PlatformAccountMenuProps = {
368
359
  * Cross-app account / settings menu. Guest trigger is a settings cog;
369
360
  * signed-in trigger is the user avatar.
370
361
  */
371
- declare function PlatformAccountMenu({ variant, isPending, user, isAdmin, verificationStatus, urls, memberOrgs, manageableOrgs, languages, currentLanguage, onLanguageChange, labels: labelsProp, onSignOut, extraItems, trigger: triggerProp, contentSide, contentAlign, contentSideOffset, contentClassName, className, }: PlatformAccountMenuProps): React.JSX.Element;
362
+ declare function PlatformAccountMenu({ variant, isPending, user, verificationStatus, urls, memberOrgs, manageableOrgs, languages, currentLanguage, onLanguageChange, labels: labelsProp, onSignOut, extraItems, trigger: triggerProp, contentSide, contentAlign, contentSideOffset, contentClassName, className, }: PlatformAccountMenuProps): React.JSX.Element;
372
363
 
373
364
  declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
374
365
  inset?: boolean;
@@ -685,6 +676,11 @@ interface VideoPlayerProps {
685
676
  labels?: VideoPlayerLabels;
686
677
  /** Show the resolution picker when multiple levels exist. Default true. */
687
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;
688
684
  onPlayingChange?: (playing: boolean) => void;
689
685
  /** Fires once, the first time playback actually starts — wire your view
690
686
  * beacon here. */
@@ -701,7 +697,30 @@ interface VideoPlayerProps {
701
697
  *
702
698
  * hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
703
699
  */
704
- 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;
705
724
 
706
725
  type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
707
726
  /** Autoplay overlay state once the manifest is parsed. */
@@ -1270,4 +1289,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1270
1289
 
1271
1290
  declare function cn(...inputs: ClassValue[]): string;
1272
1291
 
1273
- 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
@@ -246,8 +246,11 @@ type LanguageSwitcherProps = {
246
246
  declare function LanguageSwitcher({ languages: propLanguages, currentLanguage: propCurrentLanguage, onLanguageChange: propOnLanguageChange, labels, className, size, shape, variant, showIcon, align, side, }: LanguageSwitcherProps): React.JSX.Element;
247
247
 
248
248
  type PlatformNavbarProps = {
249
- /** Brand mark (isotype). Typically a link to the member app home. */
250
- logo: ReactNode;
249
+ /**
250
+ * Brand mark (isotype). Typically a link to the member app home.
251
+ * Omit in shells that already brand the sidebar.
252
+ */
253
+ logo?: ReactNode;
251
254
  /** Optional control before the center (e.g. SidebarTrigger). */
252
255
  leading?: ReactNode;
253
256
  /** Flex-growing center slot (tabs, subtitle). Horizontally scrollable. */
@@ -259,7 +262,7 @@ type PlatformNavbarProps = {
259
262
  innerClassName?: string;
260
263
  };
261
264
  /**
262
- * Shared sticky top chrome: logo | optional leading | scrollable center | fixed right.
265
+ * Shared sticky top chrome: optional logo | optional leading | scrollable center | fixed right.
263
266
  * Apps inject search, notifications, and the account menu into `right`.
264
267
  */
265
268
  declare function PlatformNavbar({ logo, leading, center, right, className, innerClassName, }: PlatformNavbarProps): React.JSX.Element;
@@ -293,7 +296,6 @@ type PlatformAccountMenuUrls = {
293
296
  authAppUrl: string;
294
297
  appUrl: string;
295
298
  adminUrl: string;
296
- backofficeUrl: string;
297
299
  loginPath?: string;
298
300
  accountPath?: string;
299
301
  activityPath?: string;
@@ -305,15 +307,6 @@ type PlatformAccountMenuLabels = {
305
307
  personalProfile: string;
306
308
  activity: string;
307
309
  professionalProfile: string;
308
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
309
- mainApp: string;
310
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
311
- orgManagement: string;
312
- backoffice: string;
313
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
314
- memberOrgs: string;
315
- /** @deprecated Unused; kept so apps can pass labels without breaking. */
316
- managementOrgs: string;
317
310
  showMoreOrgs: string;
318
311
  showLessOrgs: string;
319
312
  manageOrg: string;
@@ -339,8 +332,6 @@ type PlatformAccountMenuProps = {
339
332
  /** While session is resolving. */
340
333
  isPending?: boolean;
341
334
  user?: PlatformAccountMenuUser | null;
342
- /** Platform admin (JWT role includes admin). Enables Backoffice link. */
343
- isAdmin?: boolean;
344
335
  verificationStatus?: ProfessionalVerificationStatus;
345
336
  urls: PlatformAccountMenuUrls;
346
337
  memberOrgs?: PlatformAccountMenuOrg[];
@@ -368,7 +359,7 @@ type PlatformAccountMenuProps = {
368
359
  * Cross-app account / settings menu. Guest trigger is a settings cog;
369
360
  * signed-in trigger is the user avatar.
370
361
  */
371
- declare function PlatformAccountMenu({ variant, isPending, user, isAdmin, verificationStatus, urls, memberOrgs, manageableOrgs, languages, currentLanguage, onLanguageChange, labels: labelsProp, onSignOut, extraItems, trigger: triggerProp, contentSide, contentAlign, contentSideOffset, contentClassName, className, }: PlatformAccountMenuProps): React.JSX.Element;
362
+ declare function PlatformAccountMenu({ variant, isPending, user, verificationStatus, urls, memberOrgs, manageableOrgs, languages, currentLanguage, onLanguageChange, labels: labelsProp, onSignOut, extraItems, trigger: triggerProp, contentSide, contentAlign, contentSideOffset, contentClassName, className, }: PlatformAccountMenuProps): React.JSX.Element;
372
363
 
373
364
  declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
374
365
  inset?: boolean;
@@ -685,6 +676,11 @@ interface VideoPlayerProps {
685
676
  labels?: VideoPlayerLabels;
686
677
  /** Show the resolution picker when multiple levels exist. Default true. */
687
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;
688
684
  onPlayingChange?: (playing: boolean) => void;
689
685
  /** Fires once, the first time playback actually starts — wire your view
690
686
  * beacon here. */
@@ -701,7 +697,30 @@ interface VideoPlayerProps {
701
697
  *
702
698
  * hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
703
699
  */
704
- 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;
705
724
 
706
725
  type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
707
726
  /** Autoplay overlay state once the manifest is parsed. */
@@ -1270,4 +1289,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1270
1289
 
1271
1290
  declare function cn(...inputs: ClassValue[]): string;
1272
1291
 
1273
- 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
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import * as React7 from 'react';
3
3
  import { createContext, useContext, useState, useRef, useEffect, useLayoutEffect, useCallback, useMemo, useId } from 'react';
4
- import { ChevronsUpDown, CheckIcon, Smile, SearchIcon, Search, Clock, Flag, Hash, Lightbulb, Trophy, Plane, Apple, Leaf, Hand, Loader2, AlertTriangle, Inbox, X, ChevronLeft, ChevronRight, Monitor, Sun, Moon, Building2, Check, Plus, Languages, BadgeCheck, Settings, User, Activity, LayoutDashboard, LogOut, LogIn, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, Play, AlertCircle, VolumeX, Pause, Volume1, Volume2, PictureInPicture2, Minimize, Maximize, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, ChevronUp, ChevronDown, XIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
4
+ import { ChevronsUpDown, CheckIcon, Smile, SearchIcon, Search, Clock, Flag, Hash, Lightbulb, Trophy, Plane, Apple, Leaf, Hand, Loader2, AlertTriangle, Inbox, X, ChevronLeft, ChevronRight, Monitor, Sun, Moon, Building2, Check, Plus, Languages, BadgeCheck, Settings, User, Activity, LogOut, LogIn, Upload, Move, ZoomOut, ZoomIn, RotateCcw, RotateCw, Grid3X3, RefreshCw, Pencil, Play, AlertCircle, VolumeX, Pause, Volume1, Volume2, PictureInPicture2, Minimize, Maximize, ArrowDownIcon, MessageCircleDashedIcon, MessageCircle, ChevronUp, ChevronDown, XIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
5
5
  import { clsx } from 'clsx';
6
6
  import { twMerge } from 'tailwind-merge';
7
7
  import { cva } from 'class-variance-authority';
@@ -1715,7 +1715,7 @@ function PlatformNavbar({
1715
1715
  innerClassName
1716
1716
  ),
1717
1717
  children: [
1718
- /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: logo }),
1718
+ logo != null && logo !== false ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: logo }) : null,
1719
1719
  leading ? /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: leading }) : null,
1720
1720
  /* @__PURE__ */ jsx(
1721
1721
  "div",
@@ -1800,11 +1800,6 @@ var defaultLabels3 = {
1800
1800
  personalProfile: "Personal profile",
1801
1801
  activity: "Activity",
1802
1802
  professionalProfile: "Professional profile",
1803
- mainApp: "Main app",
1804
- orgManagement: "Organization management",
1805
- backoffice: "Backoffice",
1806
- memberOrgs: "My organizations",
1807
- managementOrgs: "Management team",
1808
1803
  showMoreOrgs: "Show more",
1809
1804
  showLessOrgs: "Show less",
1810
1805
  manageOrg: "Manage organization",
@@ -1883,9 +1878,9 @@ function LanguageThemeSubs({
1883
1878
  const themeValue = theme ?? "system";
1884
1879
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1885
1880
  /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
1886
- /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
1887
- /* @__PURE__ */ jsx(Languages, { className: "size-4" }),
1888
- labels.language
1881
+ /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2 [&>svg:last-child]:ml-0", children: [
1882
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.language }),
1883
+ /* @__PURE__ */ jsx(Languages, { className: "size-4" })
1889
1884
  ] }),
1890
1885
  /* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-40", children: /* @__PURE__ */ jsx(
1891
1886
  DropdownMenuRadioGroup,
@@ -1897,9 +1892,9 @@ function LanguageThemeSubs({
1897
1892
  ) })
1898
1893
  ] }),
1899
1894
  /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
1900
- /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2", children: [
1901
- themeValue === "light" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : themeValue === "dark" ? /* @__PURE__ */ jsx(Moon, { className: "size-4" }) : /* @__PURE__ */ jsx(Monitor, { className: "size-4" }),
1902
- labels.theme
1895
+ /* @__PURE__ */ jsxs(DropdownMenuSubTrigger, { className: "gap-2 [&>svg:last-child]:ml-0", children: [
1896
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.theme }),
1897
+ themeValue === "light" ? /* @__PURE__ */ jsx(Sun, { className: "size-4" }) : themeValue === "dark" ? /* @__PURE__ */ jsx(Moon, { className: "size-4" }) : /* @__PURE__ */ jsx(Monitor, { className: "size-4" })
1903
1898
  ] }),
1904
1899
  /* @__PURE__ */ jsx(DropdownMenuSubContent, { className: "min-w-40", children: /* @__PURE__ */ jsxs(DropdownMenuRadioGroup, { value: themeValue, onValueChange: setTheme, children: [
1905
1900
  /* @__PURE__ */ jsx(DropdownMenuRadioItem, { value: "system", children: labels.themeSystem }),
@@ -1933,14 +1928,14 @@ function OrgMenuRows({
1933
1928
  return /* @__PURE__ */ jsxs(
1934
1929
  "div",
1935
1930
  {
1936
- className: "relative flex items-center",
1931
+ className: "relative",
1937
1932
  "data-testid": `platform-account-org-${org.id}`,
1938
1933
  children: [
1939
1934
  /* @__PURE__ */ jsx(
1940
1935
  DropdownMenuItem,
1941
1936
  {
1942
1937
  asChild: true,
1943
- className: cn("min-w-0 flex-1 gap-2", org.canManage && "pr-9"),
1938
+ className: cn("gap-2", org.canManage && "pr-9"),
1944
1939
  children: /* @__PURE__ */ jsxs("a", { href: orgHomeHref, children: [
1945
1940
  /* @__PURE__ */ jsx(
1946
1941
  MenuAvatar,
@@ -1950,7 +1945,7 @@ function OrgMenuRows({
1950
1945
  sizeClass: "size-6"
1951
1946
  }
1952
1947
  ),
1953
- /* @__PURE__ */ jsx("span", { className: "truncate", children: org.name })
1948
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: org.name })
1954
1949
  ] })
1955
1950
  }
1956
1951
  ),
@@ -1958,8 +1953,8 @@ function OrgMenuRows({
1958
1953
  DropdownMenuItem,
1959
1954
  {
1960
1955
  asChild: true,
1961
- className: "absolute right-1 top-1/2 size-7 -translate-y-1/2 p-0",
1962
- children: /* @__PURE__ */ jsx("a", { href: manageHref, "aria-label": labels.manageOrg, children: /* @__PURE__ */ jsx(Settings, { className: "size-3.5" }) })
1956
+ className: "absolute right-0.5 top-1/2 size-7 -translate-y-1/2 p-0",
1957
+ children: /* @__PURE__ */ jsx("a", { href: manageHref, "aria-label": labels.manageOrg, children: /* @__PURE__ */ jsx(Settings, { className: "size-4" }) })
1963
1958
  }
1964
1959
  ) : null
1965
1960
  ]
@@ -1967,7 +1962,7 @@ function OrgMenuRows({
1967
1962
  org.id
1968
1963
  );
1969
1964
  }),
1970
- collapsible ? /* @__PURE__ */ jsx(
1965
+ collapsible ? /* @__PURE__ */ jsxs(
1971
1966
  DropdownMenuItem,
1972
1967
  {
1973
1968
  className: "gap-2",
@@ -1975,13 +1970,10 @@ function OrgMenuRows({
1975
1970
  event.preventDefault();
1976
1971
  setExpanded((value) => !value);
1977
1972
  },
1978
- children: expanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
1979
- /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" }),
1980
- labels.showLessOrgs
1981
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
1982
- /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" }),
1983
- labels.showMoreOrgs
1984
- ] })
1973
+ children: [
1974
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: expanded ? labels.showLessOrgs : labels.showMoreOrgs }),
1975
+ expanded ? /* @__PURE__ */ jsx(ChevronUp, { className: "size-4" }) : /* @__PURE__ */ jsx(ChevronDown, { className: "size-4" })
1976
+ ]
1985
1977
  }
1986
1978
  ) : null
1987
1979
  ]
@@ -1992,7 +1984,6 @@ function PlatformAccountMenu({
1992
1984
  variant = "platform",
1993
1985
  isPending = false,
1994
1986
  user = null,
1995
- isAdmin = false,
1996
1987
  verificationStatus = "unverified",
1997
1988
  urls,
1998
1989
  memberOrgs = [],
@@ -2016,6 +2007,7 @@ function PlatformAccountMenu({
2016
2007
  () => mergePlatformAccountOrgs(memberOrgs, manageableOrgs),
2017
2008
  [memberOrgs, manageableOrgs]
2018
2009
  );
2010
+ const hasOrgs = mergedOrgs.length > 0;
2019
2011
  const loginHref = `${urls.authAppUrl}${urls.loginPath ?? "/login"}`;
2020
2012
  const accountHref = `${urls.authAppUrl}${urls.accountPath ?? "/account"}`;
2021
2013
  const activityHref = `${urls.authAppUrl}${urls.activityPath ?? "/account/activity"}`;
@@ -2095,37 +2087,36 @@ function PlatformAccountMenu({
2095
2087
  ] }),
2096
2088
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
2097
2089
  variant === "platform" ? /* @__PURE__ */ jsxs(Fragment, { children: [
2090
+ hasOrgs ? /* @__PURE__ */ jsxs(Fragment, { children: [
2091
+ /* @__PURE__ */ jsx(
2092
+ OrgMenuRows,
2093
+ {
2094
+ orgs: mergedOrgs,
2095
+ appUrl: urls.appUrl,
2096
+ adminUrl: urls.adminUrl,
2097
+ labels
2098
+ }
2099
+ ),
2100
+ /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
2101
+ ] }) : null,
2098
2102
  /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
2099
- /* @__PURE__ */ jsx(User, { className: "size-4" }),
2100
- labels.personalProfile
2103
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.personalProfile }),
2104
+ /* @__PURE__ */ jsx(User, { className: "size-4" })
2101
2105
  ] }) }),
2102
2106
  /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: activityHref, children: [
2103
- /* @__PURE__ */ jsx(Activity, { className: "size-4" }),
2104
- labels.activity
2107
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.activity }),
2108
+ /* @__PURE__ */ jsx(Activity, { className: "size-4" })
2105
2109
  ] }) }),
2106
2110
  /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: profileHref, children: [
2107
- /* @__PURE__ */ jsx(User, { className: "size-4" }),
2108
- labels.professionalProfile
2111
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.professionalProfile }),
2112
+ /* @__PURE__ */ jsx(User, { className: "size-4" })
2109
2113
  ] }) }),
2110
- /* @__PURE__ */ jsx(
2111
- OrgMenuRows,
2112
- {
2113
- orgs: mergedOrgs,
2114
- appUrl: urls.appUrl,
2115
- adminUrl: urls.adminUrl,
2116
- labels
2117
- }
2118
- ),
2119
2114
  extraItems,
2120
- isAdmin && urls.backofficeUrl ? /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: urls.backofficeUrl, children: [
2121
- /* @__PURE__ */ jsx(LayoutDashboard, { className: "size-4" }),
2122
- labels.backoffice
2123
- ] }) }) : null,
2124
2115
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
2125
2116
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
2126
2117
  /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: accountHref, children: [
2127
- /* @__PURE__ */ jsx(Settings, { className: "size-4" }),
2128
- labels.accountSettings
2118
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.accountSettings }),
2119
+ /* @__PURE__ */ jsx(Settings, { className: "size-4" })
2129
2120
  ] }) }),
2130
2121
  extraItems,
2131
2122
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {})
@@ -2150,8 +2141,8 @@ function PlatformAccountMenu({
2150
2141
  void handleSignOut();
2151
2142
  },
2152
2143
  children: [
2153
- /* @__PURE__ */ jsx(LogOut, { className: "size-4" }),
2154
- signingOut ? labels.signingOut : labels.signOut
2144
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: signingOut ? labels.signingOut : labels.signOut }),
2145
+ /* @__PURE__ */ jsx(LogOut, { className: "size-4" })
2155
2146
  ]
2156
2147
  }
2157
2148
  )
@@ -2167,8 +2158,8 @@ function PlatformAccountMenu({
2167
2158
  ),
2168
2159
  /* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
2169
2160
  /* @__PURE__ */ jsx(DropdownMenuItem, { asChild: true, className: "gap-2", children: /* @__PURE__ */ jsxs("a", { href: loginHref, children: [
2170
- /* @__PURE__ */ jsx(LogIn, { className: "size-4" }),
2171
- labels.signIn
2161
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: labels.signIn }),
2162
+ /* @__PURE__ */ jsx(LogIn, { className: "size-4" })
2172
2163
  ] }) })
2173
2164
  ] })
2174
2165
  }
@@ -3766,7 +3757,7 @@ function insertAtCaret(element, value, text) {
3766
3757
  }
3767
3758
 
3768
3759
  // src/components/emoji/emoji-field-shared.ts
3769
- 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";
3770
3761
  var emojiFieldResetClassName = "border-0 bg-transparent shadow-none focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent";
3771
3762
  function mergeRefs(...refs) {
3772
3763
  return (node) => {
@@ -4492,6 +4483,7 @@ function VideoPlayer({
4492
4483
  stats,
4493
4484
  labels,
4494
4485
  showQualitySelector = true,
4486
+ paused = false,
4495
4487
  onPlayingChange,
4496
4488
  onFirstPlay,
4497
4489
  onError,
@@ -4583,6 +4575,11 @@ function VideoPlayer({
4583
4575
  video.removeEventListener("ratechange", onRate);
4584
4576
  };
4585
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]);
4586
4583
  React7.useEffect(() => {
4587
4584
  setWebkitFullscreenSupported(hasWebkitVideoFullscreen(videoRef.current));
4588
4585
  }, [videoRef, active]);
@@ -5090,6 +5087,106 @@ function MenuItem({
5090
5087
  }
5091
5088
  );
5092
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
+ }
5093
5190
  function usePlaybackStats(statsUrl, { intervalMs = 15e3, enabled = true } = {}) {
5094
5191
  const [stats, setStats] = React7.useState({});
5095
5192
  React7.useEffect(() => {
@@ -7241,6 +7338,7 @@ function SupportMessengerProvider({
7241
7338
  className
7242
7339
  }) {
7243
7340
  const isMobile = useMediaQuery2("(max-width: 767px)");
7341
+ const dockRef = useRef(null);
7244
7342
  const [listOpen, setListOpen] = useState(false);
7245
7343
  const [threads, setThreads] = useState([]);
7246
7344
  const [mobileThreadKey, setMobileThreadKey] = useState(null);
@@ -7248,6 +7346,7 @@ function SupportMessengerProvider({
7248
7346
  () => items.reduce((sum, item) => sum + (item.unreadCount ?? 0), 0),
7249
7347
  [items]
7250
7348
  );
7349
+ const isDesktopOpen = !isMobile && (listOpen || threads.length > 0);
7251
7350
  useEffect(() => {
7252
7351
  if (!forceMinimized) return;
7253
7352
  setListOpen(false);
@@ -7290,6 +7389,20 @@ function SupportMessengerProvider({
7290
7389
  setThreads([]);
7291
7390
  setMobileThreadKey(null);
7292
7391
  }, []);
7392
+ useEffect(() => {
7393
+ if (!isDesktopOpen) return;
7394
+ function onPointerDown(event) {
7395
+ const target = event.target;
7396
+ if (!(target instanceof Node)) return;
7397
+ if (dockRef.current?.contains(target)) return;
7398
+ if (target instanceof Element && target.closest('[data-slot="popover-content"]')) {
7399
+ return;
7400
+ }
7401
+ closeAll();
7402
+ }
7403
+ document.addEventListener("pointerdown", onPointerDown);
7404
+ return () => document.removeEventListener("pointerdown", onPointerDown);
7405
+ }, [isDesktopOpen, closeAll]);
7293
7406
  const ctx = useMemo(
7294
7407
  () => ({
7295
7408
  listOpen,
@@ -7333,6 +7446,7 @@ function SupportMessengerProvider({
7333
7446
  enabled ? /* @__PURE__ */ jsxs(
7334
7447
  "div",
7335
7448
  {
7449
+ ref: dockRef,
7336
7450
  className: cn(
7337
7451
  "pointer-events-none fixed right-4 bottom-4 z-50 flex flex-col items-end gap-3",
7338
7452
  className
@@ -7695,6 +7809,6 @@ function useRealtimeChannel({
7695
7809
  }, [enabled, reconnectDelayMs]);
7696
7810
  }
7697
7811
 
7698
- 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 };
7699
7813
  //# sourceMappingURL=index.js.map
7700
7814
  //# sourceMappingURL=index.js.map