bibot 1.0.65 → 1.0.67

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