stream-chat-react 11.16.1 → 11.17.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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Window = require('../../Window-9d319da4.js');
5
+ var Window = require('../../Window-5a6bf944.js');
6
6
  var React = require('react');
7
7
  var Picker = require('@emoji-mart/react');
8
8
  require('dayjs');
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { ChannelActionContextValue } from '../../context/ChannelActionContext';
3
3
  import { InfiniteScrollProps } from '../InfiniteScrollPaginator/InfiniteScroll';
4
- import type { GroupStyle } from './utils';
5
4
  import { MessageRenderer } from './renderMessages';
5
+ import type { GroupStyle, ProcessMessagesParams } from './utils';
6
6
  import type { MessageProps } from '../Message/types';
7
7
  import type { StreamMessage } from '../../context/ChannelStateContext';
8
8
  import type { DefaultStreamChatGenerics } from '../../types/types';
@@ -44,6 +44,11 @@ export type MessageListProps<StreamChatGenerics extends DefaultStreamChatGeneric
44
44
  renderMessages?: MessageRenderer<StreamChatGenerics>;
45
45
  /** If true, `readBy` data supplied to the `Message` components will include all user read states per sent message */
46
46
  returnAllReadData?: boolean;
47
+ /**
48
+ * Allows to review changes introduced to messages array on per message basis (e.g. date separator injection before a message).
49
+ * The array returned from the function is appended to the array of messages that are later rendered into React elements in the `MessageList`.
50
+ */
51
+ reviewProcessedMessage?: ProcessMessagesParams<StreamChatGenerics>['reviewProcessedMessage'];
47
52
  /**
48
53
  * The pixel threshold under which the message list is considered to be so near to the bottom,
49
54
  * so that if a new message is delivered, the list will be scrolled to the absolute bottom.
@@ -1 +1 @@
1
- {"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/MessageList/MessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAc1B,OAAO,EACL,yBAAyB,EAE1B,MAAM,oCAAoC,CAAC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AC5B;;;OAGG;IACH,sBAAsB,CAAC,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,CAAC,wBAAwB,CAAC,CAAC;IAC7F;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;OAIG;IACH,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,sJA2BvB,CAAC"}
@@ -22,7 +22,7 @@ var MessageListWithContext = function (props) {
22
22
  var _a;
23
23
  var channel = props.channel, channelUnreadUiState = props.channelUnreadUiState, _b = props.disableDateSeparator, disableDateSeparator = _b === void 0 ? false : _b, groupStyles = props.groupStyles, _c = props.hideDeletedMessages, hideDeletedMessages = _c === void 0 ? false : _c, _d = props.hideNewMessageSeparator, hideNewMessageSeparator = _d === void 0 ? false : _d, _e = props.internalInfiniteScrollProps, _f = _e === void 0 ? {} : _e, _g = _f.threshold, loadMoreScrollThreshold = _g === void 0 ? DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD : _g, restInternalInfiniteScrollProps = __rest(_f, ["threshold"]), _h = props.messageActions, messageActions = _h === void 0 ? Object.keys(MESSAGE_ACTIONS) : _h, _j = props.messages, messages = _j === void 0 ? [] : _j, notifications = props.notifications, _k = props.noGroupByUser, noGroupByUser = _k === void 0 ? false : _k, _l = props.pinPermissions, pinPermissions = _l === void 0 ? defaultPinPermissions : _l, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
24
24
  _m = props.returnAllReadData, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
25
- returnAllReadData = _m === void 0 ? false : _m, _o = props.threadList, threadList = _o === void 0 ? false : _o, _p = props.unsafeHTML, unsafeHTML = _p === void 0 ? false : _p, headerPosition = props.headerPosition, read = props.read, _q = props.renderMessages, renderMessages = _q === void 0 ? defaultRenderMessages : _q, _r = props.messageLimit, messageLimit = _r === void 0 ? DEFAULT_NEXT_CHANNEL_PAGE_SIZE : _r, loadMoreCallback = props.loadMore, loadMoreNewerCallback = props.loadMoreNewer, _s = props.hasMoreNewer, hasMoreNewer = _s === void 0 ? false : _s, showUnreadNotificationAlways = props.showUnreadNotificationAlways, suppressAutoscroll = props.suppressAutoscroll, highlightedMessageId = props.highlightedMessageId, _t = props.jumpToLatestMessage, jumpToLatestMessage = _t === void 0 ? function () { return Promise.resolve(); } : _t;
25
+ returnAllReadData = _m === void 0 ? false : _m, _o = props.threadList, threadList = _o === void 0 ? false : _o, _p = props.unsafeHTML, unsafeHTML = _p === void 0 ? false : _p, headerPosition = props.headerPosition, read = props.read, _q = props.renderMessages, renderMessages = _q === void 0 ? defaultRenderMessages : _q, reviewProcessedMessage = props.reviewProcessedMessage, _r = props.messageLimit, messageLimit = _r === void 0 ? DEFAULT_NEXT_CHANNEL_PAGE_SIZE : _r, loadMoreCallback = props.loadMore, loadMoreNewerCallback = props.loadMoreNewer, _s = props.hasMoreNewer, hasMoreNewer = _s === void 0 ? false : _s, showUnreadNotificationAlways = props.showUnreadNotificationAlways, suppressAutoscroll = props.suppressAutoscroll, highlightedMessageId = props.highlightedMessageId, _t = props.jumpToLatestMessage, jumpToLatestMessage = _t === void 0 ? function () { return Promise.resolve(); } : _t;
26
26
  var _u = React.useState(null), listElement = _u[0], setListElement = _u[1];
27
27
  var _v = React.useState(null), ulElement = _v[0], setUlElement = _v[1];
28
28
  var customClasses = useChatContext('MessageList').customClasses;
@@ -55,6 +55,7 @@ var MessageListWithContext = function (props) {
55
55
  hideNewMessageSeparator: hideNewMessageSeparator,
56
56
  messages: messages,
57
57
  noGroupByUser: noGroupByUser,
58
+ reviewProcessedMessage: reviewProcessedMessage,
58
59
  }), messageGroupStyles = _4.messageGroupStyles, enrichedMessages = _4.messages;
59
60
  var elements = useMessageListElements({
60
61
  channelUnreadUiState: channelUnreadUiState,
@@ -1,6 +1,6 @@
1
1
  import React, { RefObject } from 'react';
2
2
  import { ScrollSeekConfiguration, ScrollSeekPlaceholderProps, VirtuosoHandle, VirtuosoProps } from 'react-virtuoso';
3
- import { GroupStyle } from './utils';
3
+ import { GroupStyle, ProcessMessagesParams } from './utils';
4
4
  import { MessageProps, MessageUIComponentProps } from '../Message';
5
5
  import { ChannelActionContextValue } from '../../context/ChannelActionContext';
6
6
  import { StreamMessage } from '../../context/ChannelStateContext';
@@ -88,6 +88,11 @@ export type VirtualizedMessageListProps<StreamChatGenerics extends DefaultStream
88
88
  overscan?: number;
89
89
  /** Keep track of read receipts for each message sent by the user. When disabled, only the last own message delivery / read status is rendered. */
90
90
  returnAllReadData?: boolean;
91
+ /**
92
+ * Allows to review changes introduced to messages array on per message basis (e.g. date separator injected before a message).
93
+ * The array returned from the function is appended to the array of messages that are later rendered into React elements in the `VirtualizedMessageList`.
94
+ */
95
+ reviewProcessedMessage?: ProcessMessagesParams<StreamChatGenerics>['reviewProcessedMessage'];
91
96
  /**
92
97
  * @deprecated Pass additionalVirtuosoProps.scrollSeekConfiguration and specify the placeholder in additionalVirtuosoProps.components.ScrollSeekPlaceholder instead. Will be removed with next major release - `v11.0.0`.
93
98
  * Performance improvement by showing placeholders if user scrolls fast through list.
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedMessageList.d.ts","sourceRoot":"","sources":["../../../src/components/MessageList/VirtualizedMessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA2C,MAAM,OAAO,CAAC;AAClF,OAAO,EAEL,uBAAuB,EACvB,0BAA0B,EAE1B,cAAc,EACd,aAAa,EACd,MAAM,gBAAgB,CAAC;AAkBxB,OAAO,EAAmC,UAAU,EAAmB,MAAM,SAAS,CAAC;AACvF,OAAO,EAAE,YAAY,EAAiB,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAalF,OAAO,EACL,yBAAyB,EAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGL,aAAa,EAEd,MAAM,mCAAmC,CAAC;AAC3C,OA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B,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IAChD,qEAAqE;IACrE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,EAChF,KAAK,EAAE,2BAA2B,CAAC,kBAAkB,CAAC,qBAyCvD"}
1
+ {"version":3,"file":"VirtualizedMessageList.d.ts","sourceRoot":"","sources":["../../../src/components/MessageList/VirtualizedMessageList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAA2C,MAAM,OAAO,CAAC;AAClF,OAAO,EAEL,uBAAuB,EACvB,0BAA0B,EAE1B,cAAc,EACd,aAAa,EACd,MAAM,gBAAgB,CAAC;AAkBxB,OAAO,EAGL,UAAU,EAEV,qBAAqB,EACtB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAiB,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAalF,OAAO,EACL,yBAAyB,EAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAGL,aAAa,EAEd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAkB,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAuB,MAAM,gCAAgC,CAAC;AAE5F,OAAO,KAAK,EAA+C,YAAY,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAE,yBAAyB,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhF,KAAK,qCAAqC,GACtC,6BAA6B,GAC7B,8BAA8B,GAC9B,sBAAsB,GACtB,uBAAuB,GACvB,MAAM,GACN,aAAa,GACb,SAAS,GACT,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,qBAAqB,GACrB,YAAY,CAAC;AAEjB;;GAEG;AACH,MAAM,MA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import { MessageNotification as DefaultMessageNotification } from './MessageNotification';
9
9
  import { MessageListNotifications as DefaultMessageListNotifications } from './MessageListNotifications';
10
10
  import { MessageListMainPanel } from './MessageListMainPanel';
11
- import { getGroupStyles, getLastReceived, processMessages } from './utils';
11
+ import { getGroupStyles, getLastReceived, processMessages, } from './utils';
12
12
  import { MessageSimple } from '../Message';
13
13
  import { UnreadMessagesNotification as DefaultUnreadMessagesNotification } from './UnreadMessagesNotification';
14
14
  import { calculateFirstItemIndex, calculateItemIndex, EmptyPlaceholder, Footer, Header, Item, makeItemsRenderedHandler, messageRenderer, } from './VirtualizedMessageListComponents';
@@ -52,7 +52,7 @@ var VirtualizedMessageListWithContext = function (props) {
52
52
  // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
53
53
  _h = props.overscan,
54
54
  // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
55
- overscan = _h === void 0 ? 0 : _h, read = props.read, _j = props.returnAllReadData, returnAllReadData = _j === void 0 ? false : _j, scrollSeekPlaceHolder = props.scrollSeekPlaceHolder, _k = props.scrollToLatestMessageOnFocus, scrollToLatestMessageOnFocus = _k === void 0 ? false : _k, _l = props.separateGiphyPreview, separateGiphyPreview = _l === void 0 ? false : _l, _m = props.shouldGroupByUser, shouldGroupByUser = _m === void 0 ? false : _m, showUnreadNotificationAlways = props.showUnreadNotificationAlways, sortReactionDetails = props.sortReactionDetails, sortReactions = props.sortReactions, _o = props.stickToBottomScrollBehavior, stickToBottomScrollBehavior = _o === void 0 ? 'smooth' : _o, suppressAutoscroll = props.suppressAutoscroll, threadList = props.threadList;
55
+ overscan = _h === void 0 ? 0 : _h, read = props.read, _j = props.returnAllReadData, returnAllReadData = _j === void 0 ? false : _j, reviewProcessedMessage = props.reviewProcessedMessage, scrollSeekPlaceHolder = props.scrollSeekPlaceHolder, _k = props.scrollToLatestMessageOnFocus, scrollToLatestMessageOnFocus = _k === void 0 ? false : _k, _l = props.separateGiphyPreview, separateGiphyPreview = _l === void 0 ? false : _l, _m = props.shouldGroupByUser, shouldGroupByUser = _m === void 0 ? false : _m, showUnreadNotificationAlways = props.showUnreadNotificationAlways, sortReactionDetails = props.sortReactionDetails, sortReactions = props.sortReactions, _o = props.stickToBottomScrollBehavior, stickToBottomScrollBehavior = _o === void 0 ? 'smooth' : _o, suppressAutoscroll = props.suppressAutoscroll, threadList = props.threadList;
56
56
  var virtuosoComponentsFromProps = additionalVirtuosoProps.components, overridingVirtuosoProps = __rest(additionalVirtuosoProps, ["components"]);
57
57
  // Stops errors generated from react-virtuoso to bubble up
58
58
  // to Sentry or other tracking tools.
@@ -84,6 +84,7 @@ var VirtualizedMessageListWithContext = function (props) {
84
84
  hideNewMessageSeparator: hideNewMessageSeparator,
85
85
  lastRead: lastRead,
86
86
  messages: messages,
87
+ reviewProcessedMessage: reviewProcessedMessage,
87
88
  setGiphyPreviewMessage: setGiphyPreviewMessage,
88
89
  userId: client.userID || '',
89
90
  });
@@ -1,4 +1,4 @@
1
- import { GroupStyle } from '../../utils';
1
+ import { GroupStyle, ProcessMessagesParams } from '../../utils';
2
2
  import type { Channel } from 'stream-chat';
3
3
  import type { StreamMessage } from '../../../../context/ChannelStateContext';
4
4
  import type { DefaultStreamChatGenerics } from '../../../../types/types';
@@ -11,6 +11,19 @@ export declare const useEnrichedMessages: <StreamChatGenerics extends DefaultStr
11
11
  noGroupByUser: boolean;
12
12
  groupStyles?: ((message: StreamMessage<StreamChatGenerics>, previousMessage: StreamMessage<StreamChatGenerics>, nextMessage: StreamMessage<StreamChatGenerics>, noGroupByUser: boolean) => GroupStyle) | undefined;
13
13
  headerPosition?: number | undefined;
14
+ reviewProcessedMessage?: ((params: {
15
+ changes: StreamMessage<StreamChatGenerics>[];
16
+ context: {
17
+ userId: string;
18
+ enableDateSeparator?: boolean | undefined;
19
+ hideDeletedMessages?: boolean | undefined;
20
+ hideNewMessageSeparator?: boolean | undefined;
21
+ lastRead?: Date | null | undefined;
22
+ };
23
+ index: number;
24
+ messages: StreamMessage<StreamChatGenerics>[];
25
+ processedMessages: StreamMessage<StreamChatGenerics>[];
26
+ }) => StreamMessage<StreamChatGenerics>[]) | undefined;
14
27
  }) => {
15
28
  messageGroupStyles: Record<string, GroupStyle>;
16
29
  messages: StreamMessage<StreamChatGenerics>[];
@@ -1 +1 @@
1
- {"version":3,"file":"useEnrichedMessages.d.ts","sourceRoot":"","sources":["../../../../../src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,UAAU,EAAgC,MAAM,aAAa,CAAC;AAKvF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,eAAO,MAAM,mBAAmB;;0BAIR,OAAO;yBACR,OAAO;6BACH,OAAO;;mBAEjB,OAAO;mLAKL,OAAO,KACnB,UAAU;;;;;CAuDhB,CAAC"}
1
+ {"version":3,"file":"useEnrichedMessages.d.ts","sourceRoot":"","sources":["../../../../../src/components/MessageList/hooks/MessageList/useEnrichedMessages.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EAGV,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAKrB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEzE,eAAO,MAAM,mBAAmB;;0BAIR,OAAO;yBACR,OAAO;6BACH,OAAO;;mBAEjB,OAAO;mLAKL,OAAO,KACnB,UAAU;;;;;;;;;;;;;;;;;;CA0DhB,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import { useMemo } from 'react';
2
- import { getGroupStyles, insertIntro, processMessages } from '../../utils';
2
+ import { getGroupStyles, insertIntro, processMessages, } from '../../utils';
3
3
  import { useChatContext } from '../../../../context/ChatContext';
4
4
  import { useComponentContext } from '../../../../context/ComponentContext';
5
5
  export var useEnrichedMessages = function (args) {
6
- var channel = args.channel, disableDateSeparator = args.disableDateSeparator, groupStyles = args.groupStyles, headerPosition = args.headerPosition, hideDeletedMessages = args.hideDeletedMessages, hideNewMessageSeparator = args.hideNewMessageSeparator, messages = args.messages, noGroupByUser = args.noGroupByUser;
6
+ var channel = args.channel, disableDateSeparator = args.disableDateSeparator, groupStyles = args.groupStyles, headerPosition = args.headerPosition, hideDeletedMessages = args.hideDeletedMessages, hideNewMessageSeparator = args.hideNewMessageSeparator, messages = args.messages, noGroupByUser = args.noGroupByUser, reviewProcessedMessage = args.reviewProcessedMessage;
7
7
  var client = useChatContext('useEnrichedMessages').client;
8
8
  var HeaderComponent = useComponentContext('useEnrichedMessages').HeaderComponent;
9
9
  var lastRead = useMemo(function () { var _a; return (_a = channel.lastRead) === null || _a === void 0 ? void 0 : _a.call(channel); }, [channel]);
@@ -16,6 +16,7 @@ export var useEnrichedMessages = function (args) {
16
16
  hideNewMessageSeparator: hideNewMessageSeparator,
17
17
  lastRead: lastRead,
18
18
  messages: messages,
19
+ reviewProcessedMessage: reviewProcessedMessage,
19
20
  userId: client.userID || '',
20
21
  });
21
22
  if (HeaderComponent) {
@@ -3,8 +3,8 @@ import { CUSTOM_MESSAGE_TYPE } from '../../constants/messageTypes';
3
3
  import type { MessageLabel, UserResponse } from 'stream-chat';
4
4
  import type { DefaultStreamChatGenerics } from '../../types/types';
5
5
  import type { StreamMessage } from '../../context/ChannelStateContext';
6
- type ProcessMessagesParams<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = {
7
- messages: StreamMessage<StreamChatGenerics>[];
6
+ type ProcessMessagesContext = {
7
+ /** the connected user ID */
8
8
  userId: string;
9
9
  /** Enable date separator */
10
10
  enableDateSeparator?: boolean;
@@ -12,8 +12,23 @@ type ProcessMessagesParams<StreamChatGenerics extends DefaultStreamChatGenerics
12
12
  hideDeletedMessages?: boolean;
13
13
  /** Disable date separator display for unread incoming messages */
14
14
  hideNewMessageSeparator?: boolean;
15
- /** Sets the treshold after everything is considered unread */
15
+ /** Sets the threshold after everything is considered unread */
16
16
  lastRead?: Date | null;
17
+ };
18
+ export type ProcessMessagesParams<StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics> = ProcessMessagesContext & {
19
+ messages: StreamMessage<StreamChatGenerics>[];
20
+ reviewProcessedMessage?: (params: {
21
+ /** array of messages representing the changes applied around a given processed message */
22
+ changes: StreamMessage<StreamChatGenerics>[];
23
+ /** configuration params and information forwarded from `processMessages` */
24
+ context: ProcessMessagesContext;
25
+ /** index of the processed message in the original messages array */
26
+ index: number;
27
+ /** array of messages retrieved from the back-end */
28
+ messages: StreamMessage<StreamChatGenerics>[];
29
+ /** newly built array of messages to be later rendered */
30
+ processedMessages: StreamMessage<StreamChatGenerics>[];
31
+ }) => StreamMessage<StreamChatGenerics>[];
17
32
  /** Signals whether to separate giphy preview as well as used to set the giphy preview state */
18
33
  setGiphyPreviewMessage?: React.Dispatch<React.SetStateAction<StreamMessage<StreamChatGenerics> | undefined>>;
19
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/MessageList/utils.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAInE,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAGvE,KAAK,qBAAqB,CACxB,kBAAkB,SAAS,yBAAyB,GAAG,yBAAyB,IAC9E;IACF,QAAQ,EAAE,a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";
1
2
  /* eslint-disable no-continue */
2
3
  import { nanoid } from 'nanoid';
3
4
  import { CUSTOM_MESSAGE_TYPE } from '../../constants/messageTypes';
@@ -21,7 +22,8 @@ import { isMessageEdited } from '../Message/utils';
21
22
  */
22
23
  export var processMessages = function (params) {
23
24
  var _a, _b;
24
- var enableDateSeparator = params.enableDateSeparator, hideDeletedMessages = params.hideDeletedMessages, hideNewMessageSeparator = params.hideNewMessageSeparator, lastRead = params.lastRead, messages = params.messages, setGiphyPreviewMessage = params.setGiphyPreviewMessage, userId = params.userId;
25
+ var messages = params.messages, reviewProcessedMessage = params.reviewProcessedMessage, setGiphyPreviewMessage = params.setGiphyPreviewMessage, context = __rest(params, ["messages", "reviewProcessedMessage", "setGiphyPreviewMessage"]);
26
+ var enableDateSeparator = context.enableDateSeparator, hideDeletedMessages = context.hideDeletedMessages, hideNewMessageSeparator = context.hideNewMessageSeparator, lastRead = context.lastRead, userId = context.userId;
25
27
  var unread = false;
26
28
  var ephemeralMessagePresent = false;
27
29
  var lastDateSeparator;
@@ -36,6 +38,7 @@ export var processMessages = function (params) {
36
38
  setGiphyPreviewMessage(message);
37
39
  continue;
38
40
  }
41
+ var changes = [];
39
42
  var messageDate = (message.created_at && isDate(message.created_at) && message.created_at.toDateString()) || '';
40
43
  var previousMessage = messages[i - 1];
41
44
  var prevMessageDate = messageDate;
@@ -46,7 +49,7 @@ export var processMessages = function (params) {
46
49
  unread = (lastRead && message.created_at && new Date(lastRead) < message.created_at) || false;
47
50
  // do not show date separator for current user's messages
48
51
  if (enableDateSeparator && unread && ((_a = message.user) === null || _a === void 0 ? void 0 : _a.id) !== userId) {
49
- newMessages.push({
52
+ changes.push({
50
53
  customType: CUSTOM_MESSAGE_TYPE.date,
51
54
  date: message.created_at,
52
55
  id: makeDateMessageId(message.created_at),
@@ -61,18 +64,25 @@ export var processMessages = function (params) {
61
64
  (hideDeletedMessages &&
62
65
  (previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.type) === 'deleted' &&
63
66
  lastDateSeparator !== messageDate)) &&
64
- ((_b = newMessages === null || newMessages === void 0 ? void 0 : newMessages[newMessages.length - 1]) === null || _b === void 0 ? void 0 : _b.customType) !== CUSTOM_MESSAGE_TYPE.date // do not show two date separators in a row)
67
+ ((_b = changes[changes.length - 1]) === null || _b === void 0 ? void 0 : _b.customType) !== CUSTOM_MESSAGE_TYPE.date // do not show two date separators in a row)
65
68
  ) {
66
69
  lastDateSeparator = messageDate;
67
- newMessages.push({
70
+ changes.push({
68
71
  customType: CUSTOM_MESSAGE_TYPE.date,
69
72
  date: message.created_at,
70
73
  id: makeDateMessageId(message.created_at),
71
74
  }, message);
72
75
  }
73
76
  else {
74
- newMessages.push(message);
77
+ changes.push(message);
75
78
  }
79
+ newMessages.push.apply(newMessages, ((reviewProcessedMessage === null || reviewProcessedMessage === void 0 ? void 0 : reviewProcessedMessage({
80
+ changes: changes,
81
+ context: context,
82
+ index: i,
83
+ messages: messages,
84
+ processedMessages: newMessages,
85
+ })) || changes));
76
86
  }
77
87
  // clean up the giphy preview component state after a Cancel action
78
88
  if (setGiphyPreviewMessage && !ephemeralMessagePresent) {
package/dist/index.cjs.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Window = require('./Window-9d319da4.js');
5
+ var Window = require('./Window-5a6bf944.js');
6
6
  var React = require('react');
7
7
  var streamChat = require('stream-chat');
8
8
  var throttle = require('lodash.throttle');
@@ -117,7 +117,7 @@ var GiphyPreviewMessage = function (props) {
117
117
  };
118
118
 
119
119
  var useEnrichedMessages = function (args) {
120
- var channel = args.channel, disableDateSeparator = args.disableDateSeparator, groupStyles = args.groupStyles, headerPosition = args.headerPosition, hideDeletedMessages = args.hideDeletedMessages, hideNewMessageSeparator = args.hideNewMessageSeparator, messages = args.messages, noGroupByUser = args.noGroupByUser;
120
+ var channel = args.channel, disableDateSeparator = args.disableDateSeparator, groupStyles = args.groupStyles, headerPosition = args.headerPosition, hideDeletedMessages = args.hideDeletedMessages, hideNewMessageSeparator = args.hideNewMessageSeparator, messages = args.messages, noGroupByUser = args.noGroupByUser, reviewProcessedMessage = args.reviewProcessedMessage;
121
121
  var client = Window.useChatContext('useEnrichedMessages').client;
122
122
  var HeaderComponent = Window.useComponentContext('useEnrichedMessages').HeaderComponent;
123
123
  var lastRead = React.useMemo(function () { var _a; return (_a = channel.lastRead) === null || _a === void 0 ? void 0 : _a.call(channel); }, [channel]);
@@ -130,6 +130,7 @@ var useEnrichedMessages = function (args) {
130
130
  hideNewMessageSeparator: hideNewMessageSeparator,
131
131
  lastRead: lastRead,
132
132
  messages: messages,
133
+ reviewProcessedMessage: reviewProcessedMessage,
133
134
  userId: client.userID || '',
134
135
  });
135
136
  if (HeaderComponent) {
@@ -652,7 +653,7 @@ var MessageListWithContext = function (props) {
652
653
  var _a;
653
654
  var channel = props.channel, channelUnreadUiState = props.channelUnreadUiState, _b = props.disableDateSeparator, disableDateSeparator = _b === void 0 ? false : _b, groupStyles = props.groupStyles, _c = props.hideDeletedMessages, hideDeletedMessages = _c === void 0 ? false : _c, _d = props.hideNewMessageSeparator, hideNewMessageSeparator = _d === void 0 ? false : _d, _e = props.internalInfiniteScrollProps, _f = _e === void 0 ? {} : _e, _g = _f.threshold, loadMoreScrollThreshold = _g === void 0 ? Window.DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD : _g, restInternalInfiniteScrollProps = Window.__rest(_f, ["threshold"]), _h = props.messageActions, messageActions = _h === void 0 ? Object.keys(Window.MESSAGE_ACTIONS) : _h, _j = props.messages, messages = _j === void 0 ? [] : _j, notifications = props.notifications, _k = props.noGroupByUser, noGroupByUser = _k === void 0 ? false : _k, _l = props.pinPermissions, pinPermissions = _l === void 0 ? Window.defaultPinPermissions : _l, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
654
655
  _m = props.returnAllReadData, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
655
- returnAllReadData = _m === void 0 ? false : _m, _o = props.threadList, threadList = _o === void 0 ? false : _o, _p = props.unsafeHTML, unsafeHTML = _p === void 0 ? false : _p, headerPosition = props.headerPosition, read = props.read, _q = props.renderMessages, renderMessages = _q === void 0 ? defaultRenderMessages : _q, _r = props.messageLimit, messageLimit = _r === void 0 ? Window.DEFAULT_NEXT_CHANNEL_PAGE_SIZE : _r, loadMoreCallback = props.loadMore, loadMoreNewerCallback = props.loadMoreNewer, _s = props.hasMoreNewer, hasMoreNewer = _s === void 0 ? false : _s, showUnreadNotificationAlways = props.showUnreadNotificationAlways, suppressAutoscroll = props.suppressAutoscroll, highlightedMessageId = props.highlightedMessageId, _t = props.jumpToLatestMessage, jumpToLatestMessage = _t === void 0 ? function () { return Promise.resolve(); } : _t;
656
+ returnAllReadData = _m === void 0 ? false : _m, _o = props.threadList, threadList = _o === void 0 ? false : _o, _p = props.unsafeHTML, unsafeHTML = _p === void 0 ? false : _p, headerPosition = props.headerPosition, read = props.read, _q = props.renderMessages, renderMessages = _q === void 0 ? defaultRenderMessages : _q, reviewProcessedMessage = props.reviewProcessedMessage, _r = props.messageLimit, messageLimit = _r === void 0 ? Window.DEFAULT_NEXT_CHANNEL_PAGE_SIZE : _r, loadMoreCallback = props.loadMore, loadMoreNewerCallback = props.loadMoreNewer, _s = props.hasMoreNewer, hasMoreNewer = _s === void 0 ? false : _s, showUnreadNotificationAlways = props.showUnreadNotificationAlways, suppressAutoscroll = props.suppressAutoscroll, highlightedMessageId = props.highlightedMessageId, _t = props.jumpToLatestMessage, jumpToLatestMessage = _t === void 0 ? function () { return Promise.resolve(); } : _t;
656
657
  var _u = React__default["default"].useState(null), listElement = _u[0], setListElement = _u[1];
657
658
  var _v = React__default["default"].useState(null), ulElement = _v[0], setUlElement = _v[1];
658
659
  var customClasses = Window.useChatContext('MessageList').customClasses;
@@ -685,6 +686,7 @@ var MessageListWithContext = function (props) {
685
686
  hideNewMessageSeparator: hideNewMessageSeparator,
686
687
  messages: messages,
687
688
  noGroupByUser: noGroupByUser,
689
+ reviewProcessedMessage: reviewProcessedMessage,
688
690
  }), messageGroupStyles = _4.messageGroupStyles, enrichedMessages = _4.messages;
689
691
  var elements = useMessageListElements({
690
692
  channelUnreadUiState: channelUnreadUiState,
@@ -1149,7 +1151,7 @@ var VirtualizedMessageListWithContext = function (props) {
1149
1151
  // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
1150
1152
  _h = props.overscan,
1151
1153
  // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
1152
- overscan = _h === void 0 ? 0 : _h, read = props.read, _j = props.returnAllReadData, returnAllReadData = _j === void 0 ? false : _j, scrollSeekPlaceHolder = props.scrollSeekPlaceHolder, _k = props.scrollToLatestMessageOnFocus, scrollToLatestMessageOnFocus = _k === void 0 ? false : _k, _l = props.separateGiphyPreview, separateGiphyPreview = _l === void 0 ? false : _l, _m = props.shouldGroupByUser, shouldGroupByUser = _m === void 0 ? false : _m, showUnreadNotificationAlways = props.showUnreadNotificationAlways, sortReactionDetails = props.sortReactionDetails, sortReactions = props.sortReactions, _o = props.stickToBottomScrollBehavior, stickToBottomScrollBehavior = _o === void 0 ? 'smooth' : _o, suppressAutoscroll = props.suppressAutoscroll, threadList = props.threadList;
1154
+ overscan = _h === void 0 ? 0 : _h, read = props.read, _j = props.returnAllReadData, returnAllReadData = _j === void 0 ? false : _j, reviewProcessedMessage = props.reviewProcessedMessage, scrollSeekPlaceHolder = props.scrollSeekPlaceHolder, _k = props.scrollToLatestMessageOnFocus, scrollToLatestMessageOnFocus = _k === void 0 ? false : _k, _l = props.separateGiphyPreview, separateGiphyPreview = _l === void 0 ? false : _l, _m = props.shouldGroupByUser, shouldGroupByUser = _m === void 0 ? false : _m, showUnreadNotificationAlways = props.showUnreadNotificationAlways, sortReactionDetails = props.sortReactionDetails, sortReactions = props.sortReactions, _o = props.stickToBottomScrollBehavior, stickToBottomScrollBehavior = _o === void 0 ? 'smooth' : _o, suppressAutoscroll = props.suppressAutoscroll, threadList = props.threadList;
1153
1155
  var virtuosoComponentsFromProps = additionalVirtuosoProps.components, overridingVirtuosoProps = Window.__rest(additionalVirtuosoProps, ["components"]);
1154
1156
  // Stops errors generated from react-virtuoso to bubble up
1155
1157
  // to Sentry or other tracking tools.
@@ -1181,6 +1183,7 @@ var VirtualizedMessageListWithContext = function (props) {
1181
1183
  hideNewMessageSeparator: hideNewMessageSeparator,
1182
1184
  lastRead: lastRead,
1183
1185
  messages: messages,
1186
+ reviewProcessedMessage: reviewProcessedMessage,
1184
1187
  setGiphyPreviewMessage: setGiphyPreviewMessage,
1185
1188
  userId: client.userID || '',
1186
1189
  });
@@ -1344,7 +1347,7 @@ function VirtualizedMessageList(props) {
1344
1347
  return (React__default["default"].createElement(VirtualizedMessageListWithContext, Window.__assign({ channel: channel, channelUnreadUiState: channelUnreadUiState, hasMore: !!hasMore, hasMoreNewer: !!hasMoreNewer, highlightedMessageId: highlightedMessageId, jumpToLatestMessage: jumpToLatestMessage, loadingMore: !!loadingMore, loadingMoreNewer: !!loadingMoreNewer, loadMore: loadMore, loadMoreNewer: loadMoreNewer, messages: messages, notifications: notifications, read: read, suppressAutoscroll: suppressAutoscroll }, props)));
1345
1348
  }
1346
1349
 
1347
- var version = '11.16.1';
1350
+ var version = '11.17.0';
1348
1351
 
1349
1352
  var useChat = function (_a) {
1350
1353
  var _b, _c;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const version = "11.16.1";
1
+ export declare const version = "11.17.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export var version = '11.16.1';
1
+ export var version = '11.17.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stream-chat-react",
3
- "version": "11.16.1",
3
+ "version": "11.17.0",
4
4
  "description": "React components to create chat conversations or livestream style chat",
5
5
  "author": "GetStream",
6
6
  "homepage": "https://getstream.io/chat/",