bibot 1.0.34 → 1.0.36

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 CHANGED
@@ -1,11 +1,11 @@
1
- ._31at8 {
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
- ._1tkAI {
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
- ._2vdWr {
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
- /* Existing styles... */
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
- ._27MrF {
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
- ._3XbXj {
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
- ._3XbXj._3l8QX {
59
+ .message.user {
62
60
  background-color: #b8b8b8c6;
63
61
  align-self: flex-end;
64
62
  }
65
63
 
66
- ._3XbXj._1MqZg {
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
- /* Chat loader*/
75
- ._3mrL1 {
72
+
73
+ .loader {
76
74
  width: 12px;
77
75
  aspect-ratio: 1;
78
76
  border-radius: 50%;
79
- animation: _25GkQ 1s infinite linear alternate;
77
+ animation: l5 1s infinite linear alternate;
80
78
  }
81
- @keyframes _25GkQ {
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
- ._6V_kl {
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
- ._6V_kl input {
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
- ._6V_kl button {
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
- ._1XTQS {
114
+ .loading-bubbles {
120
115
  display: flex;
121
116
  justify-content: center;
122
117
  align-items: center;
123
118
  }
124
119
 
125
- ._32ZvK {
120
+ .bubble {
126
121
  width: 8px;
127
122
  height: 8px;
128
123
  border-radius: 50%;
129
124
  margin: 0 3px;
130
- animation: _V8DEW 0.6s infinite alternate;
125
+ animation: bounce 0.6s infinite alternate;
131
126
  }
132
127
 
133
- @keyframes _V8DEW {
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
@@ -3576,6 +3576,22 @@ var askBiBot = function askBiBot(data) {
3576
3576
  return Promise.reject(e);
3577
3577
  }
3578
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
+ };
3579
3595
  var askTimedOutBiBot = function askTimedOutBiBot(data) {
3580
3596
  try {
3581
3597
  return Promise.resolve(_catch(function () {
@@ -3640,10 +3656,15 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3640
3656
  return Promise.reject(e);
3641
3657
  }
3642
3658
  };
3643
- var askPredefinedQuestion = function askPredefinedQuestion(question) {
3659
+ var askPredefinedQuestion = function askPredefinedQuestion(question, client_id) {
3644
3660
  try {
3645
3661
  setIsLoading(true);
3646
3662
  var input = question.question.trim();
3663
+ recordPredefinedQ({
3664
+ client_id: clientId,
3665
+ question: question.question
3666
+ });
3667
+ console.log(question.question, client_id);
3647
3668
  setUserInput('');
3648
3669
  if (input === question.question) {
3649
3670
  setMessages(function (messages) {
@@ -3695,7 +3716,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3695
3716
  setChatBubbleConfig = _useState7[1];
3696
3717
  var handlePredefinedQuestionSelect = function handlePredefinedQuestionSelect(question) {
3697
3718
  sendInputInquiry();
3698
- askPredefinedQuestion(question);
3719
+ askPredefinedQuestion(question, clientId);
3699
3720
  setUserInput('');
3700
3721
  setShowPredefinedQuestions(false);
3701
3722
  };
@@ -3765,7 +3786,7 @@ var useBiBotChatBot = function useBiBotChatBot(_ref) {
3765
3786
  };
3766
3787
  };
3767
3788
 
3768
- 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"};
3789
+ var styles = {};
3769
3790
 
3770
3791
  function SendMessageIcon(_ref) {
3771
3792
  var color = _ref.color;
@@ -4098,14 +4119,15 @@ var PredefinedQuestions = function PredefinedQuestions(_ref) {
4098
4119
  style: {
4099
4120
  backgroundColor: '#fff',
4100
4121
  border: "0.5px solid " + (chatBubbleConfig ? (_chatBubbleConfig$col = chatBubbleConfig === null || chatBubbleConfig === void 0 ? void 0 : chatBubbleConfig.color) != null ? _chatBubbleConfig$col : '#dedede' : '#000'),
4101
- fontSize: 16,
4102
- margin: 5,
4122
+ fontSize: '16px',
4123
+ margin: '5px',
4103
4124
  textAlign: 'start',
4104
- height: 30,
4105
- padding: 10,
4125
+ maxHeight: '40px',
4126
+ overflow: 'hidden',
4127
+ padding: '10px',
4106
4128
  display: 'flex',
4107
4129
  alignItems: 'center',
4108
- borderRadius: 6,
4130
+ borderRadius: '6px',
4109
4131
  cursor: 'pointer'
4110
4132
  },
4111
4133
  onClick: function onClick() {