Skip to content

Commit df73f01

Browse files
authored
Release v3.3.0 (#368)
[v3.3.0] (Nov 23 2022) Features: * Provide new module `Thread`. See the specific informations of this module on the [Docs page](https://sendbird.com/docs/uikit) * You can use a combined component `Thread`. Import it with ```typescript import Thread from "@sendbird/uikit-react/Thread" ``` * Also you can use `ThreadProvider` and `useThreadContext` for customization. Import it with ```typescript import { ThreadProvider, useThreadContext } from "@sendbird/uikit-react/Thread/context" ``` * And the other UI components are provided under the Thread. `ThreadUI`, `ThreadHeader`, `ParentMessageInfo`, `ParentMessageInfoItem`, `ThreadList`, `ThreadListItem`, and `ThreadMessageInput` are it * Add channel props * `threadReplySelectType`: Type of the value should be ```typescript enum ThreadReplySelectType { PARENT, THREAD } ``` You can see how to use it below ```typescript import { ThreadReplySelectType } from "@sendbird/uikit-react/Channel/context"; <Channel ... threadReplySelectType={ThreadReplySelectType.PARENT} /> ``` * `animatedMessage`: Type of the value should be number(messageId) * `onReplyInThread`: This function is called when user click the button "Reply in thread" on the message context menu ```typescript type onReplyInThread = ({ message: UserMessage | FileMessage }) => void ``` * `onQuoteMessageClick`: This function is called when user click the quote message on the message of Channel ```typescript type onQuoteMessageClick = ({ message: UserMessage | FileMessage }) => {} ``` * `onMessageAnimated`: This function is called after that message item is animated ```typescript type onMessageAnimated = () => void ``` * `onMessageHighlighted`: This function is called after that message item is highlighted ```typescript type onMessageHighlighted = () => void ``` * Add `ui/ThreadReplies` component ```typescript interface ThreadRepliesProps { className?: string; threadInfo: ThreadInfo; onClick?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void; } ``` Fixes: * Do not allow operator to unregister itself on the OperatorList of GroupChannel * Create new group channel when user open 1:1 channel on the UserProfile * Register the channel creator as an operator in 1:1 channel
1 parent 13e74d9 commit df73f01

File tree

5 files changed

+71
-7
lines changed

5 files changed

+71
-7
lines changed

CHANGELOG.md

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

3+
## [v3.3.0] (Nov 23 2022)
4+
Features:
5+
* Provide new module `Thread`. See the specific informations of this module on the [Docs page](https://sendbird.com/docs/uikit)
6+
* You can use a combined component `Thread`. Import it with
7+
```typescript
8+
import Thread from "@sendbird/uikit-react/Thread"
9+
```
10+
* Also you can use `ThreadProvider` and `useThreadContext` for customization. Import it with
11+
```typescript
12+
import { ThreadProvider, useThreadContext } from "@sendbird/uikit-react/Thread/context"
13+
```
14+
* And the other UI components are provided under the Thread. `ThreadUI`, `ThreadHeader`, `ParentMessageInfo`, `ParentMessageInfoItem`, `ThreadList`, `ThreadListItem`, and `ThreadMessageInput` are it
15+
* Add channel props
16+
* `threadReplySelectType`: Type of the value should be
17+
```typescript
18+
enum ThreadReplySelectType { PARENT, THREAD }
19+
```
20+
You can see how to use it below
21+
```typescript
22+
import { ThreadReplySelectType } from "@sendbird/uikit-react/Channel/context";
23+
24+
<Channel
25+
...
26+
threadReplySelectType={ThreadReplySelectType.PARENT}
27+
/>
28+
```
29+
* `animatedMessage`: Type of the value should be number(messageId)
30+
* `onReplyInThread`: This function is called when user click the button "Reply in thread" on the message context menu
31+
```typescript
32+
type onReplyInThread = ({ message: UserMessage | FileMessage }) => void
33+
```
34+
* `onQuoteMessageClick`: This function is called when user click the quote message on the message of Channel
35+
```typescript
36+
type onQuoteMessageClick = ({ message: UserMessage | FileMessage }) => {}
37+
```
38+
* `onMessageAnimated`: This function is called after that message item is animated
39+
```typescript
40+
type onMessageAnimated = () => void
41+
```
42+
* `onMessageHighlighted`: This function is called after that message item is highlighted
43+
```typescript
44+
type onMessageHighlighted = () => void
45+
```
46+
* Add `ui/ThreadReplies` component
47+
```typescript
48+
interface ThreadRepliesProps {
49+
className?: string;
50+
threadInfo: ThreadInfo;
51+
onClick?: (e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void;
52+
}
53+
```
54+
55+
Fixes:
56+
* Do not allow operator to unregister itself on the OperatorList of GroupChannel
57+
* Create new group channel when user open 1:1 channel on the UserProfile
58+
* Register the channel creator as an operator in 1:1 channel
59+
360
## [v3.2.6] (Nov 14 2022)
461
Fix:
562
* Use ref instead of querySelector for DOM manipulation

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sendbird/uikit-react",
3-
"version": "3.2.6",
3+
"version": "3.3.0",
44
"description": "React based UI kit for sendbird",
55
"main": "dist/index.js",
66
"style": "dist/index.css",

scripts/index_d_ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ declare module "SendbirdUIKitGlobal" {
469469
isReactionEnabled?: boolean;
470470
isMessageGroupingEnabled?: boolean;
471471
showSearchIcon?: boolean;
472+
animatedMessage?: number;
472473
highlightedMessage?: number;
473474
startingPoint?: number;
474475
onBeforeSendUserMessage?(text: string, quotedMessage?: UserMessage | FileMessage): UserMessageCreateParams;
@@ -480,9 +481,13 @@ declare module "SendbirdUIKitGlobal" {
480481
replyType?: ReplyType;
481482
threadReplySelectType?: ThreadReplySelectType;
482483
queries?: ChannelQueries;
483-
renderUserProfile?: (props: RenderUserProfileProps) => React.ReactNode | React.ReactElement;
484+
renderUserProfile?: (props: RenderUserProfileProps) => React.ReactElement;
484485
disableUserProfile?: boolean;
485486
disableMarkAsRead?: boolean;
487+
onReplyInThread?: (props: { message: UserMessage | FileMessage }) => void;
488+
onQuoteMessageClick?: (props: { message: UserMessage | FileMessage }) => void;
489+
onMessageAnimated?: () => void;
490+
onMessageHighlighted?: () => void;
486491
};
487492

488493
export interface ChannelUIProps {
@@ -1258,7 +1263,7 @@ declare module '@sendbird/uikit-react/Channel/context' {
12581263
import SendbirdUIKitGlobal from 'SendbirdUIKitGlobal';
12591264
export const ChannelProvider: React.FunctionComponent<SendbirdUIKitGlobal.ChannelContextProps>;
12601265
export function useChannelContext(): SendbirdUIKitGlobal.ChannelProviderInterface;
1261-
export const ThreadReplySelectType: SendbirdUIKitGlobal.ThreadReplySelectType;
1266+
export enum ThreadReplySelectType { PARENT, THREAD }
12621267
}
12631268

12641269
declare module '@sendbird/uikit-react/Channel/components/ChannelHeader' {

src/smart-components/Channel/context/ChannelProvider.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import useMemoizedEmojiListItems from './hooks/useMemoizedEmojiListItems';
4242
import useToggleReactionCallback from './hooks/useToggleReactionCallback';
4343
import useScrollToMessage from './hooks/useScrollToMessage';
4444
import { CustomUseReducerDispatcher } from '../../../lib/SendbirdState';
45-
import { ThreadReplySelectType as _ThreadReplySelectType } from './const';
4645

4746
export type MessageListParams = {
4847
// https://sendbird.github.io/core-sdk-javascript/module-model_params_messageListParams-MessageListParams.html
@@ -66,7 +65,10 @@ export type ChannelQueries = {
6665
messageListParams?: MessageListParams;
6766
};
6867

69-
export const ThreadReplySelectType = _ThreadReplySelectType;
68+
export enum ThreadReplySelectType {
69+
PARENT = 'PARENT',
70+
THREAD = 'THREAD',
71+
}
7072

7173
export type ChannelContextProps = {
7274
children?: React.ReactElement;

0 commit comments

Comments
 (0)