stream-chat-react 14.5.0 → 14.6.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 (164) hide show
  1. package/dist/cjs/{ReactPlayerWrapper.963d6170.js → ReactPlayerWrapper.30240f76.js} +2 -2
  2. package/dist/cjs/{ReactPlayerWrapper.963d6170.js.map → ReactPlayerWrapper.30240f76.js.map} +1 -1
  3. package/dist/cjs/channel-detail.js +3007 -0
  4. package/dist/cjs/channel-detail.js.map +1 -0
  5. package/dist/cjs/emojis.js +5 -4
  6. package/dist/cjs/emojis.js.map +1 -1
  7. package/dist/cjs/index.js +1804 -4064
  8. package/dist/cjs/index.js.map +1 -1
  9. package/dist/cjs/useChannelHeaderOnlineStatus.6546ac83.js +4143 -0
  10. package/dist/cjs/useChannelHeaderOnlineStatus.6546ac83.js.map +1 -0
  11. package/dist/cjs/useMessageComposerController.c0dad9bc.js +99 -0
  12. package/dist/cjs/useMessageComposerController.c0dad9bc.js.map +1 -0
  13. package/dist/cjs/{useNotificationApi.e9312774.js → useNotificationApi.eb753f31.js} +121 -166
  14. package/dist/cjs/useNotificationApi.eb753f31.js.map +1 -0
  15. package/dist/css/channel-detail.css +825 -0
  16. package/dist/css/channel-detail.css.map +1 -0
  17. package/dist/css/index.css +111 -31
  18. package/dist/css/index.css.map +1 -1
  19. package/dist/es/channel-detail.mjs +2950 -0
  20. package/dist/es/channel-detail.mjs.map +1 -0
  21. package/dist/es/emojis.mjs +2 -1
  22. package/dist/es/emojis.mjs.map +1 -1
  23. package/dist/es/index.mjs +1399 -3669
  24. package/dist/es/index.mjs.map +1 -1
  25. package/dist/es/useChannelHeaderOnlineStatus.c5215b13.mjs +3600 -0
  26. package/dist/es/useChannelHeaderOnlineStatus.c5215b13.mjs.map +1 -0
  27. package/dist/es/useMessageComposerController.29f189b4.mjs +69 -0
  28. package/dist/es/useMessageComposerController.29f189b4.mjs.map +1 -0
  29. package/dist/es/{useNotificationApi.4be515a0.mjs → useNotificationApi.fa5cddf9.mjs} +104 -137
  30. package/dist/es/useNotificationApi.fa5cddf9.mjs.map +1 -0
  31. package/dist/types/components/AudioPlayback/components/index.d.ts +1 -0
  32. package/dist/types/components/AudioPlayback/components/index.d.ts.map +1 -1
  33. package/dist/types/components/Avatar/ChannelAvatar.d.ts.map +1 -1
  34. package/dist/types/components/ChannelHeader/hooks/useChannelHasMembersOnline.d.ts +7 -0
  35. package/dist/types/components/ChannelHeader/hooks/useChannelHasMembersOnline.d.ts.map +1 -0
  36. package/dist/types/components/ChannelHeader/hooks/useChannelHeaderOnlineStatus.d.ts +6 -1
  37. package/dist/types/components/ChannelHeader/hooks/useChannelHeaderOnlineStatus.d.ts.map +1 -1
  38. package/dist/types/components/ChannelListItem/hooks/index.d.ts +1 -0
  39. package/dist/types/components/ChannelListItem/hooks/index.d.ts.map +1 -1
  40. package/dist/types/components/ChannelListItem/hooks/useChannelPreviewInfo.d.ts.map +1 -1
  41. package/dist/types/components/ChannelListItem/hooks/useIsUserMuted.d.ts +2 -0
  42. package/dist/types/components/ChannelListItem/hooks/useIsUserMuted.d.ts.map +1 -0
  43. package/dist/types/components/Chat/Chat.d.ts.map +1 -1
  44. package/dist/types/components/Dialog/components/Prompt.d.ts +7 -4
  45. package/dist/types/components/Dialog/components/Prompt.d.ts.map +1 -1
  46. package/dist/types/components/Dialog/service/DialogPortal.d.ts +5 -1
  47. package/dist/types/components/Dialog/service/DialogPortal.d.ts.map +1 -1
  48. package/dist/types/components/FileIcon/iconMap.d.ts.map +1 -1
  49. package/dist/types/components/Form/Checkbox.d.ts +8 -0
  50. package/dist/types/components/Form/Checkbox.d.ts.map +1 -0
  51. package/dist/types/components/Form/SwitchField.d.ts +6 -0
  52. package/dist/types/components/Form/SwitchField.d.ts.map +1 -1
  53. package/dist/types/components/Form/index.d.ts +1 -0
  54. package/dist/types/components/Form/index.d.ts.map +1 -1
  55. package/dist/types/components/Icons/icons.d.ts +12 -0
  56. package/dist/types/components/Icons/icons.d.ts.map +1 -1
  57. package/dist/types/components/InfiniteScrollPaginator/index.d.ts +1 -0
  58. package/dist/types/components/InfiniteScrollPaginator/index.d.ts.map +1 -1
  59. package/dist/types/components/Message/hooks/useMessageTextStreaming.d.ts +1 -1
  60. package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts +1 -1
  61. package/dist/types/components/Message/hooks/useReactionsFetcher.d.ts.map +1 -1
  62. package/dist/types/components/Modal/GlobalModal.d.ts +3 -1
  63. package/dist/types/components/Modal/GlobalModal.d.ts.map +1 -1
  64. package/dist/types/components/Notifications/hooks/useNotificationApi.d.ts.map +1 -1
  65. package/dist/types/components/Poll/PollCreationDialog/MultipleAnswersField.d.ts.map +1 -1
  66. package/dist/types/components/Poll/PollOptionSelector.d.ts +0 -4
  67. package/dist/types/components/Poll/PollOptionSelector.d.ts.map +1 -1
  68. package/dist/types/context/DialogManagerContext.d.ts +3 -1
  69. package/dist/types/context/DialogManagerContext.d.ts.map +1 -1
  70. package/dist/types/i18n/Streami18n.d.ts +99 -0
  71. package/dist/types/i18n/Streami18n.d.ts.map +1 -1
  72. package/dist/types/plugins/ChannelDetail/AvatarWithChannelDetail.d.ts +9 -0
  73. package/dist/types/plugins/ChannelDetail/AvatarWithChannelDetail.d.ts.map +1 -0
  74. package/dist/types/plugins/ChannelDetail/ChannelDetail.d.ts +14 -0
  75. package/dist/types/plugins/ChannelDetail/ChannelDetail.d.ts.map +1 -0
  76. package/dist/types/plugins/ChannelDetail/ChannelDetailContext.d.ts +11 -0
  77. package/dist/types/plugins/ChannelDetail/ChannelDetailContext.d.ts.map +1 -0
  78. package/dist/types/plugins/ChannelDetail/ChannelDetailEmptyList.d.ts +3 -0
  79. package/dist/types/plugins/ChannelDetail/ChannelDetailEmptyList.d.ts.map +1 -0
  80. package/dist/types/plugins/ChannelDetail/ChannelDetailListLoadingIndicator.d.ts +6 -0
  81. package/dist/types/plugins/ChannelDetail/ChannelDetailListLoadingIndicator.d.ts.map +1 -0
  82. package/dist/types/plugins/ChannelDetail/ChannelDetailNavButton.d.ts +15 -0
  83. package/dist/types/plugins/ChannelDetail/ChannelDetailNavButton.d.ts.map +1 -0
  84. package/dist/types/plugins/ChannelDetail/ChannelDetailSearchInput.d.ts +8 -0
  85. package/dist/types/plugins/ChannelDetail/ChannelDetailSearchInput.d.ts.map +1 -0
  86. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigator.d.ts +52 -0
  87. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigator.d.ts.map +1 -0
  88. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.d.ts +11 -0
  89. package/dist/types/plugins/ChannelDetail/SectionNavigator/SectionNavigatorHeader.d.ts.map +1 -0
  90. package/dist/types/plugins/ChannelDetail/SectionNavigator/index.d.ts +3 -0
  91. package/dist/types/plugins/ChannelDetail/SectionNavigator/index.d.ts.map +1 -0
  92. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.d.ts +2 -0
  93. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesEmptyList.d.ts.map +1 -0
  94. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.d.ts +5 -0
  95. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.d.ts.map +1 -0
  96. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.utils.d.ts +40 -0
  97. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/ChannelFilesView.utils.d.ts.map +1 -0
  98. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/index.d.ts +5 -0
  99. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/index.d.ts.map +1 -0
  100. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/useChannelFilesSearch.d.ts +10 -0
  101. package/dist/types/plugins/ChannelDetail/Views/ChannelFilesView/useChannelFilesSearch.d.ts.map +1 -0
  102. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.d.ts +16 -0
  103. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementActions.defaults.d.ts.map +1 -0
  104. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.d.ts +20 -0
  105. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/ChannelManagementView.d.ts.map +1 -0
  106. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/index.d.ts +3 -0
  107. package/dist/types/plugins/ChannelDetail/Views/ChannelManagementView/index.d.ts.map +1 -0
  108. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.d.ts +2 -0
  109. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaEmptyList.d.ts.map +1 -0
  110. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.d.ts +8 -0
  111. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.d.ts.map +1 -0
  112. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.utils.d.ts +22 -0
  113. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/ChannelMediaView.utils.d.ts.map +1 -0
  114. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/index.d.ts +5 -0
  115. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/index.d.ts.map +1 -0
  116. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/useChannelMediaSearch.d.ts +9 -0
  117. package/dist/types/plugins/ChannelDetail/Views/ChannelMediaView/useChannelMediaSearch.d.ts.map +1 -0
  118. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.d.ts +26 -0
  119. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberActions.defaults.d.ts.map +1 -0
  120. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberDetail.d.ts +12 -0
  121. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/ChannelMemberDetail.d.ts.map +1 -0
  122. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/index.d.ts +3 -0
  123. package/dist/types/plugins/ChannelDetail/Views/ChannelMemberDetailView/index.d.ts.map +1 -0
  124. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.d.ts +7 -0
  125. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersAddView.d.ts.map +1 -0
  126. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.d.ts +6 -0
  127. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersBrowseView.d.ts.map +1 -0
  128. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.d.ts +45 -0
  129. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersHeaderActions.defaults.d.ts.map +1 -0
  130. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.d.ts +46 -0
  131. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.d.ts.map +1 -0
  132. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.utils.d.ts +8 -0
  133. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/ChannelMembersView.utils.d.ts.map +1 -0
  134. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/index.d.ts +6 -0
  135. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/index.d.ts.map +1 -0
  136. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberCount.d.ts +4 -0
  137. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberCount.d.ts.map +1 -0
  138. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberIds.d.ts +4 -0
  139. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMemberIds.d.ts.map +1 -0
  140. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMembersSearch.d.ts +12 -0
  141. package/dist/types/plugins/ChannelDetail/Views/ChannelMembersView/useChannelMembersSearch.d.ts.map +1 -0
  142. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.d.ts +2 -0
  143. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesEmptyList.d.ts.map +1 -0
  144. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesView.d.ts +9 -0
  145. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/PinnedMessagesView.d.ts.map +1 -0
  146. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/index.d.ts +4 -0
  147. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/index.d.ts.map +1 -0
  148. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesCount.d.ts +4 -0
  149. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesCount.d.ts.map +1 -0
  150. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesSearch.d.ts +16 -0
  151. package/dist/types/plugins/ChannelDetail/Views/PinnedMessagesView/usePinnedMessagesSearch.d.ts.map +1 -0
  152. package/dist/types/plugins/ChannelDetail/VirtualizedList/VirtualizedList.d.ts +28 -0
  153. package/dist/types/plugins/ChannelDetail/VirtualizedList/VirtualizedList.d.ts.map +1 -0
  154. package/dist/types/plugins/ChannelDetail/VirtualizedList/index.d.ts +2 -0
  155. package/dist/types/plugins/ChannelDetail/VirtualizedList/index.d.ts.map +1 -0
  156. package/dist/types/plugins/ChannelDetail/index.d.ts +16 -0
  157. package/dist/types/plugins/ChannelDetail/index.d.ts.map +1 -0
  158. package/dist/types/utils/index.d.ts +2 -0
  159. package/dist/types/utils/index.d.ts.map +1 -1
  160. package/dist/types/utils/isDmChannel.d.ts +6 -0
  161. package/dist/types/utils/isDmChannel.d.ts.map +1 -0
  162. package/package.json +11 -2
  163. package/dist/cjs/useNotificationApi.e9312774.js.map +0 -1
  164. package/dist/es/useNotificationApi.4be515a0.mjs.map +0 -1
@@ -0,0 +1,69 @@
1
+ import { L as useLegacyThreadContext, Lr as useStateStore, Wr as useChatContext, g as useThreadContext, qr as useChannelStateContext } from "./useNotificationApi.fa5cddf9.mjs";
2
+ import { createContext, useContext, useEffect, useMemo } from "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { MessageComposer } from "stream-chat";
5
+ //#region src/context/MessageComposerContext.tsx
6
+ var MessageComposerContext = createContext(void 0);
7
+ var MessageComposerContextProvider = ({ children, value }) => /* @__PURE__ */ jsx(MessageComposerContext.Provider, {
8
+ value,
9
+ children
10
+ });
11
+ var useMessageComposerContext = (componentName) => {
12
+ const contextValue = useContext(MessageComposerContext);
13
+ if (!contextValue) return {};
14
+ return contextValue;
15
+ };
16
+ //#endregion
17
+ //#region src/components/MessageComposer/hooks/useIsCooldownActive.ts
18
+ var cooldownTimerStateSelector = (state) => ({ isCooldownActive: !!state.cooldownRemaining });
19
+ var useIsCooldownActive = () => {
20
+ const { channel } = useChannelStateContext();
21
+ return useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector).isCooldownActive;
22
+ };
23
+ //#endregion
24
+ //#region src/components/MessageComposer/hooks/useMessageComposerController.ts
25
+ var useMessageComposerController = () => {
26
+ const { client } = useChatContext();
27
+ const { messageComposerCache: queueCache } = client;
28
+ const { channel } = useChannelStateContext();
29
+ const { legacyThread: parentMessage } = useLegacyThreadContext();
30
+ const threadInstance = useThreadContext();
31
+ const cachedParentMessage = useMemo(() => {
32
+ if (!parentMessage) return void 0;
33
+ return parentMessage;
34
+ }, [parentMessage?.id]);
35
+ const messageComposer = useMemo(() => {
36
+ if (threadInstance) return threadInstance.messageComposer;
37
+ else if (cachedParentMessage) {
38
+ const compositionContext = {
39
+ ...cachedParentMessage,
40
+ legacyThreadId: cachedParentMessage.id
41
+ };
42
+ const tag = MessageComposer.constructTag(compositionContext);
43
+ const cachedComposer = queueCache.get(tag);
44
+ if (cachedComposer) return cachedComposer;
45
+ return new MessageComposer({
46
+ client,
47
+ compositionContext
48
+ });
49
+ } else return channel.messageComposer;
50
+ }, [
51
+ cachedParentMessage,
52
+ channel,
53
+ client,
54
+ queueCache,
55
+ threadInstance
56
+ ]);
57
+ if (["legacy_thread", "message"].includes(messageComposer.contextType) && !queueCache.peek(messageComposer.tag)) queueCache.add(messageComposer.tag, messageComposer);
58
+ useEffect(() => {
59
+ const unsubscribe = messageComposer.registerSubscriptions();
60
+ return () => {
61
+ unsubscribe();
62
+ };
63
+ }, [messageComposer]);
64
+ return messageComposer;
65
+ };
66
+ //#endregion
67
+ export { useMessageComposerContext as a, MessageComposerContextProvider as i, useIsCooldownActive as n, MessageComposerContext as r, useMessageComposerController as t };
68
+
69
+ //# sourceMappingURL=useMessageComposerController.29f189b4.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMessageComposerController.29f189b4.mjs","names":[],"sources":["../../src/context/MessageComposerContext.tsx","../../src/components/MessageComposer/hooks/useIsCooldownActive.ts","../../src/components/MessageComposer/hooks/useMessageComposerController.ts"],"sourcesContent":["import React, { createContext, useContext } from 'react';\nimport type { PropsWithChildren } from 'react';\n\nimport type { MessageComposerProps } from '../components/MessageComposer';\nimport type { UseMessageComposerBindingsParams } from '../components/MessageComposer/hooks/useMessageComposerBindings';\n\nexport type MessageComposerContextValue = UseMessageComposerBindingsParams &\n Omit<MessageComposerProps, 'Input'>;\n\nexport const MessageComposerContext = createContext<\n UseMessageComposerBindingsParams | undefined\n>(undefined);\n\nexport const MessageComposerContextProvider = ({\n children,\n value,\n}: PropsWithChildren<{\n value: MessageComposerContextValue;\n}>) => (\n <MessageComposerContext.Provider\n value={value as unknown as MessageComposerContextValue}\n >\n {children}\n </MessageComposerContext.Provider>\n);\n\nexport const useMessageComposerContext = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n componentName?: string,\n) => {\n const contextValue = useContext(MessageComposerContext);\n\n if (!contextValue) {\n return {} as MessageComposerContextValue;\n }\n\n return contextValue as unknown as MessageComposerContextValue;\n};\n","import { useChannelStateContext } from '../../../context';\nimport { useStateStore } from '../../../store';\nimport type { CooldownTimerState } from 'stream-chat';\n\nconst cooldownTimerStateSelector = (state: CooldownTimerState) => ({\n isCooldownActive: !!state.cooldownRemaining,\n});\n\nexport const useIsCooldownActive = () => {\n const { channel } = useChannelStateContext();\n return useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector)\n .isCooldownActive;\n};\n","import { useEffect, useMemo } from 'react';\nimport { MessageComposer as MessageComposerController } from 'stream-chat';\nimport { useThreadContext } from '../../Threads';\nimport { useChannelStateContext, useChatContext } from '../../../context';\nimport { useLegacyThreadContext } from '../../Thread';\n\nexport const useMessageComposerController = () => {\n const { client } = useChatContext();\n const { messageComposerCache: queueCache } = client;\n const { channel } = useChannelStateContext();\n const { legacyThread: parentMessage } = useLegacyThreadContext();\n const threadInstance = useThreadContext();\n\n const cachedParentMessage = useMemo(() => {\n if (!parentMessage) return undefined;\n\n return parentMessage;\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentMessage?.id]);\n\n // composer hierarchy\n // edited message (always new) -> thread instance (own) -> thread message (always new) -> channel (own)\n // editedMessage ?? thread ?? parentMessage ?? channel;\n const messageComposer = useMemo(() => {\n if (threadInstance) {\n return threadInstance.messageComposer;\n } else if (cachedParentMessage) {\n const compositionContext = {\n ...cachedParentMessage,\n legacyThreadId: cachedParentMessage.id,\n };\n\n const tag = MessageComposerController.constructTag(compositionContext);\n\n const cachedComposer = queueCache.get(tag);\n if (cachedComposer) return cachedComposer;\n\n return new MessageComposerController({\n client,\n compositionContext,\n });\n } else {\n return channel.messageComposer;\n }\n }, [cachedParentMessage, channel, client, queueCache, threadInstance]);\n\n if (\n (['legacy_thread', 'message'] as MessageComposerController['contextType'][]).includes(\n messageComposer.contextType,\n ) &&\n !queueCache.peek(messageComposer.tag)\n ) {\n queueCache.add(messageComposer.tag, messageComposer);\n }\n\n useEffect(() => {\n const unsubscribe = messageComposer.registerSubscriptions();\n return () => {\n unsubscribe();\n };\n }, [messageComposer]);\n\n return messageComposer;\n};\n"],"mappings":";;;;;AASA,IAAa,yBAAyB,cAEpC,KAAA,CAAS;AAEX,IAAa,kCAAkC,EAC7C,UACA,YAIA,oBAAC,uBAAuB,UAAxB;CACS;CAEN;AAC8B,CAAA;AAGnC,IAAa,6BAEX,kBACG;CACH,MAAM,eAAe,WAAW,sBAAsB;CAEtD,IAAI,CAAC,cACH,OAAO,CAAC;CAGV,OAAO;AACT;;;ACjCA,IAAM,8BAA8B,WAA+B,EACjE,kBAAkB,CAAC,CAAC,MAAM,kBAC5B;AAEA,IAAa,4BAA4B;CACvC,MAAM,EAAE,YAAY,uBAAuB;CAC3C,OAAO,cAAc,QAAQ,cAAc,OAAO,0BAA0B,EACzE;AACL;;;ACNA,IAAa,qCAAqC;CAChD,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,sBAAsB,eAAe;CAC7C,MAAM,EAAE,YAAY,uBAAuB;CAC3C,MAAM,EAAE,cAAc,kBAAkB,uBAAuB;CAC/D,MAAM,iBAAiB,iBAAiB;CAExC,MAAM,sBAAsB,cAAc;EACxC,IAAI,CAAC,eAAe,OAAO,KAAA;EAE3B,OAAO;CAET,GAAG,CAAC,eAAe,EAAE,CAAC;CAKtB,MAAM,kBAAkB,cAAc;EACpC,IAAI,gBACF,OAAO,eAAe;OACjB,IAAI,qBAAqB;GAC9B,MAAM,qBAAqB;IACzB,GAAG;IACH,gBAAgB,oBAAoB;GACtC;GAEA,MAAM,MAAM,gBAA0B,aAAa,kBAAkB;GAErE,MAAM,iBAAiB,WAAW,IAAI,GAAG;GACzC,IAAI,gBAAgB,OAAO;GAE3B,OAAO,IAAI,gBAA0B;IACnC;IACA;GACF,CAAC;EACH,OACE,OAAO,QAAQ;CAEnB,GAAG;EAAC;EAAqB;EAAS;EAAQ;EAAY;CAAc,CAAC;CAErE,IACG,CAAC,iBAAiB,SAAS,EAAiD,SAC3E,gBAAgB,WAClB,KACA,CAAC,WAAW,KAAK,gBAAgB,GAAG,GAEpC,WAAW,IAAI,gBAAgB,KAAK,eAAe;CAGrD,gBAAgB;EACd,MAAM,cAAc,gBAAgB,sBAAsB;EAC1D,aAAa;GACX,YAAY;EACd;CACF,GAAG,CAAC,eAAe,CAAC;CAEpB,OAAO;AACT"}
@@ -1,18 +1,18 @@
1
1
  import React, { createContext, createElement, forwardRef, useCallback, useContext, useEffect, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
2
2
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
3
- import { ErrorFromResponse, MessageComposer, StateStore, localMessageToNewMessagePayload } from "stream-chat";
3
+ import { ErrorFromResponse, StateStore, localMessageToNewMessagePayload } from "stream-chat";
4
4
  import { nanoid } from "nanoid";
5
+ import clsx from "clsx";
5
6
  import { useSyncExternalStore } from "use-sync-external-store/shim";
6
7
  import { createPortal } from "react-dom";
7
8
  import Dayjs from "dayjs";
8
9
  import calendar from "dayjs/plugin/calendar";
9
10
  import localizedFormat from "dayjs/plugin/localizedFormat";
10
- import clsx from "clsx";
11
- import { autoPlacement, autoUpdate, flip, offset, shift, size, useFloating } from "@floating-ui/react";
12
11
  import debounce from "lodash.debounce";
13
12
  import throttle from "lodash.throttle";
14
13
  import deepequal from "react-fast-compare";
15
14
  import emojiRegex from "emoji-regex";
15
+ import { autoPlacement, autoUpdate, flip, offset, shift, size, useFloating } from "@floating-ui/react";
16
16
  import * as linkify from "linkifyjs";
17
17
  //#region src/context/ChannelActionContext.tsx
18
18
  var ChannelActionContext = React.createContext(void 0);
@@ -338,7 +338,7 @@ var Portal = ({ children, getPortalDestination, isOpen }) => {
338
338
  //#endregion
339
339
  //#region src/components/Dialog/service/DialogPortal.tsx
340
340
  var shouldCloseOnOutsideClick = ({ dialog, managerCloseOnClickOutside }) => dialog.closeOnClickOutside ?? managerCloseOnClickOutside;
341
- var DialogPortalDestination = () => {
341
+ var DialogPortalDestination = ({ captureOutsideClicks, className }) => {
342
342
  const { dialogManager } = useNearestDialogManagerContext() ?? {};
343
343
  const openedDialogCount = useOpenedDialogCount({ dialogManagerId: dialogManager?.id });
344
344
  const [destinationRoot, setDestinationRoot] = useState(null);
@@ -367,7 +367,10 @@ var DialogPortalDestination = () => {
367
367
  }, [destinationRoot, dialogManager]);
368
368
  if (!openedDialogCount) return null;
369
369
  return /* @__PURE__ */ jsx("div", {
370
- className: "str-chat__dialog-overlay",
370
+ className: clsx("str-chat__dialog-overlay", {
371
+ "str-chat__dialog-overlay--modal": dialogManager?.id === modalDialogManagerId,
372
+ "str-chat__dialog-overlay--with-outside-click-capture": captureOutsideClicks
373
+ }, className),
371
374
  "data-str-chat__portal-id": dialogManager?.id,
372
375
  "data-testid": "str-chat__dialog-overlay",
373
376
  ref: setDestinationRoot,
@@ -409,7 +412,7 @@ var DialogManagerProviderContext = React.createContext(void 0);
409
412
  /**
410
413
  * Creates/provides a dialog manager and its portal destination.
411
414
  */
412
- var DialogManagerProvider = ({ children, closeOnClickOutside, id }) => {
415
+ var DialogManagerProvider = ({ children, closeOnClickOutside, id, portalDestinationProps }) => {
413
416
  const [dialogManager, setDialogManager] = useState(() => {
414
417
  if (id) return getDialogManager(id) ?? null;
415
418
  return new DialogManager({ closeOnClickOutside });
@@ -428,7 +431,7 @@ var DialogManagerProvider = ({ children, closeOnClickOutside, id }) => {
428
431
  if (!dialogManager) return null;
429
432
  return /* @__PURE__ */ jsxs(DialogManagerProviderContext.Provider, {
430
433
  value: { dialogManager },
431
- children: [children, /* @__PURE__ */ jsx(DialogPortalDestination, {})]
434
+ children: [children, /* @__PURE__ */ jsx(DialogPortalDestination, { ...portalDestinationProps })]
432
435
  });
433
436
  };
434
437
  var getManagerFromStore = ({ dialogId, dialogManagerId, newState, previousState }) => {
@@ -498,18 +501,6 @@ var ModalDialogManagerProvider = ({ children }) => /* @__PURE__ */ jsx(DialogMan
498
501
  var useModalDialogManager = () => useMemo(() => getDialogManager(modalDialogManagerId), []);
499
502
  var useNearestDialogManagerContext = () => useContext(DialogManagerProviderContext);
500
503
  //#endregion
501
- //#region src/context/MessageComposerContext.tsx
502
- var MessageComposerContext = createContext(void 0);
503
- var MessageComposerContextProvider = ({ children, value }) => /* @__PURE__ */ jsx(MessageComposerContext.Provider, {
504
- value,
505
- children
506
- });
507
- var useMessageComposerContext = (componentName) => {
508
- const contextValue = useContext(MessageComposerContext);
509
- if (!contextValue) return {};
510
- return contextValue;
511
- };
512
- //#endregion
513
504
  //#region src/i18n/utils.ts
514
505
  var isNumberOrString = (output) => typeof output === "string" || typeof output === "number";
515
506
  var isDayOrMoment = (output) => !!output?.isSame;
@@ -709,50 +700,20 @@ var isNotificationForPanel = (notification, panel, options) => {
709
700
  return (options?.fallbackPanel ?? "channel") === panel;
710
701
  };
711
702
  //#endregion
712
- //#region src/components/Dialog/hooks/usePopoverPosition.ts
713
- var hasResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
714
- function autoMiddlewareFor(p) {
715
- if (!String(p).startsWith("auto")) return null;
716
- return autoPlacement({ alignment: p === "auto-start" ? "start" : p === "auto-end" ? "end" : void 0 });
717
- }
718
- function toOffsetMw(opt) {
719
- if (opt == null) return null;
720
- if (Array.isArray(opt)) {
721
- const [crossAxis, mainAxis] = opt;
722
- return offset({
723
- crossAxis,
724
- mainAxis
725
- });
726
- }
727
- if (typeof opt === "number") return offset(opt);
728
- return offset(opt);
729
- }
730
- function usePopoverPosition({ allowFlip = true, allowShift = true, autoUpdateOptions, fitAvailableSpace = false, freeze = false, offset, placement = "bottom-start", shiftOptions }) {
731
- const autoMw = autoMiddlewareFor(placement);
732
- const offsetMiddleware = toOffsetMw(offset);
733
- const isSidePlacement = placement.startsWith("left") || placement.startsWith("right");
734
- const mergedShiftOptions = shiftOptions ? {
735
- padding: 8,
736
- ...shiftOptions
737
- } : { padding: 8 };
738
- return useFloating({
739
- middleware: [
740
- ...offsetMiddleware ? [offsetMiddleware] : [],
741
- ...autoMw ? [autoMw] : allowFlip && !isSidePlacement ? [flip()] : [],
742
- ...allowShift ? [shift(mergedShiftOptions)] : [],
743
- ...fitAvailableSpace ? [size({ apply: () => {} })] : []
744
- ],
745
- placement: String(placement).startsWith("auto") ? "bottom" : placement,
746
- strategy: "fixed",
747
- whileElementsMounted: freeze ? void 0 : (reference, floating, update) => autoUpdate(reference, floating, update, {
748
- ancestorResize: true,
749
- ancestorScroll: true,
750
- animationFrame: false,
751
- elementResize: hasResizeObserver,
752
- ...autoUpdateOptions
753
- })
754
- });
755
- }
703
+ //#region src/components/UtilityComponents/useStableId.ts
704
+ var reactUseId = React.useId;
705
+ var stripUseIdWrappers = (id) => id.replace(/[:«»]/g, "");
706
+ /**
707
+ * Returns a stable, unique string id.
708
+ *
709
+ * On React 18+ this delegates to `React.useId()` (with the surrounding wrapper
710
+ * characters stripped so the value is safe to use anywhere an HTML id is expected)
711
+ * and is SSR-stable. On React 17, it falls back to a client-only id generated via `nanoid`.
712
+ */
713
+ var useStableId = () => {
714
+ if (reactUseId) return stripUseIdWrappers(reactUseId());
715
+ return useMemo(() => nanoid(), []);
716
+ };
756
717
  //#endregion
757
718
  //#region src/components/Button/Button.tsx
758
719
  var variantToClass = {
@@ -1089,6 +1050,14 @@ var IconMore = createIcon("IconMore", /* @__PURE__ */ jsxs(Fragment$1, { childre
1089
1050
  /* @__PURE__ */ jsx("path", { d: "M4.6875 11.25C5.37786 11.25 5.9375 10.6904 5.9375 10C5.9375 9.30964 5.37786 8.75 4.6875 8.75C3.99714 8.75 3.4375 9.30964 3.4375 10C3.4375 10.6904 3.99714 11.25 4.6875 11.25Z" }),
1090
1051
  /* @__PURE__ */ jsx("path", { d: "M15.3125 11.25C16.0029 11.25 16.5625 10.6904 16.5625 10C16.5625 9.30964 16.0029 8.75 15.3125 8.75C14.6221 8.75 14.0625 9.30964 14.0625 10C14.0625 10.6904 14.6221 11.25 15.3125 11.25Z" })
1091
1052
  ] }));
1053
+ var IconMenu = createIcon("IconMenu", /* @__PURE__ */ jsx("path", {
1054
+ d: "M3.125 5H16.875M3.125 10H16.875M3.125 15H16.875",
1055
+ fill: "none",
1056
+ stroke: "currentColor",
1057
+ strokeLinecap: "round",
1058
+ strokeLinejoin: "round",
1059
+ strokeWidth: "1.5"
1060
+ }));
1092
1061
  var IconReorder = createIcon("IconReorder", /* @__PURE__ */ jsx("path", { d: "M8.875 15.3125C8.875 16.2445 8.11948 17 7.1875 17C6.25552 17 5.5 16.2445 5.5 15.3125C5.5 14.3805 6.25552 13.625 7.1875 13.625C8.11948 13.625 8.875 14.3805 8.875 15.3125ZM14.5 15.3125C14.5 16.2445 13.7445 17 12.8125 17C11.8805 17 11.125 16.2445 11.125 15.3125C11.125 14.3805 11.8805 13.625 12.8125 13.625C13.7445 13.625 14.5 14.3805 14.5 15.3125ZM8.875 10C8.875 10.932 8.11948 11.6875 7.1875 11.6875C6.25552 11.6875 5.5 10.932 5.5 10C5.5 9.06802 6.25552 8.3125 7.1875 8.3125C8.11948 8.3125 8.875 9.06802 8.875 10ZM14.5 10C14.5 10.932 13.7445 11.6875 12.8125 11.6875C11.8805 11.6875 11.125 10.932 11.125 10C11.125 9.06802 11.8805 8.3125 12.8125 8.3125C13.7445 8.3125 14.5 9.06802 14.5 10ZM8.875 4.6875C8.875 5.61948 8.11948 6.375 7.1875 6.375C6.25552 6.375 5.5 5.61948 5.5 4.6875C5.5 3.75552 6.25552 3 7.1875 3C8.11948 3 8.875 3.75552 8.875 4.6875ZM14.5 4.6875C14.5 5.61948 13.7445 6.375 12.8125 6.375C11.8805 6.375 11.125 5.61948 11.125 4.6875C11.125 3.75552 11.8805 3 12.8125 3C13.7445 3 14.5 3.75552 14.5 4.6875Z" }));
1093
1062
  var IconChecks = createIcon("IconChecks", /* @__PURE__ */ jsx("path", {
1094
1063
  d: "M1.5 10.5724L4.98387 13.9936L13.1129 6.00977M10.371 13.9936L18.5 6.00977",
@@ -1175,6 +1144,10 @@ var IconFlag = createIcon("IconFlag", /* @__PURE__ */ jsx("path", {
1175
1144
  strokeLinejoin: "round",
1176
1145
  strokeWidth: "1.5"
1177
1146
  }));
1147
+ var IconFolder = createIcon("IconFolder", /* @__PURE__ */ jsx("path", {
1148
+ d: "M3.25 15.5H16.75V7H10C9.83774 7 9.67962 6.94696 9.5498 6.84961L7.25098 5.125H3.25V15.5ZM18.25 15.6943C18.25 16.0406 18.112 16.3724 17.8672 16.6172C17.6224 16.862 17.2906 17 16.9443 17H3.125C2.76033 17 2.41021 16.8555 2.15234 16.5977C1.89448 16.3398 1.75 15.9897 1.75 15.625V5C1.75 4.63533 1.89448 4.28521 2.15234 4.02734L2.25391 3.93652C2.49856 3.73611 2.80597 3.625 3.125 3.625H7.29102C7.58852 3.625 7.8782 3.72189 8.11621 3.90039L10.25 5.5H16.875C17.194 5.5 17.5014 5.61111 17.7461 5.81152L17.8477 5.90234L17.9385 6.00391C18.1389 6.24856 18.25 6.55597 18.25 6.875V15.6943Z",
1149
+ fill: "currentColor"
1150
+ }));
1178
1151
  var IconImage = createIcon("IconImage", /* @__PURE__ */ jsx("path", {
1179
1152
  d: "M4.42891 16.875L12.9953 8.30781C13.0534 8.2497 13.1223 8.2036 13.1982 8.17215C13.274 8.1407 13.3554 8.12451 13.4375 8.12451C13.5196 8.12451 13.601 8.1407 13.6768 8.17215C13.7527 8.2036 13.8216 8.2497 13.8797 8.30781L16.875 11.3039M3.75 3.125H16.25C16.5952 3.125 16.875 3.40482 16.875 3.75V16.25C16.875 16.5952 16.5952 16.875 16.25 16.875H3.75C3.40482 16.875 3.125 16.5952 3.125 16.25V3.75C3.125 3.40482 3.40482 3.125 3.75 3.125ZM8.75 7.5C8.75 8.19036 8.19036 8.75 7.5 8.75C6.80964 8.75 6.25 8.19036 6.25 7.5C6.25 6.80964 6.80964 6.25 7.5 6.25C8.19036 6.25 8.75 6.80964 8.75 7.5Z",
1180
1153
  fill: "none",
@@ -1183,6 +1156,20 @@ var IconImage = createIcon("IconImage", /* @__PURE__ */ jsx("path", {
1183
1156
  strokeLinejoin: "round",
1184
1157
  strokeWidth: "1.5"
1185
1158
  }));
1159
+ var IconInfo = createIcon("IconInfo", /* @__PURE__ */ jsxs(Fragment$1, { children: [
1160
+ /* @__PURE__ */ jsx("path", {
1161
+ d: "M16.75 10C16.75 6.27208 13.7279 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 10ZM18.25 10C18.25 14.5563 14.5563 18.25 10 18.25C5.44365 18.25 1.75 14.5563 1.75 10C1.75 5.44365 5.44365 1.75 10 1.75C14.5563 1.75 18.25 5.44365 18.25 10Z",
1162
+ fill: "currentColor"
1163
+ }),
1164
+ /* @__PURE__ */ jsx("path", {
1165
+ d: "M10.75 13.0107C11.1047 13.0703 11.375 13.3784 11.375 13.75C11.375 14.1642 11.0392 14.5 10.625 14.5C10.2603 14.5 9.91021 14.3555 9.65234 14.0977C9.39448 13.8398 9.25 13.4897 9.25 13.125V10.1133C8.89539 10.0537 8.625 9.74655 8.625 9.375C8.625 8.96079 8.96079 8.625 9.375 8.625C9.69403 8.625 10.0014 8.73611 10.2461 8.93652L10.3477 9.02734L10.4385 9.12891C10.6389 9.37356 10.75 9.68097 10.75 10V13.0107Z",
1166
+ fill: "currentColor"
1167
+ }),
1168
+ /* @__PURE__ */ jsx("path", {
1169
+ d: "M9.6875 7.5C10.2053 7.5 10.625 7.08027 10.625 6.5625C10.625 6.04473 10.2053 5.625 9.6875 5.625C9.16973 5.625 8.75 6.04473 8.75 6.5625C8.75 7.08027 9.16973 7.5 9.6875 7.5Z",
1170
+ fill: "currentColor"
1171
+ })
1172
+ ] }));
1186
1173
  var IconSearch = createIcon("IconSearch", /* @__PURE__ */ jsx("path", {
1187
1174
  d: "M13.1695 13.1695L17.5 17.5M15 8.75C15 12.2018 12.2018 15 8.75 15C5.29822 15 2.5 12.2018 2.5 8.75C2.5 5.29822 5.29822 2.5 8.75 2.5C12.2018 2.5 15 5.29822 15 8.75Z",
1188
1175
  fill: "none",
@@ -1494,21 +1481,6 @@ var IconGiphy = createIcon("IconGiphy", /* @__PURE__ */ jsxs(Fragment$1, { child
1494
1481
  })
1495
1482
  ] }));
1496
1483
  //#endregion
1497
- //#region src/components/UtilityComponents/useStableId.ts
1498
- var reactUseId = React.useId;
1499
- var stripUseIdWrappers = (id) => id.replace(/[:«»]/g, "");
1500
- /**
1501
- * Returns a stable, unique string id.
1502
- *
1503
- * On React 18+ this delegates to `React.useId()` (with the surrounding wrapper
1504
- * characters stripped so the value is safe to use anywhere an HTML id is expected)
1505
- * and is SSR-stable. On React 17, it falls back to a client-only id generated via `nanoid`.
1506
- */
1507
- var useStableId = () => {
1508
- if (reactUseId) return stripUseIdWrappers(reactUseId());
1509
- return useMemo(() => nanoid(), []);
1510
- };
1511
- //#endregion
1512
1484
  //#region src/components/EmptyStateIndicator/EmptyStateIndicator.tsx
1513
1485
  var UnMemoizedEmptyStateIndicator = (props) => {
1514
1486
  const { listType, messageText } = props;
@@ -2083,6 +2055,51 @@ var isMessageBlocked = (message) => message.shadowed || message.type === "error"
2083
2055
  var isMessageDeleted = (message) => Boolean(message.deleted_at || message.type === "deleted" || message.deleted_for_me);
2084
2056
  var isMessageEdited = (message) => !!message.message_text_updated_at;
2085
2057
  //#endregion
2058
+ //#region src/components/Dialog/hooks/usePopoverPosition.ts
2059
+ var hasResizeObserver = typeof window !== "undefined" && "ResizeObserver" in window;
2060
+ function autoMiddlewareFor(p) {
2061
+ if (!String(p).startsWith("auto")) return null;
2062
+ return autoPlacement({ alignment: p === "auto-start" ? "start" : p === "auto-end" ? "end" : void 0 });
2063
+ }
2064
+ function toOffsetMw(opt) {
2065
+ if (opt == null) return null;
2066
+ if (Array.isArray(opt)) {
2067
+ const [crossAxis, mainAxis] = opt;
2068
+ return offset({
2069
+ crossAxis,
2070
+ mainAxis
2071
+ });
2072
+ }
2073
+ if (typeof opt === "number") return offset(opt);
2074
+ return offset(opt);
2075
+ }
2076
+ function usePopoverPosition({ allowFlip = true, allowShift = true, autoUpdateOptions, fitAvailableSpace = false, freeze = false, offset, placement = "bottom-start", shiftOptions }) {
2077
+ const autoMw = autoMiddlewareFor(placement);
2078
+ const offsetMiddleware = toOffsetMw(offset);
2079
+ const isSidePlacement = placement.startsWith("left") || placement.startsWith("right");
2080
+ const mergedShiftOptions = shiftOptions ? {
2081
+ padding: 8,
2082
+ ...shiftOptions
2083
+ } : { padding: 8 };
2084
+ return useFloating({
2085
+ middleware: [
2086
+ ...offsetMiddleware ? [offsetMiddleware] : [],
2087
+ ...autoMw ? [autoMw] : allowFlip && !isSidePlacement ? [flip()] : [],
2088
+ ...allowShift ? [shift(mergedShiftOptions)] : [],
2089
+ ...fitAvailableSpace ? [size({ apply: () => {} })] : []
2090
+ ],
2091
+ placement: String(placement).startsWith("auto") ? "bottom" : placement,
2092
+ strategy: "fixed",
2093
+ whileElementsMounted: freeze ? void 0 : (reference, floating, update) => autoUpdate(reference, floating, update, {
2094
+ ancestorResize: true,
2095
+ ancestorScroll: true,
2096
+ animationFrame: false,
2097
+ elementResize: hasResizeObserver,
2098
+ ...autoUpdateOptions
2099
+ })
2100
+ });
2101
+ }
2102
+ //#endregion
2086
2103
  //#region src/components/Thread/LegacyThreadContext.ts
2087
2104
  var LegacyThreadContext = React.createContext({ legacyThread: void 0 });
2088
2105
  var useLegacyThreadContext = () => useContext(LegacyThreadContext);
@@ -2732,56 +2749,6 @@ var useActiveAudioPlayer = () => {
2732
2749
  return activeAudioPlayer;
2733
2750
  };
2734
2751
  //#endregion
2735
- //#region src/components/MessageComposer/hooks/useIsCooldownActive.ts
2736
- var cooldownTimerStateSelector = (state) => ({ isCooldownActive: !!state.cooldownRemaining });
2737
- var useIsCooldownActive = () => {
2738
- const { channel } = useChannelStateContext();
2739
- return useStateStore(channel.cooldownTimer.state, cooldownTimerStateSelector).isCooldownActive;
2740
- };
2741
- //#endregion
2742
- //#region src/components/MessageComposer/hooks/useMessageComposerController.ts
2743
- var useMessageComposerController = () => {
2744
- const { client } = useChatContext();
2745
- const { messageComposerCache: queueCache } = client;
2746
- const { channel } = useChannelStateContext();
2747
- const { legacyThread: parentMessage } = useLegacyThreadContext();
2748
- const threadInstance = useThreadContext();
2749
- const cachedParentMessage = useMemo(() => {
2750
- if (!parentMessage) return void 0;
2751
- return parentMessage;
2752
- }, [parentMessage?.id]);
2753
- const messageComposer = useMemo(() => {
2754
- if (threadInstance) return threadInstance.messageComposer;
2755
- else if (cachedParentMessage) {
2756
- const compositionContext = {
2757
- ...cachedParentMessage,
2758
- legacyThreadId: cachedParentMessage.id
2759
- };
2760
- const tag = MessageComposer.constructTag(compositionContext);
2761
- const cachedComposer = queueCache.get(tag);
2762
- if (cachedComposer) return cachedComposer;
2763
- return new MessageComposer({
2764
- client,
2765
- compositionContext
2766
- });
2767
- } else return channel.messageComposer;
2768
- }, [
2769
- cachedParentMessage,
2770
- channel,
2771
- client,
2772
- queueCache,
2773
- threadInstance
2774
- ]);
2775
- if (["legacy_thread", "message"].includes(messageComposer.contextType) && !queueCache.peek(messageComposer.tag)) queueCache.add(messageComposer.tag, messageComposer);
2776
- useEffect(() => {
2777
- const unsubscribe = messageComposer.registerSubscriptions();
2778
- return () => {
2779
- unsubscribe();
2780
- };
2781
- }, [messageComposer]);
2782
- return messageComposer;
2783
- };
2784
- //#endregion
2785
2752
  //#region src/constants/messageTypes.ts
2786
2753
  var CUSTOM_MESSAGE_TYPE = {
2787
2754
  date: "message.date",
@@ -4110,16 +4077,16 @@ var useNotificationTarget = () => {
4110
4077
  };
4111
4078
  //#endregion
4112
4079
  //#region src/components/Notifications/hooks/useNotificationApi.ts
4113
- var modalDialogIsOpenSelector = ({ dialogsById }) => ({ isOpen: !!dialogsById[modalDialogId]?.isOpen });
4080
+ var modalDialogManagerStateSelector = ({ dialogsById, openedDialogIds }) => ({ hasOpenDialog: openedDialogIds ? openedDialogIds.length > 0 : Object.values(dialogsById).some((dialog) => dialog.isOpen) });
4114
4081
  /** Tag used for full-width system banners (e.g. connection status). Excluded from `NotificationList` by default. */
4115
4082
  var SYSTEM_NOTIFICATION_TAG = "system";
4116
4083
  var hasSystemNotificationTag = (notification) => notification.tags?.includes("system") ?? false;
4117
- var getTargetTags = (targetPanels, inferredPanel, tags, modalIsOpen) => {
4084
+ var getTargetTags = (targetPanels, inferredPanel, tags, modalManagerHasOpenDialog) => {
4118
4085
  if (targetPanels) {
4119
- const effectiveTargetPanels = modalIsOpen && targetPanels.length > 0 ? [...targetPanels, "modal"] : targetPanels;
4086
+ const effectiveTargetPanels = modalManagerHasOpenDialog && targetPanels.length > 0 ? [...targetPanels, "modal"] : targetPanels;
4120
4087
  return Array.from(new Set([...effectiveTargetPanels.map(getNotificationTargetTag), ...tags ?? []]));
4121
4088
  }
4122
- if (modalIsOpen) return Array.from(new Set([
4089
+ if (modalManagerHasOpenDialog) return Array.from(new Set([
4123
4090
  ...inferredPanel ? [getNotificationTargetTag(inferredPanel)] : [],
4124
4091
  getNotificationTargetTag("modal"),
4125
4092
  ...tags ?? []
@@ -4140,10 +4107,10 @@ var getTypeFromIncident = ({ incident, severity, type }) => {
4140
4107
  var useNotificationApi = () => {
4141
4108
  const { client } = useChatContext();
4142
4109
  const inferredPanel = useNotificationTarget();
4143
- const modalIsOpen = useStateStore(useModalDialogManager()?.state, modalDialogIsOpenSelector)?.isOpen ?? false;
4110
+ const modalManagerHasOpenDialog = useStateStore(useModalDialogManager()?.state, modalDialogManagerStateSelector)?.hasOpenDialog ?? false;
4144
4111
  return {
4145
4112
  addNotification: useCallback(({ actions, context, duration, emitter, error, incident, message, severity, tags, targetPanels, type }) => {
4146
- const notificationTags = getTargetTags(targetPanels, inferredPanel, tags, modalIsOpen);
4113
+ const notificationTags = getTargetTags(targetPanels, inferredPanel, tags, modalManagerHasOpenDialog);
4147
4114
  const resolvedType = getTypeFromIncident({
4148
4115
  incident,
4149
4116
  severity,
@@ -4169,7 +4136,7 @@ var useNotificationApi = () => {
4169
4136
  }, [
4170
4137
  client,
4171
4138
  inferredPanel,
4172
- modalIsOpen
4139
+ modalManagerHasOpenDialog
4173
4140
  ]),
4174
4141
  addSystemNotification: useCallback(({ actions, context, duration, emitter, error, incident, message, severity, tags, type }) => {
4175
4142
  const notificationTags = Array.from(new Set([SYSTEM_NOTIFICATION_TAG, ...tags ?? []]));
@@ -4205,6 +4172,6 @@ var useNotificationApi = () => {
4205
4172
  };
4206
4173
  };
4207
4174
  //#endregion
4208
- export { isMessageEdited as $, getNotificationTargetPanel as $n, ChannelActionContext as $r, IconFlag as $t, useMessageComposerController as A, IconShield as An, modalDialogId as Ar, IconBookmark as At, ACTIONS_NOT_WORKING_IN_THREAD as B, IconUserCheck as Bn, DialogManager as Br, IconCommand as Bt, insertIntro as C, IconQuote as Cn, modalDialogManagerId as Cr, IconArrowUp as Ct, makeDateMessageId as D, IconRetry as Dn, DialogPortalDestination as Dr, IconBell as Dt, isLocalMessage as E, IconReply as En, useNearestDialogManagerContext as Er, IconAudio as Et, AudioPlayer as F, IconUnpin as Fn, useModalDialog as Fr, IconChecks as Ft, countEmojis as G, IconVoice as Gn, ChatProvider as Gr, IconEmoji as Gt, OPTIONAL_MESSAGE_ACTIONS as H, IconUsers as Hn, ComponentProvider as Hr, IconDelete as Ht, defaultRegisterAudioPlayerError as I, IconUnsupportedAttachment as In, useModalDialogIsOpen as Ir, IconChevronDown as It, getNonImageAttachments as J, IconXmarkSmall as Jn, ChannelStateProvider as Jr, IconExclamationMark as Jt, getImages as K, IconXCircle as Kn, useChatContext as Kr, IconEmojiAdd as Kt, elementIsPlaying as L, IconUpload as Ln, useModalDialogIsTopmost as Lr, IconChevronLeft as Lt, WithAudioPlayback as M, IconThreadFill as Mn, useDialogIsOpen as Mr, IconCamera as Mt, useActiveAudioPlayer as N, IconTranslate as Nn, useDialogIsTopmost as Nr, IconCheckmark as Nt, makeIntroMessage as O, IconSearch as On, DialogPortalEntry as Or, IconBellOff as Ot, useAudioPlayer as P, IconTrophy as Pn, useDialogOnNearestManager as Pr, IconCheckmark1Small as Pt, isMessageDeleted as Q, addNotificationTargetTag as Qn, useChannelListContext as Qr, IconFile as Qt, LegacyThreadContext as R, IconUser as Rn, useOpenedDialogCount as Rr, IconChevronRight as Rt, hasMoreMessagesProbably as S, IconPoll as Sn, ModalDialogManagerProvider as Sr, IconArrowLeft as St, isIntroMessage as T, IconReorder as Tn, useModalDialogManager as Tr, IconAttachment as Tt, areMessagePropsEqual as U, IconVideo as Un, useComponentContext as Ur, IconDownload as Ut, MESSAGE_ACTIONS as V, IconUserRemove as Vn, ComponentContext as Vr, IconCopy as Vt, areMessageUIPropsEqual as W, IconVideoFill as Wn, ChatContext as Wr, IconEdit as Wt, isMessageBlocked as X, Button as Xn, ChannelListContext as Xr, IconExclamationTriangleFill as Xt, getReadByTooltipText as Y, createIcon as Yn, useChannelStateContext as Yr, IconExclamationMarkFill as Yt, isMessageBounced as Z, usePopoverPosition as Zn, ChannelListContextProvider as Zr, IconEyeFill as Zt, Channel as _, IconPauseFill as _n, predefinedFormatters as _r, EmptyStateIndicator as _t, ChatView as a, IconLocation as an, TypingProvider as ar, messageHasGiphyAttachment as at, getIsFirstUnreadMessage as b, IconPlus as bn, useMessageComposerContext as br, IconArrowDown as bt, ChatViewSelectorButton as c, IconMessageBubbleFill as cn, TranslationProvider as cr, messageHasSingleAttachment as ct, useActiveThread as d, IconMinus as dn, defaultTranslatorFunction as dr, EMOJI_REGEX as dt, ChannelActionProvider as ei, IconGiphy as en, getNotificationTargetPanels as er, isMessageErrorRetryable as et, useChatViewContext as f, IconMinusCircle as fn, getDateString as fr, CHANNEL_CONTAINER_ID as ft, useThreadContext as g, IconNotification as gn, isNumberOrString as gr, useEditMessageHandler as gt, ThreadProvider as h, IconNoSign as hn, isLanguageSupported as hr, useMentionsHandlers as ht, useNotificationTarget as i, IconLoading as in, TypingContext as ir, messageHasAttachments as it, useIsCooldownActive as j, IconThread as jn, useDialog as jr, IconBookmarkRemove as jt, processMessages as k, IconSend as kn, Portal as kr, IconBolt as kt, ChatViewThreadsSelectorButton as l, IconMessageBubbles as ln, useTranslationContext as lr, messageTextHasEmojisOnly as lt, ThreadContext as m, IconMute as mn, isDayOrMoment as mr, LoadingChannel as mt, hasSystemNotificationTag as n, IconLeave as nn, isNotificationForPanel as nr, isUserMuted as nt, ChatViewChannelsSelectorButton as o, IconMegaphone as on, useTypingContext as or, messageHasQuotedMessage as ot, useThreadsViewContext as p, IconMore as pn, isDate as pr, LoadingErrorIndicator as pt, getMessageActions as q, IconXmark as qn, ChannelStateContext as qr, IconExclamationCircleFill as qt, useNotificationApi as r, IconLink as rn, isNotificationTargetPanel as rr, mapToUserNameOrId as rt, ChatViewContext as s, IconMessageBubble as sn, TranslationContext as sr, messageHasReactions as st, SYSTEM_NOTIFICATION_TAG as t, useChannelActionContext as ti, IconImage as tn, getNotificationTargetTag as tr, isNetworkSendFailure as tt, defaultChatViewSelectorItemSet as u, IconMicrophoneSolid as un, defaultDateTimeParser as ur, validateAndGetMessage as ut, getChannel as v, IconPin as vn, MessageComposerContext as vr, useStableId as vt, isDateSeparatorMessage as w, IconRefresh as wn, useDialogManager as wr, IconArrowUpRight as wt, getLastReceived as x, IconPlusSmall as xn, DialogManagerProvider as xr, IconArrowDownCircle as xt, getGroupStyles as y, IconPlayFill as yn, MessageComposerContextProvider as yr, IconArchive as yt, useLegacyThreadContext as z, IconUserAdd as zn, useStateStore as zr, IconClock as zt };
4175
+ export { isMessageErrorRetryable as $, addNotificationTargetTag as $n, useChannelActionContext as $r, IconGiphy as $t, WithAudioPlayback as A, IconSend as An, useDialogIsOpen as Ar, IconCamera as At, MESSAGE_ACTIONS as B, IconUserAdd as Bn, ComponentProvider as Br, IconDelete as Bt, insertIntro as C, IconPoll as Cn, useModalDialogManager as Cr, IconAttachment as Ct, makeDateMessageId as D, IconReply as Dn, Portal as Dr, IconBolt as Dt, isLocalMessage as E, IconReorder as En, DialogPortalEntry as Er, IconBellOff as Et, elementIsPlaying as F, IconTrophy as Fn, useModalDialogIsTopmost as Fr, IconChevronLeft as Ft, getImages as G, IconVideoFill as Gn, ChannelStateContext as Gr, IconExclamationCircleFill as Gt, areMessagePropsEqual as H, IconUserRemove as Hn, ChatContext as Hr, IconEdit as Ht, LegacyThreadContext as I, IconUnpin as In, useOpenedDialogCount as Ir, IconChevronRight as It, getReadByTooltipText as J, IconXmark as Jn, ChannelListContext as Jr, IconExclamationTriangleFill as Jt, getMessageActions as K, IconVoice as Kn, ChannelStateProvider as Kr, IconExclamationMark as Kt, useLegacyThreadContext as L, IconUnsupportedAttachment as Ln, useStateStore as Lr, IconClock as Lt, useAudioPlayer as M, IconThread as Mn, useDialogOnNearestManager as Mr, IconCheckmark1Small as Mt, AudioPlayer as N, IconThreadFill as Nn, useModalDialog as Nr, IconChecks as Nt, makeIntroMessage as O, IconRetry as On, modalDialogId as Or, IconBookmark as Ot, defaultRegisterAudioPlayerError as P, IconTranslate as Pn, useModalDialogIsOpen as Pr, IconChevronDown as Pt, isMessageEdited as Q, useStableId as Qn, ChannelActionProvider as Qr, IconFolder as Qt, usePopoverPosition as R, IconUpload as Rn, DialogManager as Rr, IconCommand as Rt, hasMoreMessagesProbably as S, IconPlusSmall as Sn, useDialogManager as Sr, IconArrowUpRight as St, isIntroMessage as T, IconRefresh as Tn, DialogPortalDestination as Tr, IconBell as Tt, areMessageUIPropsEqual as U, IconUsers as Un, ChatProvider as Ur, IconEmoji as Ut, OPTIONAL_MESSAGE_ACTIONS as V, IconUserCheck as Vn, useComponentContext as Vr, IconDownload as Vt, countEmojis as W, IconVideo as Wn, useChatContext as Wr, IconEmojiAdd as Wt, isMessageBounced as X, createIcon as Xn, useChannelListContext as Xr, IconFile as Xt, isMessageBlocked as Y, IconXmarkSmall as Yn, ChannelListContextProvider as Yr, IconEyeFill as Yt, isMessageDeleted as Z, Button as Zn, ChannelActionContext as Zr, IconFlag as Zt, Channel as _, IconNotification as _n, isNumberOrString as _r, IconArchive as _t, ChatView as a, IconLocation as an, TypingContext as ar, messageHasQuotedMessage as at, getIsFirstUnreadMessage as b, IconPlayFill as bn, ModalDialogManagerProvider as br, IconArrowLeft as bt, ChatViewSelectorButton as c, IconMessageBubble as cn, TranslationContext as cr, messageTextHasEmojisOnly as ct, useActiveThread as d, IconMicrophoneSolid as dn, defaultDateTimeParser as dr, CHANNEL_CONTAINER_ID as dt, IconImage as en, getNotificationTargetPanel as er, isNetworkSendFailure as et, useChatViewContext as f, IconMinus as fn, defaultTranslatorFunction as fr, LoadingErrorIndicator as ft, useThreadContext as g, IconNoSign as gn, isLanguageSupported as gr, EmptyStateIndicator as gt, ThreadProvider as h, IconMute as hn, isDayOrMoment as hr, useEditMessageHandler as ht, useNotificationTarget as i, IconLoading as in, isNotificationTargetPanel as ir, messageHasGiphyAttachment as it, useActiveAudioPlayer as j, IconShield as jn, useDialogIsTopmost as jr, IconCheckmark as jt, processMessages as k, IconSearch as kn, useDialog as kr, IconBookmarkRemove as kt, ChatViewThreadsSelectorButton as l, IconMessageBubbleFill as ln, TranslationProvider as lr, validateAndGetMessage as lt, ThreadContext as m, IconMore as mn, isDate as mr, useMentionsHandlers as mt, hasSystemNotificationTag as n, IconLeave as nn, getNotificationTargetTag as nr, mapToUserNameOrId as nt, ChatViewChannelsSelectorButton as o, IconMegaphone as on, TypingProvider as or, messageHasReactions as ot, useThreadsViewContext as p, IconMinusCircle as pn, getDateString as pr, LoadingChannel as pt, getNonImageAttachments as q, IconXCircle as qn, useChannelStateContext as qr, IconExclamationMarkFill as qt, useNotificationApi as r, IconLink as rn, isNotificationForPanel as rr, messageHasAttachments as rt, ChatViewContext as s, IconMenu as sn, useTypingContext as sr, messageHasSingleAttachment as st, SYSTEM_NOTIFICATION_TAG as t, IconInfo as tn, getNotificationTargetPanels as tr, isUserMuted as tt, defaultChatViewSelectorItemSet as u, IconMessageBubbles as un, useTranslationContext as ur, EMOJI_REGEX as ut, getChannel as v, IconPauseFill as vn, predefinedFormatters as vr, IconArrowDown as vt, isDateSeparatorMessage as w, IconQuote as wn, useNearestDialogManagerContext as wr, IconAudio as wt, getLastReceived as x, IconPlus as xn, modalDialogManagerId as xr, IconArrowUp as xt, getGroupStyles as y, IconPin as yn, DialogManagerProvider as yr, IconArrowDownCircle as yt, ACTIONS_NOT_WORKING_IN_THREAD as z, IconUser as zn, ComponentContext as zr, IconCopy as zt };
4209
4176
 
4210
- //# sourceMappingURL=useNotificationApi.4be515a0.mjs.map
4177
+ //# sourceMappingURL=useNotificationApi.fa5cddf9.mjs.map