stream-chat-react 11.2.1 → 11.4.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.
Files changed (149) hide show
  1. package/dist/browser.full-bundle.js +805 -708
  2. package/dist/browser.full-bundle.js.map +1 -1
  3. package/dist/browser.full-bundle.min.js +4 -4
  4. package/dist/browser.full-bundle.min.js.map +1 -1
  5. package/dist/components/Attachment/Attachment.d.ts.map +1 -1
  6. package/dist/components/Attachment/Attachment.js +1 -0
  7. package/dist/components/Attachment/AttachmentContainer.d.ts.map +1 -1
  8. package/dist/components/Attachment/AttachmentContainer.js +1 -0
  9. package/dist/components/Attachment/hooks/useAudioController.d.ts.map +1 -1
  10. package/dist/components/Attachment/hooks/useAudioController.js +1 -0
  11. package/dist/components/Channel/Channel.d.ts +2 -0
  12. package/dist/components/Channel/Channel.d.ts.map +1 -1
  13. package/dist/components/Channel/Channel.js +35 -24
  14. package/dist/components/Channel/hooks/useCreateChannelStateContext.d.ts.map +1 -1
  15. package/dist/components/Channel/hooks/useCreateChannelStateContext.js +3 -1
  16. package/dist/components/Channel/hooks/useCreateTypingContext.d.ts.map +1 -1
  17. package/dist/components/Channel/hooks/useCreateTypingContext.js +3 -1
  18. package/dist/components/ChannelList/ChannelList.d.ts.map +1 -1
  19. package/dist/components/ChannelList/ChannelList.js +3 -0
  20. package/dist/components/ChannelList/hooks/useChannelDeletedListener.d.ts.map +1 -1
  21. package/dist/components/ChannelList/hooks/useChannelDeletedListener.js +1 -0
  22. package/dist/components/ChannelList/hooks/useChannelHiddenListener.d.ts.map +1 -1
  23. package/dist/components/ChannelList/hooks/useChannelHiddenListener.js +1 -0
  24. package/dist/components/ChannelList/hooks/useChannelTruncatedListener.d.ts.map +1 -1
  25. package/dist/components/ChannelList/hooks/useChannelTruncatedListener.js +1 -0
  26. package/dist/components/ChannelList/hooks/useChannelUpdatedListener.d.ts.map +1 -1
  27. package/dist/components/ChannelList/hooks/useChannelUpdatedListener.js +1 -0
  28. package/dist/components/ChannelList/hooks/useChannelVisibleListener.d.ts.map +1 -1
  29. package/dist/components/ChannelList/hooks/useChannelVisibleListener.js +1 -0
  30. package/dist/components/ChannelList/hooks/useConnectionRecoveredListener.d.ts.map +1 -1
  31. package/dist/components/ChannelList/hooks/useConnectionRecoveredListener.js +1 -0
  32. package/dist/components/ChannelList/hooks/useMessageNewListener.d.ts.map +1 -1
  33. package/dist/components/ChannelList/hooks/useMessageNewListener.js +1 -0
  34. package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts.map +1 -1
  35. package/dist/components/ChannelList/hooks/useNotificationAddedToChannelListener.js +1 -0
  36. package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts.map +1 -1
  37. package/dist/components/ChannelList/hooks/useNotificationMessageNewListener.js +1 -0
  38. package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts.map +1 -1
  39. package/dist/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.js +1 -0
  40. package/dist/components/ChannelList/hooks/usePaginatedChannels.d.ts.map +1 -1
  41. package/dist/components/ChannelList/hooks/usePaginatedChannels.js +2 -0
  42. package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts.map +1 -1
  43. package/dist/components/ChannelList/hooks/useUserPresenceChangedListener.js +1 -0
  44. package/dist/components/ChannelPreview/ChannelPreview.d.ts.map +1 -1
  45. package/dist/components/ChannelPreview/ChannelPreview.js +2 -0
  46. package/dist/components/ChannelPreview/hooks/useChannelPreviewInfo.d.ts.map +1 -1
  47. package/dist/components/ChannelPreview/hooks/useChannelPreviewInfo.js +1 -0
  48. package/dist/components/ChannelPreview/hooks/useIsChannelMuted.d.ts.map +1 -1
  49. package/dist/components/ChannelPreview/hooks/useIsChannelMuted.js +1 -0
  50. package/dist/components/ChannelSearch/SearchBar.d.ts.map +1 -1
  51. package/dist/components/ChannelSearch/SearchBar.js +2 -0
  52. package/dist/components/ChannelSearch/SearchResults.d.ts.map +1 -1
  53. package/dist/components/ChannelSearch/SearchResults.js +3 -1
  54. package/dist/components/ChannelSearch/hooks/useChannelSearch.d.ts.map +1 -1
  55. package/dist/components/ChannelSearch/hooks/useChannelSearch.js +7 -1
  56. package/dist/components/Chat/hooks/useChat.d.ts.map +1 -1
  57. package/dist/components/Chat/hooks/useChat.js +2 -0
  58. package/dist/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
  59. package/dist/components/Chat/hooks/useCreateChatContext.js +3 -1
  60. package/dist/components/Gallery/ModalGallery.d.ts.map +1 -1
  61. package/dist/components/Gallery/ModalGallery.js +3 -1
  62. package/dist/components/InfiniteScrollPaginator/InfiniteScroll.d.ts.map +1 -1
  63. package/dist/components/InfiniteScrollPaginator/InfiniteScroll.js +1 -0
  64. package/dist/components/LoadMore/LoadMoreButton.d.ts.map +1 -1
  65. package/dist/components/LoadMore/LoadMoreButton.js +1 -0
  66. package/dist/components/LoadMore/LoadMorePaginator.d.ts.map +1 -1
  67. package/dist/components/LoadMore/LoadMorePaginator.js +1 -0
  68. package/dist/components/Message/MessageText.d.ts.map +1 -1
  69. package/dist/components/Message/MessageText.js +1 -0
  70. package/dist/components/Message/hooks/useReactionHandler.d.ts.map +1 -1
  71. package/dist/components/Message/hooks/useReactionHandler.js +6 -2
  72. package/dist/components/MessageActions/CustomMessageActionsList.d.ts +13 -0
  73. package/dist/components/MessageActions/CustomMessageActionsList.d.ts.map +1 -0
  74. package/dist/components/MessageActions/CustomMessageActionsList.js +11 -0
  75. package/dist/components/MessageActions/MessageActions.d.ts.map +1 -1
  76. package/dist/components/MessageActions/MessageActions.js +11 -3
  77. package/dist/components/MessageActions/MessageActionsBox.d.ts +4 -8
  78. package/dist/components/MessageActions/MessageActionsBox.d.ts.map +1 -1
  79. package/dist/components/MessageActions/MessageActionsBox.js +13 -36
  80. package/dist/components/MessageActions/hooks/index.d.ts +2 -0
  81. package/dist/components/MessageActions/hooks/index.d.ts.map +1 -0
  82. package/dist/components/MessageActions/hooks/index.js +1 -0
  83. package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.d.ts +18 -0
  84. package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.d.ts.map +1 -0
  85. package/dist/components/MessageActions/hooks/useMessageActionsBoxPopper.js +32 -0
  86. package/dist/components/MessageActions/index.d.ts +1 -0
  87. package/dist/components/MessageActions/index.d.ts.map +1 -1
  88. package/dist/components/MessageActions/index.js +1 -0
  89. package/dist/components/MessageInput/MessageInputFlat.d.ts.map +1 -1
  90. package/dist/components/MessageInput/MessageInputFlat.js +1 -0
  91. package/dist/components/MessageInput/MessageInputSmall.d.ts.map +1 -1
  92. package/dist/components/MessageInput/MessageInputSmall.js +1 -0
  93. package/dist/components/MessageInput/hooks/useAttachments.d.ts.map +1 -1
  94. package/dist/components/MessageInput/hooks/useAttachments.js +3 -1
  95. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.d.ts.map +1 -1
  96. package/dist/components/MessageInput/hooks/useCreateMessageInputContext.js +3 -1
  97. package/dist/components/MessageInput/hooks/useFileUploads.d.ts.map +1 -1
  98. package/dist/components/MessageInput/hooks/useFileUploads.js +3 -0
  99. package/dist/components/MessageInput/hooks/useImageUploads.d.ts.map +1 -1
  100. package/dist/components/MessageInput/hooks/useImageUploads.js +4 -1
  101. package/dist/components/MessageInput/hooks/useLinkPreviews.d.ts.map +1 -1
  102. package/dist/components/MessageInput/hooks/useLinkPreviews.js +5 -1
  103. package/dist/components/MessageInput/hooks/useMessageInputText.d.ts.map +1 -1
  104. package/dist/components/MessageInput/hooks/useMessageInputText.js +6 -2
  105. package/dist/components/MessageInput/hooks/usePasteHandler.d.ts.map +1 -1
  106. package/dist/components/MessageInput/hooks/usePasteHandler.js +3 -1
  107. package/dist/components/MessageInput/hooks/useUserTrigger.d.ts.map +1 -1
  108. package/dist/components/MessageInput/hooks/useUserTrigger.js +1 -0
  109. package/dist/components/MessageList/MessageList.d.ts +3 -0
  110. package/dist/components/MessageList/MessageList.d.ts.map +1 -1
  111. package/dist/components/MessageList/MessageList.js +11 -8
  112. package/dist/components/MessageList/ScrollToBottomButton.d.ts.map +1 -1
  113. package/dist/components/MessageList/ScrollToBottomButton.js +1 -0
  114. package/dist/components/MessageList/VirtualizedMessageList.d.ts.map +1 -1
  115. package/dist/components/MessageList/VirtualizedMessageList.js +12 -14
  116. package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.d.ts.map +1 -1
  117. package/dist/components/MessageList/hooks/MessageList/useEnrichedMessages.js +3 -1
  118. package/dist/components/MessageList/hooks/MessageList/useMessageListElements.d.ts +3 -3
  119. package/dist/components/MessageList/hooks/MessageList/useMessageListElements.d.ts.map +1 -1
  120. package/dist/components/MessageList/hooks/MessageList/useMessageListElements.js +19 -30
  121. package/dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.d.ts.map +1 -1
  122. package/dist/components/MessageList/hooks/MessageList/useMessageListScrollManager.js +1 -0
  123. package/dist/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts.map +1 -1
  124. package/dist/components/MessageList/hooks/MessageList/useScrollLocationLogic.js +1 -0
  125. package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.d.ts.map +1 -1
  126. package/dist/components/MessageList/hooks/VirtualizedMessageList/useGiphyPreview.js +1 -0
  127. package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.d.ts.map +1 -1
  128. package/dist/components/MessageList/hooks/VirtualizedMessageList/usePrependMessagesCount.js +1 -0
  129. package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.d.ts.map +1 -1
  130. package/dist/components/MessageList/hooks/VirtualizedMessageList/useScrollToBottomOnNewMessage.js +1 -0
  131. package/dist/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.d.ts.map +1 -1
  132. package/dist/components/MessageList/hooks/VirtualizedMessageList/useShouldForceScrollToBottom.js +1 -0
  133. package/dist/components/MessageList/index.d.ts +1 -0
  134. package/dist/components/MessageList/index.d.ts.map +1 -1
  135. package/dist/components/MessageList/index.js +1 -0
  136. package/dist/components/MessageList/renderMessages.d.ts +22 -0
  137. package/dist/components/MessageList/renderMessages.d.ts.map +1 -0
  138. package/dist/components/MessageList/renderMessages.js +30 -0
  139. package/dist/components/MessageList/utils.d.ts.map +1 -1
  140. package/dist/components/MessageList/utils.js +1 -1
  141. package/dist/components/Reactions/hooks/useProcessReactions.d.ts.map +1 -1
  142. package/dist/components/Reactions/hooks/useProcessReactions.js +3 -0
  143. package/dist/components/Thread/Thread.js +1 -0
  144. package/dist/context/ComponentContext.d.ts +2 -1
  145. package/dist/context/ComponentContext.d.ts.map +1 -1
  146. package/dist/index.cjs.js +669 -575
  147. package/dist/version.d.ts +1 -1
  148. package/dist/version.js +1 -1
  149. package/package.json +3 -2
@@ -5817,14 +5817,14 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
5817
5817
 
5818
5818
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
5819
5819
 
5820
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function _typeof$2(obj) {
5820
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function _typeof$2(o) {
5821
5821
  "@babel/helpers - typeof";
5822
5822
 
5823
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
5824
- return typeof obj;
5825
- } : function (obj) {
5826
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
5827
- }, _typeof$2(obj);
5823
+ return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
5824
+ return typeof o;
5825
+ } : function (o) {
5826
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
5827
+ }, _typeof$2(o);
5828
5828
  }
5829
5829
 
5830
5830
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function _classCallCheck(instance, Constructor) {
@@ -5833,20 +5833,20 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
5833
5833
  }
5834
5834
  }
5835
5835
 
5836
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function _toPrimitive(input, hint) {
5837
- if (_typeof$2(input) !== "object" || input === null) return input;
5838
- var prim = input[Symbol.toPrimitive];
5839
- if (prim !== undefined) {
5840
- var res = prim.call(input, hint || "default");
5841
- if (_typeof$2(res) !== "object") return res;
5836
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function toPrimitive$1(t, r) {
5837
+ if ("object" != _typeof$2(t) || !t) return t;
5838
+ var e = t[Symbol.toPrimitive];
5839
+ if (void 0 !== e) {
5840
+ var i = e.call(t, r || "default");
5841
+ if ("object" != _typeof$2(i)) return i;
5842
5842
  throw new TypeError("@@toPrimitive must return a primitive value.");
5843
5843
  }
5844
- return (hint === "string" ? String : Number)(input);
5844
+ return ("string" === r ? String : Number)(t);
5845
5845
  }
5846
5846
 
5847
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function _toPropertyKey(arg) {
5848
- var key = _toPrimitive(arg, "string");
5849
- return _typeof$2(key) === "symbol" ? key : String(key);
5847
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function toPropertyKey$1(t) {
5848
+ var i = toPrimitive$1(t, "string");
5849
+ return "symbol" == _typeof$2(i) ? i : String(i);
5850
5850
  }
5851
5851
 
5852
5852
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function _defineProperties(target, props) {
@@ -5855,7 +5855,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
5855
5855
  descriptor.enumerable = descriptor.enumerable || false;
5856
5856
  descriptor.configurable = true;
5857
5857
  if ("value" in descriptor) descriptor.writable = true;
5858
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
5858
+ Object.defineProperty(target, toPropertyKey$1(descriptor.key), descriptor);
5859
5859
  }
5860
5860
  }
5861
5861
  function _createClass(Constructor, protoProps, staticProps) {
@@ -5916,7 +5916,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
5916
5916
  }
5917
5917
 
5918
5918
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function _defineProperty$3(obj, key, value) {
5919
- key = _toPropertyKey(key);
5919
+ key = toPropertyKey$1(key);
5920
5920
  if (key in obj) {
5921
5921
  Object.defineProperty(obj, key, {
5922
5922
  value: value,
@@ -9863,6 +9863,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
9863
9863
  audioRef.current.play();
9864
9864
  return function () {
9865
9865
  var _a;
9866
+ // eslint-disable-next-line react-hooks/exhaustive-deps
9866
9867
  (_a = audioRef.current) === null || _a === void 0 ? void 0 : _a.pause();
9867
9868
  window.clearInterval(interval);
9868
9869
  };
@@ -10028,7 +10029,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
10028
10029
  source: imageSrc,
10029
10030
  };
10030
10031
  });
10031
- }, [images]);
10032
+ },
10033
+ // eslint-disable-next-line react-hooks/exhaustive-deps
10034
+ [images]);
10032
10035
  return (React__default["default"].createElement(ImageGallery, { items: formattedArray, renderItem: renderItem, showIndex: true, showPlayButton: false, showThumbnails: false, startIndex: index }));
10033
10036
  };
10034
10037
 
@@ -14648,6 +14651,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
14648
14651
  var config = videoAttachmentSizeHandler(attachment, videoElement.current, shouldGenerateVideoThumbnail);
14649
14652
  setAttachmentConfiguration(config);
14650
14653
  }
14654
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14651
14655
  }, [videoElement, videoAttachmentSizeHandler, attachment]);
14652
14656
  var content = (React__default["default"].createElement("div", { className: 'str-chat__player-wrapper', "data-testid": 'video-wrapper', ref: videoElement, style: getCssDimensionsVariables(attachment.thumb_url || '') },
14653
14657
  React__default["default"].createElement(Media, { className: 'react-player', config: { file: { attributes: { poster: attachmentConfiguration === null || attachmentConfiguration === void 0 ? void 0 : attachmentConfiguration.thumbUrl } } }, controls: true, height: '100%', url: attachmentConfiguration === null || attachmentConfiguration === void 0 ? void 0 : attachmentConfiguration.url, width: '100%' })));
@@ -14683,6 +14687,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
14683
14687
  */
14684
14688
  var Attachment = function (props) {
14685
14689
  var attachments = props.attachments;
14690
+ // eslint-disable-next-line react-hooks/exhaustive-deps
14686
14691
  var groupedAttachments = React$2.useMemo(function () { return renderGroupedAttachments(props); }, [attachments]);
14687
14692
  return (React__default["default"].createElement("div", { className: 'str-chat__attachment-list' }, ATTACHMENT_GROUPS_ORDER.reduce(function (acc, groupName) { return __spreadArray(__spreadArray([], acc, true), groupedAttachments[groupName], true); }, [])));
14688
14693
  };
@@ -16087,7 +16092,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
16087
16092
  * @property {Array<string>} [mustUseProperty]
16088
16093
  */
16089
16094
 
16090
- const own$b = {}.hasOwnProperty;
16095
+ const own$a = {}.hasOwnProperty;
16091
16096
 
16092
16097
  /**
16093
16098
  * @param {Definition} definition
@@ -16102,7 +16107,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
16102
16107
  let prop;
16103
16108
 
16104
16109
  for (prop in definition.properties) {
16105
- if (own$b.call(definition.properties, prop)) {
16110
+ if (own$a.call(definition.properties, prop)) {
16106
16111
  const value = definition.properties[prop];
16107
16112
  const info = new DefinedInfo(
16108
16113
  prop,
@@ -18031,7 +18036,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
18031
18036
  * @typedef {import('./components.js').Components} Components
18032
18037
  */
18033
18038
 
18034
- const own$a = {}.hasOwnProperty;
18039
+ const own$9 = {}.hasOwnProperty;
18035
18040
 
18036
18041
  /** @type {Map<string, number>} */
18037
18042
  const emptyMap = new Map();
@@ -18168,7 +18173,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
18168
18173
  });
18169
18174
  }
18170
18175
 
18171
- if (own$a.call(state.components, node.tagName)) {
18176
+ if (own$9.call(state.components, node.tagName)) {
18172
18177
  const key = /** @type {keyof JSX.IntrinsicElements} */ (node.tagName);
18173
18178
  type = state.components[key];
18174
18179
 
@@ -18314,7 +18319,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
18314
18319
  let alignValue;
18315
18320
 
18316
18321
  for (prop in node.properties) {
18317
- if (prop !== 'children' && own$a.call(node.properties, prop)) {
18322
+ if (prop !== 'children' && own$9.call(node.properties, prop)) {
18318
18323
  const result = createProperty(
18319
18324
  state,
18320
18325
  ancestors,
@@ -18480,7 +18485,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
18480
18485
  let from;
18481
18486
 
18482
18487
  for (from in domCasing) {
18483
- if (own$a.call(domCasing, from)) {
18488
+ if (own$9.call(domCasing, from)) {
18484
18489
  cssCasing[transformStyleToCssCasing(from)] = domCasing[from];
18485
18490
  }
18486
18491
  }
@@ -18559,395 +18564,6 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
18559
18564
  ]
18560
18565
  };
18561
18566
 
18562
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
18563
- * @typedef {import('micromark-util-types').Code} Code
18564
- */
18565
-
18566
- const unicodePunctuationInternal = regexCheck$9(/\p{P}/u);
18567
-
18568
- /**
18569
- * Check whether the character code represents an ASCII alpha (`a` through `z`,
18570
- * case insensitive).
18571
- *
18572
- * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
18573
- *
18574
- * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
18575
- * to U+005A (`Z`).
18576
- *
18577
- * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
18578
- * to U+007A (`z`).
18579
- *
18580
- * @param code
18581
- * Code.
18582
- * @returns {boolean}
18583
- * Whether it matches.
18584
- */
18585
- const asciiAlpha$4 = regexCheck$9(/[A-Za-z]/);
18586
-
18587
- /**
18588
- * Check whether the character code represents an ASCII alphanumeric (`a`
18589
- * through `z`, case insensitive, or `0` through `9`).
18590
- *
18591
- * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
18592
- * (see `asciiAlpha`).
18593
- *
18594
- * @param code
18595
- * Code.
18596
- * @returns {boolean}
18597
- * Whether it matches.
18598
- */
18599
- const asciiAlphanumeric$5 = regexCheck$9(/[\dA-Za-z]/);
18600
-
18601
- /**
18602
- * Check whether the character code represents an ASCII atext.
18603
- *
18604
- * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
18605
- * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
18606
- * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
18607
- * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
18608
- * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
18609
- * (`{`) to U+007E TILDE (`~`).
18610
- *
18611
- * See:
18612
- * **\[RFC5322]**:
18613
- * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
18614
- * P. Resnick.
18615
- * IETF.
18616
- *
18617
- * @param code
18618
- * Code.
18619
- * @returns {boolean}
18620
- * Whether it matches.
18621
- */
18622
- const asciiAtext$2 = regexCheck$9(/[#-'*+\--9=?A-Z^-~]/);
18623
-
18624
- /**
18625
- * Check whether a character code is an ASCII control character.
18626
- *
18627
- * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
18628
- * to U+001F (US), or U+007F (DEL).
18629
- *
18630
- * @param {Code} code
18631
- * Code.
18632
- * @returns {boolean}
18633
- * Whether it matches.
18634
- */
18635
- function asciiControl$3(code) {
18636
- return (
18637
- // Special whitespace codes (which have negative values), C0 and Control
18638
- // character DEL
18639
- code !== null && (code < 32 || code === 127)
18640
- )
18641
- }
18642
-
18643
- /**
18644
- * Check whether the character code represents an ASCII digit (`0` through `9`).
18645
- *
18646
- * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
18647
- * U+0039 (`9`).
18648
- *
18649
- * @param code
18650
- * Code.
18651
- * @returns {boolean}
18652
- * Whether it matches.
18653
- */
18654
- const asciiDigit$3 = regexCheck$9(/\d/);
18655
-
18656
- /**
18657
- * Check whether the character code represents an ASCII hex digit (`a` through
18658
- * `f`, case insensitive, or `0` through `9`).
18659
- *
18660
- * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
18661
- * digit, or an ASCII lower hex digit.
18662
- *
18663
- * An **ASCII upper hex digit** is a character in the inclusive range U+0041
18664
- * (`A`) to U+0046 (`F`).
18665
- *
18666
- * An **ASCII lower hex digit** is a character in the inclusive range U+0061
18667
- * (`a`) to U+0066 (`f`).
18668
- *
18669
- * @param code
18670
- * Code.
18671
- * @returns {boolean}
18672
- * Whether it matches.
18673
- */
18674
- const asciiHexDigit$2 = regexCheck$9(/[\dA-Fa-f]/);
18675
-
18676
- /**
18677
- * Check whether the character code represents ASCII punctuation.
18678
- *
18679
- * An **ASCII punctuation** is a character in the inclusive ranges U+0021
18680
- * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
18681
- * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
18682
- * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
18683
- *
18684
- * @param code
18685
- * Code.
18686
- * @returns {boolean}
18687
- * Whether it matches.
18688
- */
18689
- const asciiPunctuation$2 = regexCheck$9(/[!-/:-@[-`{-~]/);
18690
-
18691
- /**
18692
- * Check whether a character code is a markdown line ending.
18693
- *
18694
- * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
18695
- * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
18696
- *
18697
- * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
18698
- * RETURN (CR) are replaced by these virtual characters depending on whether
18699
- * they occurred together.
18700
- *
18701
- * @param {Code} code
18702
- * Code.
18703
- * @returns {boolean}
18704
- * Whether it matches.
18705
- */
18706
- function markdownLineEnding$k(code) {
18707
- return code !== null && code < -2
18708
- }
18709
-
18710
- /**
18711
- * Check whether a character code is a markdown line ending (see
18712
- * `markdownLineEnding`) or markdown space (see `markdownSpace`).
18713
- *
18714
- * @param {Code} code
18715
- * Code.
18716
- * @returns {boolean}
18717
- * Whether it matches.
18718
- */
18719
- function markdownLineEndingOrSpace$9(code) {
18720
- return code !== null && (code < 0 || code === 32)
18721
- }
18722
-
18723
- /**
18724
- * Check whether a character code is a markdown space.
18725
- *
18726
- * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
18727
- * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
18728
- *
18729
- * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
18730
- * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
18731
- * SPACE (VS) characters, depending on the column at which the tab occurred.
18732
- *
18733
- * @param {Code} code
18734
- * Code.
18735
- * @returns {boolean}
18736
- * Whether it matches.
18737
- */
18738
- function markdownSpace$a(code) {
18739
- return code === -2 || code === -1 || code === 32
18740
- }
18741
-
18742
- // Size note: removing ASCII from the regex and using `asciiPunctuation` here
18743
- // In fact adds to the bundle size.
18744
- /**
18745
- * Check whether the character code represents Unicode punctuation.
18746
- *
18747
- * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
18748
- * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
18749
- * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
18750
- * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
18751
- * punctuation (see `asciiPunctuation`).
18752
- *
18753
- * See:
18754
- * **\[UNICODE]**:
18755
- * [The Unicode Standard](https://www.unicode.org/versions/).
18756
- * Unicode Consortium.
18757
- *
18758
- * @param {Code} code
18759
- * Code.
18760
- * @returns {boolean}
18761
- * Whether it matches.
18762
- */
18763
- function unicodePunctuation$3(code) {
18764
- return asciiPunctuation$2(code) || unicodePunctuationInternal(code)
18765
- }
18766
-
18767
- /**
18768
- * Check whether the character code represents Unicode whitespace.
18769
- *
18770
- * Note that this does handle micromark specific markdown whitespace characters.
18771
- * See `markdownLineEndingOrSpace` to check that.
18772
- *
18773
- * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
18774
- * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
18775
- * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
18776
- *
18777
- * See:
18778
- * **\[UNICODE]**:
18779
- * [The Unicode Standard](https://www.unicode.org/versions/).
18780
- * Unicode Consortium.
18781
- *
18782
- * @param code
18783
- * Code.
18784
- * @returns {boolean}
18785
- * Whether it matches.
18786
- */
18787
- const unicodeWhitespace$2 = regexCheck$9(/\s/);
18788
-
18789
- /**
18790
- * Create a code check from a regex.
18791
- *
18792
- * @param {RegExp} regex
18793
- * @returns {(code: Code) => boolean}
18794
- */
18795
- function regexCheck$9(regex) {
18796
- return check
18797
-
18798
- /**
18799
- * Check whether a code matches the bound regex.
18800
- *
18801
- * @param {Code} code
18802
- * Character code.
18803
- * @returns {boolean}
18804
- * Whether the character code matches the bound regex.
18805
- */
18806
- function check(code) {
18807
- return code !== null && code > -1 && regex.test(String.fromCharCode(code))
18808
- }
18809
- }
18810
-
18811
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};const characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'};
18812
-
18813
- /**
18814
- * Encode only the dangerous HTML characters.
18815
- *
18816
- * This ensures that certain characters which have special meaning in HTML are
18817
- * dealt with.
18818
- * Technically, we can skip `>` and `"` in many cases, but CM includes them.
18819
- *
18820
- * @param {string} value
18821
- * Value to encode.
18822
- * @returns {string}
18823
- * Encoded value.
18824
- */
18825
- function encode(value) {
18826
- return value.replace(/["&<>]/g, replace)
18827
-
18828
- /**
18829
- * @param {string} value
18830
- * @returns {string}
18831
- */
18832
- function replace(value) {
18833
- // @ts-expect-error Hush, it’s fine.
18834
- return '&' + characterReferences[value] + ';'
18835
- }
18836
- }
18837
-
18838
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
18839
- * Make a value safe for injection as a URL.
18840
- *
18841
- * This encodes unsafe characters with percent-encoding and skips already
18842
- * encoded sequences (see `normalizeUri`).
18843
- * Further unsafe characters are encoded as character references (see
18844
- * `micromark-util-encode`).
18845
- *
18846
- * A regex of allowed protocols can be given, in which case the URL is
18847
- * sanitized.
18848
- * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or
18849
- * `/^https?$/i` for `img[src]` (this is what `github.com` allows).
18850
- * If the URL includes an unknown protocol (one not matched by `protocol`, such
18851
- * as a dangerous example, `javascript:`), the value is ignored.
18852
- *
18853
- * @param {string | null | undefined} url
18854
- * URI to sanitize.
18855
- * @param {RegExp | null | undefined} [protocol]
18856
- * Allowed protocols.
18857
- * @returns {string}
18858
- * Sanitized URI.
18859
- */
18860
- function sanitizeUri(url, protocol) {
18861
- const value = encode(normalizeUri(url || ''));
18862
- if (!protocol) {
18863
- return value
18864
- }
18865
- const colon = value.indexOf(':');
18866
- const questionMark = value.indexOf('?');
18867
- const numberSign = value.indexOf('#');
18868
- const slash = value.indexOf('/');
18869
- if (
18870
- // If there is no protocol, it’s relative.
18871
- colon < 0 ||
18872
- // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
18873
- (slash > -1 && colon > slash) ||
18874
- (questionMark > -1 && colon > questionMark) ||
18875
- (numberSign > -1 && colon > numberSign) ||
18876
- // It is a protocol, it should be allowed.
18877
- protocol.test(value.slice(0, colon))
18878
- ) {
18879
- return value
18880
- }
18881
- return ''
18882
- }
18883
-
18884
- /**
18885
- * Normalize a URL.
18886
- *
18887
- * Encode unsafe characters with percent-encoding, skipping already encoded
18888
- * sequences.
18889
- *
18890
- * @param {string} value
18891
- * URI to normalize.
18892
- * @returns {string}
18893
- * Normalized URI.
18894
- */
18895
- function normalizeUri(value) {
18896
- /** @type {Array<string>} */
18897
- const result = [];
18898
- let index = -1;
18899
- let start = 0;
18900
- let skip = 0;
18901
- while (++index < value.length) {
18902
- const code = value.charCodeAt(index);
18903
- /** @type {string} */
18904
- let replace = '';
18905
-
18906
- // A correct percent encoded value.
18907
- if (
18908
- code === 37 &&
18909
- asciiAlphanumeric$5(value.charCodeAt(index + 1)) &&
18910
- asciiAlphanumeric$5(value.charCodeAt(index + 2))
18911
- ) {
18912
- skip = 2;
18913
- }
18914
- // ASCII.
18915
- else if (code < 128) {
18916
- if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {
18917
- replace = String.fromCharCode(code);
18918
- }
18919
- }
18920
- // Astral.
18921
- else if (code > 55_295 && code < 57_344) {
18922
- const next = value.charCodeAt(index + 1);
18923
-
18924
- // A correct surrogate pair.
18925
- if (code < 56_320 && next > 56_319 && next < 57_344) {
18926
- replace = String.fromCharCode(code, next);
18927
- skip = 1;
18928
- }
18929
- // Lone surrogate.
18930
- else {
18931
- replace = '\uFFFD';
18932
- }
18933
- }
18934
- // Unicode.
18935
- else {
18936
- replace = String.fromCharCode(code);
18937
- }
18938
- if (replace) {
18939
- result.push(value.slice(start, index), encodeURIComponent(replace));
18940
- start = index + skip + 1;
18941
- replace = '';
18942
- }
18943
- if (skip) {
18944
- index += skip;
18945
- skip = 0;
18946
- }
18947
- }
18948
- return result.join('') + value.slice(start)
18949
- }
18950
-
18951
18567
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
18952
18568
  * @typedef {import('mdast').Nodes} Nodes
18953
18569
  *
@@ -19328,6 +18944,323 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
19328
18944
  )
19329
18945
  }
19330
18946
 
18947
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
18948
+ * @typedef {import('micromark-util-types').Code} Code
18949
+ */
18950
+
18951
+ const unicodePunctuationInternal = regexCheck$9(/\p{P}/u);
18952
+
18953
+ /**
18954
+ * Check whether the character code represents an ASCII alpha (`a` through `z`,
18955
+ * case insensitive).
18956
+ *
18957
+ * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
18958
+ *
18959
+ * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
18960
+ * to U+005A (`Z`).
18961
+ *
18962
+ * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
18963
+ * to U+007A (`z`).
18964
+ *
18965
+ * @param code
18966
+ * Code.
18967
+ * @returns {boolean}
18968
+ * Whether it matches.
18969
+ */
18970
+ const asciiAlpha$4 = regexCheck$9(/[A-Za-z]/);
18971
+
18972
+ /**
18973
+ * Check whether the character code represents an ASCII alphanumeric (`a`
18974
+ * through `z`, case insensitive, or `0` through `9`).
18975
+ *
18976
+ * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
18977
+ * (see `asciiAlpha`).
18978
+ *
18979
+ * @param code
18980
+ * Code.
18981
+ * @returns {boolean}
18982
+ * Whether it matches.
18983
+ */
18984
+ const asciiAlphanumeric$5 = regexCheck$9(/[\dA-Za-z]/);
18985
+
18986
+ /**
18987
+ * Check whether the character code represents an ASCII atext.
18988
+ *
18989
+ * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
18990
+ * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
18991
+ * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
18992
+ * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
18993
+ * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
18994
+ * (`{`) to U+007E TILDE (`~`).
18995
+ *
18996
+ * See:
18997
+ * **\[RFC5322]**:
18998
+ * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
18999
+ * P. Resnick.
19000
+ * IETF.
19001
+ *
19002
+ * @param code
19003
+ * Code.
19004
+ * @returns {boolean}
19005
+ * Whether it matches.
19006
+ */
19007
+ const asciiAtext$2 = regexCheck$9(/[#-'*+\--9=?A-Z^-~]/);
19008
+
19009
+ /**
19010
+ * Check whether a character code is an ASCII control character.
19011
+ *
19012
+ * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
19013
+ * to U+001F (US), or U+007F (DEL).
19014
+ *
19015
+ * @param {Code} code
19016
+ * Code.
19017
+ * @returns {boolean}
19018
+ * Whether it matches.
19019
+ */
19020
+ function asciiControl$3(code) {
19021
+ return (
19022
+ // Special whitespace codes (which have negative values), C0 and Control
19023
+ // character DEL
19024
+ code !== null && (code < 32 || code === 127)
19025
+ )
19026
+ }
19027
+
19028
+ /**
19029
+ * Check whether the character code represents an ASCII digit (`0` through `9`).
19030
+ *
19031
+ * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
19032
+ * U+0039 (`9`).
19033
+ *
19034
+ * @param code
19035
+ * Code.
19036
+ * @returns {boolean}
19037
+ * Whether it matches.
19038
+ */
19039
+ const asciiDigit$3 = regexCheck$9(/\d/);
19040
+
19041
+ /**
19042
+ * Check whether the character code represents an ASCII hex digit (`a` through
19043
+ * `f`, case insensitive, or `0` through `9`).
19044
+ *
19045
+ * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
19046
+ * digit, or an ASCII lower hex digit.
19047
+ *
19048
+ * An **ASCII upper hex digit** is a character in the inclusive range U+0041
19049
+ * (`A`) to U+0046 (`F`).
19050
+ *
19051
+ * An **ASCII lower hex digit** is a character in the inclusive range U+0061
19052
+ * (`a`) to U+0066 (`f`).
19053
+ *
19054
+ * @param code
19055
+ * Code.
19056
+ * @returns {boolean}
19057
+ * Whether it matches.
19058
+ */
19059
+ const asciiHexDigit$2 = regexCheck$9(/[\dA-Fa-f]/);
19060
+
19061
+ /**
19062
+ * Check whether the character code represents ASCII punctuation.
19063
+ *
19064
+ * An **ASCII punctuation** is a character in the inclusive ranges U+0021
19065
+ * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
19066
+ * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
19067
+ * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
19068
+ *
19069
+ * @param code
19070
+ * Code.
19071
+ * @returns {boolean}
19072
+ * Whether it matches.
19073
+ */
19074
+ const asciiPunctuation$2 = regexCheck$9(/[!-/:-@[-`{-~]/);
19075
+
19076
+ /**
19077
+ * Check whether a character code is a markdown line ending.
19078
+ *
19079
+ * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
19080
+ * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
19081
+ *
19082
+ * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
19083
+ * RETURN (CR) are replaced by these virtual characters depending on whether
19084
+ * they occurred together.
19085
+ *
19086
+ * @param {Code} code
19087
+ * Code.
19088
+ * @returns {boolean}
19089
+ * Whether it matches.
19090
+ */
19091
+ function markdownLineEnding$k(code) {
19092
+ return code !== null && code < -2
19093
+ }
19094
+
19095
+ /**
19096
+ * Check whether a character code is a markdown line ending (see
19097
+ * `markdownLineEnding`) or markdown space (see `markdownSpace`).
19098
+ *
19099
+ * @param {Code} code
19100
+ * Code.
19101
+ * @returns {boolean}
19102
+ * Whether it matches.
19103
+ */
19104
+ function markdownLineEndingOrSpace$9(code) {
19105
+ return code !== null && (code < 0 || code === 32)
19106
+ }
19107
+
19108
+ /**
19109
+ * Check whether a character code is a markdown space.
19110
+ *
19111
+ * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
19112
+ * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
19113
+ *
19114
+ * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
19115
+ * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
19116
+ * SPACE (VS) characters, depending on the column at which the tab occurred.
19117
+ *
19118
+ * @param {Code} code
19119
+ * Code.
19120
+ * @returns {boolean}
19121
+ * Whether it matches.
19122
+ */
19123
+ function markdownSpace$a(code) {
19124
+ return code === -2 || code === -1 || code === 32
19125
+ }
19126
+
19127
+ // Size note: removing ASCII from the regex and using `asciiPunctuation` here
19128
+ // In fact adds to the bundle size.
19129
+ /**
19130
+ * Check whether the character code represents Unicode punctuation.
19131
+ *
19132
+ * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
19133
+ * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
19134
+ * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
19135
+ * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
19136
+ * punctuation (see `asciiPunctuation`).
19137
+ *
19138
+ * See:
19139
+ * **\[UNICODE]**:
19140
+ * [The Unicode Standard](https://www.unicode.org/versions/).
19141
+ * Unicode Consortium.
19142
+ *
19143
+ * @param {Code} code
19144
+ * Code.
19145
+ * @returns {boolean}
19146
+ * Whether it matches.
19147
+ */
19148
+ function unicodePunctuation$3(code) {
19149
+ return asciiPunctuation$2(code) || unicodePunctuationInternal(code)
19150
+ }
19151
+
19152
+ /**
19153
+ * Check whether the character code represents Unicode whitespace.
19154
+ *
19155
+ * Note that this does handle micromark specific markdown whitespace characters.
19156
+ * See `markdownLineEndingOrSpace` to check that.
19157
+ *
19158
+ * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
19159
+ * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
19160
+ * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
19161
+ *
19162
+ * See:
19163
+ * **\[UNICODE]**:
19164
+ * [The Unicode Standard](https://www.unicode.org/versions/).
19165
+ * Unicode Consortium.
19166
+ *
19167
+ * @param code
19168
+ * Code.
19169
+ * @returns {boolean}
19170
+ * Whether it matches.
19171
+ */
19172
+ const unicodeWhitespace$2 = regexCheck$9(/\s/);
19173
+
19174
+ /**
19175
+ * Create a code check from a regex.
19176
+ *
19177
+ * @param {RegExp} regex
19178
+ * @returns {(code: Code) => boolean}
19179
+ */
19180
+ function regexCheck$9(regex) {
19181
+ return check
19182
+
19183
+ /**
19184
+ * Check whether a code matches the bound regex.
19185
+ *
19186
+ * @param {Code} code
19187
+ * Character code.
19188
+ * @returns {boolean}
19189
+ * Whether the character code matches the bound regex.
19190
+ */
19191
+ function check(code) {
19192
+ return code !== null && code > -1 && regex.test(String.fromCharCode(code))
19193
+ }
19194
+ }
19195
+
19196
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
19197
+ /**
19198
+ * Normalize a URL.
19199
+ *
19200
+ * Encode unsafe characters with percent-encoding, skipping already encoded
19201
+ * sequences.
19202
+ *
19203
+ * @param {string} value
19204
+ * URI to normalize.
19205
+ * @returns {string}
19206
+ * Normalized URI.
19207
+ */
19208
+ function normalizeUri(value) {
19209
+ /** @type {Array<string>} */
19210
+ const result = [];
19211
+ let index = -1;
19212
+ let start = 0;
19213
+ let skip = 0;
19214
+ while (++index < value.length) {
19215
+ const code = value.charCodeAt(index);
19216
+ /** @type {string} */
19217
+ let replace = '';
19218
+
19219
+ // A correct percent encoded value.
19220
+ if (
19221
+ code === 37 &&
19222
+ asciiAlphanumeric$5(value.charCodeAt(index + 1)) &&
19223
+ asciiAlphanumeric$5(value.charCodeAt(index + 2))
19224
+ ) {
19225
+ skip = 2;
19226
+ }
19227
+ // ASCII.
19228
+ else if (code < 128) {
19229
+ if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {
19230
+ replace = String.fromCharCode(code);
19231
+ }
19232
+ }
19233
+ // Astral.
19234
+ else if (code > 55_295 && code < 57_344) {
19235
+ const next = value.charCodeAt(index + 1);
19236
+
19237
+ // A correct surrogate pair.
19238
+ if (code < 56_320 && next > 56_319 && next < 57_344) {
19239
+ replace = String.fromCharCode(code, next);
19240
+ skip = 1;
19241
+ }
19242
+ // Lone surrogate.
19243
+ else {
19244
+ replace = '\uFFFD';
19245
+ }
19246
+ }
19247
+ // Unicode.
19248
+ else {
19249
+ replace = String.fromCharCode(code);
19250
+ }
19251
+ if (replace) {
19252
+ result.push(value.slice(start, index), encodeURIComponent(replace));
19253
+ start = index + skip + 1;
19254
+ replace = '';
19255
+ }
19256
+ if (skip) {
19257
+ index += skip;
19258
+ skip = 0;
19259
+ }
19260
+ }
19261
+ return result.join('') + value.slice(start)
19262
+ }
19263
+
19331
19264
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
19332
19265
  * @typedef {import('micromark-util-types').Effects} Effects
19333
19266
  * @typedef {import('micromark-util-types').State} State
@@ -27491,7 +27424,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
27491
27424
  *
27492
27425
  * @typedef {import('../index.js').CompileData} CompileData
27493
27426
  */
27494
- const own$9 = {}.hasOwnProperty;
27427
+ const own$8 = {}.hasOwnProperty;
27495
27428
 
27496
27429
  /**
27497
27430
  * Turn markdown into a syntax tree.
@@ -27684,7 +27617,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
27684
27617
  index = -1;
27685
27618
  while (++index < events.length) {
27686
27619
  const handler = config[events[index][0]];
27687
- if (own$9.call(handler, events[index][1].type)) {
27620
+ if (own$8.call(handler, events[index][1].type)) {
27688
27621
  handler[events[index][1].type].call(
27689
27622
  Object.assign(
27690
27623
  {
@@ -28636,7 +28569,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
28636
28569
  /** @type {keyof Extension} */
28637
28570
  let key;
28638
28571
  for (key in extension) {
28639
- if (own$9.call(extension, key)) {
28572
+ if (own$8.call(extension, key)) {
28640
28573
  switch (key) {
28641
28574
  case 'canContainEols': {
28642
28575
  const right = extension[key];
@@ -30343,7 +30276,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
30343
30276
  * @typedef {import('./footer.js').FootnoteBackLabelTemplate} FootnoteBackLabelTemplate
30344
30277
  */
30345
30278
 
30346
- const own$8 = {}.hasOwnProperty;
30279
+ const own$7 = {}.hasOwnProperty;
30347
30280
 
30348
30281
  /** @type {Options} */
30349
30282
  const emptyOptions$1 = {};
@@ -30416,7 +30349,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
30416
30349
  const type = node.type;
30417
30350
  const handle = state.handlers[type];
30418
30351
 
30419
- if (own$8.call(state.handlers, type) && handle) {
30352
+ if (own$7.call(state.handlers, type) && handle) {
30420
30353
  return handle(state, node, parent)
30421
30354
  }
30422
30355
 
@@ -30572,7 +30505,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
30572
30505
  /** @type {HastElement | HastText} */
30573
30506
  const result =
30574
30507
  'value' in node &&
30575
- !(own$8.call(data, 'hProperties') || own$8.call(data, 'hChildren'))
30508
+ !(own$7.call(data, 'hProperties') || own$7.call(data, 'hChildren'))
30576
30509
  ? {type: 'text', value: node.value}
30577
30510
  : {
30578
30511
  type: 'element',
@@ -32380,7 +32313,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
32380
32313
  // `parse` is called.
32381
32314
  // Currently, we allow directly setting `processor.parser`, which is untyped.
32382
32315
 
32383
- const own$7 = {}.hasOwnProperty;
32316
+ const own$6 = {}.hasOwnProperty;
32384
32317
 
32385
32318
  /**
32386
32319
  * @template {Node | undefined} [ParseTree=undefined]
@@ -32601,7 +32534,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
32601
32534
  }
32602
32535
 
32603
32536
  // Get `key`.
32604
- return (own$7.call(this.namespace, key) && this.namespace[key]) || undefined
32537
+ return (own$6.call(this.namespace, key) && this.namespace[key]) || undefined
32605
32538
  }
32606
32539
 
32607
32540
  // Set space.
@@ -33332,7 +33265,6 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
33332
33265
 
33333
33266
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};// Register `Raw` in tree:
33334
33267
 
33335
- const own$6 = {}.hasOwnProperty;
33336
33268
  const changelog =
33337
33269
  'https://github.com/remarkjs/react-markdown/blob/main/changelog.md';
33338
33270
 
@@ -33478,7 +33410,10 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
33478
33410
  let key;
33479
33411
 
33480
33412
  for (key in urlAttributes) {
33481
- if (own$6.call(urlAttributes, key) && own$6.call(node.properties, key)) {
33413
+ if (
33414
+ Object.hasOwn(urlAttributes, key) &&
33415
+ Object.hasOwn(node.properties, key)
33416
+ ) {
33482
33417
  const value = node.properties[key];
33483
33418
  const test = urlAttributes[key];
33484
33419
  if (test === null || test.includes(node.tagName)) {
@@ -33522,7 +33457,28 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
33522
33457
  * Safe URL.
33523
33458
  */
33524
33459
  function defaultUrlTransform(value) {
33525
- return sanitizeUri(value, safeProtocol)
33460
+ // Same as:
33461
+ // <https://github.com/micromark/micromark/blob/929275e/packages/micromark-util-sanitize-uri/dev/index.js#L34>
33462
+ // But without the `encode` part.
33463
+ const colon = value.indexOf(':');
33464
+ const questionMark = value.indexOf('?');
33465
+ const numberSign = value.indexOf('#');
33466
+ const slash = value.indexOf('/');
33467
+
33468
+ if (
33469
+ // If there is no protocol, it’s relative.
33470
+ colon < 0 ||
33471
+ // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
33472
+ (slash > -1 && colon > slash) ||
33473
+ (questionMark > -1 && colon > questionMark) ||
33474
+ (numberSign > -1 && colon > numberSign) ||
33475
+ // It is a protocol, it should be allowed.
33476
+ safeProtocol.test(value.slice(0, colon))
33477
+ ) {
33478
+ return value
33479
+ }
33480
+
33481
+ return ''
33526
33482
  }
33527
33483
 
33528
33484
  var lodash_uniqby = {exports: {}};
@@ -44810,7 +44766,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
44810
44766
  watcher_count: watcher_count,
44811
44767
  watcherCount: watcherCount,
44812
44768
  watchers: watchers,
44813
- }); }, [
44769
+ }); },
44770
+ // eslint-disable-next-line react-hooks/exhaustive-deps
44771
+ [
44814
44772
  channelId,
44815
44773
  debounceURLEnrichmentMs,
44816
44774
  enrichURLForPreview,
@@ -44847,7 +44805,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
44847
44805
  var typingValue = Object.keys(typing || {}).join();
44848
44806
  var typingContext = React$2.useMemo(function () { return ({
44849
44807
  typing: typing,
44850
- }); }, [typingValue]);
44808
+ }); },
44809
+ // eslint-disable-next-line react-hooks/exhaustive-deps
44810
+ [typingValue]);
44851
44811
  return typingContext;
44852
44812
  };
44853
44813
 
@@ -45356,34 +45316,24 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
45356
45316
 
45357
45317
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var CustomMessageActionsList = function (props) {
45358
45318
  var customMessageActions = props.customMessageActions, message = props.message;
45319
+ if (!customMessageActions)
45320
+ return null;
45359
45321
  var customActionsArray = Object.keys(customMessageActions);
45360
45322
  return (React__default["default"].createElement(React__default["default"].Fragment, null, customActionsArray.map(function (customAction) {
45361
45323
  var customHandler = customMessageActions[customAction];
45362
45324
  return (React__default["default"].createElement("button", { "aria-selected": 'false', className: 'str-chat__message-actions-list-item str-chat__message-actions-list-item-button', key: customAction, onClick: function (event) { return customHandler(message, event); }, role: 'option' }, customAction));
45363
45325
  })));
45364
45326
  };
45365
- var UnMemoizedMessageActionsBox = function (props) {
45366
- var getMessageActions = props.getMessageActions, handleDelete = props.handleDelete, handleEdit = props.handleEdit, handleFlag = props.handleFlag, handleMute = props.handleMute, handlePin = props.handlePin, isUserMuted = props.isUserMuted, mine = props.mine, _a = props.open, open = _a === void 0 ? false : _a;
45327
+
45328
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedMessageActionsBox = React__default["default"].forwardRef(function (props, ref) {
45329
+ var getMessageActions = props.getMessageActions, handleDelete = props.handleDelete, handleEdit = props.handleEdit, handleFlag = props.handleFlag, handleMute = props.handleMute, handlePin = props.handlePin, isUserMuted = props.isUserMuted;
45330
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
45331
+ props.mine; var _a = props.open, open = _a === void 0 ? false : _a, restDivProps = __rest(props, ["getMessageActions", "handleDelete", "handleEdit", "handleFlag", "handleMute", "handlePin", "isUserMuted", "mine", "open"]);
45332
+ var _b = useComponentContext('MessageActionsBox').CustomMessageActionsList, CustomMessageActionsList$1 = _b === void 0 ? CustomMessageActionsList : _b;
45367
45333
  var setQuotedMessage = useChannelActionContext('MessageActionsBox').setQuotedMessage;
45368
- var _b = useMessageContext('MessageActionsBox'), customMessageActions = _b.customMessageActions, message = _b.message, messageListRect = _b.messageListRect;
45334
+ var _c = useMessageContext('MessageActionsBox'), customMessageActions = _c.customMessageActions, message = _c.message;
45369
45335
  var t = useTranslationContext('MessageActionsBox').t;
45370
- var _c = React$2.useState(false), reverse = _c[0], setReverse = _c[1];
45371
45336
  var messageActions = getMessageActions();
45372
- var checkIfReverse = React$2.useCallback(function (containerElement) {
45373
- if (!containerElement) {
45374
- setReverse(false);
45375
- return;
45376
- }
45377
- if (open) {
45378
- var containerRect = containerElement.getBoundingClientRect();
45379
- if (mine) {
45380
- setReverse(!!messageListRect && containerRect.left < messageListRect.left);
45381
- }
45382
- else {
45383
- setReverse(!!messageListRect && containerRect.right + 5 > messageListRect.right);
45384
- }
45385
- }
45386
- }, [messageListRect, mine, open]);
45387
45337
  var handleQuote = function () {
45388
45338
  setQuotedMessage(message);
45389
45339
  var elements = message.parent_id
@@ -45395,140 +45345,24 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
45395
45345
  }
45396
45346
  };
45397
45347
  var rootClassName = clsx('str-chat__message-actions-box', {
45398
- 'str-chat__message-actions-box--mine': mine,
45399
45348
  'str-chat__message-actions-box--open': open,
45400
- 'str-chat__message-actions-box--reverse': reverse,
45401
45349
  });
45402
45350
  var buttonClassName = 'str-chat__message-actions-list-item str-chat__message-actions-list-item-button';
45403
- return (React__default["default"].createElement("div", { className: rootClassName, "data-testid": 'message-actions-box', ref: checkIfReverse },
45351
+ return (React__default["default"].createElement("div", __assign({}, restDivProps, { className: rootClassName, "data-testid": 'message-actions-box', ref: ref }),
45404
45352
  React__default["default"].createElement("div", { "aria-label": 'Message Options', className: 'str-chat__message-actions-list', role: 'listbox' },
45405
- customMessageActions && (React__default["default"].createElement(CustomMessageActionsList, { customMessageActions: customMessageActions, message: message })),
45353
+ React__default["default"].createElement(CustomMessageActionsList$1, { customMessageActions: customMessageActions, message: message }),
45406
45354
  messageActions.indexOf(MESSAGE_ACTIONS.quote) > -1 && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handleQuote, role: 'option' }, t('Reply'))),
45407
45355
  messageActions.indexOf(MESSAGE_ACTIONS.pin) > -1 && !message.parent_id && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handlePin, role: 'option' }, !message.pinned ? t('Pin') : t('Unpin'))),
45408
45356
  messageActions.indexOf(MESSAGE_ACTIONS.flag) > -1 && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handleFlag, role: 'option' }, t('Flag'))),
45409
45357
  messageActions.indexOf(MESSAGE_ACTIONS.mute) > -1 && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handleMute, role: 'option' }, isUserMuted() ? t('Unmute') : t('Mute'))),
45410
45358
  messageActions.indexOf(MESSAGE_ACTIONS.edit) > -1 && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handleEdit, role: 'option' }, t('Edit Message'))),
45411
45359
  messageActions.indexOf(MESSAGE_ACTIONS.delete) > -1 && (React__default["default"].createElement("button", { "aria-selected": 'false', className: buttonClassName, onClick: handleDelete, role: 'option' }, t('Delete'))))));
45412
- };
45360
+ });
45413
45361
  /**
45414
45362
  * A popup box that displays the available actions on a message, such as edit, delete, pin, etc.
45415
45363
  */
45416
45364
  var MessageActionsBox = React__default["default"].memo(UnMemoizedMessageActionsBox);
45417
45365
 
45418
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var MessageActions = function (props) {
45419
- var _a = props.ActionsIcon, ActionsIcon$1 = _a === void 0 ? ActionsIcon : _a, _b = props.customWrapperClass, customWrapperClass = _b === void 0 ? '' : _b, propGetMessageActions = props.getMessageActions, propHandleDelete = props.handleDelete, propHandleFlag = props.handleFlag, propHandleMute = props.handleMute, propHandlePin = props.handlePin, inline = props.inline, propMessage = props.message, messageWrapperRef = props.messageWrapperRef, mine = props.mine;
45420
- var mutes = useChatContext('MessageActions').mutes;
45421
- var _c = useMessageContext('MessageActions'), customMessageActions = _c.customMessageActions, contextGetMessageActions = _c.getMessageActions, contextHandleDelete = _c.handleDelete, contextHandleFlag = _c.handleFlag, contextHandleMute = _c.handleMute, contextHandlePin = _c.handlePin, isMyMessage = _c.isMyMessage, contextMessage = _c.message, setEditingState = _c.setEditingState;
45422
- var getMessageActions = propGetMessageActions || contextGetMessageActions;
45423
- var handleDelete = propHandleDelete || contextHandleDelete;
45424
- var handleFlag = propHandleFlag || contextHandleFlag;
45425
- var handleMute = propHandleMute || contextHandleMute;
45426
- var handlePin = propHandlePin || contextHandlePin;
45427
- var message = propMessage || contextMessage;
45428
- var _d = React$2.useState(false), actionsBoxOpen = _d[0], setActionsBoxOpen = _d[1];
45429
- var isMuted = React$2.useCallback(function () { return isUserMuted(message, mutes); }, [message, mutes]);
45430
- var hideOptions = React$2.useCallback(function (event) {
45431
- if (event instanceof KeyboardEvent && event.key !== 'Escape') {
45432
- return;
45433
- }
45434
- setActionsBoxOpen(false);
45435
- }, []);
45436
- var messageActions = getMessageActions();
45437
- var messageDeletedAt = !!(message === null || message === void 0 ? void 0 : message.deleted_at);
45438
- React$2.useEffect(function () {
45439
- if (messageWrapperRef === null || messageWrapperRef === void 0 ? void 0 : messageWrapperRef.current) {
45440
- messageWrapperRef.current.addEventListener('mouseleave', hideOptions);
45441
- }
45442
- }, [hideOptions, messageWrapperRef]);
45443
- React$2.useEffect(function () {
45444
- if (messageDeletedAt) {
45445
- document.removeEventListener('click', hideOptions);
45446
- }
45447
- }, [hideOptions, messageDeletedAt]);
45448
- React$2.useEffect(function () {
45449
- if (!actionsBoxOpen)
45450
- return;
45451
- document.addEventListener('click', hideOptions);
45452
- document.addEventListener('keyup', hideOptions);
45453
- return function () {
45454
- document.removeEventListener('click', hideOptions);
45455
- document.removeEventListener('keyup', hideOptions);
45456
- };
45457
- }, [actionsBoxOpen, hideOptions]);
45458
- if (!messageActions.length && !customMessageActions)
45459
- return null;
45460
- return (React__default["default"].createElement(MessageActionsWrapper, { customWrapperClass: customWrapperClass, inline: inline, setActionsBoxOpen: setActionsBoxOpen },
45461
- React__default["default"].createElement(MessageActionsBox, { getMessageActions: getMessageActions, handleDelete: handleDelete, handleEdit: setEditingState, handleFlag: handleFlag, handleMute: handleMute, handlePin: handlePin, isUserMuted: isMuted, mine: mine ? mine() : isMyMessage(), open: actionsBoxOpen }),
45462
- React__default["default"].createElement("button", { "aria-expanded": actionsBoxOpen, "aria-haspopup": 'true', "aria-label": 'Open Message Actions Menu', className: 'str-chat__message-actions-box-button' },
45463
- React__default["default"].createElement(ActionsIcon$1, { className: 'str-chat__message-action-icon' }))));
45464
- };
45465
- var MessageActionsWrapper = function (props) {
45466
- var children = props.children, customWrapperClass = props.customWrapperClass, inline = props.inline, setActionsBoxOpen = props.setActionsBoxOpen;
45467
- var defaultWrapperClass = "\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n str-chat__message-actions-container";
45468
- var wrapperClass = customWrapperClass || defaultWrapperClass;
45469
- var onClickOptionsAction = function (event) {
45470
- event.stopPropagation();
45471
- setActionsBoxOpen(function (prev) { return !prev; });
45472
- };
45473
- var wrapperProps = {
45474
- className: wrapperClass,
45475
- 'data-testid': 'message-actions',
45476
- onClick: onClickOptionsAction,
45477
- };
45478
- if (inline)
45479
- return React__default["default"].createElement("span", __assign({}, wrapperProps), children);
45480
- return React__default["default"].createElement("div", __assign({}, wrapperProps), children);
45481
- };
45482
-
45483
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
45484
-
45485
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedMessageOptions = function (props) {
45486
- var _a = props.ActionsIcon, ActionsIcon$1 = _a === void 0 ? ActionsIcon : _a, _b = props.displayReplies, displayReplies = _b === void 0 ? true : _b, propHandleOpenThread = props.handleOpenThread, messageWrapperRef = props.messageWrapperRef, _c = props.ReactionIcon, ReactionIcon$1 = _c === void 0 ? ReactionIcon : _c, _d = props.theme, theme = _d === void 0 ? 'simple' : _d, _e = props.ThreadIcon, ThreadIcon$1 = _e === void 0 ? ThreadIcon : _e;
45487
- var _f = useMessageContext('MessageOptions'), customMessageActions = _f.customMessageActions, getMessageActions = _f.getMessageActions, contextHandleOpenThread = _f.handleOpenThread, initialMessage = _f.initialMessage, message = _f.message, onReactionListClick = _f.onReactionListClick, threadList = _f.threadList;
45488
- var handleOpenThread = propHandleOpenThread || contextHandleOpenThread;
45489
- var messageActions = getMessageActions();
45490
- var showActionsBox = showMessageActionsBox(messageActions, threadList) || !!customMessageActions;
45491
- var shouldShowReactions = messageActions.indexOf(MESSAGE_ACTIONS.react) > -1;
45492
- var shouldShowReplies = messageActions.indexOf(MESSAGE_ACTIONS.reply) > -1 && displayReplies && !threadList;
45493
- if (!message.type ||
45494
- message.type === 'error' ||
45495
- message.type === 'system' ||
45496
- message.type === 'ephemeral' ||
45497
- message.status === 'failed' ||
45498
- message.status === 'sending' ||
45499
- initialMessage) {
45500
- return null;
45501
- }
45502
- var rootClassName = "str-chat__message-".concat(theme, "__actions str-chat__message-options");
45503
- return (React__default["default"].createElement("div", { className: rootClassName, "data-testid": 'message-options' },
45504
- showActionsBox && (React__default["default"].createElement(MessageActions, { ActionsIcon: ActionsIcon$1, messageWrapperRef: messageWrapperRef })),
45505
- shouldShowReplies && (React__default["default"].createElement("button", { "aria-label": 'Open Thread', className: "str-chat__message-".concat(theme, "__actions__action str-chat__message-").concat(theme, "__actions__action--thread str-chat__message-reply-in-thread-button"), "data-testid": 'thread-action', onClick: handleOpenThread },
45506
- React__default["default"].createElement(ThreadIcon$1, { className: 'str-chat__message-action-icon' }))),
45507
- shouldShowReactions && (React__default["default"].createElement("button", { "aria-label": 'Open Reaction Selector', className: "str-chat__message-".concat(theme, "__actions__action str-chat__message-").concat(theme, "__actions__action--reactions str-chat__message-reactions-button"), "data-testid": 'message-reaction-action', onClick: onReactionListClick },
45508
- React__default["default"].createElement(ReactionIcon$1, { className: 'str-chat__message-action-icon' })))));
45509
- };
45510
- var MessageOptions = React__default["default"].memo(UnMemoizedMessageOptions);
45511
-
45512
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedMessageRepliesCountButton = function (props) {
45513
- var labelPlural = props.labelPlural, labelSingle = props.labelSingle, onClick = props.onClick, _a = props.reply_count, reply_count = _a === void 0 ? 0 : _a;
45514
- var t = useTranslationContext('MessageRepliesCountButton').t;
45515
- var themeVersion = useChatContext('MessageRepliesCountButton').themeVersion;
45516
- if (!reply_count)
45517
- return null;
45518
- var replyCountText = t('replyCount', { count: reply_count });
45519
- if (labelPlural && reply_count > 1) {
45520
- replyCountText = "".concat(reply_count, " ").concat(labelPlural);
45521
- }
45522
- else if (labelSingle) {
45523
- replyCountText = "1 ".concat(labelSingle);
45524
- }
45525
- return (React__default["default"].createElement("div", { className: 'str-chat__message-simple-reply-button str-chat__message-replies-count-button-wrapper' },
45526
- React__default["default"].createElement("button", { className: 'str-chat__message-replies-count-button', "data-testid": 'replies-count-button', onClick: onClick },
45527
- themeVersion === '1' && React__default["default"].createElement(ReplyIcon, null),
45528
- replyCountText)));
45529
- };
45530
- var MessageRepliesCountButton = React__default["default"].memo(UnMemoizedMessageRepliesCountButton);
45531
-
45532
45366
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};React__namespace.createContext();
45533
45367
  React__namespace.createContext();
45534
45368
 
@@ -47463,6 +47297,160 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
47463
47297
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};// Public components
47464
47298
  // Public types
47465
47299
 
47300
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function useMessageActionsBoxPopper(_a) {
47301
+ var open = _a.open, placement = _a.placement, referenceElement = _a.referenceElement;
47302
+ var popperElementRef = React$2.useRef(null);
47303
+ var _b = usePopper(referenceElement, popperElementRef.current, {
47304
+ modifiers: [
47305
+ {
47306
+ name: 'eventListeners',
47307
+ options: {
47308
+ // It's not safe to update popper position on resize and scroll, since popper's
47309
+ // reference element might not be visible at the time.
47310
+ resize: false,
47311
+ scroll: false,
47312
+ },
47313
+ },
47314
+ ],
47315
+ placement: placement,
47316
+ }), attributes = _b.attributes, styles = _b.styles, update = _b.update;
47317
+ React$2.useEffect(function () {
47318
+ if (open) {
47319
+ // Since the popper's reference element might not be (and usually is not) visible
47320
+ // all the time, it's safer to force popper update before showing it.
47321
+ update === null || update === void 0 ? void 0 : update();
47322
+ }
47323
+ }, [open, update]);
47324
+ return {
47325
+ attributes: attributes,
47326
+ popperElementRef: popperElementRef,
47327
+ styles: styles,
47328
+ };
47329
+ }
47330
+
47331
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
47332
+
47333
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var MessageActions = function (props) {
47334
+ var _a = props.ActionsIcon, ActionsIcon$1 = _a === void 0 ? ActionsIcon : _a, _b = props.customWrapperClass, customWrapperClass = _b === void 0 ? '' : _b, propGetMessageActions = props.getMessageActions, propHandleDelete = props.handleDelete, propHandleFlag = props.handleFlag, propHandleMute = props.handleMute, propHandlePin = props.handlePin, inline = props.inline, propMessage = props.message, messageWrapperRef = props.messageWrapperRef, mine = props.mine;
47335
+ var mutes = useChatContext('MessageActions').mutes;
47336
+ var _c = useMessageContext('MessageActions'), customMessageActions = _c.customMessageActions, contextGetMessageActions = _c.getMessageActions, contextHandleDelete = _c.handleDelete, contextHandleFlag = _c.handleFlag, contextHandleMute = _c.handleMute, contextHandlePin = _c.handlePin, isMyMessage = _c.isMyMessage, contextMessage = _c.message, setEditingState = _c.setEditingState;
47337
+ var getMessageActions = propGetMessageActions || contextGetMessageActions;
47338
+ var handleDelete = propHandleDelete || contextHandleDelete;
47339
+ var handleFlag = propHandleFlag || contextHandleFlag;
47340
+ var handleMute = propHandleMute || contextHandleMute;
47341
+ var handlePin = propHandlePin || contextHandlePin;
47342
+ var message = propMessage || contextMessage;
47343
+ var isMine = mine ? mine() : isMyMessage();
47344
+ var _d = React$2.useState(false), actionsBoxOpen = _d[0], setActionsBoxOpen = _d[1];
47345
+ var isMuted = React$2.useCallback(function () { return isUserMuted(message, mutes); }, [message, mutes]);
47346
+ var hideOptions = React$2.useCallback(function (event) {
47347
+ if (event instanceof KeyboardEvent && event.key !== 'Escape') {
47348
+ return;
47349
+ }
47350
+ setActionsBoxOpen(false);
47351
+ }, []);
47352
+ var messageActions = getMessageActions();
47353
+ var messageDeletedAt = !!(message === null || message === void 0 ? void 0 : message.deleted_at);
47354
+ React$2.useEffect(function () {
47355
+ if (messageWrapperRef === null || messageWrapperRef === void 0 ? void 0 : messageWrapperRef.current) {
47356
+ messageWrapperRef.current.addEventListener('mouseleave', hideOptions);
47357
+ }
47358
+ }, [hideOptions, messageWrapperRef]);
47359
+ React$2.useEffect(function () {
47360
+ if (messageDeletedAt) {
47361
+ document.removeEventListener('click', hideOptions);
47362
+ }
47363
+ }, [hideOptions, messageDeletedAt]);
47364
+ React$2.useEffect(function () {
47365
+ if (!actionsBoxOpen)
47366
+ return;
47367
+ document.addEventListener('click', hideOptions);
47368
+ document.addEventListener('keyup', hideOptions);
47369
+ return function () {
47370
+ document.removeEventListener('click', hideOptions);
47371
+ document.removeEventListener('keyup', hideOptions);
47372
+ };
47373
+ }, [actionsBoxOpen, hideOptions]);
47374
+ var actionsBoxButtonRef = React$2.useRef(null);
47375
+ var _e = useMessageActionsBoxPopper({
47376
+ open: actionsBoxOpen,
47377
+ placement: isMine ? 'top-end' : 'top-start',
47378
+ referenceElement: actionsBoxButtonRef.current,
47379
+ }), attributes = _e.attributes, popperElementRef = _e.popperElementRef, styles = _e.styles;
47380
+ if (!messageActions.length && !customMessageActions)
47381
+ return null;
47382
+ return (React__default["default"].createElement(MessageActionsWrapper, { customWrapperClass: customWrapperClass, inline: inline, setActionsBoxOpen: setActionsBoxOpen },
47383
+ React__default["default"].createElement(MessageActionsBox, __assign({}, attributes.popper, { getMessageActions: getMessageActions, handleDelete: handleDelete, handleEdit: setEditingState, handleFlag: handleFlag, handleMute: handleMute, handlePin: handlePin, isUserMuted: isMuted, mine: isMine, open: actionsBoxOpen, ref: popperElementRef, style: styles.popper })),
47384
+ React__default["default"].createElement("button", { "aria-expanded": actionsBoxOpen, "aria-haspopup": 'true', "aria-label": 'Open Message Actions Menu', className: 'str-chat__message-actions-box-button', ref: actionsBoxButtonRef },
47385
+ React__default["default"].createElement(ActionsIcon$1, { className: 'str-chat__message-action-icon' }))));
47386
+ };
47387
+ var MessageActionsWrapper = function (props) {
47388
+ var children = props.children, customWrapperClass = props.customWrapperClass, inline = props.inline, setActionsBoxOpen = props.setActionsBoxOpen;
47389
+ var defaultWrapperClass = "\n str-chat__message-simple__actions__action\n str-chat__message-simple__actions__action--options\n str-chat__message-actions-container";
47390
+ var wrapperClass = customWrapperClass || defaultWrapperClass;
47391
+ var onClickOptionsAction = function (event) {
47392
+ event.stopPropagation();
47393
+ setActionsBoxOpen(function (prev) { return !prev; });
47394
+ };
47395
+ var wrapperProps = {
47396
+ className: wrapperClass,
47397
+ 'data-testid': 'message-actions',
47398
+ onClick: onClickOptionsAction,
47399
+ };
47400
+ if (inline)
47401
+ return React__default["default"].createElement("span", __assign({}, wrapperProps), children);
47402
+ return React__default["default"].createElement("div", __assign({}, wrapperProps), children);
47403
+ };
47404
+
47405
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
47406
+
47407
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedMessageOptions = function (props) {
47408
+ var _a = props.ActionsIcon, ActionsIcon$1 = _a === void 0 ? ActionsIcon : _a, _b = props.displayReplies, displayReplies = _b === void 0 ? true : _b, propHandleOpenThread = props.handleOpenThread, messageWrapperRef = props.messageWrapperRef, _c = props.ReactionIcon, ReactionIcon$1 = _c === void 0 ? ReactionIcon : _c, _d = props.theme, theme = _d === void 0 ? 'simple' : _d, _e = props.ThreadIcon, ThreadIcon$1 = _e === void 0 ? ThreadIcon : _e;
47409
+ var _f = useMessageContext('MessageOptions'), customMessageActions = _f.customMessageActions, getMessageActions = _f.getMessageActions, contextHandleOpenThread = _f.handleOpenThread, initialMessage = _f.initialMessage, message = _f.message, onReactionListClick = _f.onReactionListClick, threadList = _f.threadList;
47410
+ var handleOpenThread = propHandleOpenThread || contextHandleOpenThread;
47411
+ var messageActions = getMessageActions();
47412
+ var showActionsBox = showMessageActionsBox(messageActions, threadList) || !!customMessageActions;
47413
+ var shouldShowReactions = messageActions.indexOf(MESSAGE_ACTIONS.react) > -1;
47414
+ var shouldShowReplies = messageActions.indexOf(MESSAGE_ACTIONS.reply) > -1 && displayReplies && !threadList;
47415
+ if (!message.type ||
47416
+ message.type === 'error' ||
47417
+ message.type === 'system' ||
47418
+ message.type === 'ephemeral' ||
47419
+ message.status === 'failed' ||
47420
+ message.status === 'sending' ||
47421
+ initialMessage) {
47422
+ return null;
47423
+ }
47424
+ var rootClassName = "str-chat__message-".concat(theme, "__actions str-chat__message-options");
47425
+ return (React__default["default"].createElement("div", { className: rootClassName, "data-testid": 'message-options' },
47426
+ showActionsBox && (React__default["default"].createElement(MessageActions, { ActionsIcon: ActionsIcon$1, messageWrapperRef: messageWrapperRef })),
47427
+ shouldShowReplies && (React__default["default"].createElement("button", { "aria-label": 'Open Thread', className: "str-chat__message-".concat(theme, "__actions__action str-chat__message-").concat(theme, "__actions__action--thread str-chat__message-reply-in-thread-button"), "data-testid": 'thread-action', onClick: handleOpenThread },
47428
+ React__default["default"].createElement(ThreadIcon$1, { className: 'str-chat__message-action-icon' }))),
47429
+ shouldShowReactions && (React__default["default"].createElement("button", { "aria-label": 'Open Reaction Selector', className: "str-chat__message-".concat(theme, "__actions__action str-chat__message-").concat(theme, "__actions__action--reactions str-chat__message-reactions-button"), "data-testid": 'message-reaction-action', onClick: onReactionListClick },
47430
+ React__default["default"].createElement(ReactionIcon$1, { className: 'str-chat__message-action-icon' })))));
47431
+ };
47432
+ var MessageOptions = React__default["default"].memo(UnMemoizedMessageOptions);
47433
+
47434
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedMessageRepliesCountButton = function (props) {
47435
+ var labelPlural = props.labelPlural, labelSingle = props.labelSingle, onClick = props.onClick, _a = props.reply_count, reply_count = _a === void 0 ? 0 : _a;
47436
+ var t = useTranslationContext('MessageRepliesCountButton').t;
47437
+ var themeVersion = useChatContext('MessageRepliesCountButton').themeVersion;
47438
+ if (!reply_count)
47439
+ return null;
47440
+ var replyCountText = t('replyCount', { count: reply_count });
47441
+ if (labelPlural && reply_count > 1) {
47442
+ replyCountText = "".concat(reply_count, " ").concat(labelPlural);
47443
+ }
47444
+ else if (labelSingle) {
47445
+ replyCountText = "1 ".concat(labelSingle);
47446
+ }
47447
+ return (React__default["default"].createElement("div", { className: 'str-chat__message-simple-reply-button str-chat__message-replies-count-button-wrapper' },
47448
+ React__default["default"].createElement("button", { className: 'str-chat__message-replies-count-button', "data-testid": 'replies-count-button', onClick: onClick },
47449
+ themeVersion === '1' && React__default["default"].createElement(ReplyIcon, null),
47450
+ replyCountText)));
47451
+ };
47452
+ var MessageRepliesCountButton = React__default["default"].memo(UnMemoizedMessageRepliesCountButton);
47453
+
47466
47454
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var Tooltip = function (_a) {
47467
47455
  var children = _a.children, rest = __rest(_a, ["children"]);
47468
47456
  return (React__default["default"].createElement("div", __assign({ className: 'str-chat__tooltip' }, rest), children));
@@ -47589,6 +47577,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
47589
47577
  var message = propMessage || contextMessage;
47590
47578
  var hasAttachment = messageHasAttachments(message);
47591
47579
  var messageTextToRender = ((_b = message.i18n) === null || _b === void 0 ? void 0 : _b["".concat(userLanguage, "_text")]) || message.text;
47580
+ // eslint-disable-next-line react-hooks/exhaustive-deps
47592
47581
  var messageText = React$2.useMemo(function () { return renderText$1(messageTextToRender, message.mentioned_users); }, [
47593
47582
  message.mentioned_users,
47594
47583
  messageTextToRender,
@@ -48108,6 +48097,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48108
48097
  });
48109
48098
  return Object.values(uniqueUsers);
48110
48099
  }, [members, watchers]);
48100
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48111
48101
  var queryMembersThrottled = React$2.useCallback(lodash_throttle(function (query, onReady) { return __awaiter(void 0, void 0, void 0, function () {
48112
48102
  var response, users, error_1;
48113
48103
  return __generator(this, function (_a) {
@@ -48417,6 +48407,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48417
48407
  channel === null || channel === void 0 ? void 0 : channel.off('message.deleted', handleQuotedMessageUpdate);
48418
48408
  channel === null || channel === void 0 ? void 0 : channel.off('message.updated', handleQuotedMessageUpdate);
48419
48409
  };
48410
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48420
48411
  }, [channel, quotedMessage]);
48421
48412
  return themeVersion === '2' ? (React__default["default"].createElement(MessageInputV2, null)) : (React__default["default"].createElement(MessageInputV1, null));
48422
48413
  };
@@ -48584,6 +48575,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48584
48575
  var removeImage = React$2.useCallback(function (id) {
48585
48576
  dispatch({ id: id, type: 'removeImageUpload' });
48586
48577
  // TODO: cancel upload if still uploading
48578
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48587
48579
  }, []);
48588
48580
  var uploadImage = React$2.useCallback(function (id) { return __awaiter(void 0, void 0, void 0, function () {
48589
48581
  var img, file, canUpload, response, error_1, errorMessage, alreadyRemoved;
@@ -48659,7 +48651,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48659
48651
  return [2 /*return*/];
48660
48652
  }
48661
48653
  });
48662
- }); }, [imageUploads, channel, doImageUploadRequest, errorHandler, removeImage]);
48654
+ }); },
48655
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48656
+ [imageUploads, channel, doImageUploadRequest, errorHandler, removeImage]);
48663
48657
  React$2.useEffect(function () {
48664
48658
  var upload = Object.values(imageUploads).find(function (imageUpload) { return imageUpload.state === 'uploading' && imageUpload.file; });
48665
48659
  if (!upload)
@@ -48681,10 +48675,12 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48681
48675
  var t = useTranslationContext('useFileUploads').t;
48682
48676
  var uploadFile = React$2.useCallback(function (id) {
48683
48677
  dispatch({ id: id, state: 'uploading', type: 'setFileUpload' });
48678
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48684
48679
  }, []);
48685
48680
  var removeFile = React$2.useCallback(function (id) {
48686
48681
  // TODO: cancel upload if still uploading
48687
48682
  dispatch({ id: id, type: 'removeFileUpload' });
48683
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48688
48684
  }, []);
48689
48685
  React$2.useEffect(function () {
48690
48686
  (function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -48756,6 +48752,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48756
48752
  }
48757
48753
  });
48758
48754
  }); })();
48755
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48759
48756
  }, [fileUploads, channel, doFileUploadRequest, errorHandler, removeFile]);
48760
48757
  return {
48761
48758
  removeFile: removeFile,
@@ -48807,7 +48804,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48807
48804
  }
48808
48805
  });
48809
48806
  (_a = textareaRef === null || textareaRef === void 0 ? void 0 : textareaRef.current) === null || _a === void 0 ? void 0 : _a.focus();
48810
- }, [maxFilesLeft, noFiles]);
48807
+ },
48808
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48809
+ [maxFilesLeft, noFiles]);
48811
48810
  return {
48812
48811
  maxFilesLeft: maxFilesLeft,
48813
48812
  numberOfUploads: numberOfUploads,
@@ -48858,7 +48857,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48858
48857
  },
48859
48858
  type: 'setText',
48860
48859
  });
48861
- }, [additionalTextareaProps, newCursorPosition, textareaRef]);
48860
+ },
48861
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48862
+ [additionalTextareaProps, newCursorPosition, textareaRef]);
48862
48863
  React$2.useEffect(function () {
48863
48864
  var textareaElement = textareaRef.current;
48864
48865
  if (textareaElement && newCursorPosition.current !== undefined) {
@@ -48881,7 +48882,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
48881
48882
  if (publishTypingEvent && newText && channel) {
48882
48883
  streamChat.logChatPromiseExecution(channel.keystroke(parent === null || parent === void 0 ? void 0 : parent.id), 'start typing event');
48883
48884
  }
48884
- }, [channel, findAndEnqueueURLsToEnrich, parent, publishTypingEvent]);
48885
+ },
48886
+ // eslint-disable-next-line react-hooks/exhaustive-deps
48887
+ [channel, findAndEnqueueURLsToEnrich, parent, publishTypingEvent]);
48885
48888
  return {
48886
48889
  handleChange: handleChange,
48887
48890
  insertText: insertText,
@@ -49115,7 +49118,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
49115
49118
  }
49116
49119
  });
49117
49120
  }); })(clipboardEvent);
49118
- }, [insertText, uploadNewFiles]);
49121
+ },
49122
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49123
+ [insertText, uploadNewFiles]);
49119
49124
  return { onPaste: onPaste };
49120
49125
  };
49121
49126
 
@@ -49139,7 +49144,10 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
49139
49144
  mode: exports.SetLinkPreviewMode.UPSERT,
49140
49145
  type: 'setLinkPreviews',
49141
49146
  });
49142
- }, [onLinkPreviewDismissed]);
49147
+ },
49148
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49149
+ [onLinkPreviewDismissed]);
49150
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49143
49151
  var findAndEnqueueURLsToEnrich = React$2.useCallback(lodash_debounce(function (text, mode) {
49144
49152
  if (mode === void 0) { mode = exports.SetLinkPreviewMode.SET; }
49145
49153
  var urls = findURLFn
@@ -49205,6 +49213,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
49205
49213
  });
49206
49214
  });
49207
49215
  });
49216
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49208
49217
  }, [shouldDiscardEnrichQueries, linkPreviews]);
49209
49218
  return {
49210
49219
  cancelURLEnrichment: cancelURLEnrichment,
@@ -49498,7 +49507,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
49498
49507
  uploadImage: uploadImage,
49499
49508
  uploadNewFiles: uploadNewFiles,
49500
49509
  useMentionsTransliteration: useMentionsTransliteration,
49501
- }); }, [
49510
+ }); },
49511
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49512
+ [
49502
49513
  cancelURLEnrichment,
49503
49514
  cooldownInterval,
49504
49515
  cooldownRemaining,
@@ -49581,6 +49592,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
49581
49592
  channel === null || channel === void 0 ? void 0 : channel.off('message.deleted', handleQuotedMessageUpdate);
49582
49593
  channel === null || channel === void 0 ? void 0 : channel.off('message.updated', handleQuotedMessageUpdate);
49583
49594
  };
49595
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49584
49596
  }, [channel, quotedMessage]);
49585
49597
  return (React__default["default"].createElement("div", { className: 'str-chat__small-message-input__wrapper' },
49586
49598
  React__default["default"].createElement(ImageDropzone, { accept: acceptedFiles, disabled: !isUploadEnabled || maxFilesLeft === 0 || !!cooldownRemaining, handleFiles: uploadNewFiles, maxNumberOfFiles: maxFilesLeft, multiple: multipleUploads },
@@ -49743,8 +49755,11 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
49743
49755
  var message = useMessageContext('useProcessReactions').message;
49744
49756
  var contextReactionOptions = useComponentContext('useProcessReactions').reactionOptions;
49745
49757
  var reactionOptions = propReactionOptions !== null && propReactionOptions !== void 0 ? propReactionOptions : contextReactionOptions;
49758
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49746
49759
  var latestReactions = propReactions || message.latest_reactions || [];
49760
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49747
49761
  var ownReactions = propOwnReactions || (message === null || message === void 0 ? void 0 : message.own_reactions) || [];
49762
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49748
49763
  var reactionCounts = propReactionCounts || message.reaction_counts || {};
49749
49764
  var iHaveReactedWithReaction = React$2.useCallback(function (reactionType) { return ownReactions.find(function (reaction) { return reaction.type === reactionType; }); }, [ownReactions]);
49750
49765
  var getEmojiByReactionType = React$2.useCallback(function (reactionType) { return reactionOptions.find(function (_a) {
@@ -50256,7 +50271,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50256
50271
  // The MessageList should have configurable the limit for performing the requests.
50257
50272
  // This parameter would then be used within these functions
50258
50273
  var hasMoreMessagesProbably = function (returnedCountMessages, limit) {
50259
- return returnedCountMessages === limit;
50274
+ return returnedCountMessages >= limit;
50260
50275
  };
50261
50276
  // @deprecated
50262
50277
  var hasNotMoreMessages = function (returnedCountMessages, limit) {
@@ -50430,7 +50445,65 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50430
50445
  url.searchParams.set('w', resizeDimensions.width.toString());
50431
50446
  };
50432
50447
 
50433
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=streamChat.logChatPromiseExecution;window.StreamChat.Channel=Channel$1;window.ICAL=window.ICAL||{};var UnMemoizedChannel = function (props) {
50448
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
50449
+ * Component to display system and channel event messages
50450
+ */
50451
+ var UnMemoizedEventComponent = function (props) {
50452
+ var _a, _b, _c;
50453
+ var _d = props.Avatar, Avatar$1 = _d === void 0 ? Avatar : _d, message = props.message;
50454
+ var tDateTimeParser = useTranslationContext('EventComponent').tDateTimeParser;
50455
+ var _e = message.created_at, created_at = _e === void 0 ? '' : _e, event = message.event, text = message.text, type = message.type;
50456
+ var getDateOptions = { messageCreatedAt: created_at.toString(), tDateTimeParser: tDateTimeParser };
50457
+ if (type === 'system')
50458
+ return (React__default["default"].createElement("div", { className: 'str-chat__message--system', "data-testid": 'message-system' },
50459
+ React__default["default"].createElement("div", { className: 'str-chat__message--system__text' },
50460
+ React__default["default"].createElement("div", { className: 'str-chat__message--system__line' }),
50461
+ React__default["default"].createElement("p", null, text),
50462
+ React__default["default"].createElement("div", { className: 'str-chat__message--system__line' })),
50463
+ React__default["default"].createElement("div", { className: 'str-chat__message--system__date' },
50464
+ React__default["default"].createElement("strong", null,
50465
+ getDateString(__assign(__assign({}, getDateOptions), { format: 'dddd' })),
50466
+ " "),
50467
+ "at ",
50468
+ getDateString(__assign(__assign({}, getDateOptions), { format: 'hh:mm A' })))));
50469
+ if ((event === null || event === void 0 ? void 0 : event.type) === 'member.removed' || (event === null || event === void 0 ? void 0 : event.type) === 'member.added') {
50470
+ var name_1 = ((_a = event.user) === null || _a === void 0 ? void 0 : _a.name) || ((_b = event.user) === null || _b === void 0 ? void 0 : _b.id);
50471
+ var sentence = "".concat(name_1, " ").concat(event.type === 'member.added' ? 'has joined the chat' : 'was removed from the chat');
50472
+ return (React__default["default"].createElement("div", { className: 'str-chat__event-component__channel-event' },
50473
+ React__default["default"].createElement(Avatar$1, { image: (_c = event.user) === null || _c === void 0 ? void 0 : _c.image, name: name_1, user: event.user }),
50474
+ React__default["default"].createElement("div", { className: 'str-chat__event-component__channel-event__content' },
50475
+ React__default["default"].createElement("em", { className: 'str-chat__event-component__channel-event__sentence' }, sentence),
50476
+ React__default["default"].createElement("div", { className: 'str-chat__event-component__channel-event__date' }, getDateString(__assign(__assign({}, getDateOptions), { format: 'LT' }))))));
50477
+ }
50478
+ return null;
50479
+ };
50480
+ var EventComponent = React__default["default"].memo(UnMemoizedEventComponent);
50481
+
50482
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
50483
+
50484
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedDateSeparator = function (props) {
50485
+ var messageCreatedAt = props.date, formatDate = props.formatDate, _a = props.position, position = _a === void 0 ? 'right' : _a, unread = props.unread;
50486
+ var _b = useTranslationContext('DateSeparator'), t = _b.t, tDateTimeParser = _b.tDateTimeParser;
50487
+ var formattedDate = getDateString({
50488
+ calendar: true,
50489
+ formatDate: formatDate,
50490
+ messageCreatedAt: messageCreatedAt,
50491
+ tDateTimeParser: tDateTimeParser,
50492
+ });
50493
+ return (React__default["default"].createElement("div", { className: 'str-chat__date-separator', "data-testid": 'date-separator' },
50494
+ (position === 'right' || position === 'center') && (React__default["default"].createElement("hr", { className: 'str-chat__date-separator-line' })),
50495
+ React__default["default"].createElement("div", { className: 'str-chat__date-separator-date' }, unread ? "".concat(t('New'), " - ").concat(formattedDate) : formattedDate),
50496
+ (position === 'left' || position === 'center') && (React__default["default"].createElement("hr", { className: 'str-chat__date-separator-line' }))));
50497
+ };
50498
+ /**
50499
+ * A simple date separator between messages.
50500
+ */
50501
+ var DateSeparator = React__default["default"].memo(UnMemoizedDateSeparator);
50502
+
50503
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
50504
+
50505
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=streamChat.logChatPromiseExecution;window.StreamChat.Channel=Channel$1;window.ICAL=window.ICAL||{};var isUserResponseArray = function (output) { var _a; return ((_a = output[0]) === null || _a === void 0 ? void 0 : _a.id) != null; };
50506
+ var UnMemoizedChannel = function (props) {
50434
50507
  var propsChannel = props.channel, _a = props.EmptyPlaceholder, EmptyPlaceholder = _a === void 0 ? null : _a, LoadingErrorIndicator = props.LoadingErrorIndicator, _b = props.LoadingIndicator, LoadingIndicator = _b === void 0 ? LoadingChannel : _b;
50435
50508
  var _c = useChatContext('Channel'), contextChannel = _c.channel, channelsQueryState = _c.channelsQueryState, customClasses = _c.customClasses, theme = _c.theme;
50436
50509
  var _d = useChannelContainerClasses({
@@ -50651,6 +50724,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50651
50724
  client.off('user.deleted', handleEvent);
50652
50725
  notificationTimeouts.forEach(clearTimeout);
50653
50726
  };
50727
+ // eslint-disable-next-line react-hooks/exhaustive-deps
50654
50728
  }, [
50655
50729
  channel.cid,
50656
50730
  channelQueryOptions,
@@ -50669,14 +50743,12 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50669
50743
  /** MESSAGE */
50670
50744
  // Adds a temporary notification to message list, will be removed after 5 seconds
50671
50745
  var addNotification = makeAddNotifications(setNotifications, notificationTimeouts);
50672
- var loadMoreFinished = lodash_debounce(function (hasMore, messages) {
50746
+ // eslint-disable-next-line react-hooks/exhaustive-deps
50747
+ var loadMoreFinished = React$2.useCallback(lodash_debounce(function (hasMore, messages) {
50673
50748
  if (!isMounted.current)
50674
50749
  return;
50675
50750
  dispatch({ hasMore: hasMore, messages: messages, type: 'loadMoreFinished' });
50676
- }, 2000, {
50677
- leading: true,
50678
- trailing: true,
50679
- });
50751
+ }, 2000, { leading: true, trailing: true }), []);
50680
50752
  var loadMore = function (limit) {
50681
50753
  if (limit === void 0) { limit = DEFAULT_NEXT_CHANNEL_PAGE_SIZE; }
50682
50754
  return __awaiter(void 0, void 0, void 0, function () {
@@ -50720,12 +50792,12 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50720
50792
  var loadMoreNewer = function (limit) {
50721
50793
  if (limit === void 0) { limit = 100; }
50722
50794
  return __awaiter(void 0, void 0, void 0, function () {
50723
- var newestMessage, newestId, perPage, queryResponse, e_3, hasMoreNewer;
50795
+ var newestMessage, newestId, perPage, queryResponse, e_3, hasMoreNewerMessages;
50724
50796
  var _a, _b;
50725
50797
  return __generator(this, function (_c) {
50726
50798
  switch (_c.label) {
50727
50799
  case 0:
50728
- if (!online.current || !window.navigator.onLine)
50800
+ if (!online.current || !window.navigator.onLine || !state.hasMoreNewer)
50729
50801
  return [2 /*return*/, 0];
50730
50802
  newestMessage = (_a = state === null || state === void 0 ? void 0 : state.messages) === null || _a === void 0 ? void 0 : _a[((_b = state === null || state === void 0 ? void 0 : state.messages) === null || _b === void 0 ? void 0 : _b.length) - 1];
50731
50803
  if (state.loadingMore || state.loadingMoreNewer)
@@ -50749,8 +50821,12 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50749
50821
  dispatch({ loadingMoreNewer: false, type: 'setLoadingMoreNewer' });
50750
50822
  return [2 /*return*/, 0];
50751
50823
  case 4:
50752
- hasMoreNewer = channel.state.messages !== channel.state.latestMessages;
50753
- dispatch({ hasMoreNewer: hasMoreNewer, messages: channel.state.messages, type: 'loadMoreNewerFinished' });
50824
+ hasMoreNewerMessages = channel.state.messages !== channel.state.latestMessages;
50825
+ dispatch({
50826
+ hasMoreNewer: hasMoreNewerMessages,
50827
+ messages: channel.state.messages,
50828
+ type: 'loadMoreNewerFinished',
50829
+ });
50754
50830
  return [2 /*return*/, queryResponse.messages.length];
50755
50831
  }
50756
50832
  });
@@ -50835,7 +50911,6 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50835
50911
  type: 'copyMessagesFromChannel',
50836
50912
  });
50837
50913
  };
50838
- var isUserResponseArray = function (output) { var _a; return ((_a = output[0]) === null || _a === void 0 ? void 0 : _a.id) != null; };
50839
50914
  var doSendMessage = function (message, customMessageData, options) { return __awaiter(void 0, void 0, void 0, function () {
50840
50915
  var attachments, id, _a, mentioned_users, parent_id, text, mentions, messageData, messageResponse, existingMessage, i, msg, responseTimestamp, existingMessageTimestamp, responseIsTheNewest, error_1, stringError, parsedError;
50841
50916
  var _b, _c;
@@ -50955,17 +51030,18 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50955
51030
  event === null || event === void 0 ? void 0 : event.preventDefault();
50956
51031
  dispatch({ type: 'closeThread' });
50957
51032
  };
50958
- var loadMoreThreadFinished = lodash_debounce(function (threadHasMore, threadMessages) {
51033
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51034
+ var loadMoreThreadFinished = React$2.useCallback(lodash_debounce(function (threadHasMore, threadMessages) {
50959
51035
  dispatch({
50960
51036
  threadHasMore: threadHasMore,
50961
51037
  threadMessages: threadMessages,
50962
51038
  type: 'loadMoreThreadFinished',
50963
51039
  });
50964
- }, 2000, { leading: true, trailing: true });
51040
+ }, 2000, { leading: true, trailing: true }), []);
50965
51041
  var loadMoreThread = function (limit) {
50966
51042
  if (limit === void 0) { limit = DEFAULT_THREAD_PAGE_SIZE; }
50967
51043
  return __awaiter(void 0, void 0, void 0, function () {
50968
- var parentID, oldMessages, oldestMessageID, queryResponse, threadHasMoreMessages, newThreadMessages;
51044
+ var parentId, oldMessages, oldestMessageId, queryResponse, threadHasMoreMessages, newThreadMessages;
50969
51045
  var _a;
50970
51046
  return __generator(this, function (_b) {
50971
51047
  switch (_b.label) {
@@ -50974,23 +51050,23 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
50974
51050
  if (state.threadLoadingMore || !state.thread)
50975
51051
  return [2 /*return*/];
50976
51052
  dispatch({ type: 'startLoadingThread' });
50977
- parentID = state.thread.id;
50978
- if (!parentID) {
51053
+ parentId = state.thread.id;
51054
+ if (!parentId) {
50979
51055
  return [2 /*return*/, dispatch({ type: 'closeThread' })];
50980
51056
  }
50981
- oldMessages = channel.state.threads[parentID] || [];
50982
- oldestMessageID = (_a = oldMessages[0]) === null || _a === void 0 ? void 0 : _a.id;
51057
+ oldMessages = channel.state.threads[parentId] || [];
51058
+ oldestMessageId = (_a = oldMessages[0]) === null || _a === void 0 ? void 0 : _a.id;
50983
51059
  _b.label = 1;
50984
51060
  case 1:
50985
51061
  _b.trys.push([1, 3, , 4]);
50986
- return [4 /*yield*/, channel.getReplies(parentID, {
50987
- id_lt: oldestMessageID,
51062
+ return [4 /*yield*/, channel.getReplies(parentId, {
51063
+ id_lt: oldestMessageId,
50988
51064
  limit: limit,
50989
51065
  })];
50990
51066
  case 2:
50991
51067
  queryResponse = _b.sent();
50992
51068
  threadHasMoreMessages = hasMoreMessagesProbably(queryResponse.messages.length, limit);
50993
- newThreadMessages = channel.state.threads[parentID] || [];
51069
+ newThreadMessages = channel.state.threads[parentId] || [];
50994
51070
  // next set loadingMore to false so we can start asking for more data
50995
51071
  loadMoreThreadFinished(threadHasMoreMessages, newThreadMessages);
50996
51072
  return [3 /*break*/, 4];
@@ -51027,7 +51103,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51027
51103
  setQuotedMessage: setQuotedMessage,
51028
51104
  skipMessageDataMemoization: skipMessageDataMemoization,
51029
51105
  updateMessage: updateMessage,
51030
- }); }, [
51106
+ }); },
51107
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51108
+ [
51031
51109
  channel.cid,
51032
51110
  deleteMessage,
51033
51111
  enrichURLForPreviewConfig === null || enrichURLForPreviewConfig === void 0 ? void 0 : enrichURLForPreviewConfig.findURLFn,
@@ -51049,7 +51127,8 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51049
51127
  Avatar: props.Avatar,
51050
51128
  BaseImage: props.BaseImage,
51051
51129
  CooldownTimer: props.CooldownTimer,
51052
- DateSeparator: props.DateSeparator,
51130
+ CustomMessageActionsList: props.CustomMessageActionsList,
51131
+ DateSeparator: props.DateSeparator || DateSeparator,
51053
51132
  EditMessageInput: props.EditMessageInput,
51054
51133
  EmojiPicker: props.EmojiPicker,
51055
51134
  emojiSearchIndex: props.emojiSearchIndex,
@@ -51067,7 +51146,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51067
51146
  MessageOptions: props.MessageOptions,
51068
51147
  MessageRepliesCountButton: props.MessageRepliesCountButton,
51069
51148
  MessageStatus: props.MessageStatus,
51070
- MessageSystem: props.MessageSystem,
51149
+ MessageSystem: props.MessageSystem || EventComponent,
51071
51150
  MessageTimestamp: props.MessageTimestamp,
51072
51151
  ModalGallery: props.ModalGallery,
51073
51152
  PinIndicator: props.PinIndicator,
@@ -51084,7 +51163,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51084
51163
  TypingIndicator: props.TypingIndicator,
51085
51164
  VirtualMessage: props.VirtualMessage,
51086
51165
  });
51087
- }, [props.reactionOptions]);
51166
+ },
51167
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51168
+ [props.reactionOptions]);
51088
51169
  var typingContextValue = useCreateTypingContext({
51089
51170
  typing: typing,
51090
51171
  });
@@ -51200,6 +51281,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51200
51281
  return function () {
51201
51282
  client.off('user.updated', handleEvent);
51202
51283
  };
51284
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51203
51285
  }, []);
51204
51286
  return {
51205
51287
  displayImage: overrideImage || displayImage,
@@ -51302,6 +51384,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51302
51384
  return function () {
51303
51385
  client.off('channel.deleted', handleEvent);
51304
51386
  };
51387
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51305
51388
  }, [customHandler]);
51306
51389
  };
51307
51390
 
@@ -51327,6 +51410,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51327
51410
  return function () {
51328
51411
  client.off('channel.hidden', handleEvent);
51329
51412
  };
51413
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51330
51414
  }, [customHandler]);
51331
51415
  };
51332
51416
 
@@ -51346,6 +51430,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51346
51430
  return function () {
51347
51431
  client.off('channel.truncated', handleEvent);
51348
51432
  };
51433
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51349
51434
  }, [customHandler]);
51350
51435
  };
51351
51436
 
@@ -51374,6 +51459,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51374
51459
  return function () {
51375
51460
  client.off('channel.updated', handleEvent);
51376
51461
  };
51462
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51377
51463
  }, [customHandler]);
51378
51464
  };
51379
51465
 
@@ -51407,6 +51493,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51407
51493
  return function () {
51408
51494
  client.off('channel.visible', handleEvent);
51409
51495
  };
51496
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51410
51497
  }, [customHandler]);
51411
51498
  };
51412
51499
 
@@ -51422,6 +51509,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51422
51509
  return function () {
51423
51510
  client.off('connection.recovered', handleEvent);
51424
51511
  };
51512
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51425
51513
  }, []);
51426
51514
  };
51427
51515
 
@@ -51463,6 +51551,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51463
51551
  return function () {
51464
51552
  client.off('message.new', handleEvent);
51465
51553
  };
51554
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51466
51555
  }, [lockChannelOrder]);
51467
51556
  };
51468
51557
 
@@ -51523,6 +51612,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51523
51612
  return function () {
51524
51613
  client.off('notification.added_to_channel', handleEvent);
51525
51614
  };
51615
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51526
51616
  }, [customHandler]);
51527
51617
  };
51528
51618
 
@@ -51558,6 +51648,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51558
51648
  return function () {
51559
51649
  client.off('notification.message_new', handleEvent);
51560
51650
  };
51651
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51561
51652
  }, [customHandler]);
51562
51653
  };
51563
51654
 
@@ -51576,6 +51667,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51576
51667
  return function () {
51577
51668
  client.off('notification.removed_from_channel', handleEvent);
51578
51669
  };
51670
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51579
51671
  }, [customHandler]);
51580
51672
  };
51581
51673
 
@@ -51595,6 +51687,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51595
51687
  // memoize props
51596
51688
  var filterString = React$2.useMemo(function () { return JSON.stringify(filters); }, [filters]);
51597
51689
  var sortString = React$2.useMemo(function () { return JSON.stringify(sort); }, [sort]);
51690
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51598
51691
  var queryChannels = function (queryType) { return __awaiter(void 0, void 0, void 0, function () {
51599
51692
  var offset, newOptions, channelQueryResponse, newChannels, err_1;
51600
51693
  var _a;
@@ -51663,6 +51756,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51663
51756
  }, [client, throttleRecover]);
51664
51757
  React$2.useEffect(function () {
51665
51758
  queryChannels('reload');
51759
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51666
51760
  }, [filterString, sortString]);
51667
51761
  return {
51668
51762
  channels: channels,
@@ -51693,6 +51787,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51693
51787
  return function () {
51694
51788
  client.off('user.presence.changed', handleEvent);
51695
51789
  };
51790
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51696
51791
  }, []);
51697
51792
  };
51698
51793
 
@@ -51735,6 +51830,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51735
51830
  var handleEvent = function () { return setMuted(channel.muteStatus()); };
51736
51831
  client.on('notification.channel_mutes_updated', handleEvent);
51737
51832
  return function () { return client.off('notification.channel_mutes_updated', handleEvent); };
51833
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51738
51834
  }, [muted]);
51739
51835
  return muted;
51740
51836
  };
@@ -51818,6 +51914,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51818
51914
  };
51819
51915
  client.on('notification.mark_read', handleEvent);
51820
51916
  return function () { return client.off('notification.mark_read', handleEvent); };
51917
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51821
51918
  }, []);
51822
51919
  var refreshUnreadCount = React$2.useCallback(function () {
51823
51920
  if (isActive || muted) {
@@ -51842,6 +51939,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51842
51939
  channel.off('message.updated', handleEvent);
51843
51940
  channel.off('message.deleted', handleEvent);
51844
51941
  };
51942
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51845
51943
  }, [refreshUnreadCount, channelUpdateCount]);
51846
51944
  if (!Preview)
51847
51945
  return null;
@@ -51898,6 +51996,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51898
51996
  };
51899
51997
  document.addEventListener('click', clickListener);
51900
51998
  return function () { return document.removeEventListener('click', clickListener); };
51999
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51901
52000
  }, [disabled, inputIsFocused, query, exitSearch, clearSearchOnClickOutside]);
51902
52001
  React$2.useEffect(function () {
51903
52002
  if (!inputRef.current || disabled)
@@ -51909,8 +52008,10 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51909
52008
  inputRef.current.addEventListener('keydown', handleKeyDown);
51910
52009
  return function () {
51911
52010
  var _a;
52011
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51912
52012
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('keydown', handleKeyDown);
51913
52013
  };
52014
+ // eslint-disable-next-line react-hooks/exhaustive-deps
51914
52015
  }, [disabled]);
51915
52016
  var selectResult = React$2.useCallback(function (result) { return __awaiter(void 0, void 0, void 0, function () {
51916
52017
  var selectedChannel, newChannel;
@@ -51949,7 +52050,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51949
52050
  return [2 /*return*/];
51950
52051
  }
51951
52052
  });
51952
- }); }, [clearSearchOnClickOutside, client, exitSearch, onSelectResult, setActiveChannel, setChannels]);
52053
+ }); },
52054
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52055
+ [clearSearchOnClickOutside, client, exitSearch, onSelectResult, setActiveChannel, setChannels]);
51953
52056
  var getChannels = React$2.useCallback(function (text) { return __awaiter(void 0, void 0, void 0, function () {
51954
52057
  var results, userQueryPromise, users, channelQueryPromise, _a, channels, users, error_1;
51955
52058
  var _b, _c, _d, _e, _f, _g;
@@ -51997,6 +52100,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
51997
52100
  }
51998
52101
  });
51999
52102
  }); }, [client, searchForChannels, searchQueryParams]);
52103
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52000
52104
  var scheduleGetChannels = React$2.useCallback(lodash_debounce(getChannels, searchDebounceIntervalMs), [
52001
52105
  getChannels,
52002
52106
  searchDebounceIntervalMs,
@@ -52104,11 +52208,13 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52104
52208
  (_a = props.inputRef.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('focus', handleFocus);
52105
52209
  (_b = props.inputRef.current) === null || _b === void 0 ? void 0 : _b.addEventListener('blur', handleBlur);
52106
52210
  };
52211
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52107
52212
  }, []);
52108
52213
  var handleClearClick = React$2.useCallback(function () {
52109
52214
  var _a;
52110
52215
  exitSearch();
52111
52216
  (_a = inputProps.inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
52217
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52112
52218
  }, []);
52113
52219
  var closeAppMenu = React$2.useCallback(function () { return setMenuIsOpen(false); }, []);
52114
52220
  return (React__default["default"].createElement("div", { className: 'str-chat__channel-search-bar', "data-testid": 'search-bar', ref: searchBarRef },
@@ -52194,7 +52300,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52194
52300
  return setFocusedResult(undefined);
52195
52301
  }
52196
52302
  }
52197
- }, [focusedResult]);
52303
+ },
52304
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52305
+ [focusedResult]);
52198
52306
  React$2.useEffect(function () {
52199
52307
  document.addEventListener('keydown', handleKeyDown, false);
52200
52308
  return function () { return document.removeEventListener('keydown', handleKeyDown); };
@@ -52277,6 +52385,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52277
52385
  var loading = typeof isLoading !== 'undefined' ? isLoading : refreshing;
52278
52386
  React$2.useEffect(function () {
52279
52387
  deprecationAndReplacementWarning([[{ refreshing: refreshing }, { isLoading: isLoading }]], 'LoadMoreButton');
52388
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52280
52389
  }, []);
52281
52390
  return (React__default["default"].createElement("div", { className: 'str-chat__load-more-button' },
52282
52391
  React__default["default"].createElement("button", { "aria-label": 'Load More Channels', className: 'str-chat__load-more-button__button str-chat__cta-button', "data-testid": 'load-more-button', disabled: loading, onClick: onClick }, loading ? React__default["default"].createElement(LoadingIndicator, null) : childrenOrDefaultString)));
@@ -52288,6 +52397,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52288
52397
  var loadingState = typeof isLoading !== 'undefined' ? isLoading : refreshing;
52289
52398
  React$2.useEffect(function () {
52290
52399
  deprecationAndReplacementWarning([[{ refreshing: refreshing }, { isLoading: isLoading }]], 'LoadMorePaginator');
52400
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52291
52401
  }, []);
52292
52402
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
52293
52403
  !reverse && children,
@@ -52359,11 +52469,13 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52359
52469
  setSearchActive(true);
52360
52470
  }
52361
52471
  (_a = additionalChannelSearchProps === null || additionalChannelSearchProps === void 0 ? void 0 : additionalChannelSearchProps.onSearch) === null || _a === void 0 ? void 0 : _a.call(additionalChannelSearchProps, event);
52472
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52362
52473
  }, []);
52363
52474
  var onSearchExit = React$2.useCallback(function () {
52364
52475
  var _a;
52365
52476
  setSearchActive(false);
52366
52477
  (_a = additionalChannelSearchProps === null || additionalChannelSearchProps === void 0 ? void 0 : additionalChannelSearchProps.onSearchExit) === null || _a === void 0 ? void 0 : _a.call(additionalChannelSearchProps);
52478
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52367
52479
  }, []);
52368
52480
  var _u = usePaginatedChannels(client, filters || DEFAULT_FILTERS, sort || DEFAULT_SORT, options || DEFAULT_OPTIONS, activeChannelHandler, recoveryThrottleIntervalMs), channels = _u.channels, hasNextPage = _u.hasNextPage, loadNextPage = _u.loadNextPage, setChannels = _u.setChannels;
52369
52481
  var loadedChannels = channelRenderFilterFn ? channelRenderFilterFn(channels) : channels;
@@ -52391,6 +52503,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52391
52503
  client.off('channel.deleted', handleEvent);
52392
52504
  client.off('channel.hidden', handleEvent);
52393
52505
  };
52506
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52394
52507
  }, [channel === null || channel === void 0 ? void 0 : channel.cid]);
52395
52508
  var renderChannel = function (item) {
52396
52509
  var previewProps = {
@@ -52430,7 +52543,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52430
52543
 
52431
52544
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
52432
52545
 
52433
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version$1 = '11.2.1';
52546
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var version$1 = '11.4.0';
52434
52547
 
52435
52548
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useChat = function (_a) {
52436
52549
  var _b, _c;
@@ -52472,6 +52585,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52472
52585
  };
52473
52586
  client.on('notification.mutes_updated', handleEvent);
52474
52587
  return function () { return client.off('notification.mutes_updated', handleEvent); };
52588
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52475
52589
  }, [clientMutes === null || clientMutes === void 0 ? void 0 : clientMutes.length]);
52476
52590
  React$2.useEffect(function () {
52477
52591
  var _a;
@@ -52487,6 +52601,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52487
52601
  streami18n.getTranslators().then(function (translator) {
52488
52602
  setTranslators(__assign(__assign({}, translator), { userLanguage: userLanguage || defaultLanguage }));
52489
52603
  });
52604
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52490
52605
  }, [i18nInstance]);
52491
52606
  var setActiveChannel = React$2.useCallback(function (activeChannel, watchers, event) {
52492
52607
  if (watchers === void 0) { watchers = {}; }
@@ -52548,7 +52663,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52548
52663
  theme: theme,
52549
52664
  themeVersion: themeVersion,
52550
52665
  useImageFlagEmojisOnWindows: useImageFlagEmojisOnWindows,
52551
- }); }, [
52666
+ }); },
52667
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52668
+ [
52552
52669
  channelCid,
52553
52670
  channelsQueryError,
52554
52671
  channelsQueryInProgress,
@@ -52651,63 +52768,6 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52651
52768
 
52652
52769
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
52653
52770
 
52654
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var UnMemoizedDateSeparator = function (props) {
52655
- var messageCreatedAt = props.date, formatDate = props.formatDate, _a = props.position, position = _a === void 0 ? 'right' : _a, unread = props.unread;
52656
- var _b = useTranslationContext('DateSeparator'), t = _b.t, tDateTimeParser = _b.tDateTimeParser;
52657
- var formattedDate = getDateString({
52658
- calendar: true,
52659
- formatDate: formatDate,
52660
- messageCreatedAt: messageCreatedAt,
52661
- tDateTimeParser: tDateTimeParser,
52662
- });
52663
- return (React__default["default"].createElement("div", { className: 'str-chat__date-separator', "data-testid": 'date-separator' },
52664
- (position === 'right' || position === 'center') && (React__default["default"].createElement("hr", { className: 'str-chat__date-separator-line' })),
52665
- React__default["default"].createElement("div", { className: 'str-chat__date-separator-date' }, unread ? "".concat(t('New'), " - ").concat(formattedDate) : formattedDate),
52666
- (position === 'left' || position === 'center') && (React__default["default"].createElement("hr", { className: 'str-chat__date-separator-line' }))));
52667
- };
52668
- /**
52669
- * A simple date separator between messages.
52670
- */
52671
- var DateSeparator = React__default["default"].memo(UnMemoizedDateSeparator);
52672
-
52673
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
52674
-
52675
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
52676
-
52677
- window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
52678
- * Component to display system and channel event messages
52679
- */
52680
- var UnMemoizedEventComponent = function (props) {
52681
- var _a, _b, _c;
52682
- var _d = props.Avatar, Avatar$1 = _d === void 0 ? Avatar : _d, message = props.message;
52683
- var tDateTimeParser = useTranslationContext('EventComponent').tDateTimeParser;
52684
- var _e = message.created_at, created_at = _e === void 0 ? '' : _e, event = message.event, text = message.text, type = message.type;
52685
- var getDateOptions = { messageCreatedAt: created_at.toString(), tDateTimeParser: tDateTimeParser };
52686
- if (type === 'system')
52687
- return (React__default["default"].createElement("div", { className: 'str-chat__message--system', "data-testid": 'message-system' },
52688
- React__default["default"].createElement("div", { className: 'str-chat__message--system__text' },
52689
- React__default["default"].createElement("div", { className: 'str-chat__message--system__line' }),
52690
- React__default["default"].createElement("p", null, text),
52691
- React__default["default"].createElement("div", { className: 'str-chat__message--system__line' })),
52692
- React__default["default"].createElement("div", { className: 'str-chat__message--system__date' },
52693
- React__default["default"].createElement("strong", null,
52694
- getDateString(__assign(__assign({}, getDateOptions), { format: 'dddd' })),
52695
- " "),
52696
- "at ",
52697
- getDateString(__assign(__assign({}, getDateOptions), { format: 'hh:mm A' })))));
52698
- if ((event === null || event === void 0 ? void 0 : event.type) === 'member.removed' || (event === null || event === void 0 ? void 0 : event.type) === 'member.added') {
52699
- var name_1 = ((_a = event.user) === null || _a === void 0 ? void 0 : _a.name) || ((_b = event.user) === null || _b === void 0 ? void 0 : _b.id);
52700
- var sentence = "".concat(name_1, " ").concat(event.type === 'member.added' ? 'has joined the chat' : 'was removed from the chat');
52701
- return (React__default["default"].createElement("div", { className: 'str-chat__event-component__channel-event' },
52702
- React__default["default"].createElement(Avatar$1, { image: (_c = event.user) === null || _c === void 0 ? void 0 : _c.image, name: name_1, user: event.user }),
52703
- React__default["default"].createElement("div", { className: 'str-chat__event-component__channel-event__content' },
52704
- React__default["default"].createElement("em", { className: 'str-chat__event-component__channel-event__sentence' }, sentence),
52705
- React__default["default"].createElement("div", { className: 'str-chat__event-component__channel-event__date' }, getDateString(__assign(__assign({}, getDateOptions), { format: 'LT' }))))));
52706
- }
52707
- return null;
52708
- };
52709
- var EventComponent = React__default["default"].memo(UnMemoizedEventComponent);
52710
-
52711
52771
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};
52712
52772
 
52713
52773
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};/**
@@ -52765,6 +52825,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
52765
52825
  [{ hasMore: hasMore }, { hasPreviousPage: hasPreviousPage }],
52766
52826
  [{ loadMore: loadMore }, { loadPreviousPage: loadPreviousPage }],
52767
52827
  ], 'InfiniteScroll');
52828
+ // eslint-disable-next-line react-hooks/exhaustive-deps
52768
52829
  }, []);
52769
52830
  React$2.useLayoutEffect(function () {
52770
52831
  var _a;
@@ -53122,7 +53183,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53122
53183
  var newOwnReactions = add
53123
53184
  ? __spreadArray([reaction], ((message === null || message === void 0 ? void 0 : message.own_reactions) || []), true) : (_b = message === null || message === void 0 ? void 0 : message.own_reactions) === null || _b === void 0 ? void 0 : _b.filter(function (item) { return item.type !== reaction.type; });
53124
53185
  return __assign(__assign({}, message), { latest_reactions: newReactions || message.latest_reactions, own_reactions: newOwnReactions, reaction_counts: newReactionCounts, reaction_scores: newReactionCounts });
53125
- }, [client.user, client.userID]);
53186
+ },
53187
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53188
+ [client.user, client.userID]);
53126
53189
  var createReactionPreview = function (type) {
53127
53190
  var _a;
53128
53191
  return ({
@@ -53228,7 +53291,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53228
53291
  return;
53229
53292
  }
53230
53293
  setShowDetailedReactions(false);
53231
- }, [setShowDetailedReactions, reactionSelectorRef]);
53294
+ },
53295
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53296
+ [setShowDetailedReactions, reactionSelectorRef]);
53232
53297
  React$2.useEffect(function () {
53233
53298
  var messageWrapper = messageWrapperRef === null || messageWrapperRef === void 0 ? void 0 : messageWrapperRef.current;
53234
53299
  if (showDetailedReactions && !hasListener.current) {
@@ -53513,7 +53578,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53513
53578
  acc[message.id] = style;
53514
53579
  return acc;
53515
53580
  }, {});
53516
- }, [messagesWithDates, noGroupByUser]);
53581
+ },
53582
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53583
+ [messagesWithDates, noGroupByUser]);
53517
53584
  return { messageGroupStyles: messageGroupStyles, messages: messagesWithDates };
53518
53585
  };
53519
53586
 
@@ -53528,9 +53595,9 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53528
53595
  };
53529
53596
 
53530
53597
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var useMessageListElements = function (props) {
53531
- var enrichedMessages = props.enrichedMessages, internalMessageProps = props.internalMessageProps, messageGroupStyles = props.messageGroupStyles, read = props.read, returnAllReadData = props.returnAllReadData, threadList = props.threadList;
53598
+ var enrichedMessages = props.enrichedMessages, internalMessageProps = props.internalMessageProps, messageGroupStyles = props.messageGroupStyles, read = props.read, renderMessages = props.renderMessages, returnAllReadData = props.returnAllReadData, threadList = props.threadList;
53532
53599
  var _a = useChatContext('useMessageListElements'), client = _a.client, customClasses = _a.customClasses;
53533
- var _b = useComponentContext('useMessageListElements'), _c = _b.DateSeparator, DateSeparator$1 = _c === void 0 ? DateSeparator : _c, HeaderComponent = _b.HeaderComponent, _d = _b.MessageSystem, MessageSystem = _d === void 0 ? EventComponent : _d;
53600
+ var components = useComponentContext('useMessageListElements');
53534
53601
  // get the readData, but only for messages submitted by the user themselves
53535
53602
  var readData = useLastReadData({
53536
53603
  messages: enrichedMessages,
@@ -53538,34 +53605,28 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53538
53605
  returnAllReadData: returnAllReadData,
53539
53606
  userID: client.userID,
53540
53607
  });
53541
- var lastReceivedId = React$2.useMemo(function () { return getLastReceived(enrichedMessages); }, [enrichedMessages]);
53608
+ var lastReceivedMessageId = React$2.useMemo(function () { return getLastReceived(enrichedMessages); }, [
53609
+ enrichedMessages,
53610
+ ]);
53542
53611
  var elements = React$2.useMemo(function () {
53543
- return enrichedMessages.map(function (message) {
53544
- if (message.customType === CUSTOM_MESSAGE_TYPE.date &&
53545
- message.date &&
53546
- isDate(message.date)) {
53547
- return (React__default["default"].createElement("li", { key: "".concat(message.date.toISOString(), "-i") },
53548
- React__default["default"].createElement(DateSeparator$1, { date: message.date, formatDate: internalMessageProps.formatDate, unread: message.unread })));
53549
- }
53550
- if (message.customType === CUSTOM_MESSAGE_TYPE.intro && HeaderComponent) {
53551
- return (React__default["default"].createElement("li", { key: 'intro' },
53552
- React__default["default"].createElement(HeaderComponent, null)));
53553
- }
53554
- if (message.type === 'system') {
53555
- return (React__default["default"].createElement("li", { key: message.id || message.created_at },
53556
- React__default["default"].createElement(MessageSystem, { message: message })));
53557
- }
53558
- var groupStyles = messageGroupStyles[message.id] || '';
53559
- var messageClass = (customClasses === null || customClasses === void 0 ? void 0 : customClasses.message) || "str-chat__li str-chat__li--".concat(groupStyles);
53560
- return (React__default["default"].createElement("li", { className: messageClass, "data-message-id": message.id, "data-testid": messageClass, key: message.id || message.created_at },
53561
- React__default["default"].createElement(Message, __assign({ groupStyles: [groupStyles], lastReceivedId: lastReceivedId, message: message, readBy: readData[message.id] || [], threadList: threadList }, internalMessageProps))));
53612
+ return renderMessages({
53613
+ components: components,
53614
+ customClasses: customClasses,
53615
+ lastReceivedMessageId: lastReceivedMessageId,
53616
+ messageGroupStyles: messageGroupStyles,
53617
+ messages: enrichedMessages,
53618
+ readData: readData,
53619
+ sharedMessageProps: __assign(__assign({}, internalMessageProps), { threadList: threadList }),
53562
53620
  });
53563
- }, [
53621
+ },
53622
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53623
+ [
53564
53624
  enrichedMessages,
53565
53625
  internalMessageProps,
53566
- lastReceivedId,
53626
+ lastReceivedMessageId,
53567
53627
  messageGroupStyles,
53568
53628
  readData,
53629
+ renderMessages,
53569
53630
  threadList,
53570
53631
  ]);
53571
53632
  return elements;
@@ -53622,6 +53683,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53622
53683
  }
53623
53684
  messages.current = newMessages;
53624
53685
  measures.current = newMeasures;
53686
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53625
53687
  }, [measures, messages, params.messages]);
53626
53688
  return function (scrollTopValue) {
53627
53689
  scrollTop.current = scrollTopValue;
@@ -53651,6 +53713,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53651
53713
  setWrapperRect(listElement.getBoundingClientRect());
53652
53714
  scrollToBottom();
53653
53715
  }
53716
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53654
53717
  }, [listElement, hasMoreNewer]);
53655
53718
  var updateScrollTop = useMessageListScrollManager({
53656
53719
  loadMoreScrollThreshold: loadMoreScrollThreshold,
@@ -53805,24 +53868,50 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53805
53868
  return React__default["default"].createElement(React__default["default"].Fragment, null, children);
53806
53869
  };
53807
53870
 
53871
+ window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};function defaultRenderMessages(_a) {
53872
+ var components = _a.components, customClasses = _a.customClasses, lastReceivedId = _a.lastReceivedMessageId, messageGroupStyles = _a.messageGroupStyles, messages = _a.messages, readData = _a.readData, messageProps = _a.sharedMessageProps;
53873
+ var DateSeparator = components.DateSeparator, HeaderComponent = components.HeaderComponent, MessageSystem = components.MessageSystem;
53874
+ return messages.map(function (message) {
53875
+ if (message.customType === CUSTOM_MESSAGE_TYPE.date &&
53876
+ message.date &&
53877
+ isDate(message.date) &&
53878
+ DateSeparator) {
53879
+ return (React__default["default"].createElement("li", { key: "".concat(message.date.toISOString(), "-i") },
53880
+ React__default["default"].createElement(DateSeparator, { date: message.date, formatDate: messageProps.formatDate, unread: message.unread })));
53881
+ }
53882
+ if (message.customType === CUSTOM_MESSAGE_TYPE.intro && HeaderComponent) {
53883
+ return (React__default["default"].createElement("li", { key: 'intro' },
53884
+ React__default["default"].createElement(HeaderComponent, null)));
53885
+ }
53886
+ if (message.type === 'system' && MessageSystem) {
53887
+ return (React__default["default"].createElement("li", { key: message.id || message.created_at },
53888
+ React__default["default"].createElement(MessageSystem, { message: message })));
53889
+ }
53890
+ var groupStyles = messageGroupStyles[message.id] || '';
53891
+ var messageClass = (customClasses === null || customClasses === void 0 ? void 0 : customClasses.message) || "str-chat__li str-chat__li--".concat(groupStyles);
53892
+ return (React__default["default"].createElement("li", { className: messageClass, "data-message-id": message.id, "data-testid": messageClass, key: message.id || message.created_at },
53893
+ React__default["default"].createElement(Message, __assign({ groupStyles: [groupStyles], lastReceivedId: lastReceivedId, message: message, readBy: readData[message.id] || [] }, messageProps))));
53894
+ });
53895
+ }
53896
+
53808
53897
  window.StreamChat.StreamChat=StreamChat;window.StreamChat.logChatPromiseExecution=logChatPromiseExecution;window.StreamChat.Channel=Channel;window.ICAL=window.ICAL||{};var MessageListWithContext = function (props) {
53809
53898
  var channel = props.channel, _a = props.disableDateSeparator, disableDateSeparator = _a === void 0 ? false : _a, groupStyles = props.groupStyles, _b = props.hideDeletedMessages, hideDeletedMessages = _b === void 0 ? false : _b, _c = props.hideNewMessageSeparator, hideNewMessageSeparator = _c === void 0 ? false : _c, internalInfiniteScrollProps = props.internalInfiniteScrollProps, _d = props.messageActions, messageActions = _d === void 0 ? Object.keys(MESSAGE_ACTIONS) : _d, _e = props.messages, messages = _e === void 0 ? [] : _e, notifications = props.notifications, _f = props.noGroupByUser, noGroupByUser = _f === void 0 ? false : _f, _g = props.pinPermissions, pinPermissions = _g === void 0 ? defaultPinPermissions : _g, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
53810
53899
  _h = props.returnAllReadData, // @deprecated in favor of `channelCapabilities` - TODO: remove in next major release
53811
- returnAllReadData = _h === void 0 ? false : _h, _j = props.threadList, threadList = _j === void 0 ? false : _j, _k = props.unsafeHTML, unsafeHTML = _k === void 0 ? false : _k, headerPosition = props.headerPosition, read = props.read, _l = props.messageLimit, messageLimit = _l === void 0 ? 100 : _l, loadMoreCallback = props.loadMore, loadMoreNewerCallback = props.loadMoreNewer, _m = props.hasMoreNewer, hasMoreNewer = _m === void 0 ? false : _m, suppressAutoscroll = props.suppressAutoscroll, highlightedMessageId = props.highlightedMessageId, _o = props.jumpToLatestMessage, jumpToLatestMessage = _o === void 0 ? function () { return Promise.resolve(); } : _o;
53812
- var _p = React__default["default"].useState(null), listElement = _p[0], setListElement = _p[1];
53813
- var _q = React__default["default"].useState(null), ulElement = _q[0], setUlElement = _q[1];
53900
+ returnAllReadData = _h === void 0 ? false : _h, _j = props.threadList, threadList = _j === void 0 ? false : _j, _k = props.unsafeHTML, unsafeHTML = _k === void 0 ? false : _k, headerPosition = props.headerPosition, read = props.read, _l = props.renderMessages, renderMessages = _l === void 0 ? defaultRenderMessages : _l, _m = props.messageLimit, messageLimit = _m === void 0 ? 100 : _m, loadMoreCallback = props.loadMore, loadMoreNewerCallback = props.loadMoreNewer, _o = props.hasMoreNewer, hasMoreNewer = _o === void 0 ? false : _o, suppressAutoscroll = props.suppressAutoscroll, highlightedMessageId = props.highlightedMessageId, _p = props.jumpToLatestMessage, jumpToLatestMessage = _p === void 0 ? function () { return Promise.resolve(); } : _p;
53901
+ var _q = React__default["default"].useState(null), listElement = _q[0], setListElement = _q[1];
53902
+ var _r = React__default["default"].useState(null), ulElement = _r[0], setUlElement = _r[1];
53814
53903
  var customClasses = useChatContext('MessageList').customClasses;
53815
- var _r = useComponentContext('MessageList'), _s = _r.EmptyStateIndicator, EmptyStateIndicator$1 = _s === void 0 ? EmptyStateIndicator : _s, _t = _r.LoadingIndicator, LoadingIndicator$1 = _t === void 0 ? LoadingIndicator : _t, _u = _r.MessageListNotifications, MessageListNotifications$1 = _u === void 0 ? MessageListNotifications : _u, _v = _r.MessageNotification, MessageNotification$1 = _v === void 0 ? MessageNotification : _v, _w = _r.TypingIndicator, TypingIndicator$1 = _w === void 0 ? TypingIndicator : _w;
53904
+ var _s = useComponentContext('MessageList'), _t = _s.EmptyStateIndicator, EmptyStateIndicator$1 = _t === void 0 ? EmptyStateIndicator : _t, _u = _s.LoadingIndicator, LoadingIndicator$1 = _u === void 0 ? LoadingIndicator : _u, _v = _s.MessageListNotifications, MessageListNotifications$1 = _v === void 0 ? MessageListNotifications : _v, _w = _s.MessageNotification, MessageNotification$1 = _w === void 0 ? MessageNotification : _w, _x = _s.TypingIndicator, TypingIndicator$1 = _x === void 0 ? TypingIndicator : _x;
53816
53905
  var loadMoreScrollThreshold = (internalInfiniteScrollProps === null || internalInfiniteScrollProps === void 0 ? void 0 : internalInfiniteScrollProps.threshold) || 250;
53817
- var _x = useScrollLocationLogic({
53906
+ var _y = useScrollLocationLogic({
53818
53907
  hasMoreNewer: hasMoreNewer,
53819
53908
  listElement: listElement,
53820
53909
  loadMoreScrollThreshold: loadMoreScrollThreshold,
53821
53910
  messages: messages,
53822
53911
  scrolledUpThreshold: props.scrolledUpThreshold,
53823
53912
  suppressAutoscroll: suppressAutoscroll,
53824
- }), hasNewMessages = _x.hasNewMessages, isMessageListScrolledToBottom = _x.isMessageListScrolledToBottom, onScroll = _x.onScroll, scrollToBottom = _x.scrollToBottom, wrapperRect = _x.wrapperRect;
53825
- var _y = useEnrichedMessages({
53913
+ }), hasNewMessages = _y.hasNewMessages, isMessageListScrolledToBottom = _y.isMessageListScrolledToBottom, onScroll = _y.onScroll, scrollToBottom = _y.scrollToBottom, wrapperRect = _y.wrapperRect;
53914
+ var _z = useEnrichedMessages({
53826
53915
  channel: channel,
53827
53916
  disableDateSeparator: disableDateSeparator,
53828
53917
  groupStyles: groupStyles,
@@ -53831,7 +53920,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53831
53920
  hideNewMessageSeparator: hideNewMessageSeparator,
53832
53921
  messages: messages,
53833
53922
  noGroupByUser: noGroupByUser,
53834
- }), messageGroupStyles = _y.messageGroupStyles, enrichedMessages = _y.messages;
53923
+ }), messageGroupStyles = _z.messageGroupStyles, enrichedMessages = _z.messages;
53835
53924
  var elements = useMessageListElements({
53836
53925
  enrichedMessages: enrichedMessages,
53837
53926
  internalMessageProps: {
@@ -53862,6 +53951,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53862
53951
  },
53863
53952
  messageGroupStyles: messageGroupStyles,
53864
53953
  read: read,
53954
+ renderMessages: renderMessages,
53865
53955
  returnAllReadData: returnAllReadData,
53866
53956
  threadList: threadList,
53867
53957
  });
@@ -53900,6 +53990,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53900
53990
  var element = ulElement === null || ulElement === void 0 ? void 0 : ulElement.querySelector("[data-message-id='".concat(highlightedMessageId, "']"));
53901
53991
  element === null || element === void 0 ? void 0 : element.scrollIntoView({ block: 'center' });
53902
53992
  }
53993
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53903
53994
  }, [highlightedMessageId]);
53904
53995
  var showEmptyStateIndicator = elements.length === 0 && !threadList;
53905
53996
  return (React__default["default"].createElement(MessageListContextProvider, { value: { listElement: listElement, scrollToBottom: scrollToBottom } },
@@ -53967,6 +54058,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
53967
54058
  return function () {
53968
54059
  client.off(observedEvent, handleEvent);
53969
54060
  };
54061
+ // eslint-disable-next-line react-hooks/exhaustive-deps
53970
54062
  }, [activeChannel, isMessageListScrolledToBottom, observedEvent, replyCount, thread]);
53971
54063
  React$2.useEffect(function () {
53972
54064
  if (isMessageListScrolledToBottom) {
@@ -55277,6 +55369,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55277
55369
  return 0;
55278
55370
  // TODO: there's a bug here, the messages prop is the same array instance (something mutates it)
55279
55371
  // that's why the second dependency is necessary
55372
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55280
55373
  }, [firstRealMessageIndex, messages, messages === null || messages === void 0 ? void 0 : messages.length]);
55281
55374
  return numItemsPrepended;
55282
55375
  }
@@ -55301,6 +55394,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55301
55394
  initialFocusRegistered.current = true;
55302
55395
  recheckForNewOwnMessage();
55303
55396
  }
55397
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55304
55398
  }, [messages, messages === null || messages === void 0 ? void 0 : messages.length]);
55305
55399
  return recheckForNewOwnMessage;
55306
55400
  }
@@ -55320,6 +55414,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55320
55414
  if (separateGiphyPreview)
55321
55415
  client.on('message.new', handleEvent);
55322
55416
  return function () { return client.off('message.new', handleEvent); };
55417
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55323
55418
  }, [separateGiphyPreview]);
55324
55419
  return { giphyPreviewMessage: giphyPreviewMessage, setGiphyPreviewMessage: setGiphyPreviewMessage };
55325
55420
  };
@@ -55369,6 +55464,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55369
55464
  window.removeEventListener('focus', scrollToBottomIfConfigured);
55370
55465
  window.removeEventListener('blur', resetNewMessagesReceivedInBackground);
55371
55466
  };
55467
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55372
55468
  }, [scrollToBottomIfConfigured]);
55373
55469
  };
55374
55470
 
@@ -55467,7 +55563,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55467
55563
  return messages.length - 1;
55468
55564
  }
55469
55565
  var VirtualizedMessageListWithContext = function (props) {
55470
- var additionalMessageInputProps = props.additionalMessageInputProps, _a = props.additionalVirtuosoProps, additionalVirtuosoProps = _a === void 0 ? {} : _a, channel = props.channel, closeReactionSelectorOnClick = props.closeReactionSelectorOnClick, customMessageActions = props.customMessageActions, customMessageRenderer = props.customMessageRenderer, defaultItemHeight = props.defaultItemHeight, _b = props.disableDateSeparator, disableDateSeparator = _b === void 0 ? true : _b, groupStyles = props.groupStyles, hasMore = props.hasMore, hasMoreNewer = props.hasMoreNewer, head = props.head, _c = props.hideDeletedMessages, hideDeletedMessages = _c === void 0 ? false : _c, _d = props.hideNewMessageSeparator, hideNewMessageSeparator = _d === void 0 ? false : _d, highlightedMessageId = props.highlightedMessageId, jumpToLatestMessage = props.jumpToLatestMessage, loadingMore = props.loadingMore, loadMore = props.loadMore, loadMoreNewer = props.loadMoreNewer, MessageUIComponentFromProps = props.Message, messageActions = props.messageActions, _e = props.messageLimit, messageLimit = _e === void 0 ? 100 : _e, messages = props.messages, notifications = props.notifications,
55566
+ var additionalMessageInputProps = props.additionalMessageInputProps, _a = props.additionalVirtuosoProps, additionalVirtuosoProps = _a === void 0 ? {} : _a, channel = props.channel, closeReactionSelectorOnClick = props.closeReactionSelectorOnClick, customMessageActions = props.customMessageActions, customMessageRenderer = props.customMessageRenderer, defaultItemHeight = props.defaultItemHeight, _b = props.disableDateSeparator, disableDateSeparator = _b === void 0 ? true : _b, groupStyles = props.groupStyles, hasMoreNewer = props.hasMoreNewer, head = props.head, _c = props.hideDeletedMessages, hideDeletedMessages = _c === void 0 ? false : _c, _d = props.hideNewMessageSeparator, hideNewMessageSeparator = _d === void 0 ? false : _d, highlightedMessageId = props.highlightedMessageId, jumpToLatestMessage = props.jumpToLatestMessage, loadingMore = props.loadingMore, loadMore = props.loadMore, loadMoreNewer = props.loadMoreNewer, MessageUIComponentFromProps = props.Message, messageActions = props.messageActions, _e = props.messageLimit, messageLimit = _e === void 0 ? 100 : _e, messages = props.messages, notifications = props.notifications,
55471
55567
  // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
55472
55568
  _f = props.overscan,
55473
55569
  // TODO: refactor to scrollSeekPlaceHolderConfiguration and components.ScrollSeekPlaceholder, like the Virtuoso Component
@@ -55501,6 +55597,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55501
55597
  setGiphyPreviewMessage: setGiphyPreviewMessage,
55502
55598
  userId: client.userID || '',
55503
55599
  });
55600
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55504
55601
  }, [
55505
55602
  disableDateSeparator,
55506
55603
  hideDeletedMessages,
@@ -55530,6 +55627,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55530
55627
  }, {});
55531
55628
  },
55532
55629
  // processedMessages were incorrectly rebuilt with a new object identity at some point, hence the .length usage
55630
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55533
55631
  [processedMessages.length, shouldGroupByUser, groupStylesFn]);
55534
55632
  var _w = useNewMessageNotification(processedMessages, client.userID, hasMoreNewer), atBottom = _w.atBottom, isMessageListScrolledToBottom = _w.isMessageListScrolledToBottom, newMessagesNotification = _w.newMessagesNotification, setIsMessageListScrolledToBottom = _w.setIsMessageListScrolledToBottom, setNewMessagesNotification = _w.setNewMessagesNotification;
55535
55633
  var scrollToBottom = React$2.useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -55579,19 +55677,14 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55579
55677
  var atBottomStateChange = function (isAtBottom) {
55580
55678
  atBottom.current = isAtBottom;
55581
55679
  setIsMessageListScrolledToBottom(isAtBottom);
55582
- if (isAtBottom && newMessagesNotification) {
55583
- setNewMessagesNotification(false);
55584
- }
55585
- };
55586
- var startReached = function () {
55587
- if (hasMore && loadMore) {
55588
- loadMore(messageLimit);
55680
+ if (isAtBottom) {
55681
+ loadMoreNewer === null || loadMoreNewer === void 0 ? void 0 : loadMoreNewer(messageLimit);
55682
+ setNewMessagesNotification === null || setNewMessagesNotification === void 0 ? void 0 : setNewMessagesNotification(false);
55589
55683
  }
55590
55684
  };
55591
- var endReached = function () {
55592
- if (hasMoreNewer && loadMoreNewer) {
55593
- loadMoreNewer(messageLimit);
55594
- }
55685
+ var atTopStateChange = function (isAtTop) {
55686
+ if (isAtTop)
55687
+ loadMore === null || loadMore === void 0 ? void 0 : loadMore(messageLimit);
55595
55688
  };
55596
55689
  React$2.useEffect(function () {
55597
55690
  var _a;
@@ -55601,13 +55694,14 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55601
55694
  (_a = virtuoso.current) === null || _a === void 0 ? void 0 : _a.scrollToIndex({ align: 'center', index: index });
55602
55695
  }
55603
55696
  }
55697
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55604
55698
  }, [highlightedMessageId]);
55605
55699
  if (!processedMessages)
55606
55700
  return null;
55607
55701
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
55608
55702
  React__default["default"].createElement(MessageListMainPanel, null,
55609
55703
  React__default["default"].createElement("div", { className: (customClasses === null || customClasses === void 0 ? void 0 : customClasses.virtualizedMessageList) || 'str-chat__virtual-list' },
55610
- React__default["default"].createElement(on$1, __assign({ atBottomStateChange: atBottomStateChange, atBottomThreshold: 200, className: 'str-chat__message-list-scroll', components: __assign({ EmptyPlaceholder: EmptyPlaceholder, Footer: Footer, Header: Header, Item: Item$1 }, virtuosoComponentsFromProps), computeItemKey: computeItemKey, context: {
55704
+ React__default["default"].createElement(on$1, __assign({ atBottomStateChange: atBottomStateChange, atBottomThreshold: 100, atTopStateChange: atTopStateChange, atTopThreshold: 100, className: 'str-chat__message-list-scroll', components: __assign({ EmptyPlaceholder: EmptyPlaceholder, Footer: Footer, Header: Header, Item: Item$1 }, virtuosoComponentsFromProps), computeItemKey: computeItemKey, context: {
55611
55705
  additionalMessageInputProps: additionalMessageInputProps,
55612
55706
  closeReactionSelectorOnClick: closeReactionSelectorOnClick,
55613
55707
  customClasses: customClasses,
@@ -55627,7 +55721,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55627
55721
  shouldGroupByUser: shouldGroupByUser,
55628
55722
  threadList: threadList,
55629
55723
  virtuosoRef: virtuoso,
55630
- }, endReached: endReached, firstItemIndex: calculateFirstItemIndex(numItemsPrepended), followOutput: followOutput, increaseViewportBy: { bottom: 200, top: 0 }, initialTopMostItemIndex: calculateInitialTopMostItemIndex(processedMessages, highlightedMessageId), itemContent: messageRenderer, itemSize: fractionalItemSize, key: messageSetKey, overscan: overscan, ref: virtuoso, startReached: startReached, style: { overflowX: 'hidden' }, totalCount: processedMessages.length }, overridingVirtuosoProps, (scrollSeekPlaceHolder ? { scrollSeek: scrollSeekPlaceHolder } : {}), (defaultItemHeight ? { defaultItemHeight: defaultItemHeight } : {}))))),
55724
+ }, firstItemIndex: calculateFirstItemIndex(numItemsPrepended), followOutput: followOutput, increaseViewportBy: { bottom: 200, top: 0 }, initialTopMostItemIndex: calculateInitialTopMostItemIndex(processedMessages, highlightedMessageId), itemContent: messageRenderer, itemSize: fractionalItemSize, key: messageSetKey, overscan: overscan, ref: virtuoso, style: { overflowX: 'hidden' }, totalCount: processedMessages.length }, overridingVirtuosoProps, (scrollSeekPlaceHolder ? { scrollSeek: scrollSeekPlaceHolder } : {}), (defaultItemHeight ? { defaultItemHeight: defaultItemHeight } : {}))))),
55631
55725
  React__default["default"].createElement(MessageListNotifications$1, { hasNewMessages: newMessagesNotification, isMessageListScrolledToBottom: isMessageListScrolledToBottom, isNotAtLatestMessageSet: hasMoreNewer, MessageNotification: MessageNotification$1, notifications: notifications, scrollToBottom: scrollToBottom, threadList: threadList }),
55632
55726
  giphyPreviewMessage && React__default["default"].createElement(GiphyPreviewMessage$1, { message: giphyPreviewMessage })));
55633
55727
  };
@@ -55711,6 +55805,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
55711
55805
  // FIXME: integrators can customize channel query options but cannot customize channel.getReplies() options
55712
55806
  loadMoreThread();
55713
55807
  }
55808
+ // eslint-disable-next-line react-hooks/exhaustive-deps
55714
55809
  }, []);
55715
55810
  if (!thread)
55716
55811
  return null;
@@ -79897,6 +79992,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
79897
79992
  exports.ComponentProvider = ComponentProvider;
79898
79993
  exports.ConnectionStatus = ConnectionStatus;
79899
79994
  exports.CooldownTimer = CooldownTimer;
79995
+ exports.CustomMessageActionsList = CustomMessageActionsList;
79900
79996
  exports.DateSeparator = DateSeparator;
79901
79997
  exports.DefaultSuggestionList = List$1;
79902
79998
  exports.DefaultSuggestionListHeader = DefaultSuggestionListHeader;
@@ -80016,6 +80112,7 @@ var StreamChatReact = (function (exports, React$2, jsxRuntime, streamChat, React
80016
80112
  exports.defaultDateTimeParser = defaultDateTimeParser;
80017
80113
  exports.defaultPinPermissions = defaultPinPermissions;
80018
80114
  exports.defaultReactionOptions = defaultReactionOptions;
80115
+ exports.defaultRenderMessages = defaultRenderMessages;
80019
80116
  exports.defaultScrollToItem = defaultScrollToItem;
80020
80117
  exports.defaultTimestampFormat = defaultTimestampFormat;
80021
80118
  exports.defaultTranslatorFunction = defaultTranslatorFunction;