@douyinfe/semi-foundation 2.62.0 → 2.63.0-beta.0
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/chat/chat.scss +598 -0
- package/chat/chatBoxActionFoundation.ts +64 -0
- package/chat/constants.ts +68 -0
- package/chat/foundation.ts +306 -0
- package/chat/inputboxFoundation.ts +98 -0
- package/chat/rtl.scss +22 -0
- package/chat/variables.scss +125 -0
- package/input/textareaFoundation.ts +5 -0
- package/lib/cjs/chat/chat.css +484 -0
- package/lib/cjs/chat/chat.scss +598 -0
- package/lib/cjs/chat/chatBoxActionFoundation.d.ts +24 -0
- package/lib/cjs/chat/chatBoxActionFoundation.js +49 -0
- package/lib/cjs/chat/constants.d.ts +41 -0
- package/lib/cjs/chat/constants.js +56 -0
- package/lib/cjs/chat/foundation.d.ts +76 -0
- package/lib/cjs/chat/foundation.js +275 -0
- package/lib/cjs/chat/inputboxFoundation.d.ts +20 -0
- package/lib/cjs/chat/inputboxFoundation.js +118 -0
- package/lib/cjs/chat/rtl.scss +22 -0
- package/lib/cjs/chat/variables.scss +125 -0
- package/lib/cjs/input/textareaFoundation.js +7 -0
- package/lib/cjs/treeSelect/foundation.d.ts +3 -3
- package/lib/cjs/treeSelect/foundation.js +2 -6
- package/lib/cjs/upload/foundation.d.ts +1 -0
- package/lib/cjs/upload/foundation.js +3 -1
- package/lib/cjs/upload/upload.css +4 -0
- package/lib/cjs/upload/upload.scss +9 -0
- package/lib/es/chat/chat.css +484 -0
- package/lib/es/chat/chat.scss +598 -0
- package/lib/es/chat/chatBoxActionFoundation.d.ts +24 -0
- package/lib/es/chat/chatBoxActionFoundation.js +41 -0
- package/lib/es/chat/constants.d.ts +41 -0
- package/lib/es/chat/constants.js +51 -0
- package/lib/es/chat/foundation.d.ts +76 -0
- package/lib/es/chat/foundation.js +267 -0
- package/lib/es/chat/inputboxFoundation.d.ts +20 -0
- package/lib/es/chat/inputboxFoundation.js +110 -0
- package/lib/es/chat/rtl.scss +22 -0
- package/lib/es/chat/variables.scss +125 -0
- package/lib/es/input/textareaFoundation.js +7 -0
- package/lib/es/treeSelect/foundation.d.ts +3 -3
- package/lib/es/treeSelect/foundation.js +2 -6
- package/lib/es/upload/foundation.d.ts +1 -0
- package/lib/es/upload/foundation.js +3 -1
- package/lib/es/upload/upload.css +4 -0
- package/lib/es/upload/upload.scss +9 -0
- package/package.json +3 -3
- package/treeSelect/foundation.ts +3 -9
- package/upload/foundation.ts +4 -2
- package/upload/upload.scss +9 -0
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// radius
|
|
2
|
+
$radius-chat_chatBox_content: var(--semi-border-radius-large); // 聊天框内容圆角
|
|
3
|
+
$radius-chat_inputBox_container: 16px; // 输入框容器圆角
|
|
4
|
+
$radius-chat_attachment_img: var(--semi-border-radius-medium); // 附件图片圆角
|
|
5
|
+
$radius-chat_attachment_file: var(--semi-border-radius-medium); // 附件文件圆角
|
|
6
|
+
$radius-chat_hint_item: var(--semi-border-radius-large); // 提示条圆角
|
|
7
|
+
$radius-chat_chatBox_content_code: var(--semi-border-radius-large); // 代码块圆角
|
|
8
|
+
$radius-chat_chatBox_content_code_topSlot_copy: var(--semi-border-radius-large); // 代码块顶部复制按钮圆角
|
|
9
|
+
$radius-chat_dropArea: 16px; // 拖拽上传区域圆角
|
|
10
|
+
|
|
11
|
+
//color
|
|
12
|
+
$color-chat_action_content-bg: var(--semi-color-bg-0); // 返回按钮/停止生成内容按钮背景颜色
|
|
13
|
+
$color-chat_action_content-border: var(--semi-color-border); // 返回按钮/停止生成按钮描边颜色
|
|
14
|
+
$color-chat_divider: var(--semi-color-text-2); // 分割线颜色
|
|
15
|
+
$color-chat_chatBox_title: var(--semi-color-text-0); //聊天框标题颜色
|
|
16
|
+
$color-chat_chatBox_action_icon: var(--semi-color-text-2); // 聊天框操作区域按钮图标颜色
|
|
17
|
+
$color-chat_chatBox_action_icon-hover: var(--semi-color-text-0); // 聊天框操作区域按钮图标hover颜色
|
|
18
|
+
$color-chat_chatBox_action-bg-hover: transparent; // 聊天框操作区域按钮hover背景颜色
|
|
19
|
+
$color-chat_chatBox_content_text: var(--semi-color-text-0); // 聊天框内容文字颜色
|
|
20
|
+
$color-chat_chatBox_content_bg: var(--semi-color-fill-0); // 聊天框内容背景颜色
|
|
21
|
+
$color-chat_chatBox_content_user-bg: var(--semi-color-primary); // 聊天框内容用户背景颜色
|
|
22
|
+
$color-chat_chatBox_content_user-text: var(--semi-color-white); // 聊天框内容用户文字颜色
|
|
23
|
+
$color-chat_chatBox_content_error-bg: var(--semi-color-danger-hover); // 聊天框内容错误背景颜色
|
|
24
|
+
$color-chat_chatBox_content_error-text: var(--semi-color-white); // 聊天框内容错误文字颜色
|
|
25
|
+
$color-chat_inputBottom_clearButton_icon: var(--semi-color-text-2); //清空按钮图标颜色
|
|
26
|
+
$color-chat_inputBottom_uploadButton_icon: var(--semi-color-text-0); // 上传按钮图标颜色
|
|
27
|
+
$color-chat_inputBottom_sendButton_icon-disable: var(--semi-color-primary-disabled); // 发送按钮禁用态图标颜色
|
|
28
|
+
$color-chat_inputBox_container-border: var(--semi-color-border); // 输入框容器边框颜色
|
|
29
|
+
$color-chat_attachment_clear_icon: var(--semi-color-text-2); // 附件清除图标颜色
|
|
30
|
+
$color-chat_attachment_file-bg: var(--semi-color-fill-0); // 附件文件背景颜色
|
|
31
|
+
$color-chat_chatBox_user_attachment_file-bg: var(--semi-color-bg-0); // 用户聊天框附件文件背景颜色
|
|
32
|
+
$color-chat_chatBox_other_attachment_file-bg: var(--semi-color-fill-2); // 聊天框附件文件背景颜色
|
|
33
|
+
$color-chat_attachment_file_icon: var(--semi-color-text-2); // 附件文件图标颜色
|
|
34
|
+
$color-chat_attachment_file_title: var(--semi-color-text-0); // 附件文件标题颜色
|
|
35
|
+
$color-chat_attachment_file_metadata_text: var(--semi-color-text-2); // 附件文件元数据文字颜色
|
|
36
|
+
$color-chat_hint_item-border: var(--semi-color-border); // 提示条边框颜色
|
|
37
|
+
$color-chat_hint_item-bg: transparent; // 提示条背景颜色
|
|
38
|
+
$color-chat_hint_item-bg-hover: var(--semi-color-fill-0); // 提示条hover背景颜色
|
|
39
|
+
$color-chat_hint_content_text: var(--semi-color-text-1); // 提示条文字颜色
|
|
40
|
+
$color-chat_hint_icon: var(--semi-color-text-2); // 提示条图标颜色
|
|
41
|
+
$color-chat_chatBox_loading-bg: var(--semi-color-text-0); // 聊天内容加载图标圆圈颜色
|
|
42
|
+
$color-chat_chatBox_code_topSlot: rgba(var(--semi-white), 1); // 代码块顶部字体颜色
|
|
43
|
+
$color-chat_chatBox_code_topSlot-bg: rgba(var(--semi-grey-4), 1); //代码块顶部背景色
|
|
44
|
+
$color-chat_chatBox_code_topSlot_toCopy-bg-hover: rgba(var(--semi-grey-5), 1); // 代码块顶部复制按钮hover背景色
|
|
45
|
+
$color-chat_chatBox_code_content: var(--semi-color-bg-0); // 代码块内容背景色
|
|
46
|
+
$color-chat_action_content-bg-hover: var(--semi-color-tertiary-light-hover); // 返回按钮/停止生成按钮hover背景颜色
|
|
47
|
+
$color-chat_dropArea-bg: rgba(var(--semi-grey-2), 0.9); // 拖拽区域文字颜色
|
|
48
|
+
$color-chat_dropArea-border: var(--semi-color-border); // 拖拽区域边框颜色
|
|
49
|
+
|
|
50
|
+
// spacing
|
|
51
|
+
$spacing-chat_paddingY: 12px; // chat组件上下内边距
|
|
52
|
+
$spacing-chat_container-paddingX: 16px; // 消息框水平内边距
|
|
53
|
+
$spacing-chat_action_content-bottom: 0; // 返回按钮/停止生成按钮底部边距
|
|
54
|
+
$spacing-chat_chatBox-marginY: 8px; // 聊天框上下外边距
|
|
55
|
+
$spacing-chat_chatBox-columnGap: 12px; // 聊天框内容列间距
|
|
56
|
+
$spacing-chat_chatBox_action-columnGap: 10px; // 聊天框操作区域按钮列间距
|
|
57
|
+
$spacing-chat_chatBox_action-marginX: 10px; // 聊天框操作区域左右外边距
|
|
58
|
+
$spacing-chat_chatBox_action_btn-padding: 0; // 聊天框操作区域按钮内边距
|
|
59
|
+
$spacing-chat_chatBox_content-paddingY: 8px; // 聊天框内容上下内边距
|
|
60
|
+
$spacing-chat_chatBox_content-paddingX: 12px; // 聊天框内容左右内边距
|
|
61
|
+
$spacing-chat_inputBox-paddingTop: 8px; // 输入框顶部内边距
|
|
62
|
+
$spacing-chat_inputBox-paddingBottom: 8px; // 输入框底部内边距
|
|
63
|
+
$spacing-chat_inputBox-paddingX: 16px; // 输入框左右内边距
|
|
64
|
+
$spacing-chat_inputBox_container-padding: 11px; // 输入框容器内边距
|
|
65
|
+
$spacing-chat_inputBox_inner-columnGap: 4px; // 输入框容器列间距
|
|
66
|
+
// $spacing-chat_inputBox_textarea-marginX: 5px; // 输入框textArea左右内边距
|
|
67
|
+
$spacing-chat_inputBox-marginY: 4px;
|
|
68
|
+
$spacing-chat_attachment-columnGap: 10px; // 附件列间距
|
|
69
|
+
$spacing-chat_attachment-RowGap: 5px; // 附件行间距
|
|
70
|
+
$spacing-chat_attachment_clear-top: 8px; // 附件清除图标顶部间距
|
|
71
|
+
$spacing-chat_attachment_clear-right: 8px; // 附件清除图标右内边距
|
|
72
|
+
$spacing-chat_attachment_file-columnGap: 5px; // 文件附件列间距
|
|
73
|
+
$spacing-chat_attachment_file-padding: 5px; // 文件附件内边距
|
|
74
|
+
$spacing-chat_chatBox_loading_item-gap: 15px; // 聊天内容加载图标间距
|
|
75
|
+
$spacing-chat_divider-marginY: 12px; // 分割线上下外边距
|
|
76
|
+
$spacing-chat_chatBox_content_attachment-marginY: 4px; // 聊天框内容文件/图片上下外间距
|
|
77
|
+
$spacing-chat_chatBox_content_code_topSlot-paddingX: 5px; // 聊天框代码块顶部上下内边距
|
|
78
|
+
$spacing-chat_chatBox_content_code_topSlot-paddingY: 8px; // 聊天框代码块顶部左右内边距
|
|
79
|
+
$spacing-chat_chatBox_content_code_topSlot_copy-columnGap: 5px; // 聊天框代码块顶部复制按钮列间距:
|
|
80
|
+
$spacing-chat_chatBox_content_code_topSlot_copy-padding: 5px; // 聊天框代码块顶部复制按钮列间距:
|
|
81
|
+
$spacing-chat_chatBox_wrap: 8px; // 聊天框外层间距
|
|
82
|
+
$spacing-chat_hint-rowGap: 10px; // 提示条行间距
|
|
83
|
+
$spacing-chat_hint-marginY: 12px; // 提示条容器上下外边距
|
|
84
|
+
$spacing-chat_hint-marginLeft: 34px; // 提示条容器左外边距
|
|
85
|
+
$spacing-chat_hint_item-marginY: 8px; // 提示条上下外边距
|
|
86
|
+
$spacing-chat_hint_item-marginX: 12px; // 提示条左右外边距
|
|
87
|
+
$spacing-chat_hint_item-columnGap: 20px; // 提示条内容列间距
|
|
88
|
+
$spacing-chat_chatBox_loading-item-marginX: 18px; // 聊天内容加载图标中心圆圈左右外边距
|
|
89
|
+
$spacing-chat_chatBox_loading-item-marginY: 6px; // 聊天内容加载图标中心圆圈上下外边距
|
|
90
|
+
|
|
91
|
+
// width
|
|
92
|
+
$width-chat_backBottom_wrapper: 42px; // 返回按钮宽度
|
|
93
|
+
$width-chat_action_content-border: 1px; // 返回按钮/停止生成按钮描边宽度
|
|
94
|
+
$width-chat_inputBottom_clearButton: 48px; // 清空按钮宽度
|
|
95
|
+
$width-chat_inputBottom_uploadButton: 32px; // 上传按钮宽度
|
|
96
|
+
$width-chat_inputBottom_sendButton: 32px; // 发送按钮宽度
|
|
97
|
+
$width-chat_inputBox_container-border: 1px; // 输入框容器边框宽度
|
|
98
|
+
$width-chat_attachment_file: 50px; // 附件文件宽度
|
|
99
|
+
$width-chat_hint_item-border: 1px; // 提示条边框宽度
|
|
100
|
+
$width-chat_chatBox_loading: 8px; // 加载中单个圆圈图标宽度
|
|
101
|
+
$width-chat_attachment_file_title: 90px; // 附件文件标题最大宽度
|
|
102
|
+
$width-chat_max: 800px; // chat组件最大宽度
|
|
103
|
+
$width-chat_dropArea-border: 5px; // 拖拽上传边框宽度
|
|
104
|
+
$width-chat_chatBox_content_code_topSlot_copy: 150px; // 聊天框代码块顶部复制按钮最小宽度
|
|
105
|
+
// height
|
|
106
|
+
$height-chat_action_stop: 42px; //停止生成按钮高度
|
|
107
|
+
|
|
108
|
+
//font
|
|
109
|
+
$font-chat_divider-fontWeight: $font-weight-regular; // 分割线字重
|
|
110
|
+
$font-chat_divider-fontSize: $font-size-small; // 分割线字体大小
|
|
111
|
+
$font-chat_chatBox_title-lineHeight: 20px; //聊天框标题行高
|
|
112
|
+
$font-chat_chatBox_title-fontSize: $font-size-header-6; // 聊天框标题字体大小
|
|
113
|
+
$font-chat_chatBox_title-fontWeight: $font-weight-regular; // 聊天框标题字重
|
|
114
|
+
$font-chat_inputBottom_clearButton_icon-fontSize: 30px; // 输入区清空上下文按钮图标大小
|
|
115
|
+
$font-chat_attachment_file_title-fontSize: $font-size-header-6; // 附件文件标题字体大小
|
|
116
|
+
$font-chat_attachment_file_metadata-fontSize: $font-size-regular; // 附件文件元数据字体大小
|
|
117
|
+
$font-chat_hint_content-fontSize: $font-size-regular; // 提示条文字大小
|
|
118
|
+
// $font-chat_hint_icon: 20px; // 提示条图标大小
|
|
119
|
+
$font-chat_chatBox_code_topSlot: 12px; // 代码块顶部字体大小
|
|
120
|
+
$font-chat_chatBox_code_topSlot-lineHeight: 16px; //代码块顶部区域字体行高
|
|
121
|
+
$font-chat_dropArea_text: 48px; // 拖拽上传区域文字大小
|
|
122
|
+
|
|
123
|
+
//z-index
|
|
124
|
+
$z-chat_dropArea: 10; // 拖拽上传区域z-index
|
|
125
|
+
$z-chat_action: 1; // 返回按钮/停止生成按钮z-index
|
|
@@ -185,6 +185,13 @@ class TextAreaFoundation extends _foundation.default {
|
|
|
185
185
|
this._adapter.notifyBlur(realValue, e);
|
|
186
186
|
}
|
|
187
187
|
handleKeyDown(e) {
|
|
188
|
+
const {
|
|
189
|
+
disabledEnterStartNewLine
|
|
190
|
+
} = this.getProps();
|
|
191
|
+
if (disabledEnterStartNewLine && e.key === 'Enter' && !e.shiftKey) {
|
|
192
|
+
// Prevent default line wrapping behavior
|
|
193
|
+
e.preventDefault();
|
|
194
|
+
}
|
|
188
195
|
this._adapter.notifyKeyDown(e);
|
|
189
196
|
if (e.keyCode === 13) {
|
|
190
197
|
this._adapter.notifyPressEnter(e);
|
|
@@ -107,8 +107,6 @@ export interface TreeSelectAdapter<P = Record<string, any>, S = Record<string, a
|
|
|
107
107
|
updateInputFocus: (bool: boolean) => void;
|
|
108
108
|
updateLoadKeys: (data: BasicTreeNodeData, resolve: (value?: any) => void) => void;
|
|
109
109
|
updateIsFocus: (bool: boolean) => void;
|
|
110
|
-
setClearInputFlag: (flag: boolean) => void;
|
|
111
|
-
getClearInputFlag: () => boolean;
|
|
112
110
|
}
|
|
113
111
|
export default class TreeSelectFoundation<P = Record<string, any>, S = Record<string, any>> extends BaseFoundation<TreeSelectAdapter<P, S>, P, S> {
|
|
114
112
|
constructor(adapter: TreeSelectAdapter<P, S>);
|
|
@@ -164,7 +162,9 @@ export default class TreeSelectFoundation<P = Record<string, any>, S = Record<st
|
|
|
164
162
|
handleSingleSelect(e: any, treeNode: BasicTreeNodeProps): void;
|
|
165
163
|
calcCheckedKeys(eventKey: BasicTreeNodeProps['eventKey'], targetStatus: boolean): {
|
|
166
164
|
checkedKeys: Set<string>;
|
|
167
|
-
halfCheckedKeys: Set<string>;
|
|
165
|
+
halfCheckedKeys: Set<string>; /**
|
|
166
|
+
* A11y: simulate selection click
|
|
167
|
+
*/
|
|
168
168
|
};
|
|
169
169
|
handleMultipleSelect(e: any, treeNode: BasicTreeNodeProps): void;
|
|
170
170
|
calcNonDisabledCheckedKeys(eventKey: string, targetStatus: boolean): {
|
|
@@ -794,8 +794,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
794
794
|
* When the search box is on the trigger, the focus event processing method
|
|
795
795
|
*/
|
|
796
796
|
handleInputTriggerFocus() {
|
|
797
|
-
|
|
798
|
-
inputValue && this.clearInput();
|
|
797
|
+
this.clearInput();
|
|
799
798
|
this._adapter.updateState({
|
|
800
799
|
inputTriggerFocus: true
|
|
801
800
|
});
|
|
@@ -809,11 +808,9 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
809
808
|
searchAutoFocus,
|
|
810
809
|
searchPosition
|
|
811
810
|
} = this.getProps();
|
|
812
|
-
const inputValue = this.getState('inputValue');
|
|
813
811
|
// 将 inputValue 清空,如果有选中值的话,选中项能够快速回显
|
|
814
812
|
// Clear the inputValue. If there is a selected value, the selected item can be quickly echoed.
|
|
815
813
|
if (isVisible === false && filterTreeNode) {
|
|
816
|
-
inputValue && this._adapter.setClearInputFlag(true);
|
|
817
814
|
this.clearInputValue();
|
|
818
815
|
}
|
|
819
816
|
if (filterTreeNode && searchPosition === _constants.strings.SEARCH_POSITION_DROPDOWN && isVisible && searchAutoFocus) {
|
|
@@ -830,8 +827,7 @@ class TreeSelectFoundation extends _foundation.default {
|
|
|
830
827
|
const {
|
|
831
828
|
filterTreeNode
|
|
832
829
|
} = this.getProps();
|
|
833
|
-
|
|
834
|
-
filterTreeNode && shouldClear && this.clearInput();
|
|
830
|
+
filterTreeNode && this.clearInput();
|
|
835
831
|
}
|
|
836
832
|
}
|
|
837
833
|
exports.default = TreeSelectFoundation;
|
|
@@ -40,6 +40,7 @@ export interface AfterUploadResult {
|
|
|
40
40
|
status?: string;
|
|
41
41
|
validateMessage?: unknown;
|
|
42
42
|
name?: string;
|
|
43
|
+
url?: string;
|
|
43
44
|
}
|
|
44
45
|
export interface UploadAdapter<P = Record<string, any>, S = Record<string, any>> extends DefaultAdapter<P, S> {
|
|
45
46
|
notifyFileSelect: (files: Array<CustomFile>) => void;
|
|
@@ -695,7 +695,8 @@ class UploadFoundation extends _foundation.default {
|
|
|
695
695
|
autoRemove,
|
|
696
696
|
status,
|
|
697
697
|
validateMessage,
|
|
698
|
-
name
|
|
698
|
+
name,
|
|
699
|
+
url
|
|
699
700
|
} = this._adapter.notifyAfterUpload({
|
|
700
701
|
response: body,
|
|
701
702
|
file: newFileList[index],
|
|
@@ -704,6 +705,7 @@ class UploadFoundation extends _foundation.default {
|
|
|
704
705
|
status ? newFileList[index].status = status : null;
|
|
705
706
|
validateMessage ? newFileList[index].validateMessage = validateMessage : null;
|
|
706
707
|
name ? newFileList[index].name = name : null;
|
|
708
|
+
url ? newFileList[index].url = url : null;
|
|
707
709
|
autoRemove ? newFileList.splice(index, 1) : null;
|
|
708
710
|
}
|
|
709
711
|
this._adapter.notifySuccess(body, fileInstance, newFileList);
|
|
@@ -291,6 +291,10 @@
|
|
|
291
291
|
object-fit: cover;
|
|
292
292
|
border-radius: var(--semi-border-radius-small);
|
|
293
293
|
}
|
|
294
|
+
.semi-upload-picture-file-card-custom-thumbnail .semi-image img {
|
|
295
|
+
width: inherit;
|
|
296
|
+
height: inherit;
|
|
297
|
+
}
|
|
294
298
|
.semi-upload-picture-file-card-close {
|
|
295
299
|
visibility: hidden;
|
|
296
300
|
display: inline-flex;
|
|
@@ -358,6 +358,15 @@ $module: #{$prefix}-upload;
|
|
|
358
358
|
border-radius: $radius-upload_picture_file_card_img;
|
|
359
359
|
}
|
|
360
360
|
|
|
361
|
+
&-custom-thumbnail {
|
|
362
|
+
.#{$prefix}-image {
|
|
363
|
+
img {
|
|
364
|
+
width: inherit;
|
|
365
|
+
height: inherit;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
361
370
|
&-close {
|
|
362
371
|
visibility: hidden;
|
|
363
372
|
display: inline-flex;
|