stream-chat-react 13.6.2 → 13.6.4
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.
- package/dist/components/Channel/Channel.js +1 -2
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/Loading/index.d.ts +1 -0
- package/dist/components/Loading/index.js +1 -0
- package/dist/components/Message/MessageOptions.js +7 -2
- package/dist/components/MessageActions/MessageActions.js +2 -1
- package/dist/components/Reactions/ReactionSelectorWithButton.js +3 -2
- package/dist/experimental/index.browser.cjs +3 -2
- package/dist/experimental/index.browser.cjs.map +2 -2
- package/dist/experimental/index.node.cjs +3 -2
- package/dist/experimental/index.node.cjs.map +2 -2
- package/dist/i18n/Streami18n.d.ts +3 -0
- package/dist/i18n/de.json +3 -0
- package/dist/i18n/en.json +3 -0
- package/dist/i18n/es.json +3 -0
- package/dist/i18n/fr.json +3 -0
- package/dist/i18n/hi.json +3 -0
- package/dist/i18n/it.json +3 -0
- package/dist/i18n/ja.json +3 -0
- package/dist/i18n/ko.json +3 -0
- package/dist/i18n/nl.json +3 -0
- package/dist/i18n/pt.json +3 -0
- package/dist/i18n/ru.json +3 -0
- package/dist/i18n/tr.json +3 -0
- package/dist/index.browser.cjs +1280 -1238
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.node.cjs +1281 -1238
- package/dist/index.node.cjs.map +4 -4
- package/package.json +1 -1
- /package/dist/components/{Channel → Loading}/LoadingChannel.d.ts +0 -0
- /package/dist/components/{Channel → Loading}/LoadingChannel.js +0 -0
|
@@ -10,8 +10,7 @@ import { useCreateTypingContext } from './hooks/useCreateTypingContext';
|
|
|
10
10
|
import { useEditMessageHandler } from './hooks/useEditMessageHandler';
|
|
11
11
|
import { useIsMounted } from './hooks/useIsMounted';
|
|
12
12
|
import { useMentionsHandlers } from './hooks/useMentionsHandlers';
|
|
13
|
-
import { LoadingErrorIndicator as DefaultLoadingErrorIndicator } from '../Loading';
|
|
14
|
-
import { LoadingChannel as DefaultLoadingIndicator } from './LoadingChannel';
|
|
13
|
+
import { LoadingErrorIndicator as DefaultLoadingErrorIndicator, LoadingChannel as DefaultLoadingIndicator, } from '../Loading';
|
|
15
14
|
import { ChannelActionProvider, ChannelStateProvider, TypingProvider, useChatContext, useTranslationContext, WithComponents, } from '../../context';
|
|
16
15
|
import { CHANNEL_CONTAINER_ID } from './constants';
|
|
17
16
|
import { DEFAULT_HIGHLIGHT_DURATION, DEFAULT_INITIAL_CHANNEL_PAGE_SIZE, DEFAULT_JUMP_TO_PAGE_SIZE, DEFAULT_NEXT_CHANNEL_PAGE_SIZE, DEFAULT_THREAD_PAGE_SIZE, } from '../../constants/limits';
|
|
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (!client)
|
|
26
26
|
return;
|
|
27
|
-
const version = "13.6.
|
|
27
|
+
const version = "13.6.4";
|
|
28
28
|
const userAgent = client.getUserAgent();
|
|
29
29
|
if (!userAgent.includes('stream-chat-react')) {
|
|
30
30
|
// result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
|
|
@@ -10,8 +10,13 @@ const UnMemoizedMessageOptions = (props) => {
|
|
|
10
10
|
const { ActionsIcon = DefaultActionsIcon, displayReplies = true, handleOpenThread: propHandleOpenThread, ReactionIcon = DefaultReactionIcon, theme = 'simple', ThreadIcon = DefaultThreadIcon, } = props;
|
|
11
11
|
const { getMessageActions, handleOpenThread: contextHandleOpenThread, initialMessage, message, threadList, } = useMessageContext('MessageOptions');
|
|
12
12
|
const { t } = useTranslationContext('MessageOptions');
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
// It is necessary to namespace the dialog IDs because a message with the same ID
|
|
14
|
+
// can appear in the main message list as well as in the thread message list.
|
|
15
|
+
// Without the namespace, the search for dialog would be performed by the message ID only
|
|
16
|
+
// which could return the dialog for a message in another message list (which would not be rendered).
|
|
17
|
+
const dialogIdNamespace = threadList ? '-thread-' : '';
|
|
18
|
+
const messageActionsDialogIsOpen = useDialogIsOpen(`message-actions${dialogIdNamespace}--${message.id}`);
|
|
19
|
+
const reactionSelectorDialogIsOpen = useDialogIsOpen(`reaction-selector${dialogIdNamespace}--${message.id}`);
|
|
15
20
|
const handleOpenThread = propHandleOpenThread || contextHandleOpenThread;
|
|
16
21
|
const messageActions = getMessageActions();
|
|
17
22
|
const shouldShowReactions = messageActions.indexOf(MESSAGE_ACTIONS.react) > -1;
|
|
@@ -22,7 +22,8 @@ export const MessageActions = (props) => {
|
|
|
22
22
|
const message = propMessage || contextMessage;
|
|
23
23
|
const isMine = mine ? mine() : isMyMessage();
|
|
24
24
|
const isMuted = useCallback(() => isUserMuted(message, mutes), [message, mutes]);
|
|
25
|
-
const
|
|
25
|
+
const dialogIdNamespace = threadList ? '-thread-' : '';
|
|
26
|
+
const dialogId = `message-actions${dialogIdNamespace}--${message.id}`;
|
|
26
27
|
const dialog = useDialog({ id: dialogId });
|
|
27
28
|
const dialogIsOpen = useDialogIsOpen(dialogId);
|
|
28
29
|
const messageActions = getMessageActions();
|
|
@@ -8,10 +8,11 @@ import { useComponentContext, useMessageContext, useTranslationContext, } from '
|
|
|
8
8
|
*/
|
|
9
9
|
export const ReactionSelectorWithButton = ({ ReactionIcon, }) => {
|
|
10
10
|
const { t } = useTranslationContext('ReactionSelectorWithButton');
|
|
11
|
-
const { isMyMessage, message } = useMessageContext('MessageOptions');
|
|
11
|
+
const { isMyMessage, message, threadList } = useMessageContext('MessageOptions');
|
|
12
12
|
const { ReactionSelector = DefaultReactionSelector } = useComponentContext('MessageOptions');
|
|
13
13
|
const buttonRef = useRef(null);
|
|
14
|
-
const
|
|
14
|
+
const dialogIdNamespace = threadList ? '-thread-' : '';
|
|
15
|
+
const dialogId = `reaction-selector${dialogIdNamespace}--${message.id}`;
|
|
15
16
|
const dialog = useDialog({ id: dialogId });
|
|
16
17
|
const dialogIsOpen = useDialogIsOpen(dialogId);
|
|
17
18
|
return (React.createElement(React.Fragment, null,
|
|
@@ -11516,10 +11516,11 @@ var ReactionSelectorWithButton = ({
|
|
|
11516
11516
|
ReactionIcon: ReactionIcon2
|
|
11517
11517
|
}) => {
|
|
11518
11518
|
const { t } = useTranslationContext("ReactionSelectorWithButton");
|
|
11519
|
-
const { isMyMessage, message } = useMessageContext("MessageOptions");
|
|
11519
|
+
const { isMyMessage, message, threadList } = useMessageContext("MessageOptions");
|
|
11520
11520
|
const { ReactionSelector: ReactionSelector2 = ReactionSelector } = useComponentContext("MessageOptions");
|
|
11521
11521
|
const buttonRef = (0, import_react35.useRef)(null);
|
|
11522
|
-
const
|
|
11522
|
+
const dialogIdNamespace = threadList ? "-thread-" : "";
|
|
11523
|
+
const dialogId = `reaction-selector${dialogIdNamespace}--${message.id}`;
|
|
11523
11524
|
const dialog = useDialog({ id: dialogId });
|
|
11524
11525
|
const dialogIsOpen = useDialogIsOpen(dialogId);
|
|
11525
11526
|
return /* @__PURE__ */ import_react35.default.createElement(import_react35.default.Fragment, null, /* @__PURE__ */ import_react35.default.createElement(
|