Releases: sendbird/sendbird-uikit-react
Releases · sendbird/sendbird-uikit-react
[v3.14.13] (July 18, 2024)
Features
-
Address RTL UI Feedback
- Fixed an issue where the
htmlTextDirection
prop didn't work when usingSendbirdProvider
, but only worked in the App module. - Updated the paper plane icon to point left instead of right in RTL mode.
- Fixed an issue where the
-
Message Menu Customization in Threads
- Added
renderMessageMenu
andrenderEmojiMenu
props to the<ParentMessageInfo />
,<ThreadListItem />
, and<ThreadListItemContent />
components. - Example usage:
<Thread renderMessage={(props) => ( <ThreadListItem {...props} renderMessageMenu={(props) => ( <MessageMenu {...props} renderMenuItems={({ items }) => ( <> <items.CopyMenuItem /> <items.DeleteMenuItem /> </> )} /> )} /> )} />
- Added
Fixes
- Deprecation Marks on Channel & ChannelList Modules
- Marked
Channel
,ChannelProvider
,ChannelList
, andChannelListProvider
as deprecated. - For migration guidance, please refer to the Group Channel Migration Guide.
- Marked
Chore
- Improve Stability of
useMenuItems
- Improved the stability of the
useMenuItems
hook. - Exported
ChannelListQueryParamsType
. - Moved the
renderUserListItem
prop to the Provider from the UI component. - Exported the
ChannelSettingsMenuItem
component.
- Improved the stability of the
- Added
interop: "compat"
setting for the CommonJS output in Rollup Config to enhance the compatibility between ESM and CJS.
[v3.14.12] (July 3, 2024)
Features
-
RTL Support
- Added
htmlTextDirection
prop toSendbirdProvider
to support Right-To-Left (RTL) text direction for Middle East customers. Read more.
import ar from 'date-fns/locale/ar'; <SendbirdProvider ... htmlTextDirection={'rtl' | 'ltr'} // Setting a proper value to dateLocale would be necessary dateLocale={ar} > </SendbirdProvider>
- Added
-
DX Improvements: ChannelSetting SettingMenu
- Added new components and hooks to make the menu items in the
ChannelSettingsUI
more modular and customizable. - New Files:
useMenuItems.tsx
: Custom hook for menu items based on user roles.MenuItem.tsx
: Reusable and customizable menu item component.MenuListByRole.tsx
: Renders a list of menu items based on user roles.
- Example usage:
To customize the moderation panel with selected menu items:import React from 'react'; import ChannelSettingsUI from '@sendbird-uikit/ChannelSettings/components/ChannelSettingsUI'; import useMenuItems from '@sendbird-uikit/ChannelSettings/hooks/useMenuList'; const CustomChannelSettings = () => { const menuItems = useMenuItems(); const renderCustomModerationPanel = () => { // Create a new object by selecting only the desired menu items. const customMenuItems = { operator: { operators: menuItems.operator.operators, // Keep the operators menu allUsers: menuItems.operator.allUsers, // Keep the all users menu // Add or remove other menu items as needed. }, nonOperator: { allUsers: menuItems.nonOperator.allUsers, // Keep the all users menu // Add or remove other menu items as needed. }, }; return <MenuListByRole menuItems={customMenuItems} />; }; return ( <ChannelSettingsUI renderModerationPanel={renderCustomModerationPanel} /> ); }; export default CustomChannelSettings;
- Added new components and hooks to make the menu items in the
-
DX Improvements: ChannelSetting UserListItem
UserListItemMenu
has been newly created- Provided it as a module which also contains
UserListItemMenuProvider
anduseUserListItemMenuContext
import { UserListItemMenu, UserListItemMenuProvider, useUserListItemMenuContext } from '@sendbird/uikit-react/ui/UserListItemMenu';
- Added new
renderUserListItem
props to the list components ofChannelSettings
:OperatorList
,MemberList
,MutedMemberList
,BannedUserList
- Exported the following modules:
OperatorList
,MemberList
,MutedMemberList
,BannedUserList
import { OperatorList, MemberList, MutedMemberList, BannedUserList } from '@sendbird/uikit-react/ChannelSettings/components/ChannelSettingsUI';
- Merged
ui/UserListItem
andChannelSettings/components/UserListItem
:- Use
ui/UserListItem
from now on - Added
size
prop toUserListItem
, which now accepts two values: 'normal' and 'small' ('small' replaces the previousChannelSettings/components/UserListItem
)normal
: Used primarily in Modalssmall
: Used primarily in Lists
- Use
- Example usage:
<ChannelSettings renderUserListItem={(props) => ( <UserListItem {...props} renderListItemMenu={(props) => ( <UserListItemMenu {...props} onToggleOperatorState={({ user, newState, error }) => {/** Handle operator state change */}} onToggleMuteState={({ user, newState, error }) => {/** Handle mute state change */}} onToggleBanState={({ user, newState, error }) => {/** Handle ban state change */}} renderTrigger={({ ref }) => (<div ref={ref}>{/** Render your custom trigger icon here */}</div>)} renderMenuItems={({ items }) => ( <> <items.OperatorToggleMenuItem /> <items.MuteToggleMenuItem /> <items.BanToggleMenuItem /> </> )} /> )} /> )} />
Fixes
- Fixed image file viewer header style
- Disabled
isSuperGroupReactionsEnabled
setter - Use
APP_LAYOUT_ROOT
to get the area info of the UIKitexport const APP_LAYOUT_ROOT = 'sendbird-app__layout';
- To ensure the menu positions are calculated correctly, wrap the entire area using
SendbirdProvider
with a tag that has the specified ID.
- To ensure the menu positions are calculated correctly, wrap the entire area using
Chore
- Updated
@sendbird/chat
version to 4.13.0- Improved channel/message refreshing performance utilizing LocalCaching.
[v3.14.11] (June 20, 2024)
Features
-
Markdown Support for Text Messages
- Added
enableMarkdownForUserMessage
toUIKitOptions
. When enabled, markdown syntaxes for bold and link are now applied to user messages.
- Added
-
Descriptive Color Names Support
- Users can now customize the color set using more descriptive color names instead of numerical codes.
- Added a color map parsing utility function,
mapColorKeys
, to support both new and existing color names. - Detailed color name mappings:
- Primary, Secondary, Error, information
Primary-500 -> Primary-extra dark Primary-400 -> Primary-dark Primary-300 -> Primary-main Primary-200 -> Primary-light Primary-100 -> Primary-extra light Secondary-500 -> Secondary-extra dark Secondary-400 -> Secondary-dark Secondary-300 -> Secondary-main Secondary-200 -> Secondary-light Secondary-100 -> Secondary-extra light
- Background 100~700: No changes
- Overlay
Overlay-01 -> Overlay-dark Overlay-02 -> Overlay-light
- OnLight & OnDark
// On Light On Light-01 -> Onlight-text-high-emphasis On Light-02 -> Onlight-text-mid-emphasis On Light-03 -> Onlight-text-low-emphasis On Light-04 -> Onlight-text-disabled // On Dark On Dark -01 -> Ondark-text-high-emphasis On Dark -02 -> Ondark-text-mid-emphasis On Dark -03 -> Ondark-text-low-emphasis On Dark -04 -> Ondark-text-disabled
-
Message Menu Component Refactor
-
Created
MessageMenuProvider
,useMessageMenuContext
, andMessageMenu
component. -
Replaced
MessageItemMenu
withMessageMenu
in GroupChannel. Future PR will apply it to Thread. -
Migrated
MobileContextMenu
andMobileBottomSheet
usingMessageMenuProvider
. -
Exported the
MobileMenu
import { MobileMenu, MobileContextMenu, MobileBottomSheet } from '@sendbird/uikit-react/ui/MobileMenu';
-
How to use?
Desktop menu
import GroupChannel from '@sendbird/uikit-react/GroupChannel'; import MessageContent from '@sendbird/uikit-react/ui/MessageContent'; import { MessageMenu } from '@sendbird/uikit-react/ui/MessageMenu'; const GroupChannelPage = () => ( <GroupChannel renderMessageContent={(props) => ( <MessageContent {...props} renderMessageMenu={(props) => ( <MessageMenu {...props} renderMenuItems={(props) => { const { CopyMenuItem, ReplyMenuItem, // ... DeleteMenuItem, } = props.items; // organize the menu items using the items return ( <> <CopyMenuItem /> <DeleteMenuItem /> </> ); }} /> )} /> )} /> );
Mobile menu
import GroupChannel from '@sendbird/uikit-react/GroupChannel'; import MessageContent from '@sendbird/uikit-react/ui/MessageContent'; import { MobileMenu } from '@sendbird/uikit-react/ui/MessageMenu'; const GroupChannelPage = () => ( <GroupChannel renderMessageContent={(props) => ( <MessageContent {...props} renderMobileMenuOnLongPress={(props) => ( <MobileMenu {...props} renderMenuItems={(props) => { const { CopyMenuItem, ReplyMenuItem, // ... DeleteMenuItem, } = props.items; // organize the menu items using the items return ( <> <CopyMenuItem /> <DeleteMenuItem /> </> ); }} /> )} /> )} /> );
-
Fixes
- Fixed an issue where the
newMessages
array was not being reset even after the message list scroll reached the bottom, causing the message notification bar to not disappear properly. Manually calledresetNewMessages()
under certain conditions. - Updated the logic to align with other platforms for consistency. Relocated the logic to the same section where other
disabled
conditions are checked.
[v3.14.10] (June 13, 2024)
Fixes
- Replaced onlight-05 with onlight-03 since onlight-05 doesn't exist in the product design guide.
- Added the
onClose
event to the modals inside of theFileViewer
components.
v3.14.9
[v3.14.9] (June 7, 2024)
Fixes
- Resolved an issue where M4A format audio files were not playing in Safari. M4A files are now parsed as
audio/x-m4a
to ensure proper playback. - Prevented the newly created channels from being filtered out from the ChannelList.
Features
- Added a modal to the
FileViewer
components for utilizing theonMounted
event handler.
[v3.14.8] (May 30, 2024)
Fixes
- Resolved the issue of storybook user leaving the channel
- Added a workaround to reset IME in mobile webkit for better input handling
- This fix involves creating a ghost input to manage focus transitions, preventing the virtual keyboard from closing and ensuring the proper composition of characters like Hangul
- The ghost input is used to reset the IME context, and focus is moved back to the original input using
requestAnimationFrame
to avoid delays
- Retry connection when failed with a token expired error
- Ensure scroll to the bottom of the list when mounted before painting
- Minor bug fixes and adjustments for
SuggestedReplyItem
component:- Fixed a bug where horizontal suggested reply items contents are not wrapping to multiple lines
- Adjusted bubble size
- Added missing margin
Features
- Added support for rendering
.mov
file type only in Safari browser
[v3.14.7] (May 23, 2024)
Fixes
- Fixed issue where files that failed to compress were not being sent
- Cleaned up the props of the
ChannelSettings
component to ensure all missed props are applied - Exported the
ChannelSettingsHeader
component as defaultimport ChannelSettingsHeader from '@sendbird/uikit-react/ChannelSettings/components/ChannelSettingsHeader'
- Fixed the issue where the mention feature did not work properly in the input component
- Fixed the issue where unnecessary spaces were added between mention texts when editing an already mentioned message
- Improved the scroll position flickering issue when loading previous messages
- Implemented an attempt to load based on screen size threshold
- Added
data-testid
to the UI components for making it easily to select them in the QE test
Features
- Added
MESSAGE_INPUT__PLACE_HOLDER__FROZEN
to StringSet:'Chat is unavailable in this channel'
v3.14.6
v3.14.5
v3.14.4
[v3.14.4] (May 02, 2024)
Features
- Added
suggestedRepliesDirection
global option which serves as vertical/horizontal scroll option forSuggestedReplies
- How to use?
<App appId={appId} userId={userId} uikitOptions={{ groupChannel: { // Below turns on the `SuggestedReplies` feature (see v3.8.0 release changelog). Default value is false. enableSuggestedReplies: true, // Below changes scroll direction from horizontal to vertical. suggestedRepliesDirection: 'vertical' } }} />
- Added a new ui component
Header
(import Header from '@sendbird/uikit-react/ui/Header'
) which replaced all existing header components - Added modal.onMounted handler to global eventHandlers. This event handler is triggered within the useEffect of the Modal component at mounting time.
Fixes
- Fixed a bug where suggested replies are incorrectly displayed when
showSuggestedRepliesFor
is set to 'last_message_only'