bibot 1.0.65 → 1.0.67

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -4232,6 +4232,12 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4232
4232
  handlePredefinedQuestionSelect = _useBiBotChatBot.handlePredefinedQuestionSelect;
4233
4233
  var isOnline = useOnlineStatus();
4234
4234
  var greeting = chatBubbleConfig !== null && chatBubbleConfig !== void 0 && chatBubbleConfig.knownUser ? "Hi, " + chatBubbleConfig.knownUser + "! How can I help you today?" : 'Hello! How can I help you today?';
4235
+ var _React$useState = React.useState(true),
4236
+ isGreetingVisible = _React$useState[0],
4237
+ setGreetingVisible = _React$useState[1];
4238
+ var handleCloseGreeting = function handleCloseGreeting() {
4239
+ setGreetingVisible(false);
4240
+ };
4235
4241
  return React.createElement("div", {
4236
4242
  className: "chat-bubble " + (chatIsOpen ? 'open' : ''),
4237
4243
  style: {
@@ -4343,9 +4349,8 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4343
4349
  }), messages.map(function (message, index) {
4344
4350
  return message.sender === 'user' ? React.createElement("div", {
4345
4351
  key: index,
4346
- className: "message " + message.sender,
4352
+ className: '',
4347
4353
  style: {
4348
- marginBottom: 10,
4349
4354
  marginTop: 10,
4350
4355
  padding: '5px 10px',
4351
4356
  borderTopRightRadius: 15,
@@ -4479,7 +4484,7 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4479
4484
  alignItems: 'center',
4480
4485
  padding: '0 10px'
4481
4486
  }
4482
- }, React.createElement("span", {
4487
+ }, isGreetingVisible && React.createElement("span", {
4483
4488
  style: {
4484
4489
  fontSize: '12px',
4485
4490
  color: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color,
@@ -4492,9 +4497,22 @@ var ChatBubbleBiBot = function ChatBubbleBiBot(bibotProps) {
4492
4497
  borderTopLeftRadius: 10,
4493
4498
  borderBottomLeftRadius: 10,
4494
4499
  marginBottom: 60,
4495
- boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2)'
4500
+ boxShadow: '0 4px 8px 0 rgba(0, 0, 0, 0.2)',
4501
+ position: 'relative'
4502
+ }
4503
+ }, greeting, React.createElement("button", {
4504
+ onClick: handleCloseGreeting,
4505
+ style: {
4506
+ position: 'absolute',
4507
+ top: '2px',
4508
+ left: '-1px',
4509
+ background: 'transparent',
4510
+ border: 'none',
4511
+ cursor: 'pointer',
4512
+ color: chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color,
4513
+ fontSize: '14px'
4496
4514
  }
4497
- }, greeting), React.createElement("button", {
4515
+ }, "\xD7")), React.createElement("button", {
4498
4516
  onClick: toggleChat,
4499
4517
  className: styles['chat-toggle'],
4500
4518
  style: {