From df88ea2c6a784072186a962d4b80293490bb7df0 Mon Sep 17 00:00:00 2001 From: Liam Hongman Cho Date: Fri, 31 May 2024 16:28:49 +0900 Subject: [PATCH] release/v1.6.0 (#258) ## [1.6.0] (May 31, 2024) ### Feat: - Added `messageInputControls` to `Constant`. It allows to control enabled/disabled state of the message input - Added `dateLocale` to `Constant`. It is applied to string values of message timestamp and date separator - Added the `enableHideWidgetForDeactivatedUser` to `Constant`. It is used to decide whether the chatbot widget is hidden or not when the user is deactivated ```tsx import { ar } from 'date-fns/locale'; ``` Refer to [**Available props** section in **README.md**](./README.md#available-props) file for details. ### Fix: - Fixed a bug where multiple timestamps of messages are not grouped into one when should be if `botStudioEditProps.welcomeMessages` is given --------- Co-authored-by: sendbird-sdk-deployment --- CHANGELOG.md | 23 +++++++++++++++++++++++ README.md | 5 +++-- package.json | 2 +- packages/self-service/package.json | 2 +- src/App.tsx | 2 ++ src/const.ts | 2 +- yarn.lock | 4 ++-- 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b58581bd..45ccd3d3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,26 @@ +## [1.6.0] (May 31, 2024) +### Feat: +- Added `messageInputControls` to `Constant`. It allows to control enabled/disabled state of the message input +- Added `dateLocale` to `Constant`. It is applied to string values of message timestamp and date separator +- Added the `enableHideWidgetForDeactivatedUser` to `Constant`. It is used to decide whether the chatbot widget is hidden or not when the user is deactivated +```tsx +import { ar } from 'date-fns/locale'; + + +``` +Refer to [**Available props** section in **README.md**](./README.md#available-props) file for details. + +### Fix: +- Fixed a bug where multiple timestamps of messages are not grouped into one when should be if `botStudioEditProps.welcomeMessages` is given + ## [1.5.12] (May 28, 2024) ### Feat: - Added horizontal suggested replies support. diff --git a/README.md b/README.md index 13306f4a4..ae3dbf893 100644 --- a/README.md +++ b/README.md @@ -120,9 +120,10 @@ export default App; | `customRefreshComponent` | `{ icon: string, style: React.CSSProperties, width: string, height: string, onClick: () => void }` | No | N/A | Customizable refresh component. You can set properties such as `icon`, `style`, `width`, `height`, and `onClick`. | | `configureSession` | `() => SessionHandler` | No | N/A | Function to configure the user session. The example usage can be found [here](./custom-session-guide.md).

Must be used with `userId`.| | `autoOpen` | `boolean` | No | N/A | Determines whether the chatbot widget automatically opens when the browser window is opened. | -| `messageInputControls.blockWhileBotResponding` | `boolean \| number` | No | N/A | Allows to control enabled/disabled state of the message input for waiting for the bot's reply mesage. If number value is given, a timer will be set to force unblock the message input. | | `enableResetHistoryOnConnect` | `boolean` | No | `false` | Determines whether the chatbot widget history is reset when the user connects. | -| `enableHideWidgetForDeactivatedUser` | `boolean` | No | `false` | Determines whether the chatbot widget is hidden when the user is deactivated. | +| `messageInputControls.blockWhileBotResponding` | `boolean \| number` | No | N/A | Allows to control enabled/disabled state of the message input for waiting for the bot's reply mesage. If number value is given, a timer will be set to force unblock the message input. | +| `dateLocale` | `Locale` | No | `enUS` | Locale value to be applied to string values of message timestamp and date separator. Locale values must be imported from `date-fns`. | +| `enableHideWidgetForDeactivatedUser` | `boolean` | No | `false` | Determines whether the chatbot widget is hidden when the user is deactivated. | ## For internal contributors - [Release guide](./release-guide.md) diff --git a/package.json b/package.json index 16bd4fc99..83b83df2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sendbird/chat-ai-widget", - "version": "1.5.12", + "version": "1.6.0", "description": "Sendbird Chat AI Widget,\n Detailed documentation can be found at https://github.com/sendbird/chat-ai-widget#readme", "main": "./dist/index.umd.js", "module": "./dist/index.es.js", diff --git a/packages/self-service/package.json b/packages/self-service/package.json index 73b7ef8ce..42af93635 100644 --- a/packages/self-service/package.json +++ b/packages/self-service/package.json @@ -15,7 +15,7 @@ "format": "npm run prettier:fix && npm run lint:fix" }, "dependencies": { - "@sendbird/chat-ai-widget": "1.5.12", + "@sendbird/chat-ai-widget": "1.6.0", "react": "^18.2.0", "react-dom": "^18.2.0" }, diff --git a/src/App.tsx b/src/App.tsx index 5d3c210be..ff4bca242 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,3 +1,4 @@ +import { ar } from 'date-fns/locale'; import React from 'react'; import { StringSet } from '@uikit/ui/Label/stringSet'; @@ -47,6 +48,7 @@ const App = (props: Props) => { // messageInputControls={{ // blockWhileBotResponding: false, // }} + // dateLocale={ar} // callbacks={{ // onWidgetExpandStateChange: (newIsExpanded) => { // console.log('## newIsExpanded: ', newIsExpanded); diff --git a/src/const.ts b/src/const.ts index 8af4a6b9d..9f2c10449 100644 --- a/src/const.ts +++ b/src/const.ts @@ -172,7 +172,7 @@ export interface Constant extends ConstantFeatureFlags { */ autoOpen?: boolean; /** - * @public locale instance to be applied + * @public Locale value to be applied to string values of message timestamp and date separator. */ dateLocale: Locale; /** diff --git a/yarn.lock b/yarn.lock index 94e5fa379..28d7f3665 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3022,7 +3022,7 @@ __metadata: languageName: node linkType: hard -"@sendbird/chat-ai-widget@npm:1.5.12, @sendbird/chat-ai-widget@workspace:.": +"@sendbird/chat-ai-widget@npm:1.6.0, @sendbird/chat-ai-widget@workspace:.": version: 0.0.0-use.local resolution: "@sendbird/chat-ai-widget@workspace:." dependencies: @@ -15699,7 +15699,7 @@ __metadata: version: 0.0.0-use.local resolution: "self-service@workspace:packages/self-service" dependencies: - "@sendbird/chat-ai-widget": "npm:1.5.12" + "@sendbird/chat-ai-widget": "npm:1.6.0" "@types/react": "npm:^18.0.37" "@types/react-dom": "npm:^18.0.11" "@vitejs/plugin-react": "npm:^4.2.1"