bibot 1.0.33 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +20 -25
- package/dist/index.js +37 -31
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +37 -31
- package/dist/index.modern.js.map +1 -1
- package/dist/services/plugin-api.d.ts +6 -1
- package/package.json +1 -1
    
        package/dist/index.css
    CHANGED
    
    | @@ -1,11 +1,11 @@ | |
| 1 | 
            -
            . | 
| 1 | 
            +
            /* .chat-bubble {
         | 
| 2 2 | 
             
              position: fixed;
         | 
| 3 3 | 
             
              bottom: 20px;
         | 
| 4 4 | 
             
              right: 20px;
         | 
| 5 5 | 
             
              z-index: 9999;
         | 
| 6 6 | 
             
            }
         | 
| 7 7 |  | 
| 8 | 
            -
            . | 
| 8 | 
            +
            .chat-toggle {
         | 
| 9 9 | 
             
              color: #fff;
         | 
| 10 10 | 
             
              border-radius: 50%;
         | 
| 11 11 | 
             
              height: 60px;
         | 
| @@ -15,7 +15,7 @@ | |
| 15 15 | 
             
              justify-content: center;
         | 
| 16 16 | 
             
            }
         | 
| 17 17 |  | 
| 18 | 
            -
            . | 
| 18 | 
            +
            .chat-window {
         | 
| 19 19 | 
             
              position: absolute;
         | 
| 20 20 | 
             
              bottom: 50px;
         | 
| 21 21 | 
             
              right: 25px;
         | 
| @@ -24,15 +24,13 @@ | |
| 24 24 | 
             
              background-color: white;
         | 
| 25 25 | 
             
              border: 1px solid #ddd;
         | 
| 26 26 | 
             
              border-radius: 10px;
         | 
| 27 | 
            -
              /* padding: 10px; */
         | 
| 28 27 | 
             
              box-shadow: 0 2px 10px rgba(0,0,0,0.2);
         | 
| 29 28 | 
             
              display: flex;
         | 
| 30 29 | 
             
              flex-direction: column;
         | 
| 31 30 | 
             
              justify-content: space-between;
         | 
| 32 31 | 
             
            }
         | 
| 33 32 |  | 
| 34 | 
            -
             | 
| 35 | 
            -
            ._1ngBE{
         | 
| 33 | 
            +
            .chat-header{
         | 
| 36 34 | 
             
              height: 50px;
         | 
| 37 35 | 
             
              border-top-left-radius: 8px;
         | 
| 38 36 | 
             
              border-top-right-radius: 8px;
         | 
| @@ -42,7 +40,7 @@ | |
| 42 40 | 
             
              padding-inline: 15px;
         | 
| 43 41 | 
             
              padding-block: 30px;
         | 
| 44 42 | 
             
            }
         | 
| 45 | 
            -
            . | 
| 43 | 
            +
            .message-list {
         | 
| 46 44 | 
             
            height: calc(100% - 100px);
         | 
| 47 45 | 
             
            overflow-y: auto;
         | 
| 48 46 | 
             
            padding: 10px;
         | 
| @@ -51,19 +49,19 @@ flex-grow: 1; | |
| 51 49 | 
             
            flex-direction: column;
         | 
| 52 50 | 
             
            }
         | 
| 53 51 |  | 
| 54 | 
            -
            . | 
| 52 | 
            +
            .message {
         | 
| 55 53 | 
             
            margin-bottom: 10px;
         | 
| 56 54 | 
             
            padding: 5px 10px;
         | 
| 57 55 | 
             
            border-radius: 8px;
         | 
| 58 56 | 
             
            max-width: 70%;
         | 
| 59 57 | 
             
            }
         | 
| 60 58 |  | 
| 61 | 
            -
            . | 
| 59 | 
            +
            .message.user {
         | 
| 62 60 | 
             
            background-color: #b8b8b8c6;
         | 
| 63 61 | 
             
            align-self: flex-end;
         | 
| 64 62 | 
             
            }
         | 
| 65 63 |  | 
| 66 | 
            -
            . | 
| 64 | 
            +
            .message.bot {
         | 
| 67 65 | 
             
            background-color: #f0f0f0;
         | 
| 68 66 | 
             
            align-self: flex-start;
         | 
| 69 67 | 
             
            }
         | 
| @@ -71,14 +69,14 @@ textarea:focus, input:focus{ | |
| 71 69 | 
             
              outline: none;
         | 
| 72 70 | 
             
            }
         | 
| 73 71 |  | 
| 74 | 
            -
             | 
| 75 | 
            -
            . | 
| 72 | 
            +
             | 
| 73 | 
            +
            .loader {
         | 
| 76 74 | 
             
              width: 12px;
         | 
| 77 75 | 
             
              aspect-ratio: 1;
         | 
| 78 76 | 
             
              border-radius: 50%;
         | 
| 79 | 
            -
              animation:  | 
| 77 | 
            +
              animation: l5 1s infinite linear alternate;
         | 
| 80 78 | 
             
            }
         | 
| 81 | 
            -
            @keyframes  | 
| 79 | 
            +
            @keyframes l5 {
         | 
| 82 80 | 
             
                0%  {box-shadow: 20px 0 #000, -20px 0 #0002;background: #000 }
         | 
| 83 81 | 
             
                33% {box-shadow: 20px 0 #000, -20px 0 #0002;background: #0002}
         | 
| 84 82 | 
             
                66% {box-shadow: 20px 0 #0002,-20px 0 #000; background: #0002}
         | 
| @@ -86,7 +84,7 @@ textarea:focus, input:focus{ | |
| 86 84 | 
             
            }
         | 
| 87 85 |  | 
| 88 86 |  | 
| 89 | 
            -
            . | 
| 87 | 
            +
            .input-area {
         | 
| 90 88 | 
             
            display: flex;
         | 
| 91 89 | 
             
            align-items: center;
         | 
| 92 90 | 
             
            border-top: 1px solid #ddd;
         | 
| @@ -95,17 +93,15 @@ border-bottom-left-radius: 8px; | |
| 95 93 | 
             
            border-bottom-right-radius: 8px;
         | 
| 96 94 | 
             
            }
         | 
| 97 95 |  | 
| 98 | 
            -
            . | 
| 96 | 
            +
            .input-area input {
         | 
| 99 97 | 
             
            flex-grow: 1;
         | 
| 100 98 | 
             
            border: none;
         | 
| 101 99 | 
             
            background-color: transparent;
         | 
| 102 | 
            -
            /* border: 1px solid #ccc; */
         | 
| 103 | 
            -
            /* border-radius: 15px; */
         | 
| 104 100 | 
             
            padding: 5px 10px;
         | 
| 105 101 | 
             
            margin-right: 10px;
         | 
| 106 102 | 
             
            }
         | 
| 107 103 |  | 
| 108 | 
            -
            . | 
| 104 | 
            +
            .input-area button {
         | 
| 109 105 | 
             
            background-color: #007bff;
         | 
| 110 106 | 
             
            color: white;
         | 
| 111 107 | 
             
            border: none;
         | 
| @@ -114,27 +110,26 @@ padding: 5px 10px; | |
| 114 110 | 
             
            cursor: pointer;
         | 
| 115 111 | 
             
            }
         | 
| 116 112 |  | 
| 117 | 
            -
            /* Existing styles... */
         | 
| 118 113 |  | 
| 119 | 
            -
            . | 
| 114 | 
            +
            .loading-bubbles {
         | 
| 120 115 | 
             
            display: flex;
         | 
| 121 116 | 
             
            justify-content: center;
         | 
| 122 117 | 
             
            align-items: center;
         | 
| 123 118 | 
             
            }
         | 
| 124 119 |  | 
| 125 | 
            -
            . | 
| 120 | 
            +
            .bubble {
         | 
| 126 121 | 
             
            width: 8px;
         | 
| 127 122 | 
             
            height: 8px;
         | 
| 128 123 | 
             
            border-radius: 50%;
         | 
| 129 124 | 
             
            margin: 0 3px;
         | 
| 130 | 
            -
            animation:  | 
| 125 | 
            +
            animation: bounce 0.6s infinite alternate;
         | 
| 131 126 | 
             
            }
         | 
| 132 127 |  | 
| 133 | 
            -
            @keyframes  | 
| 128 | 
            +
            @keyframes bounce {
         | 
| 134 129 | 
             
            from {
         | 
| 135 130 | 
             
              transform: translateY(0);
         | 
| 136 131 | 
             
            }
         | 
| 137 132 | 
             
            to {
         | 
| 138 133 | 
             
              transform: translateY(-15px);
         | 
| 139 134 | 
             
            }
         | 
| 140 | 
            -
            }
         | 
| 135 | 
            +
            } */
         | 
    
        package/dist/index.js
    CHANGED
    
    | @@ -3495,33 +3495,17 @@ var AppProvider = function AppProvider(_ref) { | |
| 3495 3495 | 
             
            };
         | 
| 3496 3496 |  | 
| 3497 3497 | 
             
            var getRemoteClientChatPredefinedQuestions = function getRemoteClientChatPredefinedQuestions(params) {
         | 
| 3498 | 
            -
               | 
| 3499 | 
            -
                 | 
| 3500 | 
            -
             | 
| 3501 | 
            -
                   | 
| 3502 | 
            -
             | 
| 3503 | 
            -
                   | 
| 3504 | 
            -
             | 
| 3505 | 
            -
             | 
| 3506 | 
            -
             | 
| 3507 | 
            -
                 | 
| 3508 | 
            -
             | 
| 3509 | 
            -
                    question: 'These are placeholders',
         | 
| 3510 | 
            -
                    answer: ''
         | 
| 3511 | 
            -
                  }, {
         | 
| 3512 | 
            -
                    question: 'They will be removed in production',
         | 
| 3513 | 
            -
                    answer: ''
         | 
| 3514 | 
            -
                  }, {
         | 
| 3515 | 
            -
                    question: 'This will be empty if there are no predefined questions',
         | 
| 3516 | 
            -
                    answer: ''
         | 
| 3517 | 
            -
                  }, {
         | 
| 3518 | 
            -
                    question: 'So hide if there are no predefined questions',
         | 
| 3519 | 
            -
                    answer: ''
         | 
| 3520 | 
            -
                  }];
         | 
| 3521 | 
            -
                }));
         | 
| 3522 | 
            -
              } catch (e) {
         | 
| 3523 | 
            -
                return Promise.reject(e);
         | 
| 3524 | 
            -
              }
         | 
| 3498 | 
            +
              return Promise.resolve(_catch(function () {
         | 
| 3499 | 
            +
                var path = "" + domain.inference + resources.predefinedQ;
         | 
| 3500 | 
            +
                return Promise.resolve(pluginAxiosInstance.get(path, {
         | 
| 3501 | 
            +
                  params: params
         | 
| 3502 | 
            +
                })).then(function (response) {
         | 
| 3503 | 
            +
                  console.log(response.data.predefined_questions);
         | 
| 3504 | 
            +
                  return response.data.predefined_questions;
         | 
| 3505 | 
            +
                });
         | 
| 3506 | 
            +
              }, function () {
         | 
| 3507 | 
            +
                return [];
         | 
| 3508 | 
            +
              }));
         | 
| 3525 3509 | 
             
            };
         | 
| 3526 3510 | 
             
            var getRemoteClientChatBubbleConfig = function getRemoteClientChatBubbleConfig(params) {
         | 
| 3527 3511 | 
             
              try {
         | 
| @@ -3592,6 +3576,22 @@ var askBiBot = function askBiBot(data) { | |
| 3592 3576 | 
             
                return Promise.reject(e);
         | 
| 3593 3577 | 
             
              }
         | 
| 3594 3578 | 
             
            };
         | 
| 3579 | 
            +
            var recordPredefinedQ = function recordPredefinedQ(data) {
         | 
| 3580 | 
            +
              try {
         | 
| 3581 | 
            +
                return Promise.resolve(_catch(function () {
         | 
| 3582 | 
            +
                  var path = 'https://training.dev.bibot.thespuka.com/v0/training/predefined-questions-statistics';
         | 
| 3583 | 
            +
                  return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
         | 
| 3584 | 
            +
                    console.log(response, 'here is the res');
         | 
| 3585 | 
            +
                    return response.data;
         | 
| 3586 | 
            +
                  });
         | 
| 3587 | 
            +
                }, function (error) {
         | 
| 3588 | 
            +
                  console.log(error.message);
         | 
| 3589 | 
            +
                  return error.message;
         | 
| 3590 | 
            +
                }));
         | 
| 3591 | 
            +
              } catch (e) {
         | 
| 3592 | 
            +
                return Promise.reject(e);
         | 
| 3593 | 
            +
              }
         | 
| 3594 | 
            +
            };
         | 
| 3595 3595 | 
             
            var askTimedOutBiBot = function askTimedOutBiBot(data) {
         | 
| 3596 3596 | 
             
              try {
         | 
| 3597 3597 | 
             
                return Promise.resolve(_catch(function () {
         | 
| @@ -3656,10 +3656,15 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) { | |
| 3656 3656 | 
             
                  return Promise.reject(e);
         | 
| 3657 3657 | 
             
                }
         | 
| 3658 3658 | 
             
              };
         | 
| 3659 | 
            -
              var askPredefinedQuestion = function askPredefinedQuestion(question) {
         | 
| 3659 | 
            +
              var askPredefinedQuestion = function askPredefinedQuestion(question, client_id) {
         | 
| 3660 3660 | 
             
                try {
         | 
| 3661 3661 | 
             
                  setIsLoading(true);
         | 
| 3662 3662 | 
             
                  var input = question.question.trim();
         | 
| 3663 | 
            +
                  recordPredefinedQ({
         | 
| 3664 | 
            +
                    client_id: clientId,
         | 
| 3665 | 
            +
                    question: question.question
         | 
| 3666 | 
            +
                  });
         | 
| 3667 | 
            +
                  console.log(question.question, client_id);
         | 
| 3663 3668 | 
             
                  setUserInput('');
         | 
| 3664 3669 | 
             
                  if (input === question.question) {
         | 
| 3665 3670 | 
             
                    setMessages(function (messages) {
         | 
| @@ -3711,7 +3716,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) { | |
| 3711 3716 | 
             
                setChatBubbleConfig = _useState7[1];
         | 
| 3712 3717 | 
             
              var handlePredefinedQuestionSelect = function handlePredefinedQuestionSelect(question) {
         | 
| 3713 3718 | 
             
                sendInputInquiry();
         | 
| 3714 | 
            -
                askPredefinedQuestion(question);
         | 
| 3719 | 
            +
                askPredefinedQuestion(question, clientId);
         | 
| 3715 3720 | 
             
                setUserInput('');
         | 
| 3716 3721 | 
             
                setShowPredefinedQuestions(false);
         | 
| 3717 3722 | 
             
              };
         | 
| @@ -3781,7 +3786,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) { | |
| 3781 3786 | 
             
              };
         | 
| 3782 3787 | 
             
            };
         | 
| 3783 3788 |  | 
| 3784 | 
            -
            var styles = { | 
| 3789 | 
            +
            var styles = {};
         | 
| 3785 3790 |  | 
| 3786 3791 | 
             
            function SendMessageIcon(_ref) {
         | 
| 3787 3792 | 
             
              var color = _ref.color;
         | 
| @@ -4117,7 +4122,8 @@ var PredefinedQuestions = function PredefinedQuestions(_ref) { | |
| 4117 4122 | 
             
                    fontSize: 16,
         | 
| 4118 4123 | 
             
                    margin: 5,
         | 
| 4119 4124 | 
             
                    textAlign: 'start',
         | 
| 4120 | 
            -
                     | 
| 4125 | 
            +
                    maxHeight: '40px',
         | 
| 4126 | 
            +
                    overflow: 'hidden',
         | 
| 4121 4127 | 
             
                    padding: 10,
         | 
| 4122 4128 | 
             
                    display: 'flex',
         | 
| 4123 4129 | 
             
                    alignItems: 'center',
         |