Skip to content

Commit e20784c

Browse files
committed
Merge branch 'master' of github.com:GetStream/stream-chat-react into handleSubmit-type-fix
2 parents 36d8723 + 10e03f9 commit e20784c

20 files changed

+149
-46
lines changed

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
# Changelog
22

33

4+
## [5.1.3](https://github.com/GetStream/stream-chat-react/releases/tag/v5.1.3) 2021-04-06
5+
6+
### Feature
7+
8+
- Optimize message list components by limiting excess `loadMore` calls [#841](https://github.com/GetStream/stream-chat-react/pull/841)
9+
10+
### Bug
11+
12+
- Fix `AutoCompleteTextarea` trigger highlighting bug [#839](https://github.com/GetStream/stream-chat-react/pull/839)
13+
14+
## [5.1.2](https://github.com/GetStream/stream-chat-react/releases/tag/v5.1.2) 2021-04-05
15+
16+
### Feature
17+
18+
- Provide option to hide `DateSeparator` component for new messages with the `hideNewMessageSeparator` prop on `MessageList` and `VirtualizedMessageList` components [#837](https://github.com/GetStream/stream-chat-react/pull/837)
19+
20+
### Bug
21+
22+
- Fix bad conditional in `useMentionsHandlers` custom hook [#836](https://github.com/GetStream/stream-chat-react/pull/836)
23+
24+
## [5.1.1](https://github.com/GetStream/stream-chat-react/releases/tag/v5.1.1) 2021-04-02
25+
26+
### Feature
27+
28+
- Show formatted date separator for new messages [#818](https://github.com/GetStream/stream-chat-react/pull/818)
29+
- Provide option to display flag emojis as images on Windows via `useImageFlagEmojisOnWindows` prop [#821](https://github.com/GetStream/stream-chat-react/pull/821)
30+
- Hide reaction icon when a message has reactions [#826](https://github.com/GetStream/stream-chat-react/pull/826)
31+
32+
### Chore
33+
34+
- Update types on `Chat` component [#825](https://github.com/GetStream/stream-chat-react/pull/825)
35+
- Update Prettier settings [#831](https://github.com/GetStream/stream-chat-react/pull/831)
36+
37+
### Bug
38+
39+
- Escape characters that break emoji regex [#823](https://github.com/GetStream/stream-chat-react/pull/823)
40+
- Fix autocomplete textarea text replace algorithm [#827](https://github.com/GetStream/stream-chat-react/pull/827)
41+
- Force close suggestions list on submit [#828](https://github.com/GetStream/stream-chat-react/pull/828)
42+
443
## [5.1.0](https://github.com/GetStream/stream-chat-react/releases/tag/v5.1.0) 2021-03-30
544

645
### Feature
752 KB
Binary file not shown.
3.19 MB
Binary file not shown.

docs/EmojiOneColor.woff2

3.19 MB
Binary file not shown.

docs/NotoColorEmoji-flags.woff2

752 KB
Binary file not shown.

docs/build/bundle.487833e0.js renamed to docs/build/bundle.61874883.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.487833e0.js.LICENSE.txt renamed to docs/build/bundle.61874883.js.LICENSE.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@
6868

6969
/*! exports provided: Chat */
7070

71+
/*! exports provided: Chat, useChat */
72+
7173
/*! exports provided: ChatAutoComplete */
7274

7375
/*! exports provided: ChatContext, ChatProvider, useChatContext, withChatContext */
@@ -456,7 +458,7 @@
456458

457459
/*! exports provided: isNode */
458460

459-
/*! exports provided: isOnlyEmojis, truncate, renderText, generateRandomId, smartRender */
461+
/*! exports provided: isOnlyEmojis, truncate, renderText, escapeRegExp, generateRandomId, smartRender */
460462

461463
/*! exports provided: isVisible, notHiddenInput, isGuard, isNotAGuard, isDefined */
462464

@@ -964,6 +966,10 @@
964966
!*** ./src/context/ChannelContext.tsx ***!
965967
\****************************************/
966968

969+
/*!*****************************************!*\
970+
!*** ./dist/assets/EmojiOneColor.woff2 ***!
971+
\*****************************************/
972+
967973
/*!*****************************************!*\
968974
!*** ./node_modules/acorn-jsx/index.js ***!
969975
\*****************************************/
@@ -2012,6 +2018,10 @@
20122018
!*** ./src/components/MessageList/Center.tsx ***!
20132019
\***********************************************/
20142020

2021+
/*!************************************************!*\
2022+
!*** ./dist/assets/NotoColorEmoji-flags.woff2 ***!
2023+
\************************************************/
2024+
20152025
/*!************************************************!*\
20162026
!*** ./node_modules/a11y-focus-store/index.js ***!
20172027
\************************************************/

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.487833e0.js"></script>
12+
<script src="build/bundle.61874883.js"></script>
1313
</body>
1414
</html>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stream-chat-react",
3-
"version": "5.1.0",
3+
"version": "5.1.3",
44
"description": "React components to create chat conversations or livestream style chat",
55
"author": "GetStream",
66
"homepage": "https://getstream.io/chat/",

src/components/AutoCompleteTextarea/List.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ const List = (props) => {
1010
const {
1111
className,
1212
component,
13+
currentTrigger,
1314
dropdownScroll,
1415
getSelectedItem,
1516
getTextToReplace,
1617
itemClassName,
1718
itemStyle,
1819
onSelect,
1920
style,
21+
selectionEnd,
2022
SuggestionItem = Item,
2123
value: propValue,
2224
values,
@@ -123,7 +125,10 @@ const List = (props) => {
123125
const restructureItem = (item) => {
124126
const matched = item.name || item.id;
125127

126-
const editedPropValue = escapeRegExp(propValue.slice(1));
128+
const textBeforeCursor = propValue.slice(0, selectionEnd);
129+
const triggerIndex = textBeforeCursor.lastIndexOf(currentTrigger);
130+
const editedPropValue = escapeRegExp(textBeforeCursor.slice(triggerIndex + 1));
131+
127132
const parts = matched.split(new RegExp(`(${editedPropValue})`, 'gi'));
128133

129134
const itemNameParts = { match: editedPropValue, parts };

0 commit comments

Comments
 (0)