{"version":3,"file":"MessageList.mjs","names":[],"sources":["../../../../src/components/MessageList/MessageList.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React from 'react';\n\nimport {\n  useEnrichedMessages,\n  useMessageListElements,\n  useScrollLocationLogic,\n  useUnreadMessagesNotification,\n} from './hooks/MessageList';\nimport {\n  findMessageElement,\n  isMessageViewed,\n  MESSAGE_VIEWED_THRESHOLDS,\n} from './messageFocus';\nimport { getMessageSourceKey } from './messageSourceKey';\nimport { useMarkRead } from './hooks/useMarkRead';\n\nimport { NewMessageNotification as DefaultNewMessageNotification } from './NewMessageNotification';\nimport {\n  NotificationList as DefaultNotificationList,\n  useNotificationTarget,\n} from '../Notifications';\nimport { useIncomingMessageAnnouncements } from '../Accessibility';\nimport { UnreadMessagesNotification as DefaultUnreadMessagesNotification } from './UnreadMessagesNotification';\n\nimport { DialogManagerProvider, useChannel } from '../../context';\nimport { useChatContext } from '../../context/ChatContext';\nimport { useComponentContext } from '../../context/ComponentContext';\nimport { MessageListContextProvider } from '../../context/MessageListContext';\nimport { MessageTranslationViewProvider } from '../../context/MessageTranslationViewContext';\nimport { EmptyStateIndicator as DefaultEmptyStateIndicator } from '../EmptyStateIndicator';\nimport { LoadingIndicator as DefaultLoadingIndicator } from '../Loading';\nimport { TypingIndicator as DefaultTypingIndicator } from '../TypingIndicator';\nimport { MessageListMainPanel as DefaultMessageListMainPanel } from './MessageListMainPanel';\n\nimport { FloatingDateSeparator } from './FloatingDateSeparator';\nimport type { MessageRenderer, SharedMessageProps } from './renderMessages';\nimport { defaultRenderMessages } from './renderMessages';\nimport { useStableId } from '../UtilityComponents/useStableId';\nimport { useThreadContext } from '../Threads';\nimport { useThreadHead } from './hooks/useThreadHead';\n\nimport type {\n  MessageFocusSignalState,\n  MessagePaginatorState,\n  TimestampNS,\n  UnreadSnapshotState,\n} from 'stream-chat';\nimport type { GetGroupStyles, ProcessMessagesParams } from './utils';\nimport type { MessageProps } from '../Message/types';\n\nimport { DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD } from '../../constants/limits';\nimport { useLastOwnMessage } from './hooks/useLastOwnMessage';\nimport { useStateStore } from '../../store';\nimport type { InfiniteScrollPaginatorProps } from '../InfiniteScrollPaginator/InfiniteScrollPaginator';\nimport { InfiniteScrollPaginator } from '../InfiniteScrollPaginator/InfiniteScrollPaginator';\nimport { useMessagePaginator } from '../../hooks';\nimport { ScrollToLatestMessageButton as DefaultScrollToLatestMessageButton } from './ScrollToLatestMessageButton';\nimport { useCanPaginateReplies } from './hooks/useCanPaginateReplies';\n\ntype MessageListWithContextProps = MessageListProps;\n\nconst messagePaginatorStateSelector = (state: MessagePaginatorState) => ({\n  hasMoreNewer: state.hasMoreHead,\n  isLoading: state.isLoading,\n  messages: state.items ?? [],\n});\n\nconst unreadStateSnapshotSelector = (state: UnreadSnapshotState) => state;\nconst messageFocusSignalSelector = (state: MessageFocusSignalState) => ({\n  messageFocusSignal: state.signal,\n});\n\n// For user-initiated scrolls (scroll-to-latest, jump-to-message); autoscroll stays instant. Smooth\n// unless the OS prefers reduced motion (WCAG 2.3.3, `auto` scrolls instantly). Read at scroll time\n// instead of through a reactive hook, which would re-render the list and perturb the paginator's\n// scroll-position handling.\nconst getScrollBehavior = (): ScrollBehavior =>\n  typeof window !== 'undefined' &&\n  typeof window.matchMedia === 'function' &&\n  window.matchMedia('(prefers-reduced-motion: reduce)').matches\n    ? 'auto'\n    : 'smooth';\n\nconst MessageListWithContext = (props: MessageListWithContextProps) => {\n  const channel = useChannel();\n  const {\n    getGroupStyles,\n    groupByUser = true,\n    headerPosition,\n    hideDeletedMessages = false,\n    hideNewMessageSeparator = false,\n    internalInfiniteScrollProps: {\n      element: internalListElement = 'div',\n      threshold: loadMoreScrollThreshold = DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD,\n      ...restInternalInfiniteScrollProps\n    } = {},\n    maxTimeBetweenGroupedMessages,\n    reactionDetailsSort,\n    renderMessages = defaultRenderMessages,\n    returnAllReadData = false,\n    reviewProcessedMessage,\n    showUnreadNotificationAlways,\n    sortReactions,\n    suppressAutoscroll: suppressAutoscrollFromProps = false,\n    withDateSeparator = true,\n  } = props;\n  // The list-wide props every message gets, the thread's parent message included.\n  const messageProps: SharedMessageProps = {\n    closeReactionSelectorOnClick: props.closeReactionSelectorOnClick,\n    formatDate: props.formatDate,\n    onMentionsClick: props.onMentionsClick,\n    onMentionsHover: props.onMentionsHover,\n    onUserClick: props.onUserClick,\n    onUserHover: props.onUserHover,\n    reactionDetailsSort,\n    renderText: props.renderText,\n    showAvatar: props.showAvatar,\n    sortReactions,\n    unsafeHTML: props.unsafeHTML,\n  };\n  const threadHead = useThreadHead(messageProps);\n  const thread = useThreadContext();\n  const isThreadList = !!thread;\n  const [isLoadingOlder, setIsLoadingOlder] = React.useState(false);\n  const suppressAutoscroll = suppressAutoscrollFromProps || isLoadingOlder;\n  const loadingOlderRef = React.useRef(false);\n\n  const [listElement, setListElement] = React.useState<HTMLDivElement | null>(null);\n\n  const { customClasses } = useChatContext();\n\n  const {\n    EmptyStateIndicator = DefaultEmptyStateIndicator,\n    LoadingIndicator = DefaultLoadingIndicator,\n    MessageListWrapper = 'ul',\n    NewMessageNotification = DefaultNewMessageNotification,\n    ScrollToLatestMessageButton = DefaultScrollToLatestMessageButton,\n    TypingIndicator = DefaultTypingIndicator,\n    UnreadMessagesNotification = DefaultUnreadMessagesNotification,\n  } = useComponentContext();\n  const messagePaginator = useMessagePaginator();\n\n  const { hasMoreNewer, isLoading, messages } = useStateStore(\n    messagePaginator.state,\n    messagePaginatorStateSelector,\n  );\n\n  const channelUnreadUiState = useStateStore(\n    messagePaginator.unreadStateSnapshot,\n    unreadStateSnapshotSelector,\n  );\n  const { messageFocusSignal } = useStateStore(\n    messagePaginator.messageFocusSignal,\n    messageFocusSignalSelector,\n  );\n  const focusedMessageId = messageFocusSignal?.messageId;\n\n  const {\n    hasNewMessages,\n    isMessageListScrolledToBottom,\n    onScroll,\n    scrollToBottom,\n    wrapperRect,\n  } = useScrollLocationLogic({\n    focusedMessageId,\n    hasMoreNewer,\n    listElement,\n    loadingMore: isLoading,\n    loadMoreScrollThreshold,\n    messages, // todo: is it correct to base the scroll logic on an array that does not contain date separators or intro?\n    scrolledUpThreshold: props.scrolledUpThreshold,\n    suppressAutoscroll,\n  });\n\n  const { show: showUnreadMessagesNotification, unreadIsBelow } =\n    useUnreadMessagesNotification({\n      isMessageListScrolledToBottom,\n      listElement,\n      showAlways: !!showUnreadNotificationAlways,\n    });\n\n  useMarkRead({\n    hasMoreNewer,\n    isMessageListScrolledToBottom,\n    messageListIsThread: isThreadList,\n  });\n\n  useIncomingMessageAnnouncements({\n    activeThreadId: thread?.id,\n    channel,\n    ownUserId: channel.getClient().user?.id,\n    threadList: isThreadList,\n  });\n\n  const { messageGroupStyles, messages: enrichedMessages } = useEnrichedMessages({\n    channel,\n    getGroupStyles,\n    groupByUser,\n    headerPosition,\n    hideDeletedMessages,\n    hideNewMessageSeparator,\n    maxTimeBetweenGroupedMessages,\n    messages,\n    reviewProcessedMessage,\n    withDateSeparator,\n  });\n\n  const lastOwnMessage = useLastOwnMessage({\n    messages,\n    ownUserId: channel.getClient().user?.id,\n  });\n\n  const elements = useMessageListElements({\n    enrichedMessages,\n    focusedMessageId,\n    internalMessageProps: { ...messageProps, messageListRect: wrapperRect },\n    lastOwnMessage,\n    messageGroupStyles,\n    messages,\n    renderMessages,\n    returnAllReadData,\n  });\n\n  const messageListClass = customClasses?.messageList || 'str-chat__message-list';\n\n  // Stops a short thread from paging at both ends as soon as the scroller mounts.\n  const canPaginateReplies = useCanPaginateReplies();\n\n  const loadOlderMessages = React.useCallback(async () => {\n    // Mirrors the paginator's gate for a tailward page, so `isLoadingOlder` (the older-page\n    // indicator) is not raised while another load holds `isLoading` and `toTail()` would not query.\n    if (\n      loadingOlderRef.current ||\n      messagePaginator.isLoading ||\n      !messagePaginator.hasMoreTail\n    ) {\n      return;\n    }\n    loadingOlderRef.current = true;\n    setIsLoadingOlder(true);\n    try {\n      await messagePaginator.toTail();\n    } finally {\n      loadingOlderRef.current = false;\n      setIsLoadingOlder(false);\n    }\n  }, [messagePaginator]);\n\n  const scrollToBottomFromNotification = React.useCallback(() => {\n    if (messagePaginator.hasMoreHead) {\n      // The latest page is not loaded: load it, and the message-focus signal then drives the\n      // smooth scroll to the latest message via the effect below.\n      messagePaginator.jumpToTheLatestMessage();\n    } else {\n      scrollToBottom({ behavior: getScrollBehavior() });\n    }\n  }, [messagePaginator, scrollToBottom]);\n\n  // Scrolls a focused message (deep-link or quoted-reply jump, or jump-to-latest) into view and\n  // starts its highlight's dismissal countdown once it has been viewed. The list can be collapsed\n  // to zero width when the jump fires (e.g. a thread panel covers the channel), so the initial\n  // scroll uses stale geometry and a countdown started at the jump would expire before the user\n  // sees the message. Hence the relayout re-center (a resize never fires from scrolling, so it\n  // cannot fight the smooth scroll) and the IntersectionObserver below.\n  React.useLayoutEffect(() => {\n    if (!messageFocusSignal || !listElement) return;\n    const { messageId, token } = messageFocusSignal;\n\n    const findTarget = () => findMessageElement(listElement, messageId);\n    const centerTarget = (behavior: ScrollBehavior) =>\n      findTarget()?.scrollIntoView({ behavior, block: 'center' });\n\n    // Smooth (or `auto` under reduced motion) for the common case of a visible list.\n    centerTarget(getScrollBehavior());\n\n    const target = findTarget();\n    if (\n      !target ||\n      typeof IntersectionObserver === 'undefined' ||\n      typeof ResizeObserver === 'undefined'\n    ) {\n      // \"Viewed\" cannot be observed, so start the countdown now to let the highlight clear.\n      messagePaginator.scheduleMessageFocusSignalClear({ token });\n      return;\n    }\n\n    // Re-center when the measured size changes, not on the observer's Nth callback: the reveal\n    // (0 to full width) can coincide with the initial callback, and for a visible list that\n    // callback reports no change, so the smooth scroll above is not interrupted.\n    let lastWidth = listElement.clientWidth;\n    let lastHeight = listElement.clientHeight;\n    const relayoutObserver = new ResizeObserver(() => {\n      const width = listElement.clientWidth;\n      const height = listElement.clientHeight;\n      if (width === lastWidth && height === lastHeight) return;\n      lastWidth = width;\n      lastHeight = height;\n      centerTarget('auto');\n    });\n\n    const viewObserver = new IntersectionObserver(\n      (entries) => {\n        const entry = entries[entries.length - 1];\n        if (!isMessageViewed(entry, listElement.clientHeight)) return;\n        messagePaginator.scheduleMessageFocusSignalClear({ token });\n        viewObserver.disconnect();\n        relayoutObserver.disconnect();\n      },\n      { root: listElement, threshold: MESSAGE_VIEWED_THRESHOLDS },\n    );\n\n    viewObserver.observe(target);\n    relayoutObserver.observe(listElement);\n\n    return () => {\n      viewObserver.disconnect();\n      relayoutObserver.disconnect();\n    };\n  }, [messageFocusSignal, listElement, messagePaginator]);\n\n  const id = useStableId();\n\n  const showEmptyStateIndicator = elements.length === 0 && !isThreadList;\n  const dialogManagerId = isThreadList\n    ? `message-list-dialog-manager-thread-${id}`\n    : `message-list-dialog-manager-${id}`;\n\n  return (\n    <MessageListContextProvider\n      value={{\n        listElement,\n        processedMessages: enrichedMessages,\n        scrollToBottom,\n      }}\n    >\n      <MessageTranslationViewProvider>\n        <DialogManagerProvider id={dialogManagerId}>\n          {!isThreadList && showUnreadMessagesNotification && (\n            <UnreadMessagesNotification\n              unreadCount={channelUnreadUiState?.unreadCount}\n              unreadIsBelow={unreadIsBelow}\n            />\n          )}\n          {/*todo: apply styles\n            .str-chat__list {\n              overflow-y: hidden;\n            }\n\n            .str-chat__infinite-scroll-paginator.str-chat__message-list-scroll {\n              height: 100%;\n            }\n            */}\n          <FloatingDateSeparator\n            listElement={listElement}\n            processedMessages={enrichedMessages}\n            withDateSeparator={withDateSeparator}\n          />\n          <div\n            className={clsx(messageListClass, customClasses?.threadList)}\n            onScroll={onScroll}\n            ref={setListElement}\n            tabIndex={0}\n          >\n            {showEmptyStateIndicator ? (\n              <EmptyStateIndicator listType={isThreadList ? 'thread' : 'message'} />\n            ) : (\n              <InfiniteScrollPaginator\n                className='str-chat__message-list-scroll'\n                data-testid='reverse-infinite-scroll'\n                element={internalListElement}\n                loadNextOnScrollToBottom={\n                  canPaginateReplies ? messagePaginator.toHead : undefined\n                }\n                loadNextOnScrollToTop={canPaginateReplies ? loadOlderMessages : undefined}\n                onScroll={onScroll}\n                ref={setListElement}\n                threshold={loadMoreScrollThreshold}\n                {...restInternalInfiniteScrollProps}\n              >\n                {threadHead}\n                {isLoading && (\n                  <div className='str-chat__list__loading' key='loading-indicator'>\n                    {(props.loadingMore ?? isLoadingOlder) && <LoadingIndicator />}\n                  </div>\n                )}\n                <MessageListWrapper className='str-chat__ul'>\n                  {elements}\n                </MessageListWrapper>\n                <TypingIndicator\n                  isMessageListScrolledToBottom={isMessageListScrolledToBottom}\n                  scrollToBottom={scrollToBottom}\n                />\n\n                <div key='bottom' />\n              </InfiniteScrollPaginator>\n            )}\n            {/* Only for messages that arrived while the reader was scrolled up. Reading an older\n                  window (e.g. after a jump) is signalled by ScrollToLatestMessageButton instead. */}\n            <NewMessageNotification\n              newMessageCount={channelUnreadUiState?.unreadCount}\n              showNotification={hasNewMessages && !isMessageListScrolledToBottom}\n            />\n            {/* An empty list has nothing to jump to. */}\n            {messages.length > 0 && (\n              <ScrollToLatestMessageButton\n                isMessageListScrolledToBottom={isMessageListScrolledToBottom}\n                isNotAtLatestMessageSet={hasMoreNewer && messages.length > 0}\n                onClick={scrollToBottomFromNotification}\n              />\n            )}\n          </div>\n        </DialogManagerProvider>\n      </MessageTranslationViewProvider>\n    </MessageListContextProvider>\n  );\n};\n\ntype PropsDrilledToMessage =\n  | 'closeReactionSelectorOnClick'\n  | 'formatDate'\n  | 'onMentionsClick'\n  | 'onMentionsHover'\n  | 'onUserClick'\n  | 'onUserHover'\n  | 'reactionDetailsSort'\n  | 'renderText'\n  // | 'retrySendMessage'\n  | 'showAvatar'\n  | 'sortReactions'\n  | 'unsafeHTML';\n\n// Allows any intrinsic element while keeping the div props.\ntype InternalPaginatorProps = Partial<\n  Omit<InfiniteScrollPaginatorProps<'div'>, 'element'>\n> & {\n  element?: keyof React.JSX.IntrinsicElements;\n};\n\nexport type MessageListProps = Partial<Pick<MessageProps, PropsDrilledToMessage>> & {\n  // todo: data manipulation - should live in the paginator\n  /** Computes the group style of a message from its neighbors. Defaults to `getGroupStyles`. */\n  getGroupStyles?: GetGroupStyles;\n  /** Groups consecutive messages from the same user. Defaults to `true`. */\n  groupByUser?: boolean;\n  /**\n   * Unix-nanosecond timestamp (the unit of `message.created_at`): `HeaderComponent` renders after\n   * the last message created before it. Defaults to the top of the list.\n   */\n  headerPosition?: TimestampNS;\n  // todo: data manipulation - should live in MessagePaginator\n  /** Hides deleted messages from the list. Defaults to `false`. */\n  hideDeletedMessages?: boolean;\n  // todo: data manipulation - should live in MessagePaginator\n  /** Hides the date separator before the first unread incoming message. Defaults to `false`. */\n  hideNewMessageSeparator?: boolean;\n  /** Overrides the default props passed to [InfiniteScrollPaginator](https://github.com/GetStream/stream-chat-react/blob/master/src/components/InfiniteScrollPaginator/InfiniteScrollPaginator.tsx) */\n  internalInfiniteScrollProps?: InternalPaginatorProps;\n  /**\n   * Whether to show the `LoadingIndicator` above the messages while the paginator is loading.\n   * Defaults to showing it while an older page loads.\n   */\n  loadingMore?: boolean;\n  /** Maximum time (ms) between two messages for them to stay in the same group. */\n  maxTimeBetweenGroupedMessages?: number;\n  /** Overrides how messages are rendered into list elements. */\n  renderMessages?: MessageRenderer;\n  /** Computes read and delivery data for every own message, not only the last one. */\n  returnAllReadData?: boolean;\n  /**\n   * Reviews the changes made around each message (e.g. a date separator injected before it). The\n   * returned array is appended to the rendered messages in place of `changes`.\n   */\n  // todo: have state.pipe() API to allow modifying the state output / emission\n  reviewProcessedMessage?: ProcessMessagesParams['reviewProcessedMessage'];\n  /**\n   * Distance (px) from the bottom within which the list counts as scrolled to the bottom, so a new\n   * message scrolls it all the way down. Defaults to 200.\n   */\n  scrolledUpThreshold?: number;\n  /**\n   * Shows the unread notification whenever the `UnreadMessagesSeparator` is out of view. Defaults\n   * to `false`: it shows only when the separator is scrolled above the viewport.\n   */\n  showUnreadNotificationAlways?: boolean;\n  /** Prevents autoscrolling to the bottom on new messages. */\n  suppressAutoscroll?: boolean;\n  /** Injects date separators into the list. Defaults to `true`. */\n  withDateSeparator?: boolean;\n};\n\n/** Renders the messages of the active channel or thread, plus the notification list. */\nexport const MessageList = (props: MessageListProps) => {\n  const channel = useChannel();\n  const thread = useThreadContext();\n  const notificationTarget = useNotificationTarget();\n  const {\n    MessageListMainPanel = DefaultMessageListMainPanel,\n    NotificationList = DefaultNotificationList,\n  } = useComponentContext();\n\n  // The panel and the notification list sit outside the keyed list: the list's state (scroll\n  // position, etc.) belongs to one thread or channel and resets on a switch, but a notification's\n  // countdown and entry animation have to outlive it.\n  return (\n    <MessageListMainPanel>\n      <MessageListWithContext {...props} key={getMessageSourceKey({ channel, thread })} />\n      <NotificationList panel={notificationTarget} />\n    </MessageListMainPanel>\n  );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAM,iCAAiC,WAAkC;CACvE,cAAc,MAAM;CACpB,WAAW,MAAM;CACjB,UAAU,MAAM,SAAS,CAAC;AAC5B;AAEA,IAAM,+BAA+B,UAA+B;AACpE,IAAM,8BAA8B,WAAoC,EACtE,oBAAoB,MAAM,OAC5B;AAMA,IAAM,0BACJ,OAAO,WAAW,eAClB,OAAO,OAAO,eAAe,cAC7B,OAAO,WAAW,kCAAkC,CAAC,CAAC,UAClD,SACA;AAEN,IAAM,0BAA0B,UAAuC;CACrE,MAAM,UAAU,WAAW;CAC3B,MAAM,EACJ,gBACA,cAAc,MACd,gBACA,sBAAsB,OACtB,0BAA0B,OAC1B,6BAA6B,EAC3B,SAAS,sBAAsB,OAC/B,WAAW,0BAAA,KACX,GAAG,oCACD,CAAC,GACL,+BACA,qBACA,iBAAiB,uBACjB,oBAAoB,OACpB,wBACA,8BACA,eACA,oBAAoB,8BAA8B,OAClD,oBAAoB,SAClB;CAEJ,MAAM,eAAmC;EACvC,8BAA8B,MAAM;EACpC,YAAY,MAAM;EAClB,iBAAiB,MAAM;EACvB,iBAAiB,MAAM;EACvB,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