Skip to content

Commit 4782626

Browse files
v13.0.0 [skip-ci] (#2690)
2 parents 98af293 + 2b789e5 commit 4782626

File tree

368 files changed

+8734
-13771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

368 files changed

+8734
-13771
lines changed

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Release from "${{ github.ref_name }}" branch
1313
runs-on: ubuntu-latest
1414
# GH does not allow to limit branches in the workflow_dispatch settings so this here is a safety measure
15-
if: ${{ inputs.dry_run || startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master') }}
15+
if: ${{ inputs.dry_run || startsWith(github.ref_name, 'release') || startsWith(github.ref_name, 'master') || startsWith(github.ref_name, 'rc')}}
1616
steps:
1717
- name: Checkout
1818
uses: actions/checkout@v4

.lintstagedrc.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"src/**/*.{js,ts,tsx,md}": "eslint --max-warnings 0",
2+
"src/**/*.{js,ts,tsx,md}": "eslint --max-warnings 0 --no-warn-ignored",
33
"**/*.{js,mjs,ts,mts,jsx,tsx,md,json,yml}": "prettier --list-different",
44
"src/i18n/*.json": "yarn run validate-translations"
55
}

.releaserc.json

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"branches": [
3+
{
4+
"name": "rc",
5+
"channel": "rc",
6+
"prerelease": "rc"
7+
},
38
{
49
"name": "master",
510
"channel": "latest"

CHANGELOG.md

+63
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,66 @@
1+
## [13.0.0-rc.2](https://github.com/GetStream/stream-chat-react/compare/v13.0.0-rc.1...v13.0.0-rc.2) (2025-04-30)
2+
3+
### Features
4+
5+
* replace SuggestionItem prop with suggestionItemComponents prop for SuggestionList ([#2693](https://github.com/GetStream/stream-chat-react/issues/2693)) ([985f5e3](https://github.com/GetStream/stream-chat-react/commit/985f5e3a43da660573e21dcc44f96cf4b44b3552))
6+
7+
## [13.0.0-rc.1](https://github.com/GetStream/stream-chat-react/compare/v12.14.0...v13.0.0-rc.1) (2025-04-28)
8+
9+
### ⚠ BREAKING CHANGES
10+
11+
* `Channel` props `dragAndDropWindow` &
12+
`optionalMessageInputProps` have been removed, use
13+
* Remove ChatAutoComplete, AutoCompleteTextarea,
14+
DefaultSuggestionList, DefaultSuggestionListItem and introduce
15+
TextareaComposer, SuggestionList, SuggestionListItem
16+
* Remove defaultScrollToItem function previously used by
17+
SuggestionList
18+
* Removed DefaultTriggerProvider component
19+
* Remove from Channel props - acceptedFiles,
20+
enrichURLForPreview, enrichURLForPreviewConfig, maxNumberOfFiles,
21+
multipleUploads, TriggerProvider
22+
* Removal of acceptedFiles, debounceURLEnrichmentMs,
23+
enrichURLForPreview, findURLFn, multipleUploads, onLinkPreviewDismissed,
24+
quotedMessage from ChannelStateContext
25+
* Changed signature for functions sendMessage and
26+
editMessage in ChannelActionContext
27+
* Changed signature for handleSubmit
28+
* Removed setQuotedMessage from ChannelActionContext
29+
* Removed types MessageToSend, StreamMessage,
30+
UpdatedMessage in favor of LocalMessage or RenderedMessage
31+
* Removed Trigger generics from ChannelProps
32+
* Message input state as well as the API is now kept
33+
within MessageComposer instead of MessageInputContext
34+
* Renamed useMessageInputState to useMessageInputControls
35+
as it does not handle the composition state anymore
36+
* Removed from MessageInputProps - disabled,
37+
disableMentions, doFileUploadRequest, doImageUploadRequest,
38+
errorHandler, getDefaultValue, mentionAllAppUsers, mentionQueryParams,
39+
message, noFiles, urlEnrichmentConfig, useMentionsTransliteration,
40+
additionalTextareaProps do not expect default value anymore
41+
* Changed the signature of MessageInput prop
42+
overrideSubmitHandler
43+
* Local attachment and link preview types moved to
44+
stream-chat
45+
* The SuggestionListItem UI components for
46+
TextareaComposer receive tokenizedDisplayName instead of itemNameParts
47+
* Removed duplicate types SendMessageOptions,
48+
UpdateMessageOptions which should be imported from stream-chat instead
49+
* Removed type LinkPreviewListProps - LinkPreviewList
50+
does not have any props anymore
51+
* dropped `StreamChatGenerics`, use `Custom<Entity>Data`
52+
to extend your types
53+
54+
### Bug Fixes
55+
56+
* replace StreamChatGenerics with module augmentation ([#2634](https://github.com/GetStream/stream-chat-react/issues/2634)) ([67bed79](https://github.com/GetStream/stream-chat-react/commit/67bed794555cd1e71456c0732c6bacfcd2712685))
57+
58+
### Features
59+
60+
* default data interfaces ([#2683](https://github.com/GetStream/stream-chat-react/issues/2683)) ([a88e145](https://github.com/GetStream/stream-chat-react/commit/a88e1456e970b6c344545422bdbc4edd1370b862))
61+
* introduce WithDragAndDropUpload component ([#2688](https://github.com/GetStream/stream-chat-react/issues/2688)) ([6b03abd](https://github.com/GetStream/stream-chat-react/commit/6b03abd707165d08539af435b940dd13025481d2))
62+
* message composer ([#2669](https://github.com/GetStream/stream-chat-react/issues/2669)) ([fa2519b](https://github.com/GetStream/stream-chat-react/commit/fa2519b50f1a3bb8837369188bffb356509236ed)), closes [#2688](https://github.com/GetStream/stream-chat-react/issues/2688)
63+
164
## [12.15.0](https://github.com/GetStream/stream-chat-react/compare/v12.14.0...v12.15.0) (2025-05-02)
265

366
### Features

eslint.config.mjs

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export default tseslint.config(
9191
{ ignoreRestSiblings: false, caughtErrors: 'none' },
9292
],
9393
'@typescript-eslint/no-unsafe-function-type': 'error',
94+
'@typescript-eslint/consistent-type-imports': 'error',
9495
'@typescript-eslint/no-wrapper-object-types': 'error',
9596
'@typescript-eslint/no-non-null-assertion': 'error',
9697
'no-empty-function': 'off',

examples/capacitor/src/App.tsx

+1-19
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,7 @@ const filters: ChannelFilters = { type: 'messaging', members: { $in: [userId] }
2121
const options: ChannelOptions = { state: true, presence: true, limit: 10 };
2222
const sort: ChannelSort = { last_message_at: -1, updated_at: -1 };
2323

24-
type LocalAttachmentType = Record<string, unknown>;
25-
type LocalChannelType = Record<string, unknown>;
26-
type LocalCommandType = string;
27-
type LocalEventType = Record<string, unknown>;
28-
type LocalMessageType = Record<string, unknown>;
29-
type LocalReactionType = Record<string, unknown>;
30-
type LocalUserType = Record<string, unknown>;
31-
32-
type StreamChatGenerics = {
33-
attachmentType: LocalAttachmentType;
34-
channelType: LocalChannelType;
35-
commandType: LocalCommandType;
36-
eventType: LocalEventType;
37-
messageType: LocalMessageType;
38-
reactionType: LocalReactionType;
39-
userType: LocalUserType;
40-
};
41-
42-
const chatClient = StreamChat.getInstance<StreamChatGenerics>(apiKey);
24+
const chatClient = StreamChat.getInstance(apiKey);
4325

4426
if (process.env.REACT_APP_CHAT_SERVER_ENDPOINT) {
4527
chatClient.setBaseURL(process.env.REACT_APP_CHAT_SERVER_ENDPOINT);

examples/typescript/src/App.tsx

+1-25
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,7 @@ const filters: ChannelFilters = { type: 'messaging', members: { $in: [userId] }
2323
const options: ChannelOptions = { state: true, presence: true, limit: 10 };
2424
const sort: ChannelSort = { last_message_at: -1, updated_at: -1 };
2525

26-
type LocalAttachmentType = Record<string, unknown>;
27-
type LocalChannelType = Record<string, unknown>;
28-
type LocalCommandType = string;
29-
type LocalEventType = Record<string, unknown>;
30-
type LocalMemberType = Record<string, unknown>;
31-
type LocalMessageType = Record<string, unknown>;
32-
type LocalPollOptionType = Record<string, unknown>;
33-
type LocalPollType = Record<string, unknown>;
34-
type LocalReactionType = Record<string, unknown>;
35-
type LocalUserType = Record<string, unknown>;
36-
37-
type StreamChatGenerics = {
38-
attachmentType: LocalAttachmentType;
39-
channelType: LocalChannelType;
40-
commandType: LocalCommandType;
41-
eventType: LocalEventType;
42-
memberType: LocalMemberType;
43-
messageType: LocalMessageType;
44-
pollOptionType: LocalPollOptionType;
45-
pollType: LocalPollType;
46-
reactionType: LocalReactionType;
47-
userType: LocalUserType;
48-
};
49-
50-
const chatClient = StreamChat.getInstance<StreamChatGenerics>(apiKey);
26+
const chatClient = StreamChat.getInstance(apiKey);
5127

5228
if (process.env.REACT_APP_CHAT_SERVER_ENDPOINT) {
5329
chatClient.setBaseURL(process.env.REACT_APP_CHAT_SERVER_ENDPOINT);

examples/vite/src/App.tsx

+34-31
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { ChannelFilters, ChannelOptions, ChannelSort } from 'stream-chat';
1+
import { useEffect } from 'react';
2+
import {
3+
ChannelFilters,
4+
ChannelOptions,
5+
ChannelSort,
6+
LocalMessage,
7+
TextComposerMiddleware,
8+
} from 'stream-chat';
29
import {
310
AIStateIndicator,
411
Channel,
@@ -8,13 +15,19 @@ import {
815
Chat,
916
ChatView,
1017
MessageInput,
11-
StreamMessage,
18+
SendButtonProps,
1219
Thread,
1320
ThreadList,
1421
useCreateChatClient,
22+
useMessageComposer,
1523
VirtualizedMessageList as MessageList,
1624
Window,
1725
} from 'stream-chat-react';
26+
import { createTextComposerEmojiMiddleware } from 'stream-chat-react/emojis';
27+
import { init, SearchIndex } from 'emoji-mart';
28+
import data from '@emoji-mart/data';
29+
30+
init({ data });
1831

1932
const params = new Proxy(new URLSearchParams(window.location.search), {
2033
get: (searchParams, property) => searchParams.get(property as string),
@@ -40,40 +53,30 @@ const filters: ChannelFilters = {
4053
const options: ChannelOptions = { limit: 5, presence: true, state: true };
4154
const sort: ChannelSort = { pinned_at: 1, last_message_at: -1, updated_at: -1 };
4255

43-
type LocalAttachmentType = Record<string, unknown>;
44-
type LocalChannelType = Record<string, unknown>;
45-
type LocalCommandType = string;
46-
type LocalEventType = Record<string, unknown>;
47-
type LocalMemberType = Record<string, unknown>;
48-
type LocalMessageType = Record<string, unknown>;
49-
type LocalPollOptionType = Record<string, unknown>;
50-
type LocalPollType = Record<string, unknown>;
51-
type LocalReactionType = Record<string, unknown>;
52-
type LocalUserType = Record<string, unknown>;
53-
54-
type StreamChatGenerics = {
55-
attachmentType: LocalAttachmentType;
56-
channelType: LocalChannelType;
57-
commandType: LocalCommandType;
58-
eventType: LocalEventType;
59-
memberType: LocalMemberType;
60-
messageType: LocalMessageType;
61-
pollOptionType: LocalPollOptionType;
62-
pollType: LocalPollType;
63-
reactionType: LocalReactionType;
64-
userType: LocalUserType;
65-
};
66-
67-
const isMessageAIGenerated = (message: StreamMessage<StreamChatGenerics>) =>
68-
!!message?.ai_generated;
56+
// @ts-ignore
57+
const isMessageAIGenerated = (message: LocalMessage) => !!message?.ai_generated;
6958

7059
const App = () => {
71-
const chatClient = useCreateChatClient<StreamChatGenerics>({
60+
const chatClient = useCreateChatClient({
7261
apiKey,
7362
tokenOrProvider: userToken,
7463
userData: { id: userId },
7564
});
7665

66+
useEffect(() => {
67+
if (!chatClient) return;
68+
69+
chatClient.setMessageComposerSetupFunction(({ composer }) => {
70+
composer.textComposer.middlewareExecutor.insert({
71+
middleware: [
72+
createTextComposerEmojiMiddleware(SearchIndex) as TextComposerMiddleware,
73+
],
74+
position: { before: 'stream-io/text-composer/mentions-middleware' },
75+
unique: true,
76+
});
77+
});
78+
}, [chatClient]);
79+
7780
if (!chatClient) return <>Loading...</>;
7881

7982
return (
@@ -89,12 +92,12 @@ const App = () => {
8992
showChannelSearch
9093
additionalChannelSearchProps={{ searchForChannels: true }}
9194
/>
92-
<Channel>
95+
<Channel emojiSearchIndex={SearchIndex}>
9396
<Window>
9497
<ChannelHeader Avatar={ChannelAvatar} />
9598
<MessageList returnAllReadData />
9699
<AIStateIndicator />
97-
<MessageInput focus />
100+
<MessageInput focus audioRecordingEnabled />
98101
</Window>
99102
<Thread virtualized />
100103
</Channel>

0 commit comments

Comments
 (0)