funda-ui 4.6.111 → 4.6.222

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/Chatbox/index.css CHANGED
@@ -1,24 +1,19 @@
1
1
  /*=================== Chatbox (Loading) =================*/
2
2
  .custom-chatbox-loader-container {
3
+ --custom-chatbox-loader-color: #b9caf7;
4
+ --custom-chatbox-loader-color2: #0d6efd;
3
5
  width: 130px;
4
6
  text-align: start;
5
7
  }
6
8
  .custom-chatbox-loader-container .custom-chatbox-loader {
7
9
  height: 4px;
8
10
  width: 100%;
9
- --c: no-repeat linear-gradient(var(--bs-primary) 0 0);
10
- background: var(--c), var(--c), #b9caf7;
11
+ --c: no-repeat linear-gradient(var(--custom-chatbox-loader-color2) 0 0);
12
+ background: var(--c), var(--c), var(--custom-chatbox-loader-color);
11
13
  background-size: 60% 100%;
12
- animation: cssAnim--loadermove 3s infinite;
14
+ animation: loader-move 3s infinite;
13
15
  }
14
-
15
- .dark-mode .custom-chatbox-loader-container .custom-chatbox-loader,
16
- [data-bs-theme=dark] .custom-chatbox-loader-container .custom-chatbox-loader {
17
- --c: no-repeat linear-gradient(var(--bs-primary) 0 0);
18
- background: var(--c), var(--c), #8692b5;
19
- }
20
-
21
- @keyframes cssAnim--loadermove {
16
+ @keyframes loader-move {
22
17
  0% {
23
18
  background-position: -150% 0, -150% 0;
24
19
  }
@@ -29,6 +24,29 @@
29
24
  background-position: 250% 0, 250% 0;
30
25
  }
31
26
  }
27
+
28
+ .custom-chatbox-mini-loader {
29
+ --custom-chatbox-miniloader-color: rgba(0,0,0,.5);
30
+ width: 15px;
31
+ height: 15px;
32
+ margin: 0.5rem;
33
+ margin-bottom: 0;
34
+ border: 3px dotted var(--custom-chatbox-miniloader-color);
35
+ border-radius: 50%;
36
+ display: inline-block;
37
+ position: relative;
38
+ box-sizing: border-box;
39
+ animation: mini-loader-spin 1s linear infinite;
40
+ }
41
+ @keyframes mini-loader-spin {
42
+ 0% {
43
+ transform: rotate(0deg);
44
+ }
45
+ 100% {
46
+ transform: rotate(360deg);
47
+ }
48
+ }
49
+
32
50
  /*=================== Chatbox (Core) =================*/
33
51
  .custom-chatbox-circle {
34
52
  --custom-chatbox-circle-color: #5A5EB9;
@@ -113,6 +131,10 @@
113
131
  --custom-chatbox-toolkit-opt-border-color: #e9ecef;
114
132
  --custom-chatbox-toolkit-opt-active-color: #c2dfff;
115
133
  --custom-chatbox-toolkit-btn-radius: 20px;
134
+ --custom-chatbox-questions-bg: #f5f5f5;
135
+ --custom-chatbox-questions-hover-bg: #e9e9e9;
136
+ --custom-chatbox-content-html-elem-border-color: #ddd;
137
+ --custom-chatbox-content-html-elem-bg: rgba(0,0,0,.05);
116
138
  min-width: var(--custom-chatbox-w);
117
139
  max-width: var(--custom-chatbox-w);
118
140
  margin: auto;
@@ -132,6 +154,7 @@
132
154
  /* new chat button */
133
155
  /* toolkit buttons */
134
156
  /* toolkit options */
157
+ /* default questions */
135
158
  }
136
159
  .custom-chatbox-container details {
137
160
  font-style: italic;
@@ -139,6 +162,8 @@
139
162
  padding: 0;
140
163
  font-size: 0.75rem;
141
164
  margin-bottom: 0.5rem;
165
+ background: var(--custom-chatbox-msg-bg);
166
+ padding: 0.5rem;
142
167
  }
143
168
  .custom-chatbox-container summary {
144
169
  cursor: pointer;
@@ -168,7 +193,7 @@
168
193
  font-size: 0.75rem;
169
194
  }
170
195
  .custom-chatbox-container .messages {
171
- height: calc(100% - 80px);
196
+ height: calc(100% - 110px);
172
197
  overflow-y: auto;
173
198
  margin-bottom: 10px;
174
199
  font-size: 13px;
@@ -213,6 +238,33 @@
213
238
  margin-top: 0.3rem;
214
239
  display: inline-block;
215
240
  text-align: start;
241
+ /* Custom HTML Styles */
242
+ }
243
+ .custom-chatbox-container .messages .qa-content .table-container {
244
+ overflow-x: auto;
245
+ margin-bottom: 0.5rem;
246
+ }
247
+ .custom-chatbox-container .messages .qa-content .table-container::-webkit-scrollbar {
248
+ height: 10px;
249
+ }
250
+ .custom-chatbox-container .messages .qa-content .table-container::-webkit-scrollbar-thumb {
251
+ background: rgba(0, 0, 0, 0.2);
252
+ }
253
+ .custom-chatbox-container .messages .qa-content .table-container table {
254
+ width: 100%;
255
+ border-collapse: collapse;
256
+ border-radius: 0.35rem;
257
+ }
258
+ .custom-chatbox-container .messages .qa-content .table-container table thead {
259
+ background: var(--custom-chatbox-content-html-elem-bg);
260
+ }
261
+ .custom-chatbox-container .messages .qa-content .table-container table thead tr {
262
+ white-space: nowrap;
263
+ }
264
+ .custom-chatbox-container .messages .qa-content .table-container table th, .custom-chatbox-container .messages .qa-content .table-container table td {
265
+ padding: 0.25rem;
266
+ text-align: left;
267
+ border: 1px solid var(--custom-chatbox-content-html-elem-border-color);
216
268
  }
217
269
  .custom-chatbox-container .messages .request {
218
270
  text-align: end;
@@ -229,6 +281,8 @@
229
281
  }
230
282
  .custom-chatbox-container .messages .reply .qa-content {
231
283
  width: var(--custom-chatbox-content-w);
284
+ background: transparent;
285
+ padding-top: 0;
232
286
  }
233
287
  .custom-chatbox-container .msg-dotted-loader-container {
234
288
  font-weight: normal;
@@ -370,6 +424,11 @@
370
424
  }
371
425
  .custom-chatbox-container .newchat-btn {
372
426
  text-align: center;
427
+ position: absolute;
428
+ bottom: 95px;
429
+ left: 50%;
430
+ transform: translateX(-50%);
431
+ z-index: 1;
373
432
  }
374
433
  .custom-chatbox-container .newchat-btn > button {
375
434
  padding: 3px 6px;
@@ -434,7 +493,7 @@
434
493
  display: flex;
435
494
  align-items: center;
436
495
  justify-content: space-between;
437
- border: 1px solid #ddd;
496
+ border: 1px solid var(--custom-chatbox-gray-color);
438
497
  border-radius: var(--custom-chatbox-toolkit-btn-radius);
439
498
  cursor: pointer;
440
499
  }
@@ -459,6 +518,7 @@
459
518
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
460
519
  margin-bottom: 10px;
461
520
  max-height: 300px;
521
+ min-width: 120px;
462
522
  overflow-y: auto;
463
523
  animation: dropupAnimation 0.2s ease;
464
524
  position: absolute;
@@ -486,6 +546,27 @@
486
546
  .custom-chatbox-container .toolkit-select-wrapper .toolkit-select-option.cancel {
487
547
  color: var(--custom-chatbox-gray-color);
488
548
  }
489
- .custom-chatbox-container .toolkit-select-wrapper .toolkit-select-option:hover {
549
+ .custom-chatbox-container .toolkit-select-wrapper .toolkit-select-option.selected:not(.cancel), .custom-chatbox-container .toolkit-select-wrapper .toolkit-select-option:hover {
490
550
  background-color: var(--custom-chatbox-toolkit-opt-active-color);
491
551
  }
552
+ .custom-chatbox-container .default-questions-title {
553
+ margin-bottom: 0.5rem;
554
+ }
555
+ .custom-chatbox-container .default-questions {
556
+ padding: 15px;
557
+ width: 100%;
558
+ }
559
+ .custom-chatbox-container .default-question-item {
560
+ padding: 0.3rem 1rem;
561
+ margin-bottom: 0.2rem;
562
+ background-color: var(--custom-chatbox-questions-bg);
563
+ border-radius: 0.35rem;
564
+ cursor: pointer;
565
+ transition: all 0.3s ease;
566
+ }
567
+ .custom-chatbox-container .default-question-item:hover {
568
+ background-color: var(--custom-chatbox-questions-hover-bg);
569
+ }
570
+ .custom-chatbox-container .default-question-item:last-child {
571
+ margin-bottom: 0;
572
+ }
@@ -9,11 +9,16 @@ export declare type MessageDetail = {
9
9
  content: string;
10
10
  tag: string;
11
11
  };
12
+ export declare type QuestionData = {
13
+ title: string;
14
+ list: Array<string>;
15
+ };
12
16
  export interface FloatingButton {
13
17
  label: string;
14
18
  value: string;
15
19
  onClick: string;
16
20
  isSelect?: boolean;
21
+ dynamicOptions?: boolean;
17
22
  [key: string]: any;
18
23
  }
19
24
  export interface FloatingButtonSelectOption {
@@ -66,10 +71,12 @@ export declare type ChatboxProps = {
66
71
  toolkitButtons?: FloatingButton[];
67
72
  newChatButton?: FloatingButton;
68
73
  customMethods?: CustomMethod[];
74
+ defaultQuestions?: QuestionData;
69
75
  customRequest?: CustomRequestFunction;
70
76
  renderParser?: (input: string) => Promise<string>;
71
77
  requestBodyFormatter?: (body: any, contextData: Record<string, any>, conversationHistory: MessageDetail[]) => Promise<Record<string, any>>;
72
78
  nameFormatter?: (input: string) => string;
79
+ onQuestionClick?: (text: string, methods: Record<string, Function>) => void;
73
80
  onInputChange?: (controlRef: React.RefObject<any>, val: string) => any;
74
81
  onInputCallback?: (input: string) => Promise<string>;
75
82
  onChunk?: (controlRef: React.RefObject<any>, lastContent: string, conversationHistory: MessageDetail[]) => any;