stream-chat-react 14.0.0-beta.6 → 14.0.0-beta.8

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 (207) hide show
  1. package/dist/cjs/{WithAudioPlayback.f9abf707.js → WithAudioPlayback.58b0b39b.js} +258 -154
  2. package/dist/cjs/WithAudioPlayback.58b0b39b.js.map +1 -0
  3. package/dist/cjs/emojis.js +5 -2
  4. package/dist/cjs/emojis.js.map +1 -1
  5. package/dist/cjs/index.js +2935 -2628
  6. package/dist/cjs/index.js.map +1 -1
  7. package/dist/css/emoji-picker.css +11 -0
  8. package/dist/css/emoji-picker.css.map +1 -0
  9. package/dist/css/index.css +1809 -1369
  10. package/dist/css/index.css.map +1 -1
  11. package/dist/es/{WithAudioPlayback.d90f1a99.mjs → WithAudioPlayback.2ffdc4c5.mjs} +404 -300
  12. package/dist/es/WithAudioPlayback.2ffdc4c5.mjs.map +1 -0
  13. package/dist/es/emojis.mjs +5 -2
  14. package/dist/es/emojis.mjs.map +1 -1
  15. package/dist/es/index.mjs +3016 -2709
  16. package/dist/es/index.mjs.map +1 -1
  17. package/dist/types/components/Attachment/Audio.d.ts.map +1 -1
  18. package/dist/types/components/Attachment/FileAttachment.d.ts.map +1 -1
  19. package/dist/types/components/Attachment/UnsupportedAttachment.d.ts +1 -1
  20. package/dist/types/components/Attachment/UnsupportedAttachment.d.ts.map +1 -1
  21. package/dist/types/components/Attachment/VoiceRecording.d.ts.map +1 -1
  22. package/dist/types/components/Attachment/components/FileSizeIndicator.d.ts +1 -2
  23. package/dist/types/components/Attachment/components/FileSizeIndicator.d.ts.map +1 -1
  24. package/dist/types/components/AudioPlayback/components/useInteractiveProgressBar.d.ts.map +1 -1
  25. package/dist/types/components/AudioPlayback/plugins/AudioPlayerNotificationsPlugin.d.ts +4 -4
  26. package/dist/types/components/AudioPlayback/plugins/AudioPlayerNotificationsPlugin.d.ts.map +1 -1
  27. package/dist/types/components/Badge/MediaBadge.d.ts +8 -0
  28. package/dist/types/components/Badge/MediaBadge.d.ts.map +1 -0
  29. package/dist/types/components/Channel/Channel.d.ts.map +1 -1
  30. package/dist/types/components/ChannelHeader/ChannelHeader.d.ts +0 -2
  31. package/dist/types/components/ChannelHeader/ChannelHeader.d.ts.map +1 -1
  32. package/dist/types/components/ChannelList/ChannelList.d.ts.map +1 -1
  33. package/dist/types/components/ChannelList/ChannelListHeader.d.ts +1 -5
  34. package/dist/types/components/ChannelList/ChannelListHeader.d.ts.map +1 -1
  35. package/dist/types/components/ChannelList/hooks/index.d.ts +0 -11
  36. package/dist/types/components/ChannelList/hooks/index.d.ts.map +1 -1
  37. package/dist/types/components/ChannelList/utils.d.ts +0 -9
  38. package/dist/types/components/ChannelList/utils.d.ts.map +1 -1
  39. package/dist/types/components/ChannelListItem/ChannelListItem.d.ts +0 -2
  40. package/dist/types/components/ChannelListItem/ChannelListItem.d.ts.map +1 -1
  41. package/dist/types/components/ChannelListItem/ChannelListItemActionButtons.defaults.d.ts.map +1 -1
  42. package/dist/types/components/ChannelListItem/utils.d.ts.map +1 -1
  43. package/dist/types/components/Chat/Chat.d.ts +1 -5
  44. package/dist/types/components/Chat/Chat.d.ts.map +1 -1
  45. package/dist/types/components/Chat/hooks/useChat.d.ts +1 -10
  46. package/dist/types/components/Chat/hooks/useChat.d.ts.map +1 -1
  47. package/dist/types/components/Chat/hooks/useCreateChatContext.d.ts.map +1 -1
  48. package/dist/types/components/Chat/hooks/useReportLostConnectionSystemNotification.d.ts +6 -0
  49. package/dist/types/components/Chat/hooks/useReportLostConnectionSystemNotification.d.ts.map +1 -0
  50. package/dist/types/components/Chat/index.d.ts +1 -0
  51. package/dist/types/components/Chat/index.d.ts.map +1 -1
  52. package/dist/types/components/ChatView/ChatView.d.ts.map +1 -1
  53. package/dist/types/components/Dialog/components/ContextMenu.d.ts +4 -2
  54. package/dist/types/components/Dialog/components/ContextMenu.d.ts.map +1 -1
  55. package/dist/types/components/Dialog/hooks/useDialog.d.ts.map +1 -1
  56. package/dist/types/components/Dialog/service/DialogManager.d.ts +3 -2
  57. package/dist/types/components/Dialog/service/DialogManager.d.ts.map +1 -1
  58. package/dist/types/components/Dialog/service/DialogPortal.d.ts.map +1 -1
  59. package/dist/types/components/Form/NumericInput.d.ts.map +1 -1
  60. package/dist/types/components/Form/TextInput.d.ts +15 -8
  61. package/dist/types/components/Form/TextInput.d.ts.map +1 -1
  62. package/dist/types/components/Form/index.d.ts +1 -0
  63. package/dist/types/components/Form/index.d.ts.map +1 -1
  64. package/dist/types/components/Icons/icons.d.ts +18 -6
  65. package/dist/types/components/Icons/icons.d.ts.map +1 -1
  66. package/dist/types/components/InfiniteScrollPaginator/InfiniteScroll.d.ts +0 -20
  67. package/dist/types/components/InfiniteScrollPaginator/InfiniteScroll.d.ts.map +1 -1
  68. package/dist/types/components/LoadMore/LoadMoreButton.d.ts +1 -6
  69. package/dist/types/components/LoadMore/LoadMoreButton.d.ts.map +1 -1
  70. package/dist/types/components/LoadMore/LoadMorePaginator.d.ts.map +1 -1
  71. package/dist/types/components/Loading/UploadProgressIndicator.d.ts +5 -0
  72. package/dist/types/components/Loading/UploadProgressIndicator.d.ts.map +1 -0
  73. package/dist/types/components/Loading/UploadedSizeIndicator.d.ts +6 -0
  74. package/dist/types/components/Loading/UploadedSizeIndicator.d.ts.map +1 -0
  75. package/dist/types/components/Loading/index.d.ts +3 -0
  76. package/dist/types/components/Loading/index.d.ts.map +1 -1
  77. package/dist/types/components/Loading/progress-indicators.d.ts +7 -0
  78. package/dist/types/components/Loading/progress-indicators.d.ts.map +1 -0
  79. package/dist/types/components/Location/ShareLocationDialog.d.ts.map +1 -1
  80. package/dist/types/components/MediaRecorder/AudioRecorder/AudioRecorderRecordingControls.d.ts.map +1 -1
  81. package/dist/types/components/Message/Message.d.ts.map +1 -1
  82. package/dist/types/components/Message/MessageAlsoSentInChannelIndicator.d.ts.map +1 -1
  83. package/dist/types/components/Message/MessageUI.d.ts.map +1 -1
  84. package/dist/types/components/Message/hooks/useDeleteHandler.d.ts +1 -5
  85. package/dist/types/components/Message/hooks/useDeleteHandler.d.ts.map +1 -1
  86. package/dist/types/components/Message/hooks/useFlagHandler.d.ts +1 -6
  87. package/dist/types/components/Message/hooks/useFlagHandler.d.ts.map +1 -1
  88. package/dist/types/components/Message/hooks/useMarkUnreadHandler.d.ts +1 -6
  89. package/dist/types/components/Message/hooks/useMarkUnreadHandler.d.ts.map +1 -1
  90. package/dist/types/components/Message/hooks/useMuteHandler.d.ts +2 -7
  91. package/dist/types/components/Message/hooks/useMuteHandler.d.ts.map +1 -1
  92. package/dist/types/components/Message/hooks/usePinHandler.d.ts +1 -23
  93. package/dist/types/components/Message/hooks/usePinHandler.d.ts.map +1 -1
  94. package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts +1 -6
  95. package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts.map +1 -1
  96. package/dist/types/components/Message/hooks/useUserRole.d.ts +1 -1
  97. package/dist/types/components/Message/hooks/useUserRole.d.ts.map +1 -1
  98. package/dist/types/components/Message/types.d.ts +1 -23
  99. package/dist/types/components/Message/types.d.ts.map +1 -1
  100. package/dist/types/components/Message/utils.d.ts +2 -2
  101. package/dist/types/components/Message/utils.d.ts.map +1 -1
  102. package/dist/types/components/MessageActions/MessageActions.d.ts.map +1 -1
  103. package/dist/types/components/MessageActions/MessageActions.defaults.d.ts.map +1 -1
  104. package/dist/types/components/MessageActions/RemindMeSubmenu.d.ts.map +1 -1
  105. package/dist/types/components/MessageActions/hooks/useBaseMessageActionSetFilter.d.ts +1 -1
  106. package/dist/types/components/MessageActions/hooks/useBaseMessageActionSetFilter.d.ts.map +1 -1
  107. package/dist/types/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.d.ts +14 -0
  108. package/dist/types/components/MessageComposer/AttachmentPreviewList/AttachmentUploadedSizeIndicator.d.ts.map +1 -0
  109. package/dist/types/components/MessageComposer/AttachmentPreviewList/AudioAttachmentPreview.d.ts.map +1 -1
  110. package/dist/types/components/MessageComposer/AttachmentPreviewList/FileAttachmentPreview.d.ts.map +1 -1
  111. package/dist/types/components/MessageComposer/AttachmentPreviewList/MediaAttachmentPreview.d.ts.map +1 -1
  112. package/dist/types/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts +1 -1
  113. package/dist/types/components/MessageComposer/AttachmentPreviewList/UnsupportedAttachmentPreview.d.ts.map +1 -1
  114. package/dist/types/components/MessageComposer/hooks/useSubmitHandler.d.ts.map +1 -1
  115. package/dist/types/components/MessageComposer/icons.d.ts +0 -1
  116. package/dist/types/components/MessageComposer/icons.d.ts.map +1 -1
  117. package/dist/types/components/MessageList/MessageList.d.ts +1 -1
  118. package/dist/types/components/MessageList/MessageList.d.ts.map +1 -1
  119. package/dist/types/components/MessageList/hooks/MessageList/useFloatingDateSeparatorMessageList.d.ts +2 -2
  120. package/dist/types/components/MessageList/hooks/MessageList/useFloatingDateSeparatorMessageList.d.ts.map +1 -1
  121. package/dist/types/components/MessageList/hooks/MessageList/useScrollLocationLogic.d.ts.map +1 -1
  122. package/dist/types/components/MessageList/hooks/VirtualizedMessageList/useFloatingDateSeparator.d.ts.map +1 -1
  123. package/dist/types/components/MessageList/index.d.ts +0 -1
  124. package/dist/types/components/MessageList/index.d.ts.map +1 -1
  125. package/dist/types/components/MessageList/utils.d.ts +0 -1
  126. package/dist/types/components/MessageList/utils.d.ts.map +1 -1
  127. package/dist/types/components/Notifications/NotificationList.d.ts.map +1 -1
  128. package/dist/types/components/Notifications/hooks/index.d.ts +2 -0
  129. package/dist/types/components/Notifications/hooks/index.d.ts.map +1 -1
  130. package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts +63 -0
  131. package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -0
  132. package/dist/types/components/Notifications/hooks/useSystemNotifications.d.ts +14 -0
  133. package/dist/types/components/Notifications/hooks/useSystemNotifications.d.ts.map +1 -0
  134. package/dist/types/components/Notifications/notificationTarget.d.ts +1 -0
  135. package/dist/types/components/Notifications/notificationTarget.d.ts.map +1 -1
  136. package/dist/types/components/Poll/PollActions/EndPollAlert.d.ts.map +1 -1
  137. package/dist/types/components/Poll/PollCreationDialog/OptionFieldSet.d.ts.map +1 -1
  138. package/dist/types/components/ReactFileUtilities/UploadButton.d.ts +3 -11
  139. package/dist/types/components/ReactFileUtilities/UploadButton.d.ts.map +1 -1
  140. package/dist/types/components/Reactions/MessageReactions.d.ts.map +1 -1
  141. package/dist/types/components/Reactions/MessageReactionsDetail.d.ts +12 -2
  142. package/dist/types/components/Reactions/MessageReactionsDetail.d.ts.map +1 -1
  143. package/dist/types/components/Reactions/ReactionSelector.d.ts +5 -0
  144. package/dist/types/components/Reactions/ReactionSelector.d.ts.map +1 -1
  145. package/dist/types/components/Reactions/hooks/useFetchReactions.d.ts.map +1 -1
  146. package/dist/types/components/Reactions/index.d.ts +0 -1
  147. package/dist/types/components/Reactions/index.d.ts.map +1 -1
  148. package/dist/types/components/SummarizedMessagePreview/SummarizedMessagePreview.d.ts.map +1 -1
  149. package/dist/types/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.d.ts +1 -1
  150. package/dist/types/components/SummarizedMessagePreview/hooks/useLatestMessagePreview.d.ts.map +1 -1
  151. package/dist/types/components/Thread/ThreadHeader.d.ts +0 -2
  152. package/dist/types/components/Thread/ThreadHeader.d.ts.map +1 -1
  153. package/dist/types/components/Threads/ThreadList/ThreadList.d.ts.map +1 -1
  154. package/dist/types/components/Threads/ThreadList/ThreadListHeader.d.ts +1 -5
  155. package/dist/types/components/Threads/ThreadList/ThreadListHeader.d.ts.map +1 -1
  156. package/dist/types/components/Threads/ThreadList/ThreadListItemUI.d.ts.map +1 -1
  157. package/dist/types/components/Tooltip/Tooltip.d.ts +4 -2
  158. package/dist/types/components/Tooltip/Tooltip.d.ts.map +1 -1
  159. package/dist/types/components/index.d.ts +2 -2
  160. package/dist/types/components/index.d.ts.map +1 -1
  161. package/dist/types/context/ChatContext.d.ts +0 -3
  162. package/dist/types/context/ChatContext.d.ts.map +1 -1
  163. package/dist/types/context/ComponentContext.d.ts +18 -2
  164. package/dist/types/context/ComponentContext.d.ts.map +1 -1
  165. package/dist/types/context/MessageContext.d.ts +0 -3
  166. package/dist/types/context/MessageContext.d.ts.map +1 -1
  167. package/dist/types/i18n/Streami18n.d.ts +21 -11
  168. package/dist/types/i18n/Streami18n.d.ts.map +1 -1
  169. package/dist/types/plugins/Emojis/EmojiPicker.d.ts +0 -6
  170. package/dist/types/plugins/Emojis/EmojiPicker.d.ts.map +1 -1
  171. package/dist/types/types/types.d.ts +0 -5
  172. package/dist/types/types/types.d.ts.map +1 -1
  173. package/package.json +4 -4
  174. package/dist/cjs/WithAudioPlayback.f9abf707.js.map +0 -1
  175. package/dist/es/WithAudioPlayback.d90f1a99.mjs.map +0 -1
  176. package/dist/types/components/Button/ToggleSidebarButton.d.ts +0 -10
  177. package/dist/types/components/Button/ToggleSidebarButton.d.ts.map +0 -1
  178. package/dist/types/components/ChannelHeader/hooks/useIsMobileViewport.d.ts +0 -3
  179. package/dist/types/components/ChannelHeader/hooks/useIsMobileViewport.d.ts.map +0 -1
  180. package/dist/types/components/ChannelList/hooks/useChannelDeletedListener.d.ts +0 -3
  181. package/dist/types/components/ChannelList/hooks/useChannelDeletedListener.d.ts.map +0 -1
  182. package/dist/types/components/ChannelList/hooks/useChannelHiddenListener.d.ts +0 -3
  183. package/dist/types/components/ChannelList/hooks/useChannelHiddenListener.d.ts.map +0 -1
  184. package/dist/types/components/ChannelList/hooks/useChannelTruncatedListener.d.ts +0 -3
  185. package/dist/types/components/ChannelList/hooks/useChannelTruncatedListener.d.ts.map +0 -1
  186. package/dist/types/components/ChannelList/hooks/useChannelUpdatedListener.d.ts +0 -3
  187. package/dist/types/components/ChannelList/hooks/useChannelUpdatedListener.d.ts.map +0 -1
  188. package/dist/types/components/ChannelList/hooks/useChannelVisibleListener.d.ts +0 -3
  189. package/dist/types/components/ChannelList/hooks/useChannelVisibleListener.d.ts.map +0 -1
  190. package/dist/types/components/ChannelList/hooks/useMessageNewListener.d.ts +0 -3
  191. package/dist/types/components/ChannelList/hooks/useMessageNewListener.d.ts.map +0 -1
  192. package/dist/types/components/ChannelList/hooks/useMobileNavigation.d.ts +0 -2
  193. package/dist/types/components/ChannelList/hooks/useMobileNavigation.d.ts.map +0 -1
  194. package/dist/types/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts +0 -3
  195. package/dist/types/components/ChannelList/hooks/useNotificationAddedToChannelListener.d.ts.map +0 -1
  196. package/dist/types/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts +0 -3
  197. package/dist/types/components/ChannelList/hooks/useNotificationMessageNewListener.d.ts.map +0 -1
  198. package/dist/types/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts +0 -3
  199. package/dist/types/components/ChannelList/hooks/useNotificationRemovedFromChannelListener.d.ts.map +0 -1
  200. package/dist/types/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts +0 -3
  201. package/dist/types/components/ChannelList/hooks/useUserPresenceChangedListener.d.ts.map +0 -1
  202. package/dist/types/components/MessageList/ConnectionStatus.d.ts +0 -3
  203. package/dist/types/components/MessageList/ConnectionStatus.d.ts.map +0 -1
  204. package/dist/types/components/Reactions/StreamEmoji.d.ts +0 -19
  205. package/dist/types/components/Reactions/StreamEmoji.d.ts.map +0 -1
  206. package/dist/types/utils/deprecationWarning.d.ts +0 -2
  207. package/dist/types/utils/deprecationWarning.d.ts.map +0 -1
@@ -979,6 +979,33 @@ class AudioPlayerPool {
979
979
  }
980
980
  }
981
981
  }
982
+ const audioPlayerNotificationsPluginFactory = ({
983
+ addNotification,
984
+ panel = "channel",
985
+ t
986
+ }) => {
987
+ const errors = {
988
+ "failed-to-start": new Error(t("Failed to play the recording")),
989
+ "not-playable": new Error(
990
+ t("Recording format is not supported and cannot be reproduced")
991
+ ),
992
+ "seek-not-supported": new Error(t("Cannot seek in the recording"))
993
+ };
994
+ return {
995
+ id: "AudioPlayerNotificationsPlugin",
996
+ onError: ({ errCode, error: e }) => {
997
+ const error = (errCode && errors[errCode]) ?? e ?? new Error(t("Error reproducing the recording"));
998
+ addNotification({
999
+ emitter: "AudioPlayer",
1000
+ error,
1001
+ message: error.message,
1002
+ severity: "error",
1003
+ targetPanels: [panel],
1004
+ type: "browser:audio:playback:error"
1005
+ });
1006
+ }
1007
+ };
1008
+ };
982
1009
  const NOTIFICATION_TARGET_PANELS = [
983
1010
  "channel",
984
1011
  "thread",
@@ -995,46 +1022,29 @@ const getNotificationTargetPanel = (notification) => {
995
1022
  const panel = notification.origin.context?.panel;
996
1023
  return isNotificationTargetPanel(panel) ? panel : void 0;
997
1024
  };
1025
+ const getNotificationTargetPanels = (notification) => {
1026
+ const targetPanels = (notification.tags ?? []).filter((tag) => tag.startsWith("target:")).map((tag) => tag.slice("target:".length)).filter(
1027
+ (value) => isNotificationTargetPanel(value)
1028
+ );
1029
+ if (targetPanels.length > 0) {
1030
+ return Array.from(new Set(targetPanels));
1031
+ }
1032
+ const panel = notification.origin.context?.panel;
1033
+ return isNotificationTargetPanel(panel) ? [panel] : [];
1034
+ };
998
1035
  const getNotificationTargetTag = (panel) => `target:${panel}`;
999
1036
  const addNotificationTargetTag = (panel, tags) => {
1000
1037
  if (!panel) return tags ?? [];
1001
1038
  return Array.from(/* @__PURE__ */ new Set([getNotificationTargetTag(panel), ...tags ?? []]));
1002
1039
  };
1003
1040
  const isNotificationForPanel = (notification, panel, options) => {
1004
- const fallbackPanel = options?.fallbackPanel ?? "channel";
1005
- const resolvedPanel = getNotificationTargetPanel(notification) ?? fallbackPanel;
1041
+ const explicitTargetPanels = getNotificationTargetPanels(notification);
1042
+ if (explicitTargetPanels.length > 0) {
1043
+ return explicitTargetPanels.includes(panel);
1044
+ }
1045
+ const resolvedPanel = options?.fallbackPanel ?? "channel";
1006
1046
  return resolvedPanel === panel;
1007
1047
  };
1008
- const audioPlayerNotificationsPluginFactory = ({
1009
- client,
1010
- panel = "channel",
1011
- t
1012
- }) => {
1013
- const errors = {
1014
- "failed-to-start": new Error(t("Failed to play the recording")),
1015
- "not-playable": new Error(
1016
- t("Recording format is not supported and cannot be reproduced")
1017
- ),
1018
- "seek-not-supported": new Error(t("Cannot seek in the recording"))
1019
- };
1020
- return {
1021
- id: "AudioPlayerNotificationsPlugin",
1022
- onError: ({ errCode, error: e }) => {
1023
- const error = (errCode && errors[errCode]) ?? e ?? new Error(t("Error reproducing the recording"));
1024
- client?.notifications.addError({
1025
- message: error.message,
1026
- options: {
1027
- originalError: error,
1028
- tags: addNotificationTargetTag(panel),
1029
- type: "browser:audio:playback:error"
1030
- },
1031
- origin: {
1032
- emitter: "AudioPlayer"
1033
- }
1034
- });
1035
- }
1036
- };
1037
- };
1038
1048
  const variantToClass = {
1039
1049
  danger: "str-chat__button--destructive",
1040
1050
  primary: "str-chat__button--primary",
@@ -1246,8 +1256,8 @@ const IconBellOff = createIcon(
1246
1256
  }
1247
1257
  )
1248
1258
  );
1249
- const IconSave = createIcon(
1250
- "IconSave",
1259
+ const IconBookmark = createIcon(
1260
+ "IconBookmark",
1251
1261
  /* @__PURE__ */ jsx(
1252
1262
  "path",
1253
1263
  {
@@ -1260,8 +1270,8 @@ const IconSave = createIcon(
1260
1270
  }
1261
1271
  )
1262
1272
  );
1263
- const IconUnsave = createIcon(
1264
- "IconUnsave",
1273
+ const IconBookmarkRemove = createIcon(
1274
+ "IconBookmarkRemove",
1265
1275
  /* @__PURE__ */ jsx(
1266
1276
  "path",
1267
1277
  {
@@ -1493,6 +1503,16 @@ const IconMinusCircle = createIcon(
1493
1503
  }
1494
1504
  )
1495
1505
  );
1506
+ const IconMinus = createIcon(
1507
+ "IconMinus",
1508
+ /* @__PURE__ */ jsx(
1509
+ "path",
1510
+ {
1511
+ d: "M16.875 9.40039C17.2064 9.40039 17.4746 9.66863 17.4746 10C17.4746 10.3314 17.2064 10.5996 16.875 10.5996H3.125C2.79363 10.5996 2.52539 10.3314 2.52539 10C2.52539 9.66863 2.79363 9.40039 3.125 9.40039H16.875Z",
1512
+ fill: "currentColor"
1513
+ }
1514
+ )
1515
+ );
1496
1516
  const IconXCircle = createIcon(
1497
1517
  "IconXCircle",
1498
1518
  /* @__PURE__ */ jsx(
@@ -1545,7 +1565,7 @@ const IconXmark = createIcon(
1545
1565
  stroke: "currentColor",
1546
1566
  strokeLinecap: "round",
1547
1567
  strokeLinejoin: "round",
1548
- strokeWidth: "1.5"
1568
+ strokeWidth: "2"
1549
1569
  }
1550
1570
  )
1551
1571
  );
@@ -1612,6 +1632,46 @@ const IconEmoji = createIcon(
1612
1632
  /* @__PURE__ */ jsx("path", { d: "M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z" })
1613
1633
  ] })
1614
1634
  );
1635
+ const IconEmojiAdd = createIcon(
1636
+ "IconEmojiAdd",
1637
+ /* @__PURE__ */ jsxs(Fragment, { children: [
1638
+ /* @__PURE__ */ jsx(
1639
+ "path",
1640
+ {
1641
+ d: "M1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C10.4142 1.75 10.75 2.08579 10.75 2.5C10.75 2.91421 10.4142 3.25 10 3.25C6.27208 3.25 3.25 6.27208 3.25 10C3.25 13.7279 6.27208 16.75 10 16.75C13.7279 16.75 16.75 13.7279 16.75 10C16.75 9.58579 17.0858 9.25 17.5 9.25C17.9142 9.25 18.25 9.58579 18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10Z",
1642
+ fill: "currentColor"
1643
+ }
1644
+ ),
1645
+ /* @__PURE__ */ jsx(
1646
+ "path",
1647
+ {
1648
+ d: "M7.1875 9.375C7.70527 9.375 8.125 8.95527 8.125 8.4375C8.125 7.91973 7.70527 7.5 7.1875 7.5C6.66973 7.5 6.25 7.91973 6.25 8.4375C6.25 8.95527 6.66973 9.375 7.1875 9.375Z",
1649
+ fill: "currentColor"
1650
+ }
1651
+ ),
1652
+ /* @__PURE__ */ jsx(
1653
+ "path",
1654
+ {
1655
+ d: "M12.8125 9.375C13.3303 9.375 13.75 8.95527 13.75 8.4375C13.75 7.91973 13.3303 7.5 12.8125 7.5C12.2947 7.5 11.875 7.91973 11.875 8.4375C11.875 8.95527 12.2947 9.375 12.8125 9.375Z",
1656
+ fill: "currentColor"
1657
+ }
1658
+ ),
1659
+ /* @__PURE__ */ jsx(
1660
+ "path",
1661
+ {
1662
+ d: "M12.4756 11.499C12.683 11.1407 13.1425 11.0182 13.501 11.2256C13.8593 11.433 13.9818 11.8925 13.7744 12.251C13.0125 13.568 11.6947 14.5 10 14.5C8.30531 14.5 6.98748 13.568 6.22559 12.251C6.01825 11.8925 6.14067 11.433 6.49902 11.2256C6.85749 11.0182 7.31695 11.1407 7.52441 11.499C8.05942 12.424 8.91824 13 10 13C11.0818 13 11.9406 12.424 12.4756 11.499Z",
1663
+ fill: "currentColor"
1664
+ }
1665
+ ),
1666
+ /* @__PURE__ */ jsx(
1667
+ "path",
1668
+ {
1669
+ d: "M15.083 6.87524V4.91626H13.125C12.7108 4.91626 12.375 4.58047 12.375 4.16626C12.3752 3.7522 12.7109 3.41626 13.125 3.41626H15.083V1.45825C15.083 1.04415 15.4189 0.708427 15.833 0.708252C16.2472 0.708252 16.583 1.04404 16.583 1.45825V3.41626H18.542C18.9559 3.41644 19.2918 3.7523 19.292 4.16626C19.292 4.58036 18.9561 4.91608 18.542 4.91626H16.583V6.87524C16.5828 7.28931 16.2471 7.62524 15.833 7.62524C15.4191 7.62507 15.0832 7.2892 15.083 6.87524Z",
1670
+ fill: "currentColor"
1671
+ }
1672
+ )
1673
+ ] })
1674
+ );
1615
1675
  const IconExclamationMarkFill = createIcon(
1616
1676
  "IconExclamationMarkFill",
1617
1677
  /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1639,6 +1699,16 @@ const IconEyeFill = createIcon(
1639
1699
  "IconEyeFill",
1640
1700
  /* @__PURE__ */ jsx("path", { d: "M19.3211 9.74688C19.2937 9.68516 18.632 8.21719 17.1609 6.74609C15.2008 4.78594 12.725 3.75 9.99999 3.75C7.27499 3.75 4.79921 4.78594 2.83905 6.74609C1.36796 8.21719 0.703118 9.6875 0.678899 9.74688C0.643362 9.82681 0.625 9.91331 0.625 10.0008C0.625 10.0883 0.643362 10.1748 0.678899 10.2547C0.706243 10.3164 1.36796 11.7836 2.83905 13.2547C4.79921 15.2141 7.27499 16.25 9.99999 16.25C12.725 16.25 15.2008 15.2141 17.1609 13.2547C18.632 11.7836 19.2937 10.3164 19.3211 10.2547C19.3566 10.1748 19.375 10.0883 19.375 10.0008C19.375 9.91331 19.3566 9.82681 19.3211 9.74688ZM9.99999 13.125C9.38193 13.125 8.77774 12.9417 8.26384 12.5983C7.74993 12.255 7.34939 11.7669 7.11287 11.1959C6.87634 10.6249 6.81446 9.99653 6.93504 9.39034C7.05562 8.78415 7.35324 8.22733 7.79028 7.79029C8.22732 7.35325 8.78414 7.05562 9.39033 6.93505C9.99652 6.81447 10.6249 6.87635 11.1959 7.11288C11.7669 7.3494 12.255 7.74994 12.5983 8.26384C12.9417 8.77775 13.125 9.38193 13.125 10C13.125 10.8288 12.7958 11.6237 12.2097 12.2097C11.6236 12.7958 10.8288 13.125 9.99999 13.125Z" })
1641
1701
  );
1702
+ const IconUnsupportedAttachment = createIcon(
1703
+ "IconUnsupportedAttachment",
1704
+ /* @__PURE__ */ jsx(
1705
+ "path",
1706
+ {
1707
+ d: "M4.5 16.75H15.5V7.625H11.875C11.4608 7.625 11.125 7.28921 11.125 6.875V3.25H4.5V16.75ZM11.3447 9.46973C11.6376 9.17683 12.1124 9.17683 12.4053 9.46973C12.6982 9.76262 12.6982 10.2374 12.4053 10.5303L11.0605 11.875L12.4053 13.2197C12.6982 13.5126 12.6982 13.9874 12.4053 14.2803C12.1124 14.5732 11.6376 14.5732 11.3447 14.2803L10 12.9355L8.65527 14.2803C8.36238 14.5732 7.88762 14.5732 7.59473 14.2803C7.30183 13.9874 7.30183 13.5126 7.59473 13.2197L8.93945 11.875L7.59473 10.5303C7.30183 10.2374 7.30183 9.76262 7.59473 9.46973C7.88762 9.17683 8.36238 9.17683 8.65527 9.46973L10 10.8145L11.3447 9.46973ZM12.625 6.125H14.4395L12.625 4.31055V6.125ZM17 16.875C17 17.2397 16.8555 17.5898 16.5977 17.8477C16.3398 18.1055 15.9897 18.25 15.625 18.25H4.375C4.01033 18.25 3.66021 18.1055 3.40234 17.8477C3.14448 17.5898 3 17.2397 3 16.875V3.125C3 2.76033 3.14448 2.41021 3.40234 2.15234L3.50391 2.06152C3.74856 1.86111 4.05597 1.75 4.375 1.75H11.875C12.0739 1.75 12.2646 1.82907 12.4053 1.96973L16.7803 6.34473C16.9209 6.48538 17 6.67609 17 6.875V16.875Z",
1708
+ fill: "currentColor"
1709
+ }
1710
+ )
1711
+ );
1642
1712
  const IconUpload = createIcon(
1643
1713
  "IconUpload",
1644
1714
  /* @__PURE__ */ jsx(
@@ -1695,21 +1765,6 @@ const IconImage = createIcon(
1695
1765
  }
1696
1766
  )
1697
1767
  );
1698
- const IconSidebar = createIcon(
1699
- "IconSidebar",
1700
- /* @__PURE__ */ jsx(
1701
- "path",
1702
- {
1703
- d: "M6.875 3.75V16.25M3.125 3.75H16.875C17.2202 3.75 17.5 4.02982 17.5 4.375V15.625C17.5 15.9702 17.2202 16.25 16.875 16.25H3.125C2.77982 16.25 2.5 15.9702 2.5 15.625V4.375C2.5 4.02982 2.77982 3.75 3.125 3.75Z",
1704
- fill: "none",
1705
- stroke: "currentColor",
1706
- strokeLinecap: "round",
1707
- strokeLinejoin: "round",
1708
- strokeWidth: "1.5"
1709
- }
1710
- ),
1711
- { "data-rtl-mirror": "" }
1712
- );
1713
1768
  const IconSearch = createIcon(
1714
1769
  "IconSearch",
1715
1770
  /* @__PURE__ */ jsx(
@@ -1766,6 +1821,16 @@ const IconVoice = createIcon(
1766
1821
  }
1767
1822
  )
1768
1823
  );
1824
+ const IconMicrophoneSolid = createIcon(
1825
+ "IconMicrophoneSolid",
1826
+ /* @__PURE__ */ jsx(
1827
+ "path",
1828
+ {
1829
+ d: "M6.25 10V5C6.25 4.00544 6.64509 3.05161 7.34835 2.34835C8.05161 1.64509 9.00544 1.25 10 1.25C10.9946 1.25 11.9484 1.64509 12.6517 2.34835C13.3549 3.05161 13.75 4.00544 13.75 5V10C13.75 10.9946 13.3549 11.9484 12.6517 12.6517C11.9484 13.3549 10.9946 13.75 10 13.75C9.00544 13.75 8.05161 13.3549 7.34835 12.6517C6.64509 11.9484 6.25 10.9946 6.25 10ZM16.25 10C16.25 9.83424 16.1842 9.67527 16.0669 9.55806C15.9497 9.44085 15.7908 9.375 15.625 9.375C15.4592 9.375 15.3003 9.44085 15.1831 9.55806C15.0658 9.67527 15 9.83424 15 10C15 11.3261 14.4732 12.5979 13.5355 13.5355C12.5979 14.4732 11.3261 15 10 15C8.67392 15 7.40215 14.4732 6.46447 13.5355C5.52678 12.5979 5 11.3261 5 10C5 9.83424 4.93415 9.67527 4.81694 9.55806C4.69973 9.44085 4.54076 9.375 4.375 9.375C4.20924 9.375 4.05027 9.44085 3.93306 9.55806C3.81585 9.67527 3.75 9.83424 3.75 10C3.7519 11.5489 4.32806 13.042 5.36707 14.1907C6.40607 15.3393 7.83409 16.062 9.375 16.2188V18.75C9.375 18.9158 9.44085 19.0747 9.55806 19.1919C9.67527 19.3092 9.83424 19.375 10 19.375C10.1658 19.375 10.3247 19.3092 10.4419 19.1919C10.5592 19.0747 10.625 18.9158 10.625 18.75V16.2188C12.1659 16.062 13.5939 15.3393 14.6329 14.1907C15.6719 13.042 16.2481 11.5489 16.25 10Z",
1830
+ fill: "currentColor"
1831
+ }
1832
+ )
1833
+ );
1769
1834
  const IconMute = createIcon(
1770
1835
  "IconMute",
1771
1836
  /* @__PURE__ */ jsx(
@@ -1907,7 +1972,7 @@ const IconPlus = createIcon(
1907
1972
  stroke: "currentColor",
1908
1973
  strokeLinecap: "round",
1909
1974
  strokeLinejoin: "round",
1910
- strokeWidth: "1.5"
1975
+ strokeWidth: "2"
1911
1976
  }
1912
1977
  )
1913
1978
  );
@@ -2612,63 +2677,6 @@ const MESSAGE_ACTIONS = {
2612
2677
  reply: "reply",
2613
2678
  saveForLater: "saveForLater"
2614
2679
  };
2615
- const defaultPinPermissions = {
2616
- commerce: {
2617
- admin: true,
2618
- anonymous: false,
2619
- channel_member: false,
2620
- channel_moderator: true,
2621
- guest: false,
2622
- member: false,
2623
- moderator: true,
2624
- owner: true,
2625
- user: false
2626
- },
2627
- gaming: {
2628
- admin: true,
2629
- anonymous: false,
2630
- channel_member: false,
2631
- channel_moderator: true,
2632
- guest: false,
2633
- member: false,
2634
- moderator: true,
2635
- owner: false,
2636
- user: false
2637
- },
2638
- livestream: {
2639
- admin: true,
2640
- anonymous: false,
2641
- channel_member: false,
2642
- channel_moderator: true,
2643
- guest: false,
2644
- member: false,
2645
- moderator: true,
2646
- owner: true,
2647
- user: false
2648
- },
2649
- messaging: {
2650
- admin: true,
2651
- anonymous: false,
2652
- channel_member: true,
2653
- channel_moderator: true,
2654
- guest: false,
2655
- member: true,
2656
- moderator: true,
2657
- owner: true,
2658
- user: false
2659
- },
2660
- team: {
2661
- admin: true,
2662
- anonymous: false,
2663
- channel_member: true,
2664
- channel_moderator: true,
2665
- guest: false,
2666
- member: true,
2667
- moderator: true,
2668
- owner: true,
2669
- user: false
2670
- }
2671
- };
2672
2680
  const getMessageActions = (actions, {
2673
2681
  canDelete,
2674
2682
  canEdit,
@@ -2684,7 +2692,7 @@ const getMessageActions = (actions, {
2684
2692
  let messageActions = [];
2685
2693
  if (actions && typeof actions === "boolean") {
2686
2694
  messageActions = Object.keys(MESSAGE_ACTIONS);
2687
- } else if (actions && actions.length > 0) {
2695
+ } else if (actions && Array.isArray(actions) && actions.length > 0) {
2688
2696
  messageActions = [...actions];
2689
2697
  } else {
2690
2698
  return [];
@@ -2775,6 +2783,7 @@ const areMessageUIPropsEqual = (prevProps, nextProps) => {
2775
2783
  return areMessagesEqual(prevMessage, nextMessage);
2776
2784
  };
2777
2785
  const messageHasReactions = (message) => Object.values(message?.reaction_groups ?? {}).some(({ count }) => count > 0);
2786
+ const messageHasQuotedMessage = (message) => !!message?.quoted_message;
2778
2787
  const messageHasAttachments = (message) => !!message?.attachments && !!message.attachments.length;
2779
2788
  const messageHasSingleAttachment = (message) => message?.attachments?.length === 1;
2780
2789
  const messageHasGiphyAttachment = (message) => !!message?.attachments?.some((att) => att.type === "giphy");
@@ -2843,6 +2852,7 @@ const isMessageErrorRetryable = (message) => message.status === "failed" && mess
2843
2852
  const isNetworkSendFailure = (message) => message.status === "failed" && message.error?.status === 0;
2844
2853
  const isMessageBounced = (message) => message.type === "error" && (message.moderation_details?.action === "MESSAGE_RESPONSE_ACTION_BOUNCE" || message.moderation?.action === "bounce");
2845
2854
  const isMessageBlocked = (message) => message.type === "error" && (message.moderation_details?.action === "MESSAGE_RESPONSE_ACTION_REMOVE" || message.moderation?.action === "remove");
2855
+ const isMessageDeleted = (message) => Boolean(message.deleted_at || message.type === "deleted" || message.deleted_for_me);
2846
2856
  const isMessageEdited = (message) => !!message.message_text_updated_at;
2847
2857
  const hasResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
2848
2858
  function autoMiddlewareFor(p) {
@@ -3094,7 +3104,6 @@ const getGroupStyles = (message, previousMessage, nextMessage, noGroupByUser, ma
3094
3104
  return "";
3095
3105
  };
3096
3106
  const hasMoreMessagesProbably = (returnedCountMessages, limit) => returnedCountMessages >= limit;
3097
- const hasNotMoreMessages = (returnedCountMessages, limit) => returnedCountMessages < limit;
3098
3107
  function isIntroMessage(message) {
3099
3108
  return message.customType === CUSTOM_MESSAGE_TYPE.intro;
3100
3109
  }
@@ -3423,6 +3432,7 @@ const ChannelInner = (props) => {
3423
3432
  LoadingIndicator = LoadingChannel
3424
3433
  } = useComponentContext();
3425
3434
  const { client, customClasses, latestMessageDatesByChannels, mutes, searchController } = useChatContext("Channel");
3435
+ const { addNotification } = useNotificationApi();
3426
3436
  const { t } = useTranslationContext("Channel");
3427
3437
  const chatContainerClass = getChatContainerClass(customClasses?.chatContainer);
3428
3438
  const windowsEmojiClass = useImageFlagEmojisOnWindowsClass();
@@ -3668,18 +3678,15 @@ const ChannelInner = (props) => {
3668
3678
  handleHighlightedMessageChange({ highlightedMessageId: jumpToMessageFromSearch.id });
3669
3679
  }, [jumpToMessageFromSearch, handleHighlightedMessageChange]);
3670
3680
  const notifyJumpToFirstUnreadError = useCallback(() => {
3671
- client.notifications.addError({
3681
+ addNotification({
3682
+ context: { feature: "jumpToFirstUnread" },
3683
+ emitter: "Channel",
3672
3684
  message: t("Failed to jump to the first unread message"),
3673
- options: {
3674
- tags: addNotificationTargetTag("channel"),
3675
- type: "channel:jumpToFirstUnread:failed"
3676
- },
3677
- origin: {
3678
- context: { feature: "jumpToFirstUnread" },
3679
- emitter: "Channel"
3680
- }
3685
+ severity: "error",
3686
+ targetPanels: ["channel"],
3687
+ type: "channel:jumpToFirstUnread:failed"
3681
3688
  });
3682
- }, [client, t]);
3689
+ }, [addNotification, t]);
3683
3690
  const loadMoreFinished = useCallback(
3684
3691
  debounce(
3685
3692
  (hasMore, messages) => {
@@ -4280,7 +4287,6 @@ const ChatViewChannelsSelectorButton = ({
4280
4287
  iconOnly = true
4281
4288
  }) => {
4282
4289
  const { activeChatView, setActiveChatView } = useChatViewContext();
4283
- const { openMobileNav } = useChatContext("ChatViewChannelsSelectorButton");
4284
4290
  const { t } = useTranslationContext();
4285
4291
  const isActive = activeChatView === "channels";
4286
4292
  return /* @__PURE__ */ jsx(
@@ -4291,10 +4297,7 @@ const ChatViewChannelsSelectorButton = ({
4291
4297
  Icon: IconMessageBubble,
4292
4298
  iconOnly,
4293
4299
  isActive,
4294
- onPointerDown: () => {
4295
- openMobileNav();
4296
- setActiveChatView("channels");
4297
- },
4300
+ onPointerDown: () => setActiveChatView("channels"),
4298
4301
  text: t("Channels")
4299
4302
  }
4300
4303
  );
@@ -4302,7 +4305,7 @@ const ChatViewChannelsSelectorButton = ({
4302
4305
  const ChatViewThreadsSelectorButton = ({
4303
4306
  iconOnly = true
4304
4307
  }) => {
4305
- const { client, openMobileNav } = useChatContext();
4308
+ const { client } = useChatContext();
4306
4309
  const { unreadThreadCount } = useStateStore(
4307
4310
  client.threads.state,
4308
4311
  unreadThreadCountSelector
@@ -4320,10 +4323,7 @@ const ChatViewThreadsSelectorButton = ({
4320
4323
  Icon: IconThread,
4321
4324
  iconOnly,
4322
4325
  isActive,
4323
- onPointerDown: () => {
4324
- openMobileNav();
4325
- setActiveChatView("threads");
4326
- },
4326
+ onPointerDown: () => setActiveChatView("threads"),
4327
4327
  text: t("Threads"),
4328
4328
  children: /* @__PURE__ */ jsx(UnreadCountBadge, { count: unreadThreadCount, position: "top-right", children: isActive ? /* @__PURE__ */ jsx(IconThreadFill, {}) : /* @__PURE__ */ jsx(IconThread, {}) })
4329
4329
  }
@@ -4342,19 +4342,7 @@ const defaultChatViewSelectorItemSet = [
4342
4342
  const ChatViewSelector = ({
4343
4343
  iconOnly = true,
4344
4344
  itemSet = defaultChatViewSelectorItemSet
4345
- }) => {
4346
- const { navOpen } = useChatContext("ChatView.Selector");
4347
- return /* @__PURE__ */ jsx(
4348
- "div",
4349
- {
4350
- className: clsx("str-chat__chat-view__selector", {
4351
- "str-chat__chat-view__selector--nav-closed": navOpen === false,
4352
- "str-chat__chat-view__selector--nav-open": navOpen === true
4353
- }),
4354
- children: itemSet.map(({ Component, type }) => /* @__PURE__ */ jsx(Component, { iconOnly }, type))
4355
- }
4356
- );
4357
- };
4345
+ }) => /* @__PURE__ */ jsx("div", { className: "str-chat__chat-view__selector", children: itemSet.map(({ Component, type }) => /* @__PURE__ */ jsx(Component, { iconOnly }, type)) });
4358
4346
  ChatView.Channels = ChannelsView;
4359
4347
  ChatView.Threads = ThreadsView;
4360
4348
  ChatView.ThreadAdapter = ThreadAdapter;
@@ -4371,6 +4359,115 @@ const useNotificationTarget = () => {
4371
4359
  if (channels) return "channel-list";
4372
4360
  return void 0;
4373
4361
  };
4362
+ const SYSTEM_NOTIFICATION_TAG = "system";
4363
+ const hasSystemNotificationTag = (notification) => notification.tags?.includes(SYSTEM_NOTIFICATION_TAG) ?? false;
4364
+ const getTargetTags = (targetPanels, inferredPanel, tags) => {
4365
+ if (targetPanels) {
4366
+ return Array.from(
4367
+ /* @__PURE__ */ new Set([...targetPanels.map(getNotificationTargetTag), ...tags ?? []])
4368
+ );
4369
+ }
4370
+ return addNotificationTargetTag(inferredPanel, tags);
4371
+ };
4372
+ const getTypeFromIncident = ({
4373
+ incident,
4374
+ severity,
4375
+ type
4376
+ }) => {
4377
+ if (type) return type;
4378
+ if (!incident) return void 0;
4379
+ const status = incident.status ?? (severity === "error" ? "failed" : severity === "success" ? "success" : severity);
4380
+ return [incident.domain, incident.entity, incident.operation, status].filter((segment) => !!segment).join(":");
4381
+ };
4382
+ const useNotificationApi = () => {
4383
+ const { client } = useChatContext();
4384
+ const inferredPanel = useNotificationTarget();
4385
+ const addNotification = useCallback(
4386
+ ({
4387
+ actions,
4388
+ context,
4389
+ duration,
4390
+ emitter,
4391
+ error,
4392
+ incident,
4393
+ message,
4394
+ severity,
4395
+ tags,
4396
+ targetPanels,
4397
+ type
4398
+ }) => {
4399
+ const notificationTags = getTargetTags(targetPanels, inferredPanel, tags);
4400
+ const resolvedType = getTypeFromIncident({ incident, severity, type });
4401
+ const origin = context ? { context, emitter } : { emitter };
4402
+ const options = {
4403
+ ...actions ? { actions } : {},
4404
+ ...typeof duration === "number" ? { duration } : {},
4405
+ ...error ? { originalError: error } : {},
4406
+ ...notificationTags.length > 0 ? { tags: notificationTags } : {},
4407
+ ...severity ? { severity } : {},
4408
+ ...resolvedType ? { type: resolvedType } : {}
4409
+ };
4410
+ client.notifications.add({
4411
+ message,
4412
+ options,
4413
+ origin
4414
+ });
4415
+ },
4416
+ [client, inferredPanel]
4417
+ );
4418
+ const addSystemNotification = useCallback(
4419
+ ({
4420
+ actions,
4421
+ context,
4422
+ duration,
4423
+ emitter,
4424
+ error,
4425
+ incident,
4426
+ message,
4427
+ severity,
4428
+ tags,
4429
+ type
4430
+ }) => {
4431
+ const notificationTags = Array.from(
4432
+ /* @__PURE__ */ new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []])
4433
+ );
4434
+ const resolvedType = getTypeFromIncident({ incident, severity, type });
4435
+ const origin = context ? { context, emitter } : { emitter };
4436
+ const options = {
4437
+ ...actions ? { actions } : {},
4438
+ ...typeof duration === "number" ? { duration } : {},
4439
+ ...error ? { originalError: error } : {},
4440
+ ...notificationTags.length > 0 ? { tags: notificationTags } : {},
4441
+ ...severity ? { severity } : {},
4442
+ ...resolvedType ? { type: resolvedType } : {}
4443
+ };
4444
+ return client.notifications.add({
4445
+ message,
4446
+ options,
4447
+ origin
4448
+ });
4449
+ },
4450
+ [client]
4451
+ );
4452
+ const removeNotification = useCallback(
4453
+ (id) => {
4454
+ client.notifications.remove(id);
4455
+ },
4456
+ [client]
4457
+ );
4458
+ const startNotificationTimeout = useCallback(
4459
+ (id) => {
4460
+ client.notifications.startTimeout(id);
4461
+ },
4462
+ [client]
4463
+ );
4464
+ return {
4465
+ addNotification,
4466
+ addSystemNotification,
4467
+ removeNotification,
4468
+ startNotificationTimeout
4469
+ };
4470
+ };
4374
4471
  const AudioPlayerContext = React.createContext({
4375
4472
  audioPlayers: null
4376
4473
  });
@@ -4399,7 +4496,7 @@ const useAudioPlayer = ({
4399
4496
  title,
4400
4497
  waveformData
4401
4498
  }) => {
4402
- const { client } = useChatContext();
4499
+ const { addNotification } = useNotificationApi();
4403
4500
  const panel = useNotificationTarget();
4404
4501
  const { t } = useTranslationContext();
4405
4502
  const { audioPlayers } = useContext(AudioPlayerContext);
@@ -4417,7 +4514,7 @@ const useAudioPlayer = ({
4417
4514
  useEffect(() => {
4418
4515
  if (!audioPlayer) return;
4419
4516
  const notificationsPlugin = audioPlayerNotificationsPluginFactory({
4420
- client,
4517
+ addNotification,
4421
4518
  panel,
4422
4519
  t
4423
4520
  });
@@ -4425,7 +4522,7 @@ const useAudioPlayer = ({
4425
4522
  ...currentPlugins.filter((plugin) => plugin.id !== notificationsPlugin.id),
4426
4523
  notificationsPlugin
4427
4524
  ]);
4428
- }, [audioPlayer, client, panel, t]);
4525
+ }, [addNotification, audioPlayer, panel, t]);
4429
4526
  return audioPlayer;
4430
4527
  };
4431
4528
  const activeAudioPlayerSelector = ({ activeAudioPlayer }) => ({
@@ -4437,56 +4534,56 @@ const useActiveAudioPlayer = () => {
4437
4534
  return activeAudioPlayer;
4438
4535
  };
4439
4536
  export {
4440
- IconPoll as $,
4441
- IconArrowLeft as A,
4537
+ IconFile as $,
4538
+ IconNoSign as A,
4442
4539
  Button as B,
4443
4540
  ComponentContext as C,
4444
- IconExclamationMark as D,
4445
- IconNoSign as E,
4446
- isMessageErrorRetryable as F,
4447
- ACTIONS_NOT_WORKING_IN_THREAD as G,
4448
- useNotificationTarget as H,
4541
+ isMessageDeleted as D,
4542
+ isMessageErrorRetryable as E,
4543
+ ACTIONS_NOT_WORKING_IN_THREAD as F,
4544
+ useNotificationApi as G,
4545
+ IconArrowUpRight as H,
4449
4546
  IconPauseFill as I,
4450
- IconArrowUpRight as J,
4451
- addNotificationTargetTag as K,
4547
+ IconPin as J,
4548
+ mapToUserNameOrId as K,
4452
4549
  LocalizedFormat as L,
4453
- IconPin as M,
4454
- mapToUserNameOrId as N,
4455
- IconClock as O,
4456
- IconCheckmark1Small as P,
4457
- IconChecks as Q,
4458
- getReadByTooltipText as R,
4459
- messageHasAttachments as S,
4460
- messageTextHasEmojisOnly as T,
4461
- isDate as U,
4462
- getDateString as V,
4463
- IconTranslate as W,
4464
- useMessageComposerContext as X,
4465
- useIsCooldownActive as Y,
4466
- IconXmarkSmall as Z,
4467
- IconImage as _,
4550
+ IconClock as M,
4551
+ IconCheckmark1Small as N,
4552
+ IconChecks as O,
4553
+ getReadByTooltipText as P,
4554
+ messageHasAttachments as Q,
4555
+ messageTextHasEmojisOnly as R,
4556
+ isDate as S,
4557
+ getDateString as T,
4558
+ IconTranslate as U,
4559
+ useMessageComposerContext as V,
4560
+ useIsCooldownActive as W,
4561
+ IconXmarkSmall as X,
4562
+ IconImage as Y,
4563
+ IconPoll as Z,
4564
+ IconLocation as _,
4468
4565
  useMessageComposerController as a,
4469
- processMessages as a$,
4470
- IconLocation as a0,
4471
- IconFile as a1,
4472
- IconLink as a2,
4473
- IconVideo as a3,
4474
- IconVideoFill as a4,
4475
- IconVoice as a5,
4476
- IconSave as a6,
4477
- IconBell as a7,
4478
- IconChevronDown as a8,
4479
- IconPlusSmall as a9,
4480
- isLanguageSupported as aA,
4481
- IconSidebar as aB,
4482
- useChatViewContext as aC,
4483
- MESSAGE_ACTIONS as aD,
4484
- LegacyThreadContext as aE,
4566
+ getMessageActions as a$,
4567
+ IconLink as a0,
4568
+ IconVideo as a1,
4569
+ IconCamera as a2,
4570
+ IconVoice as a3,
4571
+ IconBookmark as a4,
4572
+ IconBell as a5,
4573
+ IconChevronDown as a6,
4574
+ IconMinus as a7,
4575
+ IconPlusSmall as a8,
4576
+ IconCheckmark as a9,
4577
+ useTypingContext as aA,
4578
+ useChatViewContext as aB,
4579
+ MESSAGE_ACTIONS as aC,
4580
+ LegacyThreadContext as aD,
4581
+ IconEmojiAdd as aE,
4485
4582
  IconReply as aF,
4486
4583
  IconEmoji as aG,
4487
4584
  IconMore as aH,
4488
4585
  IconUserCheck as aI,
4489
- IconUnsave as aJ,
4586
+ IconBookmarkRemove as aJ,
4490
4587
  IconBellOff as aK,
4491
4588
  IconNotification as aL,
4492
4589
  IconEdit as aM,
@@ -4500,111 +4597,118 @@ export {
4500
4597
  messageHasSingleAttachment as aU,
4501
4598
  messageHasGiphyAttachment as aV,
4502
4599
  messageHasReactions as aW,
4503
- isMessageEdited as aX,
4504
- countEmojis as aY,
4505
- areMessagePropsEqual as aZ,
4506
- getMessageActions as a_,
4507
- IconCheckmark as aa,
4508
- DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD as ab,
4509
- IconTrophy as ac,
4510
- IconReorder as ad,
4511
- IconMinusCircle as ae,
4512
- IconSend as af,
4513
- IconAudio as ag,
4514
- IconUserAdd as ah,
4515
- IconMute as ai,
4516
- IconGiphy as aj,
4517
- IconFlag as ak,
4518
- IconUserRemove as al,
4519
- IconAttachment as am,
4520
- IconCommand as an,
4521
- CHANNEL_CONTAINER_ID as ao,
4522
- IconPlus as ap,
4600
+ messageHasQuotedMessage as aX,
4601
+ isMessageEdited as aY,
4602
+ countEmojis as aZ,
4603
+ areMessagePropsEqual as a_,
4604
+ DEFAULT_LOAD_PAGE_SCROLL_THRESHOLD as aa,
4605
+ IconTrophy as ab,
4606
+ IconReorder as ac,
4607
+ IconMinusCircle as ad,
4608
+ IconSend as ae,
4609
+ IconAudio as af,
4610
+ IconUserAdd as ag,
4611
+ IconMute as ah,
4612
+ IconGiphy as ai,
4613
+ IconFlag as aj,
4614
+ IconUserRemove as ak,
4615
+ IconAttachment as al,
4616
+ IconCommand as am,
4617
+ CHANNEL_CONTAINER_ID as an,
4618
+ IconPlus as ao,
4619
+ IconUnsupportedAttachment as ap,
4523
4620
  IconExclamationTriangleFill as aq,
4524
4621
  useAudioPlayer as ar,
4525
- IconRetry as as,
4526
- IconArrowDownCircle as at,
4527
- IconBolt as au,
4528
- IconDelete as av,
4529
- IconUpload as aw,
4530
- MessageComposerContextProvider as ax,
4531
- useTypingContext as ay,
4532
- defaultDateTimeParser as az,
4622
+ IconMicrophoneSolid as as,
4623
+ IconVideoFill as at,
4624
+ IconRetry as au,
4625
+ IconArrowDownCircle as av,
4626
+ IconBolt as aw,
4627
+ IconDelete as ax,
4628
+ IconUpload as ay,
4629
+ MessageComposerContextProvider as az,
4533
4630
  useChannelActionContext as b,
4534
- ChannelStateContext as b$,
4535
- insertIntro as b0,
4536
- getGroupStyles as b1,
4537
- getLastReceived as b2,
4538
- IconArrowUp as b3,
4539
- isIntroMessage as b4,
4540
- isLocalMessage as b5,
4541
- getIsFirstUnreadMessage as b6,
4542
- IconArrowDown as b7,
4543
- DEFAULT_NEXT_CHANNEL_PAGE_SIZE as b8,
4544
- EmptyStateIndicator as b9,
4545
- useActiveThread as bA,
4546
- ChatViewSelectorButton as bB,
4547
- ChatViewChannelsSelectorButton as bC,
4548
- ChatViewThreadsSelectorButton as bD,
4549
- defaultChatViewSelectorItemSet as bE,
4550
- createIcon as bF,
4551
- IconMessageBubble as bG,
4552
- IconMessageBubbleFill as bH,
4553
- IconThreadFill as bI,
4554
- LoadingChannel as bJ,
4555
- LoadingErrorIndicator as bK,
4556
- OPTIONAL_MESSAGE_ACTIONS as bL,
4557
- getImages as bM,
4558
- getNonImageAttachments as bN,
4559
- makeIntroMessage as bO,
4560
- makeDateMessageId as bP,
4561
- hasMoreMessagesProbably as bQ,
4562
- hasNotMoreMessages as bR,
4563
- isNotificationTargetPanel as bS,
4564
- getNotificationTargetPanel as bT,
4565
- getNotificationTargetTag as bU,
4566
- useLegacyThreadContext as bV,
4567
- ThreadContext as bW,
4568
- ThreadProvider as bX,
4569
- ChannelActionContext as bY,
4570
- ChannelActionProvider as bZ,
4571
- ChannelListContext as b_,
4572
- getChannel as ba,
4573
- IconSearch as bb,
4574
- IconXCircle as bc,
4575
- useChannelListContext as bd,
4576
- DEFAULT_JUMP_TO_PAGE_SIZE as be,
4577
- ChannelListContextProvider as bf,
4578
- IconArchive as bg,
4579
- IconLeave as bh,
4580
- IconCamera as bi,
4581
- IconExclamationCircleFill as bj,
4582
- ChatProvider as bk,
4583
- TranslationProvider as bl,
4584
- useThreadsViewContext as bm,
4585
- IconMessageBubbles as bn,
4586
- IconRefresh as bo,
4631
+ addNotificationTargetTag as b$,
4632
+ processMessages as b0,
4633
+ insertIntro as b1,
4634
+ getGroupStyles as b2,
4635
+ getLastReceived as b3,
4636
+ IconArrowUp as b4,
4637
+ isIntroMessage as b5,
4638
+ isLocalMessage as b6,
4639
+ getIsFirstUnreadMessage as b7,
4640
+ IconArrowDown as b8,
4641
+ DEFAULT_NEXT_CHANNEL_PAGE_SIZE as b9,
4642
+ useMentionsHandlers as bA,
4643
+ Channel as bB,
4644
+ ChatViewContext as bC,
4645
+ ChatView as bD,
4646
+ useActiveThread as bE,
4647
+ ChatViewSelectorButton as bF,
4648
+ ChatViewChannelsSelectorButton as bG,
4649
+ ChatViewThreadsSelectorButton as bH,
4650
+ defaultChatViewSelectorItemSet as bI,
4651
+ createIcon as bJ,
4652
+ IconMessageBubble as bK,
4653
+ IconMessageBubbleFill as bL,
4654
+ IconThreadFill as bM,
4655
+ LoadingChannel as bN,
4656
+ LoadingErrorIndicator as bO,
4657
+ validateAndGetMessage as bP,
4658
+ OPTIONAL_MESSAGE_ACTIONS as bQ,
4659
+ getImages as bR,
4660
+ getNonImageAttachments as bS,
4661
+ makeIntroMessage as bT,
4662
+ makeDateMessageId as bU,
4663
+ hasMoreMessagesProbably as bV,
4664
+ SYSTEM_NOTIFICATION_TAG as bW,
4665
+ isNotificationTargetPanel as bX,
4666
+ getNotificationTargetPanel as bY,
4667
+ getNotificationTargetPanels as bZ,
4668
+ getNotificationTargetTag as b_,
4669
+ EmptyStateIndicator as ba,
4670
+ useNotificationTarget as bb,
4671
+ getChannel as bc,
4672
+ IconSearch as bd,
4673
+ IconXCircle as be,
4674
+ useChannelListContext as bf,
4675
+ DEFAULT_JUMP_TO_PAGE_SIZE as bg,
4676
+ ChannelListContextProvider as bh,
4677
+ IconLeave as bi,
4678
+ IconArchive as bj,
4679
+ IconExclamationCircleFill as bk,
4680
+ useThreadsViewContext as bl,
4681
+ IconMessageBubbles as bm,
4682
+ IconRefresh as bn,
4683
+ hasSystemNotificationTag as bo,
4587
4684
  IconEyeFill as bp,
4588
- useActiveAudioPlayer as bq,
4589
- WithAudioPlayback as br,
4590
- defaultRegisterAudioPlayerError as bs,
4591
- elementIsPlaying as bt,
4592
- AudioPlayer as bu,
4593
- useEditMessageHandler as bv,
4594
- useMentionsHandlers as bw,
4595
- Channel as bx,
4596
- ChatViewContext as by,
4597
- ChatView as bz,
4685
+ defaultDateTimeParser as bq,
4686
+ isLanguageSupported as br,
4687
+ ChatProvider as bs,
4688
+ TranslationProvider as bt,
4689
+ useActiveAudioPlayer as bu,
4690
+ WithAudioPlayback as bv,
4691
+ defaultRegisterAudioPlayerError as bw,
4692
+ elementIsPlaying as bx,
4693
+ AudioPlayer as by,
4694
+ useEditMessageHandler as bz,
4598
4695
  useTranslationContext as c,
4599
- ChannelStateProvider as c0,
4600
- ChatContext as c1,
4601
- ComponentProvider as c2,
4602
- MessageComposerContext as c3,
4603
- TranslationContext as c4,
4604
- TypingContext as c5,
4605
- TypingProvider as c6,
4606
- isDayOrMoment as c7,
4607
- isNumberOrString as c8,
4696
+ useLegacyThreadContext as c0,
4697
+ ThreadContext as c1,
4698
+ ThreadProvider as c2,
4699
+ ChannelActionContext as c3,
4700
+ ChannelActionProvider as c4,
4701
+ ChannelListContext as c5,
4702
+ ChannelStateContext as c6,
4703
+ ChannelStateProvider as c7,
4704
+ ChatContext as c8,
4705
+ ComponentProvider as c9,
4706
+ MessageComposerContext as ca,
4707
+ TranslationContext as cb,
4708
+ TypingContext as cc,
4709
+ TypingProvider as cd,
4710
+ isDayOrMoment as ce,
4711
+ isNumberOrString as cf,
4608
4712
  useChannelStateContext as d,
4609
4713
  useChatContext as e,
4610
4714
  isNotificationForPanel as f,
@@ -4614,19 +4718,19 @@ export {
4614
4718
  defaultTranslatorFunction as j,
4615
4719
  calendar as k,
4616
4720
  IconLoading as l,
4617
- isNetworkSendFailure as m,
4618
- isUserMuted as n,
4619
- defaultPinPermissions as o,
4721
+ useComponentContext as m,
4722
+ isNetworkSendFailure as n,
4723
+ isUserMuted as o,
4620
4724
  predefinedFormatters as p,
4621
4725
  useThreadContext as q,
4622
4726
  usePopoverPosition as r,
4623
- useComponentContext as s,
4624
- IconXmark as t,
4727
+ IconXmark as s,
4728
+ IconUser as t,
4625
4729
  useStateStore as u,
4626
- validateAndGetMessage as v,
4627
- IconUser as w,
4628
- IconExclamationMarkFill as x,
4629
- IconChevronRight as y,
4630
- IconChevronLeft as z
4730
+ IconExclamationMarkFill as v,
4731
+ IconChevronRight as w,
4732
+ IconChevronLeft as x,
4733
+ IconArrowLeft as y,
4734
+ IconExclamationMark as z
4631
4735
  };
4632
- //# sourceMappingURL=WithAudioPlayback.d90f1a99.mjs.map
4736
+ //# sourceMappingURL=WithAudioPlayback.2ffdc4c5.mjs.map