You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
28
28
29
29
### Added
30
30
31
-
- Resolves [#2539](https://github.com/Microsoft/BotFramework-WebChat/issues/2539), added React hooks for customization, by [@compulim](https://github.com/compulim), in the following PRs:
31
+
- Resolves [#2539](https://github.com/Microsoft/BotFramework-WebChat/issues/2539), added React hooks for customziation, by [@compulim](https://github.com/compulim) and [@corinagum](https://github.com/corinagum), in the following PRs:
Copy file name to clipboardExpand all lines: HOOKS.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,16 +8,16 @@ To enable Web Chat API, all UI components must be located under the [`<Composer>
8
8
9
9
React Hooks will make your code cleaner and shorter, and also greatly improve readability.
10
10
11
-
Web Chat expose our APIs through React Hooks. This API surface enables us to freely move stuff behind the scene, introduce new APIs, and a safe way to deprecate APIs. It will also make us easier to shuffle work between our internal Redux store and React Context.
11
+
Web Chat expose our APIs through React Hooks. This API surface enables us to freely move stuff behind the scene, introduce new APIs, and a safe way to deprecate APIs. It will also make it easier to shuffle work between our internal Redux store and React Context.
12
12
13
13
## Two types of hooks
14
14
15
15
We design our hooks largely with two basic shapes:
16
16
17
17
- Actions, these are functions that you can call at any time to perform a side-effect
18
18
- Properties, these are getter function with an optional setter
19
-
- This is same as [React State Hook pattern](https://reactjs.org/docs/hooks-state.html), but setter could be optional
20
-
- If the value changed, React will call your render function again
19
+
- This is same as [React State Hook pattern](https://reactjs.org/docs/hooks-state.html), but setters are optional
20
+
- If the value is changed, React will call your render function again
21
21
22
22
### Actions
23
23
@@ -130,7 +130,7 @@ useAvatarForBot(): [{
130
130
131
131
This function will return the image and initials of the bot. Both image and initials are optional and can be falsy.
132
132
133
-
To set the avatar for bot, use style options.
133
+
To set the avatar for the bot, use style options.
134
134
135
135
## `useAvatarForUser`
136
136
@@ -143,7 +143,7 @@ useAvatarForUser(): [{
143
143
144
144
This function will return the image and initials of the user. Both image and initials are optional and can be falsy.
145
145
146
-
To set the avatar for user, use style options.
146
+
To set the avatar for the user, use style options.
147
147
148
148
## `useConnectivityStatus`
149
149
@@ -263,7 +263,7 @@ This property is computed on every incoming activity.
263
263
useLocalize(identifier: string) => string
264
264
```
265
265
266
-
This function will return a localized string represented by the identifier. It honor the language settings from `useLanguage` hook.
266
+
This function will return a localized string represented by the identifier. It honors the language settings from `useLanguage` hook.
267
267
268
268
To modify this value, change the props passed to Web Chat.
When called, this function will post the activity on behalf of the user, to the bot.
298
298
299
-
You can use this function to send any type of activities to the bot. We highly recommend you send the following type of activities only:
299
+
You can use this function to send any type of activities to the bot, but we highly recommend you send the following type of activities only:
300
300
301
301
-`event`
302
302
-`message`
@@ -336,7 +336,7 @@ useRenderAttachment(): ({
336
336
}) =>React.Element
337
337
```
338
338
339
-
This function is for rendering attachment into React element. The caller will need to pass `activity` and `attachment`. This function is a composition of `attachmentRendererMiddleware`, which is passed as a prop.
339
+
This function is for rendering attachments into React element. The caller will need to pass `activity` and `attachment` as parameters. This function is a composition of `attachmentRendererMiddleware`, which is passed as a prop.
When called, this function will send a message activity with one or more [File](https://developer.mozilla.org/en-US/docs/Web/API/File) attachments to the bot, including these operations:
392
392
393
393
- Convert [File](https://developer.mozilla.org/en-US/docs/Web/API/File) into object URL
394
-
- Generate thumbnail and will use Web Worker and offscreen canvas if supported
394
+
- Generate thumbnail and will use a Web Worker and a offscreen canvas if supported
395
395
396
-
If you are using `ArrayBuffer`, you can use `FileReader` to convert it into a blob before calling [`URL.createObjectURL`](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL).
396
+
If you are using an `ArrayBuffer`, you can use `FileReader` to convert it into a blob before calling [`URL.createObjectURL`](https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL).
When called, this function will send a text message activity to the bot.
405
405
406
-
You can optionally include the input method the text message is collected. Currently, if specified, only `speech` is supported.
406
+
You can optionally include the input method how the text message was collected. Currently, if specified, only `speech` is supported.
407
407
408
408
## `useSendMessageBack`
409
409
@@ -503,7 +503,7 @@ The suggested actions is computed from the last message activity sent from the b
503
503
useTimeoutForSend(): [number]
504
504
```
505
505
506
-
This function will return the interval before a sending activity is considered fail. The interval is represented in milliseconds. Due to network partitioning problem, activity that failed to send could eventually successfully deliver to the bot.
506
+
This function will return the interval before a sending activity is considered unsuccessful. The interval is represented in milliseconds. Due to network partitioning problem, an activity that has failed to send could eventually be successfully delivered to the bot.
507
507
508
508
To modify this value, change the props passed to Web Chat.
509
509
@@ -577,7 +577,7 @@ When called, this function will toggle microphone open or close.
577
577
useMicrophoneButtonDisabled(): () =>void
578
578
```
579
579
580
-
This function will return whether the microphone button is disabled. This is more than`useDisabled()`. The microphone button could be disabled because it is currently starting or stopping.
580
+
This function will return whether the microphone button is disabled. This is different from`useDisabled()`. The microphone button could be disabled because it is currently starting or stopping.
581
581
582
582
This value can be partly controllable through Web Chat props.
This function will return whether the typing indicator should be visible or not. This function is time-sensitive, means, the value could varies based on the clock.
638
638
639
-
This function derive the visibility of the typing indicator by:
639
+
This function derives the visibility of the typing indicator by:
640
640
641
641
-`typingAnimationDuration` value specified in style options, in milliseconds
0 commit comments