Skip to content

Commit 46f05a3

Browse files
committed
docs: Minor updates
1 parent b3ebb5a commit 46f05a3

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

docs/api/hooks.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ The `useMessages` hook allows you to track and manage the chatbot's messages.
216216
| endStreamMessage | `async function` | Refer [here](/api/params#endstreammessage) | A utility function used to indicate the end of an existing message stream, identical to `params.endMessageStream`. |
217217
| removeMessage | `async function` | Refer [here](/api/params#removemessage) | A utility function used to remove a message from the chat, identical to `params.removeMessage`. |
218218
| messages | `Array<Message>` | - |Array containing all messages currently shown in the chatbot. |
219-
| replaceMessages | `function` | **newMessages (required)** - `Message[]` to replace chat with | Directly replaces the current messages with provided messages. |
219+
| replaceMessages | `function` | **newMessagesOrUpdater (required)** - Either: (1) `Message[]` to replace chat with, or (2) a callback `(prevMessages: Message[]) => Message[]` returning the new messages. | Directly replaces the current messages with provided messages, or computes them from the previous state. |
220220

221221
#### Code Example
222222
```jsx
@@ -298,8 +298,7 @@ The `usePaths` hook allows you to track and manage the chatbot's paths.
298298
| getPrevPath | `function` | - | Retrieves the previous path of the user. |
299299
| goToPath | `function` | Refer [here](/api/params#gotopath) | Sends the user to a specified path, identical to `params.goToPath`. |
300300
| paths | `Array<string>` | - | Array containing all paths the user has taken in order. |
301-
| replacePaths | `function` | **newPaths (required)** - `string[]` containing paths to replace with | Directly replaces the current paths with provided paths (hardly a reason to do this, think twice). |
302-
301+
| replacePaths | `function` | **newPathsOrUpdater (required)** – Either: (1) `string[]` containing paths to replace with, or (2) a callback `(prevPaths: string[]) => string[]` returning the new paths. | Directly replaces the current paths with provided paths, or computes them from the previous state (hardly a reason to do this, think twice). |
303302

304303
#### Code Example
305304
```jsx
@@ -329,7 +328,7 @@ The `useSettings` hook allows you to track and manage the chatbot's settings.
329328
| Name | Type | Parameter | Description |
330329
|-----------------|-------------|-----------|------------------------------------------------------------------------------|
331330
| settings | `Settings` | - | Represents the current settings of the chatbot. |
332-
| replaceSettings | `function` | **newSettings (required)** - `Settings` to replace with | Directly replaces the current settings with provided settings. |
331+
| replaceSettings | `function` | **newSettingsOrUpdater (required)** – Either: (1) `Settings` to replace with, or (2) a callback `(prevSettings: Settings) => Settings` returning the new settings. | Directly replaces the current settings with provided settings, or computes them from the previous state. |
333332
| updateSettings | `function` | **fields (required)** - `Settings` fields to update | Modifies and merges the provided settings with existing settings. |
334333

335334
#### Code Example
@@ -362,7 +361,7 @@ The `useStyles` hook allows you to track and manage the chatbot's styles.
362361
| Name | Type | Parameter | Description |
363362
|---------------|------------|-----------|--------------------------------------------------------------------------|
364363
| styles | `Styles` | - | Represents the current styles of the chatbot. |
365-
| replaceStyles | `function` | **newStyles (required)** - `Styles` to replace with | Directly replaces the current styles with provided styles. |
364+
| replaceStyles | `function` | **newStylesOrUpdater (required)** – Either: (1) `Styles` to replace with, or (2) a callback `(prevStyles: Styles) => Styles` returning the new styles. | Directly replaces the current styles with provided styles, or computes them from the previous state. |
366365
| updateStyles | `function` | **fields (required)** - `Styles` fields to update | Modifies and merges the provided styles with existing styles. |
367366

368367
#### Code Example
@@ -431,7 +430,7 @@ The `useToasts` hook allows you to track and manage the chatbot's toasts.
431430
| showToast | `async function` | Refer [here](/api/params#showtoast) | Shows a toast in chat, identical to `params.showToast`. |
432431
| dismissToast | `async function` | Refer [here](/api/params#dismisstoast) | Dismisses a toast from chat, identical to `params.dismissToast`. |
433432
| toasts | `Array<Toast>` | - | Array containing all toasts currently shown in the chatbot. |
434-
| replaceToasts | `function` | **newToasts (required)** - `Toast[]` to replace with | Directly replaces the current toasts with provided toasts. |
433+
| replaceToasts | `function` | **newToastsOrUpdater (required)** – Either: (1) `Toast[]` to replace with, or (2) a callback `(prevToasts: Toast[]) => Toast[]` returning the new toasts. | Directly replaces the current toasts with provided toasts, or computes them from the previous state. |
435434

436435
#### Code Example
437436
```jsx

docs/api/styles.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const DefaultStyles: Styles = {
4141
loadingSpinnerStyle: {},
4242
mediaDisplayContainerStyle: {},
4343
chatButtonStyle: {},
44+
chatButtonHoveredStyle: {},
4445
chatHistoryButtonStyle: {},
4546
chatHistoryButtonHoveredStyle: {},
4647
sendButtonStyle: {},
@@ -104,6 +105,7 @@ If you wish to refine the appearance of the chatbot, these are the list of secti
104105
| characterLimitStyle | `object` | {} | Styles for the character limit display. |
105106
| characterLimitReachedStyle | `object` | {} | Styles for the character limit display when limit is reached. |
106107
| chatButtonStyle | `object` | {} | Styles for the chatbot button. |
108+
| chatButtonHoveredStyle | `object` | {} | Styles for the hovered chatbot button. |
107109
| chatHistoryButtonHoveredStyle | `object` | {} | Styles for the hovered chat history button. |
108110
| chatHistoryButtonStyle | `object` | {} | Styles for the chat history button. |
109111
| chatHistoryLineBreakStyle | `object` | {} | Styles for the chat history line break. |

0 commit comments

Comments
 (0)