@sesionario/blocks 1.5.0 → 1.6.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
@@ -811,6 +811,132 @@ type ChatMessageListProps = {
811
811
  };
812
812
  declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, }: ChatMessageListProps): React.JSX.Element;
813
813
 
814
+ type ConversationKind = "pharma_support" | "org_support" | "member_support";
815
+ type SupportConversation = {
816
+ id: string;
817
+ kind: ConversationKind;
818
+ subjectId: string;
819
+ memberUserId: string | null;
820
+ lastMessageAt: string | null;
821
+ unreadCount?: number;
822
+ };
823
+ type SupportMessage = {
824
+ id: string;
825
+ conversationId: string;
826
+ senderId: string;
827
+ senderName: string;
828
+ senderSide: string;
829
+ body: string;
830
+ deleted: boolean;
831
+ createdAt: string;
832
+ };
833
+ type FindOrCreateConversationInput = {
834
+ kind: ConversationKind;
835
+ subjectId: string;
836
+ memberUserId?: string;
837
+ };
838
+ type SupportChatClient = {
839
+ basePath: string;
840
+ listConversations: () => Promise<SupportConversation[]>;
841
+ findOrCreateConversation: (input: FindOrCreateConversationInput) => Promise<SupportConversation>;
842
+ listMessages: (conversationId: string) => Promise<SupportMessage[]>;
843
+ sendMessage: (conversationId: string, text: string) => Promise<SupportMessage>;
844
+ markRead: (conversationId: string) => Promise<void>;
845
+ };
846
+ declare function createSupportChatClient(basePath?: string): SupportChatClient;
847
+
848
+ type SupportMessengerItem = {
849
+ /** Stable list key (org id, conversation id, etc.). */
850
+ key: string;
851
+ title: string;
852
+ subtitle?: string;
853
+ avatarUrl?: string | null;
854
+ unreadCount?: number;
855
+ conversationId?: string | null;
856
+ open?: FindOrCreateConversationInput;
857
+ };
858
+ type SupportMessengerTab = {
859
+ id: string;
860
+ label: string;
861
+ };
862
+ type SupportMessengerLabels = {
863
+ launcherAria: string;
864
+ listTitle: string;
865
+ emptyList: string;
866
+ emptyThread: string;
867
+ placeholder: string;
868
+ send: string;
869
+ close: string;
870
+ back: string;
871
+ loading: string;
872
+ searchPlaceholder?: string;
873
+ unreadBadgeAria?: string;
874
+ };
875
+ type OpenThreadRequest = {
876
+ key: string;
877
+ title: string;
878
+ subtitle?: string;
879
+ conversationId?: string | null;
880
+ open?: FindOrCreateConversationInput;
881
+ };
882
+ type SupportMessengerContextValue = {
883
+ listOpen: boolean;
884
+ openList: () => void;
885
+ closeList: () => void;
886
+ toggleList: () => void;
887
+ openThread: (req: OpenThreadRequest) => void;
888
+ closeThread: (key: string) => void;
889
+ closeAll: () => void;
890
+ activeThreadKey: string | null;
891
+ totalUnread: number;
892
+ };
893
+ declare function useSupportMessenger(): SupportMessengerContextValue;
894
+ /** Returns null when rendered outside `SupportMessengerProvider`. */
895
+ declare function useSupportMessengerOptional(): SupportMessengerContextValue | null;
896
+ type SupportMessengerProviderProps = {
897
+ children: ReactNode;
898
+ client: SupportChatClient;
899
+ getWsUrl: (conversationId: string) => Promise<string | null>;
900
+ currentUserId: string | null;
901
+ items: SupportMessengerItem[];
902
+ labels: SupportMessengerLabels;
903
+ /** When false, messenger chrome is not rendered. */
904
+ enabled?: boolean;
905
+ /** Collapse dock/sheet; FAB remains (e.g. event chat visible). */
906
+ forceMinimized?: boolean;
907
+ emojiLocale?: EmojiPickerLocale;
908
+ tabs?: SupportMessengerTab[];
909
+ activeTab?: string;
910
+ onTabChange?: (id: string) => void;
911
+ onRefreshItems?: () => void | Promise<void>;
912
+ /** Show search when item count >= this (default 8). */
913
+ searchThreshold?: number;
914
+ className?: string;
915
+ };
916
+ declare function SupportMessengerProvider({ children, client, getWsUrl, currentUserId, items, labels, enabled, forceMinimized, emojiLocale, tabs, activeTab, onTabChange, onRefreshItems, searchThreshold, className, }: SupportMessengerProviderProps): React.JSX.Element;
917
+
918
+ type UseSupportConversationOptions = {
919
+ client: SupportChatClient;
920
+ /** Resolve a WebSocket URL (including auth token). Return null to skip WS. */
921
+ getWsUrl: (conversationId: string) => Promise<string | null>;
922
+ /** Existing conversation id, or null to find-or-create via `open`. */
923
+ conversationId: string | null;
924
+ open?: FindOrCreateConversationInput | null;
925
+ enabled?: boolean;
926
+ onConversationReady?: (conversationId: string) => void;
927
+ onIncomingMessage?: (message: SupportMessage) => void;
928
+ };
929
+ type UseSupportConversationResult = {
930
+ conversationId: string | null;
931
+ messages: SupportMessage[];
932
+ loading: boolean;
933
+ sending: boolean;
934
+ error: string | null;
935
+ send: (text: string) => Promise<void>;
936
+ reload: () => Promise<void>;
937
+ };
938
+ declare function useSupportConversation({ client, getWsUrl, conversationId: conversationIdProp, open, enabled, onConversationReady, onIncomingMessage, }: UseSupportConversationOptions): UseSupportConversationResult;
939
+
814
940
  declare function cn(...inputs: ClassValue[]): string;
815
941
 
816
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type DescribedPlaybackError, 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, type FeatureEntry, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PhoneInput, type PhoneInputProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey };
942
+ 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, 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, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, 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, PhoneInput, type PhoneInputProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, 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 UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
package/dist/index.d.ts CHANGED
@@ -811,6 +811,132 @@ type ChatMessageListProps = {
811
811
  };
812
812
  declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, }: ChatMessageListProps): React.JSX.Element;
813
813
 
814
+ type ConversationKind = "pharma_support" | "org_support" | "member_support";
815
+ type SupportConversation = {
816
+ id: string;
817
+ kind: ConversationKind;
818
+ subjectId: string;
819
+ memberUserId: string | null;
820
+ lastMessageAt: string | null;
821
+ unreadCount?: number;
822
+ };
823
+ type SupportMessage = {
824
+ id: string;
825
+ conversationId: string;
826
+ senderId: string;
827
+ senderName: string;
828
+ senderSide: string;
829
+ body: string;
830
+ deleted: boolean;
831
+ createdAt: string;
832
+ };
833
+ type FindOrCreateConversationInput = {
834
+ kind: ConversationKind;
835
+ subjectId: string;
836
+ memberUserId?: string;
837
+ };
838
+ type SupportChatClient = {
839
+ basePath: string;
840
+ listConversations: () => Promise<SupportConversation[]>;
841
+ findOrCreateConversation: (input: FindOrCreateConversationInput) => Promise<SupportConversation>;
842
+ listMessages: (conversationId: string) => Promise<SupportMessage[]>;
843
+ sendMessage: (conversationId: string, text: string) => Promise<SupportMessage>;
844
+ markRead: (conversationId: string) => Promise<void>;
845
+ };
846
+ declare function createSupportChatClient(basePath?: string): SupportChatClient;
847
+
848
+ type SupportMessengerItem = {
849
+ /** Stable list key (org id, conversation id, etc.). */
850
+ key: string;
851
+ title: string;
852
+ subtitle?: string;
853
+ avatarUrl?: string | null;
854
+ unreadCount?: number;
855
+ conversationId?: string | null;
856
+ open?: FindOrCreateConversationInput;
857
+ };
858
+ type SupportMessengerTab = {
859
+ id: string;
860
+ label: string;
861
+ };
862
+ type SupportMessengerLabels = {
863
+ launcherAria: string;
864
+ listTitle: string;
865
+ emptyList: string;
866
+ emptyThread: string;
867
+ placeholder: string;
868
+ send: string;
869
+ close: string;
870
+ back: string;
871
+ loading: string;
872
+ searchPlaceholder?: string;
873
+ unreadBadgeAria?: string;
874
+ };
875
+ type OpenThreadRequest = {
876
+ key: string;
877
+ title: string;
878
+ subtitle?: string;
879
+ conversationId?: string | null;
880
+ open?: FindOrCreateConversationInput;
881
+ };
882
+ type SupportMessengerContextValue = {
883
+ listOpen: boolean;
884
+ openList: () => void;
885
+ closeList: () => void;
886
+ toggleList: () => void;
887
+ openThread: (req: OpenThreadRequest) => void;
888
+ closeThread: (key: string) => void;
889
+ closeAll: () => void;
890
+ activeThreadKey: string | null;
891
+ totalUnread: number;
892
+ };
893
+ declare function useSupportMessenger(): SupportMessengerContextValue;
894
+ /** Returns null when rendered outside `SupportMessengerProvider`. */
895
+ declare function useSupportMessengerOptional(): SupportMessengerContextValue | null;
896
+ type SupportMessengerProviderProps = {
897
+ children: ReactNode;
898
+ client: SupportChatClient;
899
+ getWsUrl: (conversationId: string) => Promise<string | null>;
900
+ currentUserId: string | null;
901
+ items: SupportMessengerItem[];
902
+ labels: SupportMessengerLabels;
903
+ /** When false, messenger chrome is not rendered. */
904
+ enabled?: boolean;
905
+ /** Collapse dock/sheet; FAB remains (e.g. event chat visible). */
906
+ forceMinimized?: boolean;
907
+ emojiLocale?: EmojiPickerLocale;
908
+ tabs?: SupportMessengerTab[];
909
+ activeTab?: string;
910
+ onTabChange?: (id: string) => void;
911
+ onRefreshItems?: () => void | Promise<void>;
912
+ /** Show search when item count >= this (default 8). */
913
+ searchThreshold?: number;
914
+ className?: string;
915
+ };
916
+ declare function SupportMessengerProvider({ children, client, getWsUrl, currentUserId, items, labels, enabled, forceMinimized, emojiLocale, tabs, activeTab, onTabChange, onRefreshItems, searchThreshold, className, }: SupportMessengerProviderProps): React.JSX.Element;
917
+
918
+ type UseSupportConversationOptions = {
919
+ client: SupportChatClient;
920
+ /** Resolve a WebSocket URL (including auth token). Return null to skip WS. */
921
+ getWsUrl: (conversationId: string) => Promise<string | null>;
922
+ /** Existing conversation id, or null to find-or-create via `open`. */
923
+ conversationId: string | null;
924
+ open?: FindOrCreateConversationInput | null;
925
+ enabled?: boolean;
926
+ onConversationReady?: (conversationId: string) => void;
927
+ onIncomingMessage?: (message: SupportMessage) => void;
928
+ };
929
+ type UseSupportConversationResult = {
930
+ conversationId: string | null;
931
+ messages: SupportMessage[];
932
+ loading: boolean;
933
+ sending: boolean;
934
+ error: string | null;
935
+ send: (text: string) => Promise<void>;
936
+ reload: () => Promise<void>;
937
+ };
938
+ declare function useSupportConversation({ client, getWsUrl, conversationId: conversationIdProp, open, enabled, onConversationReady, onIncomingMessage, }: UseSupportConversationOptions): UseSupportConversationResult;
939
+
814
940
  declare function cn(...inputs: ClassValue[]): string;
815
941
 
816
- export { type AutoplayState, AvatarEditor, AvatarEditorDialog, type AvatarEditorDialogProps, type AvatarEditorProps, type BlocksLanguage, Bubble, BubbleContent, BubbleGroup, BubbleReactions, type ChatListMessage, ChatMessageList, type ChatMessageListProps, ConfirmDestructiveDialog, type ConfirmDestructiveDialogProps, type DescribedPlaybackError, 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, type FeatureEntry, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, MexicoMap, type MexicoMapProps, type MexicoState, type MexicoStateId, OrgSwitcher, type OrgSwitcherLabels, type OrgSwitcherProps, type OrgSwitcherTenant, PhoneInput, type PhoneInputProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, ThemeSwitcher, type ThemeSwitcherLabels, type ThemeSwitcherProps, type UseHlsPlaybackOptions, type UseHlsPlaybackResult, type UsePlaybackStatsOptions, type UseSearchHotkeyOptions, type UseSearchHotkeyResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey };
942
+ 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, 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, type FeatureEntry, type FindOrCreateConversationInput, type HlsPlayerMode, type Language, LanguageContext, type LanguageContextValue, LanguageSwitcher, type LanguageSwitcherLabels, type LanguageSwitcherProps, LoadingState, MEXICO_STATES, MEXICO_STATE_PATHS, Marker, MarkerContent, MarkerIcon, Message, MessageAvatar, 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, PhoneInput, type PhoneInputProps, type PlaybackErrorContext, type PlaybackErrorDetail, type PlaybackErrorKind, type PlaybackState, type PlaybackStats, type ProfessionalVerificationStatus, type QualityLevel, SearchCommand, type SearchCommandLabels, type SearchCommandProps, type SearchCommandSelection, type SearchHit, 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 UseSearchHotkeyOptions, type UseSearchHotkeyResult, type UseSupportConversationOptions, type UseSupportConversationResult, VerifiedProfessionalBadge, type VerifiedProfessionalBadgeProps, VideoPlayer, type VideoPlayerLabels, type VideoPlayerProps, bubbleVariants, cn, createLiveHlsConfig, createSupportChatClient, createVodHlsConfig, defaultLanguages, describePlaybackError, fuzzyMatch, insertAtCaret, markerVariants, normalizeEmojiQuery, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useHlsPlayback, useLanguageContext, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };