Skip to content

Commit 71ded65

Browse files
committed
merge master
2 parents 8259144 + bd8b037 commit 71ded65

Some content is hidden

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

72 files changed

+1499
-738
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ babel.i18next-extract.js
1717
/built
1818
/coverage
1919
types/index.d.ts
20+
src/components/Channel/types.ts

.github/workflows/ci.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,14 @@ jobs:
1717
with:
1818
node-version: ${{ matrix.node }}
1919

20-
- name: Get yarn cache directory path
21-
id: yarn-cache-path
22-
run: echo "::set-output name=dir::$(yarn cache dir)"
23-
24-
- uses: actions/cache@master
25-
id: yarn-cache
20+
- name: Cache Dependencies
21+
uses: actions/cache@v2
2622
with:
27-
path: ${{ steps.yarn-cache-path.outputs.dir }}
28-
key: yarn-${{ hashFiles('**/yarn.lock') }}
29-
restore-keys: yarn-
23+
path: ./node_modules
24+
key: ${{ runner.os }}-${{ matrix.node }}-modules-${{ hashFiles('**/yarn.lock') }}
3025

31-
- name: Install dependencies
32-
run: yarn install
26+
- name: Install Dependencies & Build
27+
run: yarn install --frozen-lockfile
3328

3429
- name: Lint and Test with ${{ matrix.node }}
3530
env:

.github/workflows/size.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Compressed Size
22

3-
on: [pull_request]
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- '**.test.js'
9+
- '**.md'
410

511
jobs:
612
build:
@@ -9,5 +15,5 @@ jobs:
915
- uses: actions/checkout@v2
1016
- uses: preactjs/[email protected]
1117
with:
12-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
13-
pattern: "./dist/**/*.{js,css,json}"
18+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
19+
pattern: './dist/**/*.{js,css,json}'

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Changelog
22

3+
## [3.5.3](https://github.com/GetStream/stream-chat-react/releases/tag/v3.5.3) 2021-01-26
4+
5+
### Feature
6+
7+
- `ChannelList` accepts an optional prop to filter/sort channels prior to render [#678](https://github.com/GetStream/stream-chat-react/pull/678)
8+
9+
## [3.5.2](https://github.com/GetStream/stream-chat-react/releases/tag/v3.5.2) 2021-01-21
10+
11+
### Fix
12+
13+
- Handle emoji picker event listener race condition [#675](https://github.com/GetStream/stream-chat-react/pull/675)
14+
- Adjust style for only emoji messages [#676](https://github.com/GetStream/stream-chat-react/pull/676)
15+
16+
## [3.5.1](https://github.com/GetStream/stream-chat-react/releases/tag/v3.5.1) 2021-01-19
17+
18+
### Fix
19+
20+
- Upload PSD attachments as file [#673](https://github.com/GetStream/stream-chat-react/pull/673)
21+
22+
### Chore
23+
24+
- Bump MML-React [#674](https://github.com/GetStream/stream-chat-react/pull/674)
25+
26+
## [3.5.0](https://github.com/GetStream/stream-chat-react/releases/tag/v3.5.0) 2021-01-15
27+
28+
## Feature
29+
30+
- Support typing indicator in Thread component [#662](https://github.com/GetStream/stream-chat-react/pull/662)
31+
- Add parent ID to typing events [#665](https://github.com/GetStream/stream-chat-react/pull/665)
32+
- Allow MessageInput emoji and file upload icon customization [#666](https://github.com/GetStream/stream-chat-react/pull/666)
33+
- Add optional `disableMentions` prop to MessageInput and update mentions UI [#669](https://github.com/GetStream/stream-chat-react/pull/669)
34+
35+
## Fix
36+
37+
- Fix maxLength paste text bug [#670](https://github.com/GetStream/stream-chat-react/pull/670)
38+
339
## [3.4.6](https://github.com/GetStream/stream-chat-react/releases/tag/v3.4.6) 2021-01-08
440

541
## Feature

docs/build/bundle.571d5957.js renamed to docs/build/bundle.33cc8b6e.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/bundle.571d5957.js.LICENSE.txt renamed to docs/build/bundle.33cc8b6e.js.LICENSE.txt

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*! exports provided: 0, 128, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 142, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 158, 159, default */
22

3-
/*! exports provided: 1 reply, Attach files, Cancel, Channel Missing, Close, Commands matching, Connection failure, reconnecting now..., Delete, Delivered, Edit Message, Emoji matching, Empty message..., Error adding flag: Either the flag already exist or there is issue with network connection ..., Error connecting to chat, refresh the page to try again., Error muting a user ..., Error unmuting a user ..., Error · Unsent, Error: {{ errorMessage }}, Flag, Message Failed · Click to try again, Message deleted, Message failed. Click to try again., Message has been successfully flagged, Mute, New, New Messages!, Nothing yet..., Only visible to you, Open emoji picker, Pick your emoji, Searching for people, Send, Sending..., Start of a new thread, This message was deleted..., Thread, Type your message, Unmute, You have no channels currently, You've reached the maximum number of files, live, this content could not be displayed, {{ commaSeparatedUsers }} and {{ lastUser }} are typing..., {{ commaSeparatedUsers }} and {{ moreCount }} more, {{ commaSeparatedUsers }}, and {{ lastUser }}, {{ firstUser }} and {{ secondUser }}, {{ firstUser }} and {{ secondUser }} are typing..., {{ imageCount }} more, {{ memberCount }} members, {{ replyCount }} replies, {{ user }} has been muted, {{ user }} has been unmuted, {{ user }} is typing..., {{ watcherCount }} online, 🏙 Attachment..., default */
3+
/*! exports provided: 1 reply, Attach files, Cancel, Channel Missing, Close, Commands matching, Connection failure, reconnecting now..., Delete, Delivered, Edit Message, Emoji matching, Empty message..., Error adding flag: Either the flag already exist or there is issue with network connection ..., Error connecting to chat, refresh the page to try again., Error muting a user ..., Error unmuting a user ..., Error · Unsent, Error: {{ errorMessage }}, Flag, Message Failed · Click to try again, Message deleted, Message failed. Click to try again., Message has been successfully flagged, Mute, New, New Messages!, Nothing yet..., Only visible to you, Open emoji picker, People matching, Pick your emoji, Send, Sending..., Start of a new thread, This message was deleted..., Thread, Type your message, Unmute, You have no channels currently, You've reached the maximum number of files, live, this content could not be displayed, {{ commaSeparatedUsers }} and {{ lastUser }} are typing..., {{ commaSeparatedUsers }} and {{ moreCount }} more, {{ commaSeparatedUsers }}, and {{ lastUser }}, {{ firstUser }} and {{ secondUser }}, {{ firstUser }} and {{ secondUser }} are typing..., {{ imageCount }} more, {{ memberCount }} members, {{ replyCount }} replies, {{ user }} has been muted, {{ user }} has been unmuted, {{ user }} is typing..., {{ watcherCount }} online, 🏙 Attachment..., default */
44

55
/*! exports provided: ACORN_OPTIONS, default */
66

@@ -16,7 +16,7 @@
1616

1717
/*! exports provided: Attachment, Card, Audio, AttachmentActions, FileAttachment */
1818

19-
/*! exports provided: Attachment, Card, Audio, AttachmentActions, FileAttachment, AutoCompleteTextarea, Item, List, listener, KEY_CODES, defaultScrollToItem, Avatar, ChannelPreview, ChannelPreviewCompact, ChannelPreviewCountOnly, ChannelPreviewLastMessage, ChannelPreviewMessenger, Channel, useChannelEditMessageHandler, useChannelMentionsHandler, ChannelHeader, ChannelList, ChannelListMessenger, ChannelListTeam, ChannelSearch, Chat, ChatAutoComplete, ChatDown, CommandItem, DateSeparator, EmoticonItem, EmptyStateIndicator, EventComponent, Gallery, ImageComponent, ModalImage, ModalWrapper, InfiniteScroll, InfiniteScrollPaginator, ReverseInfiniteScroll, LoadingChannels, LoadingErrorIndicator, LoadingIndicator, LoadMoreButton, LoadMorePaginator, Message, MessageCommerce, MessageLivestream, MessageSimple, MessageTeam, MessageRepliesCountButton, MessageOptions, MessageText, MessageDeleted, FixedHeightMessage, handleActionWarning, useActionHandler, useDeleteHandler, useEditHandler, missingUseFlagHandlerParameterWarning, useFlagHandler, useMentionsHandler, useMentionsUIHandler, missingUseMuteHandlerParamsWarning, useMuteHandler, useOpenThreadHandler, reactionHandlerWarning, useReactionHandler, useReactionClick, useRetryHandler, useUserHandler, useUserRole, validateAndGetMessage, isUserMuted, MESSAGE_ACTIONS, getMessageActions, areMessagePropsEqual, shouldMessageComponentUpdate, messageHasReactions, messageHasAttachments, getImages, getNonImageAttachments, getReadByTooltipText, MessagePropTypes, MessageActionsBox, MessageActions, MessageInput, MessageInputFlat, MessageInputLarge, MessageInputSmall, MessageInputSimple, EditMessageForm, EmojiPicker, SendButton, UploadsPreview, useMessageInput, MessageList, VirtualizedMessageList, MessageNotification, ConnectionStatus, Modal, ReactionSelector, ReactionsList, SimpleReactionsList, SafeAnchor, Thread, Tooltip, TypingIndicator, UserItem, Window */
19+
/*! exports provided: Attachment, Card, Audio, AttachmentActions, FileAttachment, AutoCompleteTextarea, Item, List, listener, KEY_CODES, defaultScrollToItem, Avatar, ChannelPreview, ChannelPreviewCompact, ChannelPreviewCountOnly, ChannelPreviewLastMessage, ChannelPreviewMessenger, Channel, useChannelEditMessageHandler, useChannelMentionsHandler, ChannelHeader, ChannelList, ChannelListMessenger, ChannelListTeam, ChannelSearch, Chat, ChatAutoComplete, ChatDown, CommandItem, DateSeparator, EmoticonItem, EmptyStateIndicator, EventComponent, Gallery, ImageComponent, ModalImage, ModalWrapper, InfiniteScroll, InfiniteScrollPaginator, ReverseInfiniteScroll, LoadingChannels, LoadingErrorIndicator, LoadingIndicator, LoadMoreButton, LoadMorePaginator, Message, MessageCommerce, MessageLivestream, MessageSimple, MessageTeam, MessageRepliesCountButton, MessageOptions, MessageText, MessageDeleted, FixedHeightMessage, handleActionWarning, useActionHandler, useDeleteHandler, useEditHandler, missingUseFlagHandlerParameterWarning, useFlagHandler, useMentionsHandler, useMentionsUIHandler, missingUseMuteHandlerParamsWarning, useMuteHandler, useOpenThreadHandler, reactionHandlerWarning, useReactionHandler, useReactionClick, useRetryHandler, useUserHandler, useUserRole, validateAndGetMessage, isUserMuted, MESSAGE_ACTIONS, getMessageActions, areMessagePropsEqual, shouldMessageComponentUpdate, messageHasReactions, messageHasAttachments, getImages, getNonImageAttachments, getReadByTooltipText, MessagePropTypes, MessageActionsBox, MessageActions, MessageInput, MessageInputFlat, MessageInputLarge, MessageInputSmall, MessageInputSimple, EditMessageForm, EmojiPicker, UploadsPreview, SendButton, useMessageInput, MessageList, VirtualizedMessageList, MessageNotification, ConnectionStatus, Modal, ReactionSelector, ReactionsList, SimpleReactionsList, SafeAnchor, Thread, Tooltip, TypingIndicator, UserItem, Window */
2020

2121
/*! exports provided: AttachmentIcon, FileIcon, FilePreviewer, FileUploadButton, IconButton, ImageDropzone, ImagePreviewer, ImageUploadButton, LoadingIndicator, PictureIcon, Thumbnail, ThumbnailPlaceholder, dataTransferItemsHaveFiles, dataTransferItemsToFiles */
2222

@@ -86,6 +86,8 @@
8686

8787
/*! exports provided: Effect */
8888

89+
/*! exports provided: EmojiIconLarge, EmojiIconSmall, FileUploadIcon, FileUploadIconFlat, default */
90+
8991
/*! exports provided: EmojiPropTypes, PickerPropTypes */
9092

9193
/*! exports provided: EmoticonItem */
@@ -148,7 +150,7 @@
148150

149151
/*! exports provided: MessageActionsBox, MessageActions */
150152

151-
/*! exports provided: MessageInput, MessageInputFlat, MessageInputLarge, MessageInputSmall, MessageInputSimple, EditMessageForm, EmojiPicker, SendButton, UploadsPreview, useMessageInput */
153+
/*! exports provided: MessageInput, MessageInputFlat, MessageInputLarge, MessageInputSmall, MessageInputSimple, EditMessageForm, EmojiPicker, UploadsPreview, SendButton, useMessageInput */
152154

153155
/*! exports provided: MessageList, VirtualizedMessageList, MessageNotification, ConnectionStatus */
154156

@@ -506,7 +508,7 @@
506508

507509
/*! exports provided: useUserRole */
508510

509-
/*! exports provided: v1, v3, v4, v5 */
511+
/*! exports provided: v1, v3, v4, v5, NIL, version, validate, stringify, parse */
510512

511513
/*! exports provided: validateAndGetMessage, isUserMuted, MESSAGE_ACTIONS, getMessageActions, areMessagePropsEqual, shouldMessageComponentUpdate, messageHasReactions, messageHasAttachments, getImages, getNonImageAttachments, getReadByTooltipText, MessagePropTypes */
512514

@@ -1760,6 +1762,10 @@
17601762
!*** ./src/components/Gallery/ModalImage.js ***!
17611763
\**********************************************/
17621764

1765+
/*!**********************************************!*\
1766+
!*** ./src/components/MessageInput/icons.js ***!
1767+
\**********************************************/
1768+
17631769
/*!**********************************************!*\
17641770
!*** ./src/components/MessageInput/index.js ***!
17651771
\**********************************************/
@@ -2348,6 +2354,10 @@
23482354
!*** ./node_modules/uuid/dist/esm-browser/md5.js ***!
23492355
\***************************************************/
23502356

2357+
/*!***************************************************!*\
2358+
!*** ./node_modules/uuid/dist/esm-browser/nil.js ***!
2359+
\***************************************************/
2360+
23512361
/*!***************************************************!*\
23522362
!*** ./node_modules/uuid/dist/esm-browser/rng.js ***!
23532363
\***************************************************/
@@ -2380,10 +2390,6 @@
23802390
!*** ./src/components/Message/MessageCommerce.js ***!
23812391
\***************************************************/
23822392

2383-
/*!***************************************************!*\
2384-
!*** ./src/components/MessageInput/SendButton.js ***!
2385-
\***************************************************/
2386-
23872393
/*!***************************************************!*\
23882394
!*** ./src/components/MessageList/MessageList.js ***!
23892395
\***************************************************/
@@ -2668,6 +2674,14 @@
26682674
!*** ./node_modules/uuid/dist/esm-browser/index.js ***!
26692675
\*****************************************************/
26702676

2677+
/*!*****************************************************!*\
2678+
!*** ./node_modules/uuid/dist/esm-browser/parse.js ***!
2679+
\*****************************************************/
2680+
2681+
/*!*****************************************************!*\
2682+
!*** ./node_modules/uuid/dist/esm-browser/regex.js ***!
2683+
\*****************************************************/
2684+
26712685
/*!*****************************************************!*\
26722686
!*** ./src/components/Attachment/FileAttachment.js ***!
26732687
\*****************************************************/
@@ -2964,6 +2978,10 @@
29642978
!*** ./node_modules/use-sidecar/dist/es2015/index.js ***!
29652979
\*******************************************************/
29662980

2981+
/*!*******************************************************!*\
2982+
!*** ./node_modules/uuid/dist/esm-browser/version.js ***!
2983+
\*******************************************************/
2984+
29672985
/*!*******************************************************!*\
29682986
!*** ./src/assets/Poweredby_100px-White_VertText.png ***!
29692987
\*******************************************************/
@@ -3140,6 +3158,10 @@
31403158
!*** ./node_modules/use-sidecar/dist/es2015/medium.js ***!
31413159
\********************************************************/
31423160

3161+
/*!********************************************************!*\
3162+
!*** ./node_modules/uuid/dist/esm-browser/validate.js ***!
3163+
\********************************************************/
3164+
31433165
/*!********************************************************!*\
31443166
!*** ./src/components/Attachment/AttachmentActions.js ***!
31453167
\********************************************************/
@@ -3328,6 +3350,10 @@
33283350
!*** ./node_modules/use-sidecar/dist/es2015/exports.js ***!
33293351
\*********************************************************/
33303352

3353+
/*!*********************************************************!*\
3354+
!*** ./node_modules/uuid/dist/esm-browser/stringify.js ***!
3355+
\*********************************************************/
3356+
33313357
/*!*********************************************************!*\
33323358
!*** ./src/components/AutoCompleteTextarea/Textarea.js ***!
33333359
\*********************************************************/
@@ -3664,10 +3690,6 @@
36643690
!*** ./node_modules/react-view-pager/lib/PagerElement.js ***!
36653691
\***********************************************************/
36663692

3667-
/*!***********************************************************!*\
3668-
!*** ./node_modules/uuid/dist/esm-browser/bytesToUuid.js ***!
3669-
\***********************************************************/
3670-
36713693
/*!***********************************************************!*\
36723694
!*** ./src/components/MessageInput/MessageInputSimple.js ***!
36733695
\***********************************************************/

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
</head>
1010
<body>
1111
<div id="rsg-root"></div>
12-
<script src="build/bundle.571d5957.js"></script>
12+
<script src="build/bundle.33cc8b6e.js"></script>
1313
</body>
1414
</html>

examples/commerce/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"react": "^16.12.0",
77
"react-dom": "^16.12.0",
88
"react-scripts": "2.1.4",
9-
"stream-chat": "^2.3.0",
9+
"stream-chat": "^2.12.0",
1010
"stream-chat-react": "^2.4.1"
1111
},
1212
"scripts": {

examples/commerce/src/App.js

Lines changed: 33 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable */
21
import React, { Component } from 'react';
32
import { StreamChat } from 'stream-chat';
43
import {
@@ -15,27 +14,25 @@ import 'stream-chat-react/dist/css/index.css';
1514
import './App.css';
1615

1716
const urlParams = new URLSearchParams(window.location.search);
18-
// const user =
19-
// urlParams.get('user') || process.env.REACT_APP_CHAT_API_DEFAULT_USER;
20-
const theme = urlParams.get('theme') || 'light';
17+
const apiKey = urlParams.get('apiKey') || 'qk4nn7rpcn75';
2118
const channelName = urlParams.get('channel') || 'demo';
22-
// const userToken =
23-
// urlParams.get('user_token') ||
24-
// process.env.REACT_APP_CHAT_API_DEFAULT_USER_TOKEN;
19+
const userId = urlParams.get('user') || 'example-user';
20+
const theme = urlParams.get('theme') || 'light';
21+
const userToken =
22+
urlParams.get('user_token') ||
23+
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZXhhbXBsZS11c2VyIn0.HlC0dMKL43y3K_XbfvQS_Yc3V314HU4Z7LrBLil777g';
2524

2625
class App extends Component {
2726
constructor(props) {
2827
super(props);
29-
this.chatClient = new StreamChat('qk4nn7rpcn75');
28+
this.chatClient = StreamChat.getInstance(apiKey);
29+
3030
if (process.env.REACT_APP_CHAT_SERVER_ENDPOINT) {
3131
this.chatClient.setBaseURL(process.env.REACT_APP_CHAT_SERVER_ENDPOINT);
3232
}
33-
this.chatClient.setUser(
34-
{
35-
id: 'example-user',
36-
},
37-
'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiZXhhbXBsZS11c2VyIn0.HlC0dMKL43y3K_XbfvQS_Yc3V314HU4Z7LrBLil777g',
38-
);
33+
34+
this.chatClient.connectUser({ id: userId }, userToken);
35+
3936
this.channel = this.chatClient.channel('commerce', channelName, {
4037
image: 'https://i.stack.imgur.com/e7G42m.jpg',
4138
name: 'Hello 👋',
@@ -60,34 +57,30 @@ class App extends Component {
6057

6158
render() {
6259
return (
63-
<>
64-
<div className={`wrapper ${this.state.open ? 'wrapper--open' : ''}`}>
65-
<Chat client={this.chatClient} theme={`commerce ${theme}`}>
66-
<Channel
67-
channel={this.channel}
68-
onMentionsHover={(e, user) => console.log(e, user)}
69-
onMentionsClick={(e, user) => console.log(e, user)}
70-
>
71-
<Window>
72-
<ChannelHeader />
73-
{this.state.open && <MessageList Message={MessageCommerce} />}
74-
<MessageInput
75-
onFocus={!this.state.open ? this.toggleDemo : null}
76-
Input={MessageInputFlat}
77-
focus
78-
/>
79-
</Window>
80-
</Channel>
81-
</Chat>
82-
<Button onClick={this.toggleDemo} open={this.state.open} />
83-
</div>
84-
</>
60+
<div className={`wrapper ${this.state.open ? 'wrapper--open' : ''}`}>
61+
<Chat client={this.chatClient} theme={`commerce ${theme}`}>
62+
<Channel
63+
channel={this.channel}
64+
onMentionsHover={(event, user) => console.log(event, user)}
65+
onMentionsClick={(event, user) => console.log(event, user)}
66+
>
67+
<Window>
68+
<ChannelHeader />
69+
{this.state.open && <MessageList Message={MessageCommerce} />}
70+
<MessageInput
71+
onFocus={!this.state.open ? this.toggleDemo : null}
72+
Input={MessageInputFlat}
73+
focus
74+
/>
75+
</Window>
76+
</Channel>
77+
</Chat>
78+
<Button onClick={this.toggleDemo} open={this.state.open} />
79+
</div>
8580
);
8681
}
8782
}
8883

89-
export default App;
90-
9184
const Button = ({ open, onClick }) => (
9285
<div
9386
onClick={onClick}
@@ -110,3 +103,5 @@ const Button = ({ open, onClick }) => (
110103
)}
111104
</div>
112105
);
106+
107+
export default App;

0 commit comments

Comments
 (0)