@sesionario/blocks 1.10.0 → 1.12.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
@@ -378,14 +378,16 @@ interface EmojiPickerPopoverProps extends EmojiPickerProps {
378
378
  open?: boolean;
379
379
  onOpenChange?: (open: boolean) => void;
380
380
  /** Keep the popover open after choosing an emoji (e.g. to add several).
381
- * Default `false`. */
381
+ * Default `true` so multi-emoji insertion is one-click-away. Pass `false`
382
+ * to close on every selection. */
382
383
  keepOpenOnSelect?: boolean;
383
384
  }
384
385
  /**
385
386
  * Convenience wrapper: a `Smile` icon button that opens {@link EmojiPicker} in
386
387
  * a popover. Prefer {@link EmojiTextarea} / {@link EmojiInput} for in-field
387
388
  * adornment; use this when you need a standalone trigger. Uncontrolled by
388
- * default; pass `open`/`onOpenChange` to control it.
389
+ * default; pass `open`/`onOpenChange` to control it. Stays open across
390
+ * selections by default; closes on pointer-down outside or Escape.
389
391
  */
390
392
  declare function EmojiPickerPopover({ onSelect, triggerLabel, triggerClassName, disabled, side, align, open, onOpenChange, keepOpenOnSelect, locale, ...pickerProps }: EmojiPickerPopoverProps): React.JSX.Element;
391
393
 
@@ -396,6 +398,7 @@ type EmojiFieldSharedProps = PickerPassthrough & {
396
398
  /** Extra classes for the emoji trigger button. */
397
399
  emojiTriggerClassName?: string;
398
400
  };
401
+
399
402
  type EmojiTextareaProps = Omit<React.ComponentProps<"textarea">, "children"> & EmojiFieldSharedProps;
400
403
  declare const EmojiTextarea: React.ForwardRefExoticComponent<Omit<EmojiTextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
401
404
  type EmojiInputProps = Omit<React.ComponentProps<"input">, "children"> & EmojiFieldSharedProps;
@@ -929,6 +932,43 @@ type ChatMessageListProps = {
929
932
  };
930
933
  declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, }: ChatMessageListProps): React.JSX.Element;
931
934
 
935
+ type MessageComposerProps = Omit<React.ComponentProps<"textarea">, "children" | "onSubmit"> & EmojiFieldSharedProps & {
936
+ /** Label for the submit button (e.g. "Enviar"). */
937
+ sendLabel: string;
938
+ /**
939
+ * Extra condition that disables send (e.g. connection closed).
940
+ * Empty/whitespace drafts are blocked unless {@link allowEmptySubmit}.
941
+ */
942
+ sendDisabled?: boolean;
943
+ /**
944
+ * When true, the submit button stays enabled with an empty draft
945
+ * (e.g. attachment-only feed posts). Default `false`.
946
+ */
947
+ allowEmptySubmit?: boolean;
948
+ /** Called when the form submits (and draft/guards allow it). */
949
+ onSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
950
+ /** Extra classes for the submit button. */
951
+ sendButtonClassName?: string;
952
+ /** Submit button size. Default `"sm"`. */
953
+ sendButtonSize?: React.ComponentProps<typeof Button>["size"];
954
+ /**
955
+ * When true (default), Enter submits and Shift+Enter inserts a newline.
956
+ * Set false for long-form composers (Enter = newline; submit via button).
957
+ */
958
+ submitOnEnter?: boolean;
959
+ /** Icon/tool buttons rendered next to the emoji trigger (left cluster). */
960
+ tools?: React.ReactNode;
961
+ /** Attachment previews rendered between the textarea and the toolbar. */
962
+ attachments?: React.ReactNode;
963
+ };
964
+ /**
965
+ * Unified chat composer: bordered form with textarea, emoji picker, and send
966
+ * button. Enter submits by default; Shift+Enter inserts a newline. IME
967
+ * composition Enter is ignored. Pass `tools` / `attachments` to extend the
968
+ * toolbar and preview strip (e.g. feed post media controls).
969
+ */
970
+ declare const MessageComposer: React.ForwardRefExoticComponent<Omit<MessageComposerProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
971
+
932
972
  type ConversationKind = "pharma_support" | "org_support" | "member_support";
933
973
  type SupportConversation = {
934
974
  id: string;
@@ -1057,4 +1097,4 @@ declare function useSupportConversation({ client, getWsUrl, conversationId: conv
1057
1097
 
1058
1098
  declare function cn(...inputs: ClassValue[]): string;
1059
1099
 
1060
- 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, 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, 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, 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 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, useMediaQuery, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1100
+ 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, 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, 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, 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, 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 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, useMediaQuery, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
package/dist/index.d.ts CHANGED
@@ -378,14 +378,16 @@ interface EmojiPickerPopoverProps extends EmojiPickerProps {
378
378
  open?: boolean;
379
379
  onOpenChange?: (open: boolean) => void;
380
380
  /** Keep the popover open after choosing an emoji (e.g. to add several).
381
- * Default `false`. */
381
+ * Default `true` so multi-emoji insertion is one-click-away. Pass `false`
382
+ * to close on every selection. */
382
383
  keepOpenOnSelect?: boolean;
383
384
  }
384
385
  /**
385
386
  * Convenience wrapper: a `Smile` icon button that opens {@link EmojiPicker} in
386
387
  * a popover. Prefer {@link EmojiTextarea} / {@link EmojiInput} for in-field
387
388
  * adornment; use this when you need a standalone trigger. Uncontrolled by
388
- * default; pass `open`/`onOpenChange` to control it.
389
+ * default; pass `open`/`onOpenChange` to control it. Stays open across
390
+ * selections by default; closes on pointer-down outside or Escape.
389
391
  */
390
392
  declare function EmojiPickerPopover({ onSelect, triggerLabel, triggerClassName, disabled, side, align, open, onOpenChange, keepOpenOnSelect, locale, ...pickerProps }: EmojiPickerPopoverProps): React.JSX.Element;
391
393
 
@@ -396,6 +398,7 @@ type EmojiFieldSharedProps = PickerPassthrough & {
396
398
  /** Extra classes for the emoji trigger button. */
397
399
  emojiTriggerClassName?: string;
398
400
  };
401
+
399
402
  type EmojiTextareaProps = Omit<React.ComponentProps<"textarea">, "children"> & EmojiFieldSharedProps;
400
403
  declare const EmojiTextarea: React.ForwardRefExoticComponent<Omit<EmojiTextareaProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
401
404
  type EmojiInputProps = Omit<React.ComponentProps<"input">, "children"> & EmojiFieldSharedProps;
@@ -929,6 +932,43 @@ type ChatMessageListProps = {
929
932
  };
930
933
  declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, }: ChatMessageListProps): React.JSX.Element;
931
934
 
935
+ type MessageComposerProps = Omit<React.ComponentProps<"textarea">, "children" | "onSubmit"> & EmojiFieldSharedProps & {
936
+ /** Label for the submit button (e.g. "Enviar"). */
937
+ sendLabel: string;
938
+ /**
939
+ * Extra condition that disables send (e.g. connection closed).
940
+ * Empty/whitespace drafts are blocked unless {@link allowEmptySubmit}.
941
+ */
942
+ sendDisabled?: boolean;
943
+ /**
944
+ * When true, the submit button stays enabled with an empty draft
945
+ * (e.g. attachment-only feed posts). Default `false`.
946
+ */
947
+ allowEmptySubmit?: boolean;
948
+ /** Called when the form submits (and draft/guards allow it). */
949
+ onSubmit: (event: React.FormEvent<HTMLFormElement>) => void;
950
+ /** Extra classes for the submit button. */
951
+ sendButtonClassName?: string;
952
+ /** Submit button size. Default `"sm"`. */
953
+ sendButtonSize?: React.ComponentProps<typeof Button>["size"];
954
+ /**
955
+ * When true (default), Enter submits and Shift+Enter inserts a newline.
956
+ * Set false for long-form composers (Enter = newline; submit via button).
957
+ */
958
+ submitOnEnter?: boolean;
959
+ /** Icon/tool buttons rendered next to the emoji trigger (left cluster). */
960
+ tools?: React.ReactNode;
961
+ /** Attachment previews rendered between the textarea and the toolbar. */
962
+ attachments?: React.ReactNode;
963
+ };
964
+ /**
965
+ * Unified chat composer: bordered form with textarea, emoji picker, and send
966
+ * button. Enter submits by default; Shift+Enter inserts a newline. IME
967
+ * composition Enter is ignored. Pass `tools` / `attachments` to extend the
968
+ * toolbar and preview strip (e.g. feed post media controls).
969
+ */
970
+ declare const MessageComposer: React.ForwardRefExoticComponent<Omit<MessageComposerProps, "ref"> & React.RefAttributes<HTMLTextAreaElement>>;
971
+
932
972
  type ConversationKind = "pharma_support" | "org_support" | "member_support";
933
973
  type SupportConversation = {
934
974
  id: string;
@@ -1057,4 +1097,4 @@ declare function useSupportConversation({ client, getWsUrl, conversationId: conv
1057
1097
 
1058
1098
  declare function cn(...inputs: ClassValue[]): string;
1059
1099
 
1060
- 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, 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, 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, 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 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, useMediaQuery, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1100
+ 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, 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, 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, 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, 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 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, useMediaQuery, usePlaybackStats, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };