@sesionario/blocks 1.17.1 → 1.19.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/README.md +13 -0
- package/dist/index.cjs +171 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +61 -2
- package/dist/index.d.ts +61 -2
- package/dist/index.js +166 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -7,6 +7,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
7
7
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
8
8
|
import { HlsConfig, RetryConfig, LoaderResponse } from 'hls.js';
|
|
9
9
|
import * as RPNInput from 'react-phone-number-input';
|
|
10
|
+
import { PaymentType } from 'react-svg-credit-card-payment-icons';
|
|
10
11
|
import { MessageScroller as MessageScroller$1 } from '@shadcn/react/message-scroller';
|
|
11
12
|
export { useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from '@shadcn/react/message-scroller';
|
|
12
13
|
import { ClassValue } from 'clsx';
|
|
@@ -676,6 +677,11 @@ interface VideoPlayerProps {
|
|
|
676
677
|
labels?: VideoPlayerLabels;
|
|
677
678
|
/** Show the resolution picker when multiple levels exist. Default true. */
|
|
678
679
|
showQualitySelector?: boolean;
|
|
680
|
+
/**
|
|
681
|
+
* When true, force-pauses the media element. Clearing it does not
|
|
682
|
+
* auto-resume — the user must press play again.
|
|
683
|
+
*/
|
|
684
|
+
paused?: boolean;
|
|
679
685
|
onPlayingChange?: (playing: boolean) => void;
|
|
680
686
|
/** Fires once, the first time playback actually starts — wire your view
|
|
681
687
|
* beacon here. */
|
|
@@ -692,7 +698,30 @@ interface VideoPlayerProps {
|
|
|
692
698
|
*
|
|
693
699
|
* hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
|
|
694
700
|
*/
|
|
695
|
-
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
701
|
+
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
702
|
+
|
|
703
|
+
interface FeedVideoPlayerProps extends VideoPlayerProps {
|
|
704
|
+
/** Stable id for exclusive playback (typically the feed post id). */
|
|
705
|
+
playbackId: string;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
|
|
709
|
+
* playback autopauses when the card leaves the viewport or the tab is hidden.
|
|
710
|
+
*/
|
|
711
|
+
declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
|
|
712
|
+
|
|
713
|
+
interface UseFeedExclusivePlaybackResult {
|
|
714
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
715
|
+
paused: boolean;
|
|
716
|
+
onPlayingChange: (playing: boolean) => void;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Coordinates exclusive feed playback: claims the global slot on play,
|
|
720
|
+
* force-pauses when another feed video plays, when the player leaves the
|
|
721
|
+
* viewport, or when the tab is hidden. Picture-in-Picture is exempt from
|
|
722
|
+
* scroll/visibility autopause.
|
|
723
|
+
*/
|
|
724
|
+
declare function useFeedExclusivePlayback(playbackId: string): UseFeedExclusivePlaybackResult;
|
|
696
725
|
|
|
697
726
|
type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
|
|
698
727
|
/** Autoplay overlay state once the manifest is parsed. */
|
|
@@ -1002,6 +1031,36 @@ interface MexicoMapProps {
|
|
|
1002
1031
|
}
|
|
1003
1032
|
declare function MexicoMap({ selected, onToggle, className }: MexicoMapProps): React.JSX.Element;
|
|
1004
1033
|
|
|
1034
|
+
type PaymentIconFormat = "flat" | "flatRounded" | "logo" | "logoBorder" | "mono" | "monoOutline";
|
|
1035
|
+
interface PaymentIconProps {
|
|
1036
|
+
/** Stripe `card.brand` (e.g. `"amex"`). Null/unknown → Generic. */
|
|
1037
|
+
brand: string | null | undefined;
|
|
1038
|
+
/** Visual style from react-svg-credit-card-payment-icons. */
|
|
1039
|
+
format?: PaymentIconFormat;
|
|
1040
|
+
width?: number;
|
|
1041
|
+
height?: number;
|
|
1042
|
+
className?: string;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Stripe-friendly payment brand mark (wraps react-svg-credit-card-payment-icons).
|
|
1046
|
+
*
|
|
1047
|
+
* @example
|
|
1048
|
+
* ```tsx
|
|
1049
|
+
* <PaymentIcon brand="amex" />
|
|
1050
|
+
* <PaymentIcon brand={pm.cardBrand} format="flat" width={40} />
|
|
1051
|
+
* ```
|
|
1052
|
+
*/
|
|
1053
|
+
declare function PaymentIcon({ brand, format, width, height, className, }: PaymentIconProps): React.JSX.Element;
|
|
1054
|
+
|
|
1055
|
+
declare function normalizePaymentCardBrand(brand: string | null | undefined): string | null;
|
|
1056
|
+
/** Human-readable brand for UI (falls back to a tidy capitalization). */
|
|
1057
|
+
declare function formatPaymentCardBrand(brand: string | null | undefined): string;
|
|
1058
|
+
/**
|
|
1059
|
+
* Maps a Stripe `card.brand` (or similar) to an upstream payment-icon type.
|
|
1060
|
+
* Unknown / empty brands resolve to `Generic`.
|
|
1061
|
+
*/
|
|
1062
|
+
declare function paymentTypeFromStripeBrand(brand: string | null | undefined): PaymentType;
|
|
1063
|
+
|
|
1005
1064
|
declare const MEXICO_STATE_PATHS: Record<MexicoStateId, string>;
|
|
1006
1065
|
|
|
1007
1066
|
declare function MessageGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -1261,4 +1320,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
|
|
|
1261
1320
|
|
|
1262
1321
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1263
1322
|
|
|
1264
|
-
export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
1323
|
+
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, 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, 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, formatPaymentCardBrand, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentTypeFromStripeBrand, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
|
7
7
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
8
8
|
import { HlsConfig, RetryConfig, LoaderResponse } from 'hls.js';
|
|
9
9
|
import * as RPNInput from 'react-phone-number-input';
|
|
10
|
+
import { PaymentType } from 'react-svg-credit-card-payment-icons';
|
|
10
11
|
import { MessageScroller as MessageScroller$1 } from '@shadcn/react/message-scroller';
|
|
11
12
|
export { useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from '@shadcn/react/message-scroller';
|
|
12
13
|
import { ClassValue } from 'clsx';
|
|
@@ -676,6 +677,11 @@ interface VideoPlayerProps {
|
|
|
676
677
|
labels?: VideoPlayerLabels;
|
|
677
678
|
/** Show the resolution picker when multiple levels exist. Default true. */
|
|
678
679
|
showQualitySelector?: boolean;
|
|
680
|
+
/**
|
|
681
|
+
* When true, force-pauses the media element. Clearing it does not
|
|
682
|
+
* auto-resume — the user must press play again.
|
|
683
|
+
*/
|
|
684
|
+
paused?: boolean;
|
|
679
685
|
onPlayingChange?: (playing: boolean) => void;
|
|
680
686
|
/** Fires once, the first time playback actually starts — wire your view
|
|
681
687
|
* beacon here. */
|
|
@@ -692,7 +698,30 @@ interface VideoPlayerProps {
|
|
|
692
698
|
*
|
|
693
699
|
* hls.js is a peer dependency loaded on demand; see {@link useHlsPlayback}.
|
|
694
700
|
*/
|
|
695
|
-
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
701
|
+
declare function VideoPlayer({ src, mode, poster, autoPlay, muted, stats, labels, showQualitySelector, paused, onPlayingChange, onFirstPlay, onError, className, }: VideoPlayerProps): React.JSX.Element;
|
|
702
|
+
|
|
703
|
+
interface FeedVideoPlayerProps extends VideoPlayerProps {
|
|
704
|
+
/** Stable id for exclusive playback (typically the feed post id). */
|
|
705
|
+
playbackId: string;
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Feed-scoped {@link VideoPlayer}: only one feed video plays at a time, and
|
|
709
|
+
* playback autopauses when the card leaves the viewport or the tab is hidden.
|
|
710
|
+
*/
|
|
711
|
+
declare function FeedVideoPlayer({ playbackId, onPlayingChange, paused: pausedProp, ...playerProps }: FeedVideoPlayerProps): React.JSX.Element;
|
|
712
|
+
|
|
713
|
+
interface UseFeedExclusivePlaybackResult {
|
|
714
|
+
containerRef: React.RefObject<HTMLDivElement | null>;
|
|
715
|
+
paused: boolean;
|
|
716
|
+
onPlayingChange: (playing: boolean) => void;
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Coordinates exclusive feed playback: claims the global slot on play,
|
|
720
|
+
* force-pauses when another feed video plays, when the player leaves the
|
|
721
|
+
* viewport, or when the tab is hidden. Picture-in-Picture is exempt from
|
|
722
|
+
* scroll/visibility autopause.
|
|
723
|
+
*/
|
|
724
|
+
declare function useFeedExclusivePlayback(playbackId: string): UseFeedExclusivePlaybackResult;
|
|
696
725
|
|
|
697
726
|
type PlaybackState = "idle" | "loading" | "ready" | "waiting" | "error";
|
|
698
727
|
/** Autoplay overlay state once the manifest is parsed. */
|
|
@@ -1002,6 +1031,36 @@ interface MexicoMapProps {
|
|
|
1002
1031
|
}
|
|
1003
1032
|
declare function MexicoMap({ selected, onToggle, className }: MexicoMapProps): React.JSX.Element;
|
|
1004
1033
|
|
|
1034
|
+
type PaymentIconFormat = "flat" | "flatRounded" | "logo" | "logoBorder" | "mono" | "monoOutline";
|
|
1035
|
+
interface PaymentIconProps {
|
|
1036
|
+
/** Stripe `card.brand` (e.g. `"amex"`). Null/unknown → Generic. */
|
|
1037
|
+
brand: string | null | undefined;
|
|
1038
|
+
/** Visual style from react-svg-credit-card-payment-icons. */
|
|
1039
|
+
format?: PaymentIconFormat;
|
|
1040
|
+
width?: number;
|
|
1041
|
+
height?: number;
|
|
1042
|
+
className?: string;
|
|
1043
|
+
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Stripe-friendly payment brand mark (wraps react-svg-credit-card-payment-icons).
|
|
1046
|
+
*
|
|
1047
|
+
* @example
|
|
1048
|
+
* ```tsx
|
|
1049
|
+
* <PaymentIcon brand="amex" />
|
|
1050
|
+
* <PaymentIcon brand={pm.cardBrand} format="flat" width={40} />
|
|
1051
|
+
* ```
|
|
1052
|
+
*/
|
|
1053
|
+
declare function PaymentIcon({ brand, format, width, height, className, }: PaymentIconProps): React.JSX.Element;
|
|
1054
|
+
|
|
1055
|
+
declare function normalizePaymentCardBrand(brand: string | null | undefined): string | null;
|
|
1056
|
+
/** Human-readable brand for UI (falls back to a tidy capitalization). */
|
|
1057
|
+
declare function formatPaymentCardBrand(brand: string | null | undefined): string;
|
|
1058
|
+
/**
|
|
1059
|
+
* Maps a Stripe `card.brand` (or similar) to an upstream payment-icon type.
|
|
1060
|
+
* Unknown / empty brands resolve to `Generic`.
|
|
1061
|
+
*/
|
|
1062
|
+
declare function paymentTypeFromStripeBrand(brand: string | null | undefined): PaymentType;
|
|
1063
|
+
|
|
1005
1064
|
declare const MEXICO_STATE_PATHS: Record<MexicoStateId, string>;
|
|
1006
1065
|
|
|
1007
1066
|
declare function MessageGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
@@ -1261,4 +1320,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
|
|
|
1261
1320
|
|
|
1262
1321
|
declare function cn(...inputs: ClassValue[]): string;
|
|
1263
1322
|
|
|
1264
|
-
export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type ConversationKind, type DescribedPlaybackError, DropdownMenuItem, DropdownMenuSeparator, type EmojiCategoryData, type EmojiCategoryKey, type EmojiDatum, EmojiInput, type EmojiInputProps, EmojiPicker, type EmojiPickerLabels, type EmojiPickerLocale, EmojiPickerPopover, type EmojiPickerPopoverProps, type EmojiPickerProps, type EmojiSkinTone, EmojiTextarea, type EmojiTextareaProps, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, type EmptyStateProps, EmptyTitle, ErrorState, ExpandableText, type ExpandableTextProps, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, ImageLightbox, type ImageLightboxLabels, type ImageLightboxProps, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, type MergedPlatformAccountOrg, Message, MessageAvatar, MessageComposer, type MessageComposerProps, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, type OpenThreadRequest, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, type PhoneInputProps, PlatformAccountMenu, type PlatformAccountMenuLabels, type PlatformAccountMenuOrg, type PlatformAccountMenuProps, type PlatformAccountMenuUrls, type PlatformAccountMenuUser, type PlatformAccountMenuVariant, PlatformNavbar, type PlatformNavbarProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, type RealtimeEvent, type ScrollFadeXEdges, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, SearchablePicker, type SearchablePickerCreateOption, type SearchablePickerLabels, type SearchablePickerMultipleProps, type SearchablePickerPinned, type SearchablePickerProps, type SearchablePickerSingleProps, type SupportChatClient, type SupportConversation, type SupportMessage, type SupportMessengerItem, type SupportMessengerLabels, SupportMessengerProvider, type SupportMessengerProviderProps, type SupportMessengerTab, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseRealtimeChannelOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
1323
|
+
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, 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, 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, formatPaymentCardBrand, fuzzyMatch, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentTypeFromStripeBrand, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { Command as Command$1 } from 'cmdk';
|
|
|
21
21
|
import * as RPNInput from 'react-phone-number-input';
|
|
22
22
|
import flags from 'react-phone-number-input/flags';
|
|
23
23
|
import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
|
|
24
|
+
import { PaymentIcon as PaymentIcon$1 } from 'react-svg-credit-card-payment-icons';
|
|
24
25
|
import { MessageScroller as MessageScroller$1 } from '@shadcn/react/message-scroller';
|
|
25
26
|
export { useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility } from '@shadcn/react/message-scroller';
|
|
26
27
|
|
|
@@ -3757,7 +3758,7 @@ function insertAtCaret(element, value, text) {
|
|
|
3757
3758
|
}
|
|
3758
3759
|
|
|
3759
3760
|
// src/components/emoji/emoji-field-shared.ts
|
|
3760
|
-
var emojiFieldWrapperClassName = "relative w-full rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 has-[:disabled]:opacity-50 dark:bg-input/30 dark:has-[[aria-invalid=true]]:ring-destructive/40";
|
|
3761
|
+
var emojiFieldWrapperClassName = "relative w-full rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] focus-within:border-ring focus-within:ring-[3px] focus-within:ring-ring/50 has-[[aria-invalid=true]]:border-destructive has-[[aria-invalid=true]]:ring-destructive/20 has-[[data-slot=textarea]:disabled]:opacity-50 has-[[data-slot=input]:disabled]:opacity-50 dark:bg-input/30 dark:has-[[aria-invalid=true]]:ring-destructive/40";
|
|
3761
3762
|
var emojiFieldResetClassName = "border-0 bg-transparent shadow-none focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent";
|
|
3762
3763
|
function mergeRefs(...refs) {
|
|
3763
3764
|
return (node) => {
|
|
@@ -4483,6 +4484,7 @@ function VideoPlayer({
|
|
|
4483
4484
|
stats,
|
|
4484
4485
|
labels,
|
|
4485
4486
|
showQualitySelector = true,
|
|
4487
|
+
paused = false,
|
|
4486
4488
|
onPlayingChange,
|
|
4487
4489
|
onFirstPlay,
|
|
4488
4490
|
onError,
|
|
@@ -4574,6 +4576,11 @@ function VideoPlayer({
|
|
|
4574
4576
|
video.removeEventListener("ratechange", onRate);
|
|
4575
4577
|
};
|
|
4576
4578
|
}, [videoRef, active, mode]);
|
|
4579
|
+
React7.useEffect(() => {
|
|
4580
|
+
const video = videoRef.current;
|
|
4581
|
+
if (!paused || !video || !isPlaying) return;
|
|
4582
|
+
video.pause();
|
|
4583
|
+
}, [paused, videoRef, isPlaying]);
|
|
4577
4584
|
React7.useEffect(() => {
|
|
4578
4585
|
setWebkitFullscreenSupported(hasWebkitVideoFullscreen(videoRef.current));
|
|
4579
4586
|
}, [videoRef, active]);
|
|
@@ -5081,6 +5088,106 @@ function MenuItem({
|
|
|
5081
5088
|
}
|
|
5082
5089
|
);
|
|
5083
5090
|
}
|
|
5091
|
+
|
|
5092
|
+
// src/components/video/feedPlaybackCoordinator.ts
|
|
5093
|
+
var players = /* @__PURE__ */ new Map();
|
|
5094
|
+
function registerFeedPlayer(id, pause) {
|
|
5095
|
+
players.set(id, pause);
|
|
5096
|
+
return () => {
|
|
5097
|
+
if (players.get(id) === pause) {
|
|
5098
|
+
players.delete(id);
|
|
5099
|
+
}
|
|
5100
|
+
};
|
|
5101
|
+
}
|
|
5102
|
+
function claimFeedPlaying(id) {
|
|
5103
|
+
for (const [otherId, pause] of players) {
|
|
5104
|
+
if (otherId !== id) pause();
|
|
5105
|
+
}
|
|
5106
|
+
}
|
|
5107
|
+
|
|
5108
|
+
// src/components/video/useFeedExclusivePlayback.ts
|
|
5109
|
+
var VISIBILITY_THRESHOLDS = [0, 0.5, 1];
|
|
5110
|
+
var MIN_VISIBLE_RATIO = 0.5;
|
|
5111
|
+
function videoInPictureInPicture(container) {
|
|
5112
|
+
if (typeof document === "undefined" || !container) return false;
|
|
5113
|
+
const pip = document.pictureInPictureElement;
|
|
5114
|
+
if (!pip) return false;
|
|
5115
|
+
return container.contains(pip);
|
|
5116
|
+
}
|
|
5117
|
+
function useFeedExclusivePlayback(playbackId) {
|
|
5118
|
+
const containerRef = React7.useRef(null);
|
|
5119
|
+
const [forcePaused, setForcePaused] = React7.useState(false);
|
|
5120
|
+
const requestPause = React7.useCallback(() => {
|
|
5121
|
+
if (videoInPictureInPicture(containerRef.current)) return;
|
|
5122
|
+
setForcePaused(true);
|
|
5123
|
+
}, []);
|
|
5124
|
+
React7.useEffect(() => {
|
|
5125
|
+
return registerFeedPlayer(playbackId, requestPause);
|
|
5126
|
+
}, [playbackId, requestPause]);
|
|
5127
|
+
React7.useEffect(() => {
|
|
5128
|
+
const node = containerRef.current;
|
|
5129
|
+
if (!node || typeof IntersectionObserver === "undefined") return;
|
|
5130
|
+
const observer = new IntersectionObserver(
|
|
5131
|
+
(entries) => {
|
|
5132
|
+
const entry = entries[0];
|
|
5133
|
+
if (!entry) return;
|
|
5134
|
+
if (!entry.isIntersecting || entry.intersectionRatio < MIN_VISIBLE_RATIO) {
|
|
5135
|
+
requestPause();
|
|
5136
|
+
}
|
|
5137
|
+
},
|
|
5138
|
+
{ threshold: [...VISIBILITY_THRESHOLDS] }
|
|
5139
|
+
);
|
|
5140
|
+
observer.observe(node);
|
|
5141
|
+
return () => observer.disconnect();
|
|
5142
|
+
}, [requestPause]);
|
|
5143
|
+
React7.useEffect(() => {
|
|
5144
|
+
const onVisibility = () => {
|
|
5145
|
+
if (document.hidden) requestPause();
|
|
5146
|
+
};
|
|
5147
|
+
document.addEventListener("visibilitychange", onVisibility);
|
|
5148
|
+
return () => document.removeEventListener("visibilitychange", onVisibility);
|
|
5149
|
+
}, [requestPause]);
|
|
5150
|
+
const onPlayingChange = React7.useCallback(
|
|
5151
|
+
(playing) => {
|
|
5152
|
+
if (!playing) return;
|
|
5153
|
+
setForcePaused(false);
|
|
5154
|
+
claimFeedPlaying(playbackId);
|
|
5155
|
+
},
|
|
5156
|
+
[playbackId]
|
|
5157
|
+
);
|
|
5158
|
+
return {
|
|
5159
|
+
containerRef,
|
|
5160
|
+
paused: forcePaused,
|
|
5161
|
+
onPlayingChange
|
|
5162
|
+
};
|
|
5163
|
+
}
|
|
5164
|
+
function FeedVideoPlayer({
|
|
5165
|
+
playbackId,
|
|
5166
|
+
onPlayingChange,
|
|
5167
|
+
paused: pausedProp,
|
|
5168
|
+
...playerProps
|
|
5169
|
+
}) {
|
|
5170
|
+
const {
|
|
5171
|
+
containerRef,
|
|
5172
|
+
paused: exclusivePaused,
|
|
5173
|
+
onPlayingChange: onExclusivePlayingChange
|
|
5174
|
+
} = useFeedExclusivePlayback(playbackId);
|
|
5175
|
+
const handlePlayingChange = React7.useCallback(
|
|
5176
|
+
(playing) => {
|
|
5177
|
+
onExclusivePlayingChange(playing);
|
|
5178
|
+
onPlayingChange?.(playing);
|
|
5179
|
+
},
|
|
5180
|
+
[onExclusivePlayingChange, onPlayingChange]
|
|
5181
|
+
);
|
|
5182
|
+
return /* @__PURE__ */ jsx("div", { ref: containerRef, "data-slot": "feed-video-player", children: /* @__PURE__ */ jsx(
|
|
5183
|
+
VideoPlayer,
|
|
5184
|
+
{
|
|
5185
|
+
...playerProps,
|
|
5186
|
+
paused: pausedProp || exclusivePaused,
|
|
5187
|
+
onPlayingChange: handlePlayingChange
|
|
5188
|
+
}
|
|
5189
|
+
) });
|
|
5190
|
+
}
|
|
5084
5191
|
function usePlaybackStats(statsUrl, { intervalMs = 15e3, enabled = true } = {}) {
|
|
5085
5192
|
const [stats, setStats] = React7.useState({});
|
|
5086
5193
|
React7.useEffect(() => {
|
|
@@ -6373,6 +6480,63 @@ function MexicoMap({ selected, onToggle, className }) {
|
|
|
6373
6480
|
}
|
|
6374
6481
|
);
|
|
6375
6482
|
}
|
|
6483
|
+
|
|
6484
|
+
// src/lib/paymentCardBrand.ts
|
|
6485
|
+
var CARD_BRAND_LABELS = {
|
|
6486
|
+
visa: "Visa",
|
|
6487
|
+
mastercard: "Mastercard",
|
|
6488
|
+
amex: "American Express",
|
|
6489
|
+
discover: "Discover",
|
|
6490
|
+
diners: "Diners Club",
|
|
6491
|
+
jcb: "JCB",
|
|
6492
|
+
unionpay: "UnionPay"
|
|
6493
|
+
};
|
|
6494
|
+
var STRIPE_TO_PAYMENT_TYPE = {
|
|
6495
|
+
visa: "Visa",
|
|
6496
|
+
mastercard: "Mastercard",
|
|
6497
|
+
amex: "AmericanExpress",
|
|
6498
|
+
discover: "Discover",
|
|
6499
|
+
diners: "DinersClub",
|
|
6500
|
+
jcb: "JCB",
|
|
6501
|
+
unionpay: "UnionPay"
|
|
6502
|
+
};
|
|
6503
|
+
function normalizePaymentCardBrand(brand) {
|
|
6504
|
+
if (!brand?.trim()) return null;
|
|
6505
|
+
return brand.trim().toLowerCase();
|
|
6506
|
+
}
|
|
6507
|
+
function formatPaymentCardBrand(brand) {
|
|
6508
|
+
if (!brand?.trim()) return "Card";
|
|
6509
|
+
const key = brand.trim().toLowerCase();
|
|
6510
|
+
const known = CARD_BRAND_LABELS[key];
|
|
6511
|
+
if (known) return known;
|
|
6512
|
+
return key.charAt(0).toUpperCase() + key.slice(1);
|
|
6513
|
+
}
|
|
6514
|
+
function paymentTypeFromStripeBrand(brand) {
|
|
6515
|
+
const key = normalizePaymentCardBrand(brand);
|
|
6516
|
+
if (!key) return "Generic";
|
|
6517
|
+
return STRIPE_TO_PAYMENT_TYPE[key] ?? "Generic";
|
|
6518
|
+
}
|
|
6519
|
+
var DEFAULT_FORMAT = "flatRounded";
|
|
6520
|
+
var DEFAULT_WIDTH = 36;
|
|
6521
|
+
function PaymentIcon({
|
|
6522
|
+
brand,
|
|
6523
|
+
format = DEFAULT_FORMAT,
|
|
6524
|
+
width = DEFAULT_WIDTH,
|
|
6525
|
+
height,
|
|
6526
|
+
className
|
|
6527
|
+
}) {
|
|
6528
|
+
return /* @__PURE__ */ jsx(
|
|
6529
|
+
PaymentIcon$1,
|
|
6530
|
+
{
|
|
6531
|
+
type: paymentTypeFromStripeBrand(brand),
|
|
6532
|
+
format,
|
|
6533
|
+
width,
|
|
6534
|
+
height,
|
|
6535
|
+
className: cn("inline-block shrink-0", className),
|
|
6536
|
+
"aria-hidden": true
|
|
6537
|
+
}
|
|
6538
|
+
);
|
|
6539
|
+
}
|
|
6376
6540
|
function MessageGroup({ className, ...props }) {
|
|
6377
6541
|
return /* @__PURE__ */ jsx(
|
|
6378
6542
|
"div",
|
|
@@ -7703,6 +7867,6 @@ function useRealtimeChannel({
|
|
|
7703
7867
|
}, [enabled, reconnectDelayMs]);
|
|
7704
7868
|
}
|
|
7705
7869
|
|
|
7706
|
-
export { AvatarEditor, AvatarEditorDialog, Bubble, BubbleContent, BubbleGroup, BubbleReactions, ChatMessageList, ConfirmDestructiveDialog, DropdownMenuItem, DropdownMenuSeparator, EmojiInput, EmojiPicker, EmojiPickerPopover, EmojiTextarea, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, ErrorState, ExpandableText, ImageLightbox, LanguageContext, LanguageSwitcher, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageComposer, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, OrgSwitcher, PLATFORM_ACCOUNT_ORG_COLLAPSE_AT, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
7870
|
+
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, PaymentIcon, PhoneInput, PlatformAccountMenu, PlatformNavbar, SearchCommand, SearchablePicker, SupportMessengerProvider, ThemeSwitcher, VerifiedProfessionalBadge, VideoPlayer, avatarFallbackStyle, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describeAvResync, describePlaybackError, formatPaymentCardBrand, fuzzyMatch, getAvatarColors, getInitials, insertAtCaret, markerVariants, mergePlatformAccountOrgs, normalizeEmojiQuery, normalizePaymentCardBrand, paymentTypeFromStripeBrand, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery2 as useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
|
|
7707
7871
|
//# sourceMappingURL=index.js.map
|
|
7708
7872
|
//# sourceMappingURL=index.js.map
|