@sesionario/blocks 1.33.1 → 1.34.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
@@ -4,7 +4,6 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
6
6
  import * as PopoverPrimitive from '@radix-ui/react-popover';
7
- import { HlsConfig, RetryConfig, LoaderResponse } from 'hls.js';
8
7
  import * as RPNInput from 'react-phone-number-input';
9
8
  import { MessageScroller as MessageScroller$1 } from '@shadcn/react/message-scroller';
10
9
  export { useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from '@shadcn/react/message-scroller';
@@ -787,250 +786,6 @@ declare function insertAtCaret(element: {
787
786
  caret: number;
788
787
  };
789
788
 
790
- /**
791
- * Playback error description, ported from the app's HLS player but stripped of
792
- * Sentry. `@sesionario/blocks` must stay reporting-agnostic: the player surfaces
793
- * a {@link DescribedPlaybackError} through an optional `onError` prop so each
794
- * app can wire its own reporting (Sentry, Datadog, console, …).
795
- *
796
- * User-facing messages are intentionally NOT baked in here — they come from the
797
- * player's `labels` prop so they stay translatable. This module only classifies
798
- * the error and produces a machine-readable summary + detail for logging.
799
- */
800
- type HlsPlayerMode = "live" | "vod";
801
- /** Coarse category the player uses to pick the right localized message. */
802
- type PlaybackErrorKind = "unavailable" | "network" | "media" | "unsupported" | "resync" | "generic";
803
- type PlaybackErrorContext = {
804
- mode: HlsPlayerMode;
805
- src: string;
806
- manifestParsed: boolean;
807
- retryCount?: number;
808
- source: "hls" | "native" | "unsupported";
809
- };
810
- type PlaybackErrorDetail = {
811
- source: PlaybackErrorContext["source"];
812
- kind: PlaybackErrorKind;
813
- type?: string;
814
- details?: string;
815
- fatal?: boolean;
816
- httpStatus?: number;
817
- url?: string;
818
- reason?: string;
819
- errorMessage?: string;
820
- mediaErrorCode?: number;
821
- mediaErrorName?: string;
822
- context: PlaybackErrorContext;
823
- };
824
- type DescribePlaybackErrorInput = {
825
- source: "hls";
826
- type?: string;
827
- details?: string;
828
- fatal: boolean;
829
- url?: string;
830
- response?: {
831
- code?: number;
832
- text?: string;
833
- };
834
- reason?: string;
835
- error?: unknown;
836
- context: PlaybackErrorContext;
837
- } | {
838
- source: "native";
839
- mediaError?: MediaError | null;
840
- context: PlaybackErrorContext;
841
- } | {
842
- source: "unsupported";
843
- context: PlaybackErrorContext;
844
- };
845
- type DescribedPlaybackError = {
846
- /** Machine-readable one-line summary for logs. */
847
- summary: string;
848
- /** Coarse category for choosing a localized message. */
849
- kind: PlaybackErrorKind;
850
- detail: PlaybackErrorDetail;
851
- };
852
- /**
853
- * Soft (non-fatal) report for an automatic A/V resync. Apps should treat this
854
- * like other non-fatal playback events (breadcrumb / warn), never as a hard
855
- * error UI — the player recovers in place.
856
- */
857
- declare function describeAvResync(input: {
858
- lagSeconds: number;
859
- context: PlaybackErrorContext;
860
- }): DescribedPlaybackError;
861
- declare function describePlaybackError(input: DescribePlaybackErrorInput): DescribedPlaybackError;
862
-
863
- interface PlaybackStats {
864
- /** Concurrent live viewers (meaningful in live mode). */
865
- viewers?: number;
866
- /** Cumulative VOD reproductions. */
867
- views?: number;
868
- }
869
- interface UsePlaybackStatsOptions {
870
- /** Poll interval in ms. Default 15000. */
871
- intervalMs?: number;
872
- /** When false, polling is paused. Default true. */
873
- enabled?: boolean;
874
- }
875
- /**
876
- * Polls a playback-stats endpoint (media-svc `GET /playback/:mediaId/stats`)
877
- * and returns `{ viewers, views }`. Plain `fetch`, zero dependencies, so wiring
878
- * it into an app is a one-liner. Fails silently (stats are non-critical); the
879
- * last successful value is retained across transient errors.
880
- */
881
- declare function usePlaybackStats(statsUrl: string | null | undefined, { intervalMs, enabled }?: UsePlaybackStatsOptions): PlaybackStats;
882
-
883
- interface VideoPlayerLabels {
884
- play?: string;
885
- pause?: string;
886
- mute?: string;
887
- unmute?: string;
888
- enterFullscreen?: string;
889
- exitFullscreen?: string;
890
- pictureInPicture?: string;
891
- settings?: string;
892
- quality?: string;
893
- auto?: string;
894
- speed?: string;
895
- live?: string;
896
- goLive?: string;
897
- tapToUnmute?: string;
898
- loading?: string;
899
- waiting?: string;
900
- retry?: string;
901
- /** Messages by error kind; a generic fallback covers the rest. */
902
- errorUnavailable?: string;
903
- errorNetwork?: string;
904
- errorMedia?: string;
905
- errorUnsupported?: string;
906
- errorGeneric?: string;
907
- /** `(n) => "N watching"`. */
908
- formatViewers?: (n: number) => string;
909
- /** `(n) => "N views"`. */
910
- formatViews?: (n: number) => string;
911
- }
912
- interface VideoPlayerProps {
913
- src: string;
914
- mode: "live" | "vod";
915
- /** Cover image; renders a click-to-play state before attaching HLS. */
916
- poster?: string;
917
- autoPlay?: boolean;
918
- muted?: boolean;
919
- /** Presentational stats (see `usePlaybackStats`). */
920
- stats?: PlaybackStats;
921
- labels?: VideoPlayerLabels;
922
- /** Show the resolution picker when multiple levels exist. Default true. */
923
- showQualitySelector?: boolean;
924
- /**
925
- * When true, force-pauses the media element. Clearing it does not
926
- * auto-resume — the user must press play again.
927
- */
928
- paused?: boolean;
929
- onPlayingChange?: (playing: boolean) => void;
930
- /** Fires once, the first time playback actually starts — wire your view
931
- * beacon here. */
932
- onFirstPlay?: () => void;
933
- onError?: (error: DescribedPlaybackError) => void;
934
- /**
935
- * Default `aspect-video` for feed cards. Use `contain` in fullscreen
936
- * viewers so portrait sources fill the pane with object-fit and controls
937
- * stay at the bottom of the pane.
938
- */
939
- fit?: "aspect-video" | "contain";
940
- className?: string;
941
- }
942
- /**
943
- * Standardized HLS video player with a fully custom control bar (no native
944
- * `controls`): click-to-play poster, play/pause, mute + volume, resolution
945
- * picker, playback speed (VOD), Picture-in-Picture, fullscreen, a VOD seekbar
946
- * with buffered ranges, and a live badge (no seekbar) with a "go live"
947
- * affordance. `stats` renders live viewer / VOD reproduction counts.
948
- *
949
- * hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
950
- */
951
- declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, fit, className, }: VideoPlayerProps): React.JSX.Element;
952
-
953
- interface FeedVideoPlayerProps extends VideoPlayerProps {
954
- /** Stable id for exclusive playback (typically the feed post id). */
955
- playbackId: string;
956
- }
957
- /**
958
- * Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
959
- * playback autopauses when the card leaves the viewport or the tab is hidden.
960
- */
961
- declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, fit, className, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
962
-
963
- interface UseFeedExclusivePlaybackResult {
964
- containerRef: React.RefObject<HTMLDivElement | null>;
965
- paused: boolean;
966
- onPlayingChange: (playing: boolean) => void;
967
- }
968
- /**
969
- * Coordinates exclusive feed playback: claims the global slot on play,
970
- * force-pauses when another feed video plays, when the player leaves the
971
- * viewport, or when the tab is hidden. Picture-in-Picture is exempt from
972
- * scroll/visibility autopause.
973
- */
974
- declare function useFeedExclusivePlayback(playbackId: string): UseFeedExclusivePlaybackResult;
975
-
976
- type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
977
- /** Autoplay overlay state once the manifest is parsed. */
978
- type AutoplayState = "none" | "playing" | "muted" | "blocked";
979
- interface QualityLevel {
980
- /** hls.js level index. */
981
- index: number;
982
- /** Vertical resolution, e.g. 720. */
983
- height: number;
984
- }
985
- interface UseHlsPlaybackOptions {
986
- src: string;
987
- mode: HlsPlayerMode;
988
- /** When false, nothing is attached/loaded (poster gating). */
989
- active: boolean;
990
- /** Attempt autoplay once the manifest is ready. Live always autoplays. */
991
- autoPlay?: boolean;
992
- /** Start muted (independent of the autoplay cascade). */
993
- muted?: boolean;
994
- onError?: (error: DescribedPlaybackError) => void;
995
- onPlayingChange?: (playing: boolean) => void;
996
- }
997
- interface UseHlsPlaybackResult {
998
- videoRef: React.RefObject<HTMLVideoElement | null>;
999
- state: PlaybackState;
1000
- /** Available quality levels (empty for native HLS / single-level). */
1001
- qualities: QualityLevel[];
1002
- /** Selected level index, or -1 for automatic. */
1003
- activeLevel: number;
1004
- setLevel: (index: number) => void;
1005
- autoplayState: AutoplayState;
1006
- /** The classified error, when `state === "error"`. */
1007
- error: DescribedPlaybackError | null;
1008
- retry: () => void;
1009
- }
1010
- /**
1011
- * Attaches hls.js (loaded on demand via dynamic import) or native HLS to a
1012
- * `<video>` element and exposes the state a custom control bar needs. Ported
1013
- * from the app's production `HlsPlayer` effect, minus the built-in UI and
1014
- * Sentry: errors are classified and handed to `onError`.
1015
- */
1016
- declare function useHlsPlayback({ src, mode, active, autoPlay, muted, onError, onPlayingChange, }: UseHlsPlaybackOptions): UseHlsPlaybackResult;
1017
-
1018
- /** Retry transient live-edge 404s; hls.js skips all 4xx by default. */
1019
- declare function shouldRetryLiveEdge404(retryConfig: RetryConfig | null | undefined, retryCount: number, _isTimeout: boolean, loaderResponse: LoaderResponse | undefined, defaultRetry: boolean): boolean;
1020
- /**
1021
- * HLS.js options tuned for live playback through a Cloudflare R2 custom domain.
1022
- * Ported from the app's production player: stays 4 segments (~8s) behind the
1023
- * live edge so transient upload lag never reaches the playhead, and retries the
1024
- * 404s that appear while a new segment is still being written.
1025
- */
1026
- declare function createLiveHlsConfig(): Partial<HlsConfig>;
1027
- /**
1028
- * HLS.js options for on-demand (VOD) playback. No live-edge cushion; enables
1029
- * the worker and lets hls.js manage the buffer with its defaults, which are
1030
- * well suited to seekable recordings.
1031
- */
1032
- declare function createVodHlsConfig(): Partial<HlsConfig>;
1033
-
1034
789
  /**
1035
790
  * Debounces a value — useful for ZIP lookups and autocomplete queries.
1036
791
  */
@@ -1531,7 +1286,7 @@ type MessageComposerProps = Omit<React.ComponentProps<"textarea">, "children" |
1531
1286
  */
1532
1287
  declare const MessageComposer: React.ForwardRefExoticComponent<Omit<MessageComposerProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
1533
1288
 
1534
- type ConversationKind = "pharma_support" | "org_support" | "member_support";
1289
+ type ConversationKind = "ads_support" | "org_support" | "member_support";
1535
1290
  type SupportConversation = {
1536
1291
  id: string;
1537
1292
  kind: ConversationKind;
@@ -1687,4 +1442,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1687
1442
 
1688
1443
  declare function cn(...inputs: ClassValue[]): string;
1689
1444
 
1690
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, BrandX, type BrandXProps, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, 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, FieldMessage, type FieldMessageProps, 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, MediaCarousel, type MediaCarouselItem, type MediaCarouselLabels, type MediaCarouselPdfRenderProps, type MediaCarouselProps, MediaViewerDialog, type MediaViewerDialogLabels, type MediaViewerDialogProps, 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, PaymentIcon, type PaymentIconFormat, type PaymentIconProps, 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, SafeImage, type SafeImageProps, type ScrollFadeXEdges, type ScrollMark, type ScrollRestorationContextValue, ScrollRestorationProvider, type ScrollRestorationProviderProps, 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, type SwipeDirection, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, type UseZoomPanGesturesOptions, type UseZoomPanGesturesResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, ZOOM_PAN_MAX_SCALE, ZOOM_PAN_MIN_SCALE, ZOOM_PAN_SWIPE_COMMIT_PX, ZOOM_PAN_SWIPE_SNAP_MS, type ZoomPanTransform, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, formatPaymentCardBrand, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, prefersReducedMotion, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useRestorableState, useScrollFadeXEdges, useScrollRestorationContext, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional, useZoomPanGestures, zoomToward };
1445
+ export { AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, BrandX, type BrandXProps, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, DropdownMenuItem, DropdownMenuSeparator, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, 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, FieldMessage, type FieldMessageProps, type FindOrCreateConversationInput, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, MediaCarousel, type MediaCarouselItem, type MediaCarouselLabels, type MediaCarouselPdfRenderProps, type MediaCarouselProps, MediaViewerDialog, type MediaViewerDialogLabels, type MediaViewerDialogProps, 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, PaymentIcon, type PaymentIconFormat, type PaymentIconProps, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type ProfessionalVerificationStatus, type RealtimeEvent, SafeImage, type SafeImageProps, type ScrollFadeXEdges, type ScrollMark, type ScrollRestorationContextValue, ScrollRestorationProvider, type ScrollRestorationProviderProps, 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, type SwipeDirection, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, type UseZoomPanGesturesOptions, type UseZoomPanGesturesResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, ZOOM_PAN_MAX_SCALE, ZOOM_PAN_MIN_SCALE, ZOOM_PAN_SWIPE_COMMIT_PX, ZOOM_PAN_SWIPE_SNAP_MS, type ZoomPanTransform, bubbleVariants, cn, createSupportChatClient, defaultLanguages, formatPaymentCardBrand, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, prefersReducedMotion, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useLanguageContext, useMediaQuery, useRealtimeChannel, useRestorableState, useScrollFadeXEdges, useScrollRestorationContext, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional, useZoomPanGestures, zoomToward };
package/dist/index.d.ts CHANGED
@@ -4,7 +4,6 @@ import * as class_variance_authority_types from 'class-variance-authority/types'
4
4
  import { VariantProps } from 'class-variance-authority';
5
5
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
6
6
  import * as PopoverPrimitive from '@radix-ui/react-popover';
7
- import { HlsConfig, RetryConfig, LoaderResponse } from 'hls.js';
8
7
  import * as RPNInput from 'react-phone-number-input';
9
8
  import { MessageScroller as MessageScroller$1 } from '@shadcn/react/message-scroller';
10
9
  export { useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from '@shadcn/react/message-scroller';
@@ -787,250 +786,6 @@ declare function insertAtCaret(element: {
787
786
  caret: number;
788
787
  };
789
788
 
790
- /**
791
- * Playback error description, ported from the app's HLS player but stripped of
792
- * Sentry. `@sesionario/blocks` must stay reporting-agnostic: the player surfaces
793
- * a {@link DescribedPlaybackError} through an optional `onError` prop so each
794
- * app can wire its own reporting (Sentry, Datadog, console, …).
795
- *
796
- * User-facing messages are intentionally NOT baked in here — they come from the
797
- * player's `labels` prop so they stay translatable. This module only classifies
798
- * the error and produces a machine-readable summary + detail for logging.
799
- */
800
- type HlsPlayerMode = "live" | "vod";
801
- /** Coarse category the player uses to pick the right localized message. */
802
- type PlaybackErrorKind = "unavailable" | "network" | "media" | "unsupported" | "resync" | "generic";
803
- type PlaybackErrorContext = {
804
- mode: HlsPlayerMode;
805
- src: string;
806
- manifestParsed: boolean;
807
- retryCount?: number;
808
- source: "hls" | "native" | "unsupported";
809
- };
810
- type PlaybackErrorDetail = {
811
- source: PlaybackErrorContext["source"];
812
- kind: PlaybackErrorKind;
813
- type?: string;
814
- details?: string;
815
- fatal?: boolean;
816
- httpStatus?: number;
817
- url?: string;
818
- reason?: string;
819
- errorMessage?: string;
820
- mediaErrorCode?: number;
821
- mediaErrorName?: string;
822
- context: PlaybackErrorContext;
823
- };
824
- type DescribePlaybackErrorInput = {
825
- source: "hls";
826
- type?: string;
827
- details?: string;
828
- fatal: boolean;
829
- url?: string;
830
- response?: {
831
- code?: number;
832
- text?: string;
833
- };
834
- reason?: string;
835
- error?: unknown;
836
- context: PlaybackErrorContext;
837
- } | {
838
- source: "native";
839
- mediaError?: MediaError | null;
840
- context: PlaybackErrorContext;
841
- } | {
842
- source: "unsupported";
843
- context: PlaybackErrorContext;
844
- };
845
- type DescribedPlaybackError = {
846
- /** Machine-readable one-line summary for logs. */
847
- summary: string;
848
- /** Coarse category for choosing a localized message. */
849
- kind: PlaybackErrorKind;
850
- detail: PlaybackErrorDetail;
851
- };
852
- /**
853
- * Soft (non-fatal) report for an automatic A/V resync. Apps should treat this
854
- * like other non-fatal playback events (breadcrumb / warn), never as a hard
855
- * error UI — the player recovers in place.
856
- */
857
- declare function describeAvResync(input: {
858
- lagSeconds: number;
859
- context: PlaybackErrorContext;
860
- }): DescribedPlaybackError;
861
- declare function describePlaybackError(input: DescribePlaybackErrorInput): DescribedPlaybackError;
862
-
863
- interface PlaybackStats {
864
- /** Concurrent live viewers (meaningful in live mode). */
865
- viewers?: number;
866
- /** Cumulative VOD reproductions. */
867
- views?: number;
868
- }
869
- interface UsePlaybackStatsOptions {
870
- /** Poll interval in ms. Default 15000. */
871
- intervalMs?: number;
872
- /** When false, polling is paused. Default true. */
873
- enabled?: boolean;
874
- }
875
- /**
876
- * Polls a playback-stats endpoint (media-svc `GET /playback/:mediaId/stats`)
877
- * and returns `{ viewers, views }`. Plain `fetch`, zero dependencies, so wiring
878
- * it into an app is a one-liner. Fails silently (stats are non-critical); the
879
- * last successful value is retained across transient errors.
880
- */
881
- declare function usePlaybackStats(statsUrl: string | null | undefined, { intervalMs, enabled }?: UsePlaybackStatsOptions): PlaybackStats;
882
-
883
- interface VideoPlayerLabels {
884
- play?: string;
885
- pause?: string;
886
- mute?: string;
887
- unmute?: string;
888
- enterFullscreen?: string;
889
- exitFullscreen?: string;
890
- pictureInPicture?: string;
891
- settings?: string;
892
- quality?: string;
893
- auto?: string;
894
- speed?: string;
895
- live?: string;
896
- goLive?: string;
897
- tapToUnmute?: string;
898
- loading?: string;
899
- waiting?: string;
900
- retry?: string;
901
- /** Messages by error kind; a generic fallback covers the rest. */
902
- errorUnavailable?: string;
903
- errorNetwork?: string;
904
- errorMedia?: string;
905
- errorUnsupported?: string;
906
- errorGeneric?: string;
907
- /** `(n) => "N watching"`. */
908
- formatViewers?: (n: number) => string;
909
- /** `(n) => "N views"`. */
910
- formatViews?: (n: number) => string;
911
- }
912
- interface VideoPlayerProps {
913
- src: string;
914
- mode: "live" | "vod";
915
- /** Cover image; renders a click-to-play state before attaching HLS. */
916
- poster?: string;
917
- autoPlay?: boolean;
918
- muted?: boolean;
919
- /** Presentational stats (see `usePlaybackStats`). */
920
- stats?: PlaybackStats;
921
- labels?: VideoPlayerLabels;
922
- /** Show the resolution picker when multiple levels exist. Default true. */
923
- showQualitySelector?: boolean;
924
- /**
925
- * When true, force-pauses the media element. Clearing it does not
926
- * auto-resume — the user must press play again.
927
- */
928
- paused?: boolean;
929
- onPlayingChange?: (playing: boolean) => void;
930
- /** Fires once, the first time playback actually starts — wire your view
931
- * beacon here. */
932
- onFirstPlay?: () => void;
933
- onError?: (error: DescribedPlaybackError) => void;
934
- /**
935
- * Default `aspect-video` for feed cards. Use `contain` in fullscreen
936
- * viewers so portrait sources fill the pane with object-fit and controls
937
- * stay at the bottom of the pane.
938
- */
939
- fit?: "aspect-video" | "contain";
940
- className?: string;
941
- }
942
- /**
943
- * Standardized HLS video player with a fully custom control bar (no native
944
- * `controls`): click-to-play poster, play/pause, mute + volume, resolution
945
- * picker, playback speed (VOD), Picture-in-Picture, fullscreen, a VOD seekbar
946
- * with buffered ranges, and a live badge (no seekbar) with a "go live"
947
- * affordance. `stats` renders live viewer / VOD reproduction counts.
948
- *
949
- * hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
950
- */
951
- declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, fit, className, }: VideoPlayerProps): React.JSX.Element;
952
-
953
- interface FeedVideoPlayerProps extends VideoPlayerProps {
954
- /** Stable id for exclusive playback (typically the feed post id). */
955
- playbackId: string;
956
- }
957
- /**
958
- * Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
959
- * playback autopauses when the card leaves the viewport or the tab is hidden.
960
- */
961
- declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, fit, className, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
962
-
963
- interface UseFeedExclusivePlaybackResult {
964
- containerRef: React.RefObject<HTMLDivElement | null>;
965
- paused: boolean;
966
- onPlayingChange: (playing: boolean) => void;
967
- }
968
- /**
969
- * Coordinates exclusive feed playback: claims the global slot on play,
970
- * force-pauses when another feed video plays, when the player leaves the
971
- * viewport, or when the tab is hidden. Picture-in-Picture is exempt from
972
- * scroll/visibility autopause.
973
- */
974
- declare function useFeedExclusivePlayback(playbackId: string): UseFeedExclusivePlaybackResult;
975
-
976
- type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
977
- /** Autoplay overlay state once the manifest is parsed. */
978
- type AutoplayState = "none" | "playing" | "muted" | "blocked";
979
- interface QualityLevel {
980
- /** hls.js level index. */
981
- index: number;
982
- /** Vertical resolution, e.g. 720. */
983
- height: number;
984
- }
985
- interface UseHlsPlaybackOptions {
986
- src: string;
987
- mode: HlsPlayerMode;
988
- /** When false, nothing is attached/loaded (poster gating). */
989
- active: boolean;
990
- /** Attempt autoplay once the manifest is ready. Live always autoplays. */
991
- autoPlay?: boolean;
992
- /** Start muted (independent of the autoplay cascade). */
993
- muted?: boolean;
994
- onError?: (error: DescribedPlaybackError) => void;
995
- onPlayingChange?: (playing: boolean) => void;
996
- }
997
- interface UseHlsPlaybackResult {
998
- videoRef: React.RefObject<HTMLVideoElement | null>;
999
- state: PlaybackState;
1000
- /** Available quality levels (empty for native HLS / single-level). */
1001
- qualities: QualityLevel[];
1002
- /** Selected level index, or -1 for automatic. */
1003
- activeLevel: number;
1004
- setLevel: (index: number) => void;
1005
- autoplayState: AutoplayState;
1006
- /** The classified error, when `state === "error"`. */
1007
- error: DescribedPlaybackError | null;
1008
- retry: () => void;
1009
- }
1010
- /**
1011
- * Attaches hls.js (loaded on demand via dynamic import) or native HLS to a
1012
- * `<video>` element and exposes the state a custom control bar needs. Ported
1013
- * from the app's production `HlsPlayer` effect, minus the built-in UI and
1014
- * Sentry: errors are classified and handed to `onError`.
1015
- */
1016
- declare function useHlsPlayback({ src, mode, active, autoPlay, muted, onError, onPlayingChange, }: UseHlsPlaybackOptions): UseHlsPlaybackResult;
1017
-
1018
- /** Retry transient live-edge 404s; hls.js skips all 4xx by default. */
1019
- declare function shouldRetryLiveEdge404(retryConfig: RetryConfig | null | undefined, retryCount: number, _isTimeout: boolean, loaderResponse: LoaderResponse | undefined, defaultRetry: boolean): boolean;
1020
- /**
1021
- * HLS.js options tuned for live playback through a Cloudflare R2 custom domain.
1022
- * Ported from the app's production player: stays 4 segments (~8s) behind the
1023
- * live edge so transient upload lag never reaches the playhead, and retries the
1024
- * 404s that appear while a new segment is still being written.
1025
- */
1026
- declare function createLiveHlsConfig(): Partial<HlsConfig>;
1027
- /**
1028
- * HLS.js options for on-demand (VOD) playback. No live-edge cushion; enables
1029
- * the worker and lets hls.js manage the buffer with its defaults, which are
1030
- * well suited to seekable recordings.
1031
- */
1032
- declare function createVodHlsConfig(): Partial<HlsConfig>;
1033
-
1034
789
  /**
1035
790
  * Debounces a value — useful for ZIP lookups and autocomplete queries.
1036
791
  */
@@ -1531,7 +1286,7 @@ type MessageComposerProps = Omit<React.ComponentProps<"textarea">, "children" |
1531
1286
  */
1532
1287
  declare const MessageComposer: React.ForwardRefExoticComponent<Omit<MessageComposerProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
1533
1288
 
1534
- type ConversationKind = "pharma_support" | "org_support" | "member_support";
1289
+ type ConversationKind = "ads_support" | "org_support" | "member_support";
1535
1290
  type SupportConversation = {
1536
1291
  id: string;
1537
1292
  kind: ConversationKind;
@@ -1687,4 +1442,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1687
1442
 
1688
1443
  declare function cn(...inputs: ClassValue[]): string;
1689
1444
 
1690
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, BrandX, type BrandXProps, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, 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, FieldMessage, type FieldMessageProps, 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, MediaCarousel, type MediaCarouselItem, type MediaCarouselLabels, type MediaCarouselPdfRenderProps, type MediaCarouselProps, MediaViewerDialog, type MediaViewerDialogLabels, type MediaViewerDialogProps, 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, PaymentIcon, type PaymentIconFormat, type PaymentIconProps, 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, SafeImage, type SafeImageProps, type ScrollFadeXEdges, type ScrollMark, type ScrollRestorationContextValue, ScrollRestorationProvider, type ScrollRestorationProviderProps, 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, type SwipeDirection, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseFeedExclusivePlaybackResult, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, type UseZoomPanGesturesOptions, type UseZoomPanGesturesResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, ZOOM_PAN_MAX_SCALE, ZOOM_PAN_MIN_SCALE, ZOOM_PAN_SWIPE_COMMIT_PX, ZOOM_PAN_SWIPE_SNAP_MS, type ZoomPanTransform, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, formatPaymentCardBrand, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, prefersReducedMotion, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useRestorableState, useScrollFadeXEdges, useScrollRestorationContext, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional, useZoomPanGestures, zoomToward };
1445
+ export { AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, BrandX, type BrandXProps, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, DEFAULT_EDITABLE_SECTION_LABELS, DataList, DataListItem, type DataListItemProps, type DataListProps, DropdownMenuItem, DropdownMenuSeparator, EditableSection, type EditableSectionLabels, type EditableSectionMode, type EditableSectionProps, type EditableSectionSlots, 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, FieldMessage, type FieldMessageProps, type FindOrCreateConversationInput, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, MediaCarousel, type MediaCarouselItem, type MediaCarouselLabels, type MediaCarouselPdfRenderProps, type MediaCarouselProps, MediaViewerDialog, type MediaViewerDialogLabels, type MediaViewerDialogProps, 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, PaymentIcon, type PaymentIconFormat, type PaymentIconProps, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type ProfessionalVerificationStatus, type RealtimeEvent, SafeImage, type SafeImageProps, type ScrollFadeXEdges, type ScrollMark, type ScrollRestorationContextValue, ScrollRestorationProvider, type ScrollRestorationProviderProps, 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, type SwipeDirection, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseEditableSectionOptions, type UseEditableSectionResult, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, type UseZoomPanGesturesOptions, type UseZoomPanGesturesResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, ZOOM_PAN_MAX_SCALE, ZOOM_PAN_MIN_SCALE, ZOOM_PAN_SWIPE_COMMIT_PX, ZOOM_PAN_SWIPE_SNAP_MS, type ZoomPanTransform, bubbleVariants, cn, createSupportChatClient, defaultLanguages, formatPaymentCardBrand, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, prefersReducedMotion, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useLanguageContext, useMediaQuery, useRealtimeChannel, useRestorableState, useScrollFadeXEdges, useScrollRestorationContext, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional, useZoomPanGestures, zoomToward };