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.
@@ -3492,33 +3492,17 @@ var AppProvider = function AppProvider(_ref) {
3492
3492
  };
3493
3493
 
3494
3494
  var getRemoteClientChatPredefinedQuestions = function getRemoteClientChatPredefinedQuestions(params) {
3495
- try {
3496
- return Promise.resolve(_catch(function () {
3497
- var path = "" + domain.inference + resources.predefinedQ;
3498
- return Promise.resolve(pluginAxiosInstance.get(path, {
3499
- params: params
3500
- })).then(function (response) {
3501
- console.log(response.data.predefined_questions);
3502
- return response.data.predefined_questions;
3503
- });
3504
- }, function () {
3505
- return [{
3506
- question: 'These are placeholders',
3507
- answer: ''
3508
- }, {
3509
- question: 'They will be removed in production',
3510
- answer: ''
3511
- }, {
3512
- question: 'This will be empty if there are no predefined questions',
3513
- answer: ''
3514
- }, {
3515
- question: 'So hide if there are no predefined questions',
3516
- answer: ''
3517
- }];
3518
- }));
3519
- } catch (e) {
3520
- return Promise.reject(e);
3521
- }
3495
+ return Promise.resolve(_catch(function () {
3496
+ var path = "" + domain.inference + resources.predefinedQ;
3497
+ return Promise.resolve(pluginAxiosInstance.get(path, {
3498
+ params: params
3499
+ })).then(function (response) {
3500
+ console.log(response.data.predefined_questions);
3501
+ return response.data.predefined_questions;
3502
+ });
3503
+ }, function () {
3504
+ return [];
3505
+ }));
3522
3506
  };
3523
3507
  var getRemoteClientChatBubbleConfig = function getRemoteClientChatBubbleConfig(params) {
3524
3508
  try {
@@ -3589,6 +3573,22 @@ var askBiBot = function askBiBot(data) {
3589
3573
  return Promise.reject(e);
3590
3574
  }
3591
3575
  };
3576
+ var recordPredefinedQ = function recordPredefinedQ(data) {
3577
+ try {
3578
+ return Promise.resolve(_catch(function () {
3579
+ var path = 'https://training.dev.bibot.thespuka.com/v0/training/predefined-questions-statistics';
3580
+ return Promise.resolve(pluginAxiosInstance.post(path, data)).then(function (response) {
3581
+ console.log(response, 'here is the res');
3582
+ return response.data;
3583
+ });
3584
+ }, function (error) {
3585
+ console.log(error.message);
3586
+ return error.message;
3587
+ }));
3588
+ } catch (e) {
3589
+ return Promise.reject(e);
3590
+ }
3591
+ };
3592
3592
  var askTimedOutBiBot = function askTimedOutBiBot(data) {
3593
3593
  try {
3594
3594
  return Promise.resolve(_catch(function () {
@@ -3653,10 +3653,15 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3653
3653
  return Promise.reject(e);
3654
3654
  }
3655
3655
  };
3656
- var askPredefinedQuestion = function askPredefinedQuestion(question) {
3656
+ var askPredefinedQuestion = function askPredefinedQuestion(question, client_id) {
3657
3657
  try {
3658
3658
  setIsLoading(true);
3659
3659
  var input = question.question.trim();
3660
+ recordPredefinedQ({
3661
+ client_id: clientId,
3662
+ question: question.question
3663
+ });
3664
+ console.log(question.question, client_id);
3660
3665
  setUserInput('');
3661
3666
  if (input === question.question) {
3662
3667
  setMessages(function (messages) {
@@ -3708,7 +3713,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3708
3713
  setChatBubbleConfig = _useState7[1];
3709
3714
  var handlePredefinedQuestionSelect = function handlePredefinedQuestionSelect(question) {
3710
3715
  sendInputInquiry();
3711
- askPredefinedQuestion(question);
3716
+ askPredefinedQuestion(question, clientId);
3712
3717
  setUserInput('');
3713
3718
  setShowPredefinedQuestions(false);
3714
3719
  };
@@ -3778,7 +3783,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3778
3783
  };
3779
3784
  };
3780
3785
 
3781
- var styles = {"chat-bubble":"_31at8","chat-toggle":"_1tkAI","chat-window":"_2vdWr","chat-header":"_1ngBE","message-list":"_27MrF","message":"_3XbXj","user":"_3l8QX","bot":"_1MqZg","loader":"_3mrL1","l5":"_25GkQ","input-area":"_6V_kl","loading-bubbles":"_1XTQS","bubble":"_32ZvK","bounce":"_V8DEW"};
3786
+ var styles = {};
3782
3787
 
3783
3788
  function SendMessageIcon(_ref) {
3784
3789
  var color = _ref.color;
@@ -4114,7 +4119,8 @@ var PredefinedQuestions = function PredefinedQuestions(_ref) {
4114
4119
  fontSize: 16,
4115
4120
  margin: 5,
4116
4121
  textAlign: 'start',
4117
- height: 30,
4122
+ maxHeight: '40px',
4123
+ overflow: 'hidden',
4118
4124
  padding: 10,
4119
4125
  display: 'flex',
4120
4126
  alignItems: 'center',