funda-ui 4.6.101 → 4.6.151
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 +25 -1
- package/Chatbox/index.d.ts +7 -0
- package/Chatbox/index.js +279 -133
- package/Date/index.js +53 -47
- package/Select/index.d.ts +4 -4
- package/TagInput/index.d.ts +6 -0
- package/TagInput/index.js +6 -3
- package/Textarea/index.js +46 -46
- package/Utils/sanitize.d.ts +14 -0
- package/Utils/sanitize.js +87 -0
- package/Utils/useAutosizeTextArea.js +46 -46
- package/lib/cjs/Chatbox/index.d.ts +7 -0
- package/lib/cjs/Chatbox/index.js +279 -133
- package/lib/cjs/Date/index.js +53 -47
- package/lib/cjs/Select/index.d.ts +4 -4
- package/lib/cjs/TagInput/index.d.ts +6 -0
- package/lib/cjs/TagInput/index.js +6 -3
- package/lib/cjs/Textarea/index.js +46 -46
- package/lib/cjs/Utils/sanitize.d.ts +14 -0
- package/lib/cjs/Utils/sanitize.js +87 -0
- package/lib/cjs/Utils/useAutosizeTextArea.js +46 -46
- package/lib/css/Chatbox/index.css +25 -1
- package/lib/esm/Chatbox/index.scss +33 -2
- package/lib/esm/Chatbox/index.tsx +70 -8
- package/lib/esm/Chatbox/utils/func.ts +0 -54
- package/lib/esm/Date/index.tsx +60 -43
- package/lib/esm/Input/index.tsx +1 -0
- package/lib/esm/Select/index.tsx +4 -5
- package/lib/esm/TagInput/index.tsx +30 -10
- package/lib/esm/Textarea/index.tsx +1 -0
- package/lib/esm/Utils/hooks/useAutosizeTextArea.tsx +47 -49
- package/lib/esm/Utils/libs/sanitize.ts +55 -0
- package/package.json +1 -1
package/Chatbox/index.css
CHANGED
|
@@ -113,6 +113,8 @@
|
|
|
113
113
|
--custom-chatbox-toolkit-opt-border-color: #e9ecef;
|
|
114
114
|
--custom-chatbox-toolkit-opt-active-color: #c2dfff;
|
|
115
115
|
--custom-chatbox-toolkit-btn-radius: 20px;
|
|
116
|
+
--custom-chatbox-questions-bg: #f5f5f5;
|
|
117
|
+
--custom-chatbox-questions-hover-bg: #e9e9e9;
|
|
116
118
|
min-width: var(--custom-chatbox-w);
|
|
117
119
|
max-width: var(--custom-chatbox-w);
|
|
118
120
|
margin: auto;
|
|
@@ -132,6 +134,7 @@
|
|
|
132
134
|
/* new chat button */
|
|
133
135
|
/* toolkit buttons */
|
|
134
136
|
/* toolkit options */
|
|
137
|
+
/* default questions */
|
|
135
138
|
}
|
|
136
139
|
.custom-chatbox-container details {
|
|
137
140
|
font-style: italic;
|
|
@@ -434,7 +437,7 @@
|
|
|
434
437
|
display: flex;
|
|
435
438
|
align-items: center;
|
|
436
439
|
justify-content: space-between;
|
|
437
|
-
border: 1px solid
|
|
440
|
+
border: 1px solid var(--custom-chatbox-gray-color);
|
|
438
441
|
border-radius: var(--custom-chatbox-toolkit-btn-radius);
|
|
439
442
|
cursor: pointer;
|
|
440
443
|
}
|
|
@@ -489,3 +492,24 @@
|
|
|
489
492
|
.custom-chatbox-container .toolkit-select-wrapper .toolkit-select-option:hover {
|
|
490
493
|
background-color: var(--custom-chatbox-toolkit-opt-active-color);
|
|
491
494
|
}
|
|
495
|
+
.custom-chatbox-container .default-questions-title {
|
|
496
|
+
margin-bottom: 0.5rem;
|
|
497
|
+
}
|
|
498
|
+
.custom-chatbox-container .default-questions {
|
|
499
|
+
padding: 15px;
|
|
500
|
+
width: 100%;
|
|
501
|
+
}
|
|
502
|
+
.custom-chatbox-container .default-question-item {
|
|
503
|
+
padding: 0.3rem 1rem;
|
|
504
|
+
margin-bottom: 0.2rem;
|
|
505
|
+
background-color: var(--custom-chatbox-questions-bg);
|
|
506
|
+
border-radius: 0.35rem;
|
|
507
|
+
cursor: pointer;
|
|
508
|
+
transition: all 0.3s ease;
|
|
509
|
+
}
|
|
510
|
+
.custom-chatbox-container .default-question-item:hover {
|
|
511
|
+
background-color: var(--custom-chatbox-questions-hover-bg);
|
|
512
|
+
}
|
|
513
|
+
.custom-chatbox-container .default-question-item:last-child {
|
|
514
|
+
margin-bottom: 0;
|
|
515
|
+
}
|
package/Chatbox/index.d.ts
CHANGED
|
@@ -9,6 +9,10 @@ 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;
|
|
@@ -38,6 +42,7 @@ export declare type CustomRequestResponse = {
|
|
|
38
42
|
export declare type CustomRequestFunction = (message: string, config: CustomRequestConfig) => Promise<CustomRequestResponse>;
|
|
39
43
|
export declare type ChatboxProps = {
|
|
40
44
|
debug?: boolean;
|
|
45
|
+
defaultRows?: number;
|
|
41
46
|
prefix?: string;
|
|
42
47
|
contentRef?: React.RefObject<any>;
|
|
43
48
|
model?: string;
|
|
@@ -65,10 +70,12 @@ export declare type ChatboxProps = {
|
|
|
65
70
|
toolkitButtons?: FloatingButton[];
|
|
66
71
|
newChatButton?: FloatingButton;
|
|
67
72
|
customMethods?: CustomMethod[];
|
|
73
|
+
defaultQuestions?: QuestionData;
|
|
68
74
|
customRequest?: CustomRequestFunction;
|
|
69
75
|
renderParser?: (input: string) => Promise<string>;
|
|
70
76
|
requestBodyFormatter?: (body: any, contextData: Record<string, any>, conversationHistory: MessageDetail[]) => Promise<Record<string, any>>;
|
|
71
77
|
nameFormatter?: (input: string) => string;
|
|
78
|
+
onQuestionClick?: (text: string, methods: Record<string, Function>) => void;
|
|
72
79
|
onInputChange?: (controlRef: React.RefObject<any>, val: string) => any;
|
|
73
80
|
onInputCallback?: (input: string) => Promise<string>;
|
|
74
81
|
onChunk?: (controlRef: React.RefObject<any>, lastContent: string, conversationHistory: MessageDetail[]) => any;
|