v6.19.0
Chameleon 6.19.0 (2025-08-07)
| Category | Change |
|---|---|
[ch-chat] Rename "stop-generating-anwser" button to "stop-response" and rename the generatingResponse property to waitingResponse by @ncamera in #540 |
|
[ch-chat] Add more options to customize the content of the send-container element and add support to replace the send button with the stop-response button by @ncamera in #541 |
Important changes in the ch-chat component
-
The
stopGeneratingAnwserbutton is now calledstopResponsebutton. -
The send button is now replaced with the stop-response button by default.
-
Added the
sendContainerLayoutproperty to support changing the position of the send and stop-response buttons of thech-chat's send-container part. There are four positions for distributing elements in thesend-container:sendContainerBefore: Before the contents of thesend-containerpart.sendInputBefore: Before the contents of thesend-inputpart.sendInputAfter: After the contents of thesend-inputpart.sendContainerAfter: After the contents of thesend-containerpart.
At each position you can specify reserved elements, such as the
send-buttonandstop-response-button, but can also be specified non-reserved elements, which will be projected as content slots.If the reserved
stop-response-buttonelement is not specified anywhere, the send button will be replaced with the stop-response button whenwaitingResponse = trueand thestopResponsecallback is specified.If the
send-buttonis not specified in any position, it won't be rendered in thech-chat.For example, if you define:
const sendContainerLayout: ChatSendContainerLayout = { sendInputBefore: ["attach-files-button"], sendInputAfter: ["send-button"] }
You will have to put
slot="attach-files-button"as follows (but not thesend-buttonas this is a reserved element that is rendered internally by thech-chat):<ch-chat sendContainerLayout={sendContainerLayout} > <button slot="attach-files-button" type="button"> ... </button> </ch-chat>
The following diagram shows a visual example of the
ch-chat's layout with this new property:
-
Added the following parts:
-
send-container-before: The container for the elements of thesendContainerLayout.sendContainerBeforeposition. -
send-input-before: The container for the elements of thesendContainerLayout.sendInputBeforeposition. -
send-input-after: The container for the elements of thesendContainerLayout.sendInputAfterposition. -
send-container-after: The container for the elements of thesendContainerLayout.sendContainerAfterposition.
-
Breaking changes
-
[ch-chat]ThestopGeneratingAnswercallback has been renamed tostopResponse. -
[ch-chat]TheaccessibleName.stopGeneratingAnswerButtontranslation has been renamed toaccessibleName.stopResponseButton. -
[ch-chat]Thetext.stopGeneratingAnswerButtontranslation has been renamed totext.stopResponseButton. -
[ch-chat]The"stop-generating-answer-button"part has been renamed to"stop-response-button". -
[ch-chat]ThegeneratingResponseproperty has been renamed towaitingResponse. -
[ch-chat]Removed thesend-input-wrapperpart. -
[ch-chat]Now, by default the send button is replaced with the stop-response button, ifwaitingReponse === trueand thestopResponsecallback is defined. If we want to keep separated those two buttons under the previous conditions, the position for thestop-response-buttonmust be specified in thesendContainerLayoutproperty. -
[ch-chat]Removed the default translationtext.stopResponseButton, becase now by default the send button is replaced with the stop-response button, ifwaitingReponse === trueand thestopResponsecallback is defined. -
[ch-chat]Removed theshowSendInputAdditionalContentBeforeandshowSendInputAdditionalContentAfterproperties. To add custom content in thesend-inputpart, thesendInputBeforeand/orsendInputAftermembers of thesendContainerLayoutproperty must be specified. This new way to customize thesend-inputcontent allow us to have a better control of the DOM order (which is important for the accessibility).
Full Changelog: v6.18.1...v6.19.0