stream-chat-react 12.0.0-rc.13 → 12.0.0-rc.15
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/hooks/useCreateChannelStateContext.js +1 -0
- package/dist/components/ChannelHeader/ChannelHeader.js +4 -5
- package/dist/components/ChannelPreview/hooks/useChannelPreviewInfo.js +14 -16
- package/dist/components/ChannelPreview/utils.js +9 -20
- package/dist/components/ChannelSearch/hooks/useChannelSearch.js +2 -3
- package/dist/components/ChatView/ChatView.js +2 -1
- package/dist/components/Dialog/DialogAnchor.d.ts +25 -0
- package/dist/components/Dialog/DialogAnchor.js +68 -0
- package/dist/components/Dialog/DialogManager.d.ts +43 -0
- package/dist/components/Dialog/DialogManager.js +98 -0
- package/dist/components/Dialog/DialogPortal.d.ts +7 -0
- package/dist/components/Dialog/DialogPortal.js +25 -0
- package/dist/components/Dialog/hooks/index.d.ts +1 -0
- package/dist/components/Dialog/hooks/index.js +1 -0
- package/dist/components/Dialog/hooks/useDialog.d.ts +4 -0
- package/dist/components/Dialog/hooks/useDialog.js +26 -0
- package/dist/components/Dialog/index.d.ts +4 -0
- package/dist/components/Dialog/index.js +4 -0
- package/dist/components/Message/Message.js +3 -5
- package/dist/components/Message/MessageOptions.d.ts +1 -2
- package/dist/components/Message/MessageOptions.js +13 -9
- package/dist/components/Message/MessageSimple.js +5 -14
- package/dist/components/Message/hooks/useReactionHandler.d.ts +1 -7
- package/dist/components/Message/hooks/useReactionHandler.js +1 -63
- package/dist/components/Message/utils.js +3 -0
- package/dist/components/MessageActions/MessageActions.d.ts +1 -2
- package/dist/components/MessageActions/MessageActions.js +13 -47
- package/dist/components/MessageActions/MessageActionsBox.d.ts +1 -1
- package/dist/components/MessageActions/MessageActionsBox.js +6 -6
- package/dist/components/MessageInput/hooks/useUserTrigger.js +0 -1
- package/dist/components/MessageList/MessageList.js +7 -5
- package/dist/components/MessageList/VirtualizedMessageList.js +39 -37
- package/dist/components/Reactions/ReactionSelector.d.ts +1 -1
- package/dist/components/Reactions/ReactionSelector.js +33 -24
- package/dist/components/Reactions/ReactionSelectorWithButton.d.ts +13 -0
- package/dist/components/Reactions/ReactionSelectorWithButton.js +22 -0
- package/dist/components/Reactions/ReactionsList.d.ts +0 -3
- package/dist/components/Thread/Thread.js +2 -1
- package/dist/components/Threads/ThreadList/ThreadList.js +1 -1
- package/dist/components/Threads/ThreadList/ThreadListItemUI.js +1 -1
- package/dist/components/Threads/ThreadList/ThreadListLoadingIndicator.js +1 -1
- package/dist/components/Threads/ThreadList/ThreadListUnseenThreadsBanner.js +1 -1
- package/dist/components/Threads/hooks/useThreadManagerState.js +1 -1
- package/dist/components/Threads/hooks/useThreadState.js +1 -1
- package/dist/components/Threads/index.d.ts +0 -1
- package/dist/components/Threads/index.js +0 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/context/DialogManagerContext.d.ts +10 -0
- package/dist/context/DialogManagerContext.js +14 -0
- package/dist/context/MessageContext.d.ts +2 -10
- package/dist/context/index.d.ts +1 -0
- package/dist/context/index.js +1 -0
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/index.browser.cjs +2164 -2004
- package/dist/index.browser.cjs.map +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.node.cjs +2087 -1918
- package/dist/index.node.cjs.map +4 -4
- package/dist/scss/v2/Dialog/Dialog-layout.scss +8 -0
- package/dist/scss/v2/Message/Message-layout.scss +8 -0
- package/dist/scss/v2/MessageReactions/MessageReactionsSelector-layout.scss +16 -0
- package/dist/scss/v2/ThreadList/ThreadList-layout.scss +4 -1
- package/dist/scss/v2/index.layout.scss +1 -0
- package/dist/store/hooks/index.d.ts +1 -0
- package/dist/store/hooks/index.js +1 -0
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.js +1 -0
- package/package.json +2 -2
- /package/dist/{components/Threads → store}/hooks/useStateStore.d.ts +0 -0
- /package/dist/{components/Threads → store}/hooks/useStateStore.js +0 -0
|
@@ -10,6 +10,7 @@ export * from './Chat';
|
|
|
10
10
|
export * from './ChatAutoComplete';
|
|
11
11
|
export * from './CommandItem';
|
|
12
12
|
export * from './DateSeparator';
|
|
13
|
+
export * from './Dialog';
|
|
13
14
|
export * from './EmoticonItem';
|
|
14
15
|
export * from './EmptyStateIndicator';
|
|
15
16
|
export * from './EventComponent';
|
package/dist/components/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './Chat';
|
|
|
10
10
|
export * from './ChatAutoComplete';
|
|
11
11
|
export * from './CommandItem';
|
|
12
12
|
export * from './DateSeparator';
|
|
13
|
+
export * from './Dialog';
|
|
13
14
|
export * from './EmoticonItem';
|
|
14
15
|
export * from './EmptyStateIndicator';
|
|
15
16
|
export * from './EventComponent';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from 'react';
|
|
2
|
+
import { DialogManager } from '../components/Dialog/DialogManager';
|
|
3
|
+
type DialogManagerProviderContextValue = {
|
|
4
|
+
dialogManager: DialogManager;
|
|
5
|
+
};
|
|
6
|
+
export declare const DialogManagerProvider: ({ children, id }: PropsWithChildren<{
|
|
7
|
+
id?: string;
|
|
8
|
+
}>) => React.JSX.Element;
|
|
9
|
+
export declare const useDialogManager: () => DialogManagerProviderContextValue;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { useContext, useState } from 'react';
|
|
2
|
+
import { DialogManager } from '../components/Dialog/DialogManager';
|
|
3
|
+
import { DialogPortalDestination } from '../components/Dialog/DialogPortal';
|
|
4
|
+
const DialogManagerProviderContext = React.createContext(undefined);
|
|
5
|
+
export const DialogManagerProvider = ({ children, id }) => {
|
|
6
|
+
const [dialogManager] = useState(() => new DialogManager({ id }));
|
|
7
|
+
return (React.createElement(DialogManagerProviderContext.Provider, { value: { dialogManager } },
|
|
8
|
+
children,
|
|
9
|
+
React.createElement(DialogPortalDestination, null)));
|
|
10
|
+
};
|
|
11
|
+
export const useDialogManager = () => {
|
|
12
|
+
const value = useContext(DialogManagerProviderContext);
|
|
13
|
+
return value;
|
|
14
|
+
};
|
|
@@ -50,10 +50,6 @@ export type MessageContextValue<StreamChatGenerics extends DefaultStreamChatGene
|
|
|
50
50
|
handleRetry: ChannelActionContextValue<StreamChatGenerics>['retrySendMessage'];
|
|
51
51
|
/** Function that returns whether the Message belongs to the current user */
|
|
52
52
|
isMyMessage: () => boolean;
|
|
53
|
-
/** @deprecated will be removed in the next major release.
|
|
54
|
-
* Whether sending reactions is enabled for the active channel.
|
|
55
|
-
*/
|
|
56
|
-
isReactionEnabled: boolean;
|
|
57
53
|
/** The message object */
|
|
58
54
|
message: StreamMessage<StreamChatGenerics>;
|
|
59
55
|
/** Indicates whether a message has not been read yet or has been marked unread */
|
|
@@ -62,22 +58,18 @@ export type MessageContextValue<StreamChatGenerics extends DefaultStreamChatGene
|
|
|
62
58
|
onMentionsClickMessage: ReactEventHandler;
|
|
63
59
|
/** Handler function for a hover event on an @mention in Message */
|
|
64
60
|
onMentionsHoverMessage: ReactEventHandler;
|
|
65
|
-
/** Handler function for a click event on the reaction list */
|
|
66
|
-
onReactionListClick: ReactEventHandler;
|
|
67
61
|
/** Handler function for a click event on the user that posted the Message */
|
|
68
62
|
onUserClick: ReactEventHandler;
|
|
69
63
|
/** Handler function for a hover event on the user that posted the Message */
|
|
70
64
|
onUserHover: ReactEventHandler;
|
|
71
|
-
/** Ref to be placed on the reaction selector component */
|
|
72
|
-
reactionSelectorRef: React.MutableRefObject<HTMLDivElement | null>;
|
|
73
65
|
/** Function to toggle the edit state on a Message */
|
|
74
66
|
setEditingState: ReactEventHandler;
|
|
75
|
-
/** Whether or not to show reaction list details */
|
|
76
|
-
showDetailedReactions: boolean;
|
|
77
67
|
/** Additional props for underlying MessageInput component, [available props](https://getstream.io/chat/docs/sdk/react/message-input-components/message_input/#props) */
|
|
78
68
|
additionalMessageInputProps?: MessageInputProps<StreamChatGenerics>;
|
|
79
69
|
/** Call this function to keep message list scrolled to the bottom when the scroll height increases, e.g. an element appears below the last message (only used in the `VirtualizedMessageList`) */
|
|
80
70
|
autoscrollToBottom?: () => void;
|
|
71
|
+
/** Message component configuration prop. If true, picking a reaction from the `ReactionSelector` component will close the selector */
|
|
72
|
+
closeReactionSelectorOnClick?: boolean;
|
|
81
73
|
/** Object containing custom message actions and function handlers */
|
|
82
74
|
customMessageActions?: CustomMessageActions<StreamChatGenerics>;
|
|
83
75
|
/** If true, the message is the last one in a group sent by a specific user (only used in the `VirtualizedMessageList`) */
|
package/dist/context/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './ChannelListContext';
|
|
|
3
3
|
export * from './ChannelStateContext';
|
|
4
4
|
export * from './ChatContext';
|
|
5
5
|
export * from './ComponentContext';
|
|
6
|
+
export * from './DialogManagerContext';
|
|
6
7
|
export * from './MessageContext';
|
|
7
8
|
export * from './MessageBounceContext';
|
|
8
9
|
export * from './MessageInputContext';
|
package/dist/context/index.js
CHANGED
|
@@ -3,6 +3,7 @@ export * from './ChannelListContext';
|
|
|
3
3
|
export * from './ChannelStateContext';
|
|
4
4
|
export * from './ChatContext';
|
|
5
5
|
export * from './ComponentContext';
|
|
6
|
+
export * from './DialogManagerContext';
|
|
6
7
|
export * from './MessageContext';
|
|
7
8
|
export * from './MessageBounceContext';
|
|
8
9
|
export * from './MessageInputContext';
|