@sesionario/blocks 1.22.3 → 1.24.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
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FormEvent, KeyboardEvent, RefObject, CSSProperties, ReactNode, ComponentProps, SVGProps } from 'react';
2
+ import { FormEvent, KeyboardEvent, RefObject, CSSProperties, ReactNode, ComponentProps, PointerEvent, Dispatch, SetStateAction, SVGProps } from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
5
  import { VariantProps } from 'class-variance-authority';
@@ -289,6 +289,70 @@ type ImageLightboxProps = {
289
289
  */
290
290
  declare function ImageLightbox({ images, index, onIndexChange, onClose, labels, }: ImageLightboxProps): React.ReactPortal;
291
291
 
292
+ type MediaCarouselItem = {
293
+ kind: "image";
294
+ src: string;
295
+ alt?: string;
296
+ } | {
297
+ kind: "video";
298
+ node: ReactNode;
299
+ } | {
300
+ kind: "pdf";
301
+ fileUrl: string;
302
+ fileName: string;
303
+ downloadUrl?: string;
304
+ };
305
+ type MediaCarouselLabels = {
306
+ previous?: string;
307
+ next?: string;
308
+ counter?: (current: number, total: number) => string;
309
+ };
310
+ type MediaCarouselPdfRenderProps = {
311
+ fileUrl: string;
312
+ fileName: string;
313
+ downloadUrl?: string;
314
+ };
315
+ type MediaCarouselProps = {
316
+ items: MediaCarouselItem[];
317
+ index: number;
318
+ onIndexChange: (index: number) => void;
319
+ labels?: MediaCarouselLabels;
320
+ className?: string;
321
+ /**
322
+ * Slot for PDF rendering so this component can live in the root barrel
323
+ * without pulling pdfjs into every consumer.
324
+ */
325
+ renderPdf?: (props: MediaCarouselPdfRenderProps) => ReactNode;
326
+ };
327
+ /**
328
+ * Presentational media pane for image / video-slot / pdf items. Images use
329
+ * pinch/swipe gestures; video and pdf are opaque slots supplied by the
330
+ * consumer.
331
+ */
332
+ declare function MediaCarousel({ items, index, onIndexChange, labels, className, renderPdf, }: MediaCarouselProps): React.JSX.Element | null;
333
+
334
+ type MediaViewerDialogLabels = {
335
+ close?: string;
336
+ title?: string;
337
+ description?: string;
338
+ };
339
+ type MediaViewerDialogProps = {
340
+ open: boolean;
341
+ onOpenChange: (open: boolean) => void;
342
+ children: ReactNode;
343
+ labels?: MediaViewerDialogLabels;
344
+ className?: string;
345
+ /** Extra classes for the dialog content shell. */
346
+ contentClassName?: string;
347
+ showCloseButton?: boolean;
348
+ };
349
+ /**
350
+ * Edge-to-edge fullscreen dialog shell for media viewers (post detail, PDF,
351
+ * etc.). Uses the shared Radix dialog for focus trap, Esc and `aria-modal`.
352
+ * Pass `contentClassName` to opt into a contained desktop card when needed.
353
+ */
354
+ declare function MediaViewerDialog({ open, onOpenChange, children, labels, className, contentClassName, showCloseButton, }: MediaViewerDialogProps): React.JSX.Element;
355
+
292
356
  type ThemeSwitcherLabels = {
293
357
  /** Tooltip label for the theme switcher */
294
358
  theme?: string;
@@ -958,6 +1022,54 @@ declare function useDebouncedValueStrict<T>(value: T, delayMs: number): T | unde
958
1022
 
959
1023
  declare function useMediaQuery(query: string): boolean;
960
1024
 
1025
+ declare const ZOOM_PAN_MIN_SCALE = 1;
1026
+ declare const ZOOM_PAN_MAX_SCALE = 4;
1027
+ declare const ZOOM_PAN_SWIPE_COMMIT_PX = 56;
1028
+ declare const ZOOM_PAN_SWIPE_SNAP_MS = 180;
1029
+ type ZoomPanTransform = {
1030
+ scale: number;
1031
+ tx: number;
1032
+ ty: number;
1033
+ };
1034
+ type SwipeDirection = "prev" | "next";
1035
+ type UseZoomPanGesturesOptions = {
1036
+ minScale?: number;
1037
+ maxScale?: number;
1038
+ /** When false, horizontal swipe never commits (still pans when zoomed). */
1039
+ swipeEnabled?: boolean;
1040
+ onSwipeCommit?: (direction: SwipeDirection) => void;
1041
+ /** When true, wheel zoom is attached to the stage. Defaults to true. */
1042
+ wheelZoom?: boolean;
1043
+ /**
1044
+ * Double-tap behavior at min scale: "reset" (default — ImageLightbox) or
1045
+ * "toggle" (zoom in toward tap, then reset).
1046
+ */
1047
+ doubleTap?: "reset" | "toggle";
1048
+ };
1049
+ type UseZoomPanGesturesResult = {
1050
+ stageRef: RefObject<HTMLDivElement | null>;
1051
+ transform: ZoomPanTransform;
1052
+ isDragging: boolean;
1053
+ snapBack: boolean;
1054
+ handlers: {
1055
+ onPointerDown: (e: PointerEvent<HTMLDivElement>) => void;
1056
+ onPointerMove: (e: PointerEvent<HTMLDivElement>) => void;
1057
+ onPointerUp: (e: PointerEvent<HTMLDivElement>) => void;
1058
+ onPointerCancel: (e: PointerEvent<HTMLDivElement>) => void;
1059
+ };
1060
+ reset: () => void;
1061
+ setScale: (scale: number) => void;
1062
+ clearSnapBack: () => void;
1063
+ };
1064
+ declare function zoomToward(prev: ZoomPanTransform, nextScale: number, originX: number, originY: number, minScale?: number, maxScale?: number): ZoomPanTransform;
1065
+ declare function prefersReducedMotion(): boolean;
1066
+ /**
1067
+ * Pointer-driven pinch zoom, double-tap zoom toggle/reset, pan while zoomed,
1068
+ * and horizontal swipe-to-commit. Shared by ImageLightbox, MediaCarousel and
1069
+ * PdfViewer.
1070
+ */
1071
+ declare function useZoomPanGestures(options?: UseZoomPanGesturesOptions): UseZoomPanGesturesResult;
1072
+
961
1073
  type ScrollFadeXEdges = {
962
1074
  canScrollLeft: boolean;
963
1075
  canScrollRight: boolean;
@@ -990,6 +1102,57 @@ interface UseSearchHotkeyResult {
990
1102
  */
991
1103
  declare function useSearchHotkey(options?: UseSearchHotkeyOptions): UseSearchHotkeyResult;
992
1104
 
1105
+ /**
1106
+ * Like `useState`, but when the surrounding `ScrollRestorationProvider` is
1107
+ * mounting a browser back/forward traversal, the initial state is read from
1108
+ * an in-memory snapshot (so infinite lists paint tall enough to restore
1109
+ * scroll). Writes back on every change. Outside a provider, degrades to
1110
+ * plain `useState`.
1111
+ */
1112
+ declare function useRestorableState<T>(subKey: string, initializer: () => T): [T, Dispatch<SetStateAction<T>>];
1113
+
1114
+ type ScrollRestorationContextValue = {
1115
+ routeKey: string;
1116
+ /** True when this route mount is a browser back/forward traversal. */
1117
+ isTraversal: boolean;
1118
+ anchorAttribute: string;
1119
+ };
1120
+ declare function useScrollRestorationContext(): ScrollRestorationContextValue | null;
1121
+ type ScrollRestorationProviderProps = {
1122
+ /** App-supplied key, typically `pathname + search`. */
1123
+ routeKey: string;
1124
+ /**
1125
+ * Nested scroll container. Omit to use the document (window) scroller.
1126
+ * Required when the app shells content inside `overflow-auto` / `overflow-y-auto`.
1127
+ */
1128
+ containerRef?: RefObject<HTMLElement | null>;
1129
+ /** Attribute used to mark restore anchors. Default: `data-scroll-anchor`. */
1130
+ anchorAttribute?: string;
1131
+ children: ReactNode;
1132
+ };
1133
+ /**
1134
+ * Owns per-route scroll marks: saves on scroll, resets to top on fresh
1135
+ * navigation, and restores (with anchor alignment) on browser back/forward.
1136
+ *
1137
+ * Apps must supply `routeKey` from their router (`usePathname` +
1138
+ * `useSearchParams`) so this package stays free of `next/*` imports.
1139
+ */
1140
+ declare function ScrollRestorationProvider({ routeKey, containerRef, anchorAttribute, children, }: ScrollRestorationProviderProps): React.JSX.Element;
1141
+
1142
+ /**
1143
+ * Framework-free scroll-restoration store.
1144
+ *
1145
+ * Keeps per-route scroll marks (offset + anchor) and in-memory list snapshots
1146
+ * so infinite-scroll pages can remount tall enough for the browser to land
1147
+ * where the user left off. No `next/*` imports — apps supply the route key.
1148
+ */
1149
+ type ScrollMark = {
1150
+ top: number;
1151
+ anchorId: string | null;
1152
+ /** Anchor's top edge relative to the scrollport top at save time. */
1153
+ anchorTop: number;
1154
+ };
1155
+
993
1156
  type SearchablePickerLabels = {
994
1157
  placeholder?: string;
995
1158
  searchPlaceholder?: string;
@@ -1501,4 +1664,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1501
1664
 
1502
1665
  declare function cn(...inputs: ClassValue[]): string;
1503
1666
 
1504
- 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, 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 UseEditableSectionOptions, type UseEditableSectionResult, 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, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1667
+ 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, 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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { FormEvent, KeyboardEvent, RefObject, CSSProperties, ReactNode, ComponentProps, SVGProps } from 'react';
2
+ import { FormEvent, KeyboardEvent, RefObject, CSSProperties, ReactNode, ComponentProps, PointerEvent, Dispatch, SetStateAction, SVGProps } from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
5
  import { VariantProps } from 'class-variance-authority';
@@ -289,6 +289,70 @@ type ImageLightboxProps = {
289
289
  */
290
290
  declare function ImageLightbox({ images, index, onIndexChange, onClose, labels, }: ImageLightboxProps): React.ReactPortal;
291
291
 
292
+ type MediaCarouselItem = {
293
+ kind: "image";
294
+ src: string;
295
+ alt?: string;
296
+ } | {
297
+ kind: "video";
298
+ node: ReactNode;
299
+ } | {
300
+ kind: "pdf";
301
+ fileUrl: string;
302
+ fileName: string;
303
+ downloadUrl?: string;
304
+ };
305
+ type MediaCarouselLabels = {
306
+ previous?: string;
307
+ next?: string;
308
+ counter?: (current: number, total: number) => string;
309
+ };
310
+ type MediaCarouselPdfRenderProps = {
311
+ fileUrl: string;
312
+ fileName: string;
313
+ downloadUrl?: string;
314
+ };
315
+ type MediaCarouselProps = {
316
+ items: MediaCarouselItem[];
317
+ index: number;
318
+ onIndexChange: (index: number) => void;
319
+ labels?: MediaCarouselLabels;
320
+ className?: string;
321
+ /**
322
+ * Slot for PDF rendering so this component can live in the root barrel
323
+ * without pulling pdfjs into every consumer.
324
+ */
325
+ renderPdf?: (props: MediaCarouselPdfRenderProps) => ReactNode;
326
+ };
327
+ /**
328
+ * Presentational media pane for image / video-slot / pdf items. Images use
329
+ * pinch/swipe gestures; video and pdf are opaque slots supplied by the
330
+ * consumer.
331
+ */
332
+ declare function MediaCarousel({ items, index, onIndexChange, labels, className, renderPdf, }: MediaCarouselProps): React.JSX.Element | null;
333
+
334
+ type MediaViewerDialogLabels = {
335
+ close?: string;
336
+ title?: string;
337
+ description?: string;
338
+ };
339
+ type MediaViewerDialogProps = {
340
+ open: boolean;
341
+ onOpenChange: (open: boolean) => void;
342
+ children: ReactNode;
343
+ labels?: MediaViewerDialogLabels;
344
+ className?: string;
345
+ /** Extra classes for the dialog content shell. */
346
+ contentClassName?: string;
347
+ showCloseButton?: boolean;
348
+ };
349
+ /**
350
+ * Edge-to-edge fullscreen dialog shell for media viewers (post detail, PDF,
351
+ * etc.). Uses the shared Radix dialog for focus trap, Esc and `aria-modal`.
352
+ * Pass `contentClassName` to opt into a contained desktop card when needed.
353
+ */
354
+ declare function MediaViewerDialog({ open, onOpenChange, children, labels, className, contentClassName, showCloseButton, }: MediaViewerDialogProps): React.JSX.Element;
355
+
292
356
  type ThemeSwitcherLabels = {
293
357
  /** Tooltip label for the theme switcher */
294
358
  theme?: string;
@@ -958,6 +1022,54 @@ declare function useDebouncedValueStrict<T>(value: T, delayMs: number): T | unde
958
1022
 
959
1023
  declare function useMediaQuery(query: string): boolean;
960
1024
 
1025
+ declare const ZOOM_PAN_MIN_SCALE = 1;
1026
+ declare const ZOOM_PAN_MAX_SCALE = 4;
1027
+ declare const ZOOM_PAN_SWIPE_COMMIT_PX = 56;
1028
+ declare const ZOOM_PAN_SWIPE_SNAP_MS = 180;
1029
+ type ZoomPanTransform = {
1030
+ scale: number;
1031
+ tx: number;
1032
+ ty: number;
1033
+ };
1034
+ type SwipeDirection = "prev" | "next";
1035
+ type UseZoomPanGesturesOptions = {
1036
+ minScale?: number;
1037
+ maxScale?: number;
1038
+ /** When false, horizontal swipe never commits (still pans when zoomed). */
1039
+ swipeEnabled?: boolean;
1040
+ onSwipeCommit?: (direction: SwipeDirection) => void;
1041
+ /** When true, wheel zoom is attached to the stage. Defaults to true. */
1042
+ wheelZoom?: boolean;
1043
+ /**
1044
+ * Double-tap behavior at min scale: "reset" (default — ImageLightbox) or
1045
+ * "toggle" (zoom in toward tap, then reset).
1046
+ */
1047
+ doubleTap?: "reset" | "toggle";
1048
+ };
1049
+ type UseZoomPanGesturesResult = {
1050
+ stageRef: RefObject<HTMLDivElement | null>;
1051
+ transform: ZoomPanTransform;
1052
+ isDragging: boolean;
1053
+ snapBack: boolean;
1054
+ handlers: {
1055
+ onPointerDown: (e: PointerEvent<HTMLDivElement>) => void;
1056
+ onPointerMove: (e: PointerEvent<HTMLDivElement>) => void;
1057
+ onPointerUp: (e: PointerEvent<HTMLDivElement>) => void;
1058
+ onPointerCancel: (e: PointerEvent<HTMLDivElement>) => void;
1059
+ };
1060
+ reset: () => void;
1061
+ setScale: (scale: number) => void;
1062
+ clearSnapBack: () => void;
1063
+ };
1064
+ declare function zoomToward(prev: ZoomPanTransform, nextScale: number, originX: number, originY: number, minScale?: number, maxScale?: number): ZoomPanTransform;
1065
+ declare function prefersReducedMotion(): boolean;
1066
+ /**
1067
+ * Pointer-driven pinch zoom, double-tap zoom toggle/reset, pan while zoomed,
1068
+ * and horizontal swipe-to-commit. Shared by ImageLightbox, MediaCarousel and
1069
+ * PdfViewer.
1070
+ */
1071
+ declare function useZoomPanGestures(options?: UseZoomPanGesturesOptions): UseZoomPanGesturesResult;
1072
+
961
1073
  type ScrollFadeXEdges = {
962
1074
  canScrollLeft: boolean;
963
1075
  canScrollRight: boolean;
@@ -990,6 +1102,57 @@ interface UseSearchHotkeyResult {
990
1102
  */
991
1103
  declare function useSearchHotkey(options?: UseSearchHotkeyOptions): UseSearchHotkeyResult;
992
1104
 
1105
+ /**
1106
+ * Like `useState`, but when the surrounding `ScrollRestorationProvider` is
1107
+ * mounting a browser back/forward traversal, the initial state is read from
1108
+ * an in-memory snapshot (so infinite lists paint tall enough to restore
1109
+ * scroll). Writes back on every change. Outside a provider, degrades to
1110
+ * plain `useState`.
1111
+ */
1112
+ declare function useRestorableState<T>(subKey: string, initializer: () => T): [T, Dispatch<SetStateAction<T>>];
1113
+
1114
+ type ScrollRestorationContextValue = {
1115
+ routeKey: string;
1116
+ /** True when this route mount is a browser back/forward traversal. */
1117
+ isTraversal: boolean;
1118
+ anchorAttribute: string;
1119
+ };
1120
+ declare function useScrollRestorationContext(): ScrollRestorationContextValue | null;
1121
+ type ScrollRestorationProviderProps = {
1122
+ /** App-supplied key, typically `pathname + search`. */
1123
+ routeKey: string;
1124
+ /**
1125
+ * Nested scroll container. Omit to use the document (window) scroller.
1126
+ * Required when the app shells content inside `overflow-auto` / `overflow-y-auto`.
1127
+ */
1128
+ containerRef?: RefObject<HTMLElement | null>;
1129
+ /** Attribute used to mark restore anchors. Default: `data-scroll-anchor`. */
1130
+ anchorAttribute?: string;
1131
+ children: ReactNode;
1132
+ };
1133
+ /**
1134
+ * Owns per-route scroll marks: saves on scroll, resets to top on fresh
1135
+ * navigation, and restores (with anchor alignment) on browser back/forward.
1136
+ *
1137
+ * Apps must supply `routeKey` from their router (`usePathname` +
1138
+ * `useSearchParams`) so this package stays free of `next/*` imports.
1139
+ */
1140
+ declare function ScrollRestorationProvider({ routeKey, containerRef, anchorAttribute, children, }: ScrollRestorationProviderProps): React.JSX.Element;
1141
+
1142
+ /**
1143
+ * Framework-free scroll-restoration store.
1144
+ *
1145
+ * Keeps per-route scroll marks (offset + anchor) and in-memory list snapshots
1146
+ * so infinite-scroll pages can remount tall enough for the browser to land
1147
+ * where the user left off. No `next/*` imports — apps supply the route key.
1148
+ */
1149
+ type ScrollMark = {
1150
+ top: number;
1151
+ anchorId: string | null;
1152
+ /** Anchor's top edge relative to the scrollport top at save time. */
1153
+ anchorTop: number;
1154
+ };
1155
+
993
1156
  type SearchablePickerLabels = {
994
1157
  placeholder?: string;
995
1158
  searchPlaceholder?: string;
@@ -1501,4 +1664,4 @@ declare function useRealtimeChannel({ getWsUrl, onEvent, enabled, reconnectDelay
1501
1664
 
1502
1665
  declare function cn(...inputs: ClassValue[]): string;
1503
1666
 
1504
- 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, 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 UseEditableSectionOptions, type UseEditableSectionResult, 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, paymentIconBrandFromStripe, paymentTypeFromStripeBrand, shouldRetryLiveEdge404, useDebouncedValue, useDebouncedValueStrict, useEditableSection, useFeedExclusivePlayback, useHlsPlayback, useLanguageContext, useMediaQuery, usePlaybackStats, useRealtimeChannel, useScrollFadeXEdges, useSearchHotkey, useSupportConversation, useSupportMessenger, useSupportMessengerOptional };
1667
+ 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, 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 };