Releases: tjtanjin/react-chatbotify
v2.0.0-beta.11
Added:
- Added a new
useFlow
hook that grants access to retrieving and restarting the conversation flows - The
hasFlowStarted
boolean which was previously found inuseFirstInteraction
has been moved touseFlow
for better consistency
Fixed:
- Fixed an issue where states were not updated in conversation flow
Note:
There have been confusions surrounding the use of ChatBotProvider
such as what props it should be given if used. To reduce the mental load on developers, all props are now centralized to only ChatBot
, regardless of whether you are using ChatBotProvider
or not.
There is no functionality change and developers can now just remember that ChatBot
is what accepts all props. With that said, if you're currently passing props to ChatBotProvider
, move them all to ChatBot
instead.
v2.0.0-beta.10
Fixed:
- Fixed an issue where chatbot view on mobile devices may not resize correctly
- Fixed an issue where uuids are not generated properly for non-https environments
v2.0.0-beta.9
Breaking Changes (Advanced Users):
- If you are manually manipulating the
messages
array via advanced messages, note that the message elements now enforce that the following fields must be present (more details here):- id
- sender
- content
- type
- timestamp
- If you are currently using any of the advanced features (e.g.
SettingsContext
,StylesContext
,MessagesContext
orPathsContext
), note that these have been removed in favor of a single provider (ChatBotProvider
). Theadvance
configuration section has also been removed fromsettings
as the entire concept of advanced features is being dropped (more details here).
Breaking Changes (All Users):
- The
isOpen
variable insettings
which tracked the open/close state of the chatbot window has been removed, in favor ofuseChatWindow
hook. More details here. - Last beta release, a new
params.injectToast
was added. This has been renamed toparams.showToast
to avoid conceptual similarities with messages.
Fixed:
- Fixed an issue where
params.setTextAreaValue
may not respect the character limit of the text area (if set).
Added:
- A new id prop has been added to uniquely identify a bot (relevant for firing events when there are multiple chatbots).
- A new plugins prop is now available. However, there are no plugins released yet - they will come in October. More details here.
- A new hooks feature is now available, granting extreme flexibility in interacting with the chatbot from your own components. This is achieved by nesting your components within a single
<ChatBotProvider/>
. More details here. - A new events feature is now available, allowing you to listen for chatbot events and run your own application logic. Events are an opt-in feature so you'll need to enable them in
settings
. More details here. - A message id (string) is now returned for
injectMessage
andstreamMessage
which identifies the message the content is sent in (returns null if sending of message was prevented in event listeners). - A toast id (string) is now returned for
showToast
which identifies the toast the content is sent in (returns null if sending of toast was prevented in event listeners). - The
transition
attribute now accepts anumber
as well (defaults interruptable tofalse
).
Note:
This beta release includes large scale changes in order to deliver on the events/plugins feature. Pending major bugs or implementation issues, this will be the last round of introducing massive changes as we strive towards a stable version for v2. Note that given the scale of these changes, there are minor breaking changes (in addition to the initial beta release), which largely affects advanced users. For users updating from the older beta versions, I've put together the sections to catch up on for addressing breaking changes:
- Removed isOpen from BotOptions (Settings)
- Advance Section Removed
- Message Attributes Expanded and Required
If you're updating to this version from v1, then you should still refer to the migration guide which has also already been updated with all the latest information.
v2.0.0-beta.8
Fixed:
- Fixed an issue where bot typing indicator is not shown when
params.goToPath
is used
Added:
- A new
params.setTextAreaValue
has been added for users to directly set the text area value - A new
params.injectToast
has been added for users to show toasts within the chatbot - A new
toast
section has been added tosettings
which contains 3 properties (maxCount
,forbidOnMax
anddismissOnClick
) along with 3 new additions tostyles
(toastPromptContainerStyle
,toastPromptStyle
,toastPromptHoveredStyle
) - The
checkboxes
block attribute now accepts an array of strings as well, and will populateitems
property with it (all other values defaulted) - The
checkboxes
block attribute has 2 new propertiessendOutput
andreusable
, which determines whether the selected checkboxes should be sent in chat and whether the checkboxes can be reused - The
options
block attribute now accepts an object as well, accepting 3 properties which areitems
,sendOutput
andreusable
(current array input still works)
Note:
This update adds on to and expands the checkboxes
and options
block attributes. There are no breaking changes but if users are keen to leverage on the new features, do refer to the attributes documentation. In addition, 2 new parameters (params.setTextAreaValue
and params.injectToast
) have also been added which greatly enhances the capabilities of the chatbot and sets the groundwork for the impending events/plugins update. Details of their usage can be found in params documentation.
v2.0.0-beta.7
Added:
- Added
rcbTypingIndicatorContainerStyle
andrcbTypingIndicatorDotStyle
for ease of styling typing indicator
v2.0.0-beta.6
Fixed:
- Fixed an issue where chat icon will not fit in the button correctly
- Fixed an issue where
baseUrl
was wrongly namedbase_url
Added:
- Added caching of themes locally to improve performance
- Added optional
cacheDuration
field when specifying themes which specifies in seconds the duration to cache the theme for (defaults to 30 days)
v2.0.0-beta.5
Fixed:
- Fixed an issue where cursor disabled icon was not showing up on mac devices
Added:
- Added a bunch of new style props for buttons and icons to improve convenience in styling:
// new button styles
audioButtonStyle?: React.CSSProperties;
audioButtonDisabledStyle?: React.CSSProperties;
closeChatButtonStyle?: React.CSSProperties;
emojiButtonStyle?: React.CSSProperties;
emojiButtonDisabledStyle?: React.CSSProperties;
fileAttachmentButtonStyle?: React.CSSProperties;
fileAttachmentButtonDisabledStyle?: React.CSSProperties;
notificationButtonStyle?: React.CSSProperties;
notificationButtonDisabledStyle?: React.CSSProperties;
voiceButtonStyle?: React.CSSProperties;
voiceButtonDisabledStyle?: React.CSSProperties;
// new icon styles
chatIconStyle?: React.CSSProperties;
audioIconStyle?: React.CSSProperties;
audioIconDisabledStyle?: React.CSSProperties;
closeChatIconStyle?: React.CSSProperties;
emojiIconStyle?: React.CSSProperties;
emojiIconDisabledStyle?: React.CSSProperties;
fileAttachmentIconStyle?: React.CSSProperties;
fileAttachmentIconDisabledStyle?: React.CSSProperties;
notificationIconStyle?: React.CSSProperties;
notificationIconDisabledStyle?: React.CSSProperties;
voiceIconStyle?: React.CSSProperties;
voiceIconDisabledStyle?: React.CSSProperties;
sendIconStyle?: React.CSSProperties;
Note:
There were minor shifting of a few classes to better separate buttons and icons. This should not be an issue for the vast majority of users, but if you've done very specific changes to button/icon styles by targeting the CSS classes, it is advisable to visually check the appearance of said buttons/icons.
v2.0.0-beta.4
Fixed:
- Fixed an issue where disabling
chatInput
globally cannot be overriden by block-levelchatDisabled
attribute
v2.0.0-beta.3
Fixed:
- Fixed an issue where themes will override the current
isOpen
value insettings
, causing it to open/close unexpectedly
v2.0.0-beta.2
Fixed:
- Fixed an issue where theme conflicts are not properly resolved
- Fixed an issue where invalid sections are not caught in themes
- Fixed an issue where sensitive inputs permanently mask the remaining conversations
- Fixed an issue where chatbot loses focus in text area when transitioning from a previously disabled state