Browse Source

Merge branch 'feat/new-icons' into feat-dialogue

林艳 3 weeks ago
parent
commit
7097a32bd9

+ 2 - 2
content/plus/chat/index-en-US.md

@@ -13,7 +13,7 @@ showNew: true
 
 The `Chat` component can be used in scenarios such as regular conversations or AI conversations.
 
-The rendering of the conversation content is based on the MarkdownRender component, which supports Markdown and MDX. It allows for common rich text features such as images, tables, links, bold text, code blocks, and more. More complex and customized document writing and display requirements can be achieved using JSX.
+The rendering of the conversation content is based on the [MarkdownRender](/en-US/plus/markdownrender) component, which supports Markdown and MDX (Note: The default format mode of MarkdownRender in Chat is md. If you need to use MDX format, you can set it through the markdownRenderProps API). It allows for common rich text features such as images, tables, links, bold text, code blocks, and more. More complex and customized document writing and display requirements can be achieved using JSX.
 
 ## Demos
 
@@ -1618,7 +1618,7 @@ render(DefaultChat);
 | inputBoxStyle | Input box style | CSSProperties | - |
 | inputBoxCls | Input box className | string | - |
 | sendHotKey | Keyboard shortcut for sending content, supports `enter` \| `shift+enter`. The former will send the message in the input box when you press enter alone. When the shift and enter keys are pressed at the same time, it will only wrap the line and not send it. The latter is the opposite | string | `enter` |
-| markdownRenderProps | This parameter will be passed to the MarkdownRender component used for dialog rendering. For details, see [MarkdownRenderProps](/en-US/plus/markdownrender#API)| MarkdownRenderProps |-|
+| markdownRenderProps | This parameter will be passed to the MarkdownRender component used for dialog rendering. For details, see [MarkdownRenderProps](/en-US/plus/markdownrender#API). The default format of markdownRender in Chat is md. If you need to use mdx format, you can set it through this parameter| MarkdownRenderProps |-|
 | mode | Conversation mode, support `bubble` \| `noBubble` \| `userBubble`  | string | `bubble` |
 | roleConfig | Role information configuration, see [RoleConfig](#RoleConfig) | RoleConfig | - |
 | renderDivider | Custom render divider, supported since v2.67.0 | (message?: Message) => ReactNode | - |

+ 2 - 2
content/plus/chat/index.md

@@ -13,7 +13,7 @@ showNew: true
 
 Chat 组件可用于普通会话,AI 会话等场景。
 
-对话内容渲染基于 MarkdownRender 组件,支持 Markdown 和 MDX,可实现图片,表格,链接,加粗,代码区等常用富文本功能。也可通过 JSX 实现更加复杂定制化的文档撰写与展示需求。
+对话内容渲染基于 [MarkdownRender](/zh-CN/plus/markdownrender) 组件,支持 Markdown 和 MDX (注:Chat 中的 MarkdownRender 的默认 format 模式是 md,如果需要使用 MDX 格式,可通过 markdownRenderProps API 设置),可实现图片,表格,链接,加粗,代码区等常用富文本功能。也可通过 JSX 实现更加复杂定制化的文档撰写与展示需求。
 
 
 ## 代码演示
@@ -1621,7 +1621,7 @@ render(DefaultChat);
 | inputBoxStyle | 输入框样式 | CSSProperties | - |
 | inputBoxCls | 输入框类名 | string | - |
 | sendHotKey | 发送输入内容的键盘快捷键,支持 `enter` \| `shift+enter`。前者在单独按下 enter 将发送输入框中的消息, shift 和 enter 按键同时按下时,仅换行,不发送。后者相反 | string | `enter` |
-| markdownRenderProps | 该参数将透传给对话框渲染所用的 MarkdownRender 组件,详见 [MarkdownRenderProps](/zh-CN/plus/markdownrender#API)| MarkdownRenderProps |-|
+| markdownRenderProps | 该参数将透传给对话框渲染所用的 MarkdownRender 组件,详见 [MarkdownRenderProps](/zh-CN/plus/markdownrender#API),Chat 中的 markdownRender 默认 format 为 md ,如果需要使用 mdx 格式,可通过此参数设置 | MarkdownRenderProps |-|
 | mode | 对话模式,支持 `bubble` \| `noBubble` \| `userBubble`  | string | `bubble` |
 | roleConfig | 角色信息配置,具体见 [RoleConfig](#RoleConfig) | RoleConfig | - |
 | renderDivider | 自定义渲染分割线, 自 v2.67.0 支持 | (message?: Message) => ReactNode | - |

+ 2 - 2
packages/semi-foundation/button/variables.scss

@@ -96,8 +96,8 @@ $color-button_disabled_outline-border-default: var(--semi-color-border); // 边
 
 // light
 $color-button_light-bg-default: var(--semi-color-fill-0); // 浅色按钮背景颜色
-$color-button_light-bg-hover: var(--semi-color-fill-1); // 禁用按钮背景颜色 - 悬浮
-$color-button_light-bg-active: var(--semi-color-fill-2); // 禁用按钮背景颜色 - 按下
+$color-button_light-bg-hover: var(--semi-color-fill-1); // 浅色按钮背景颜色 - 悬浮
+$color-button_light-bg-active: var(--semi-color-fill-2); // 浅色按钮背景颜色 - 按下
 $color-button_light-border-default: transparent; // 浅色按钮描边颜色
 $color-button_light-border-hover: $color-button_light-border-default; // 浅色按钮描边颜色 - 悬浮
 $color-button_light-border-active: $color-button_light-border-hover; // 浅色按钮描边颜色 - 按下

+ 23 - 0
packages/semi-icons/src/icons/IconExcel.tsx

@@ -0,0 +1,23 @@
+import * as React from 'react';
+import { convertIcon } from '../components/Icon';
+function SvgComponent(props: React.SVGProps<SVGSVGElement>) {
+    return (
+        <svg
+            viewBox="0 0 20 20"
+            fill="none"
+            xmlns="http://www.w3.org/2000/svg"
+            width="1em"
+            height="1em"
+            focusable={false}
+            aria-hidden={true}
+            {...props}
+        >
+            <path
+                d="M12.6.67a1 1 0 0 1 .6.29l4.17 4.17a1 1 0 0 1 .3.7V17.5c0 1.01-.82 1.83-1.84 1.83H4.17a1.83 1.83 0 0 1-1.84-1.83v-15c0-1.01.82-1.83 1.84-1.83h8.43ZM7.92 6.5a1 1 0 0 0-1 1v6.67a1 1 0 0 0 1 1h4.16a1 1 0 0 0 0-2H8.92v-1.34h3.16a1 1 0 0 0 0-2H8.92V8.5h3.16a1 1 0 0 0 0-2H7.92Z"
+                fill="currentColor"
+            />
+        </svg>
+    );
+}
+const IconComponent = convertIcon(SvgComponent, 'excel');
+export default IconComponent;

+ 23 - 0
packages/semi-icons/src/icons/IconPdf.tsx

@@ -0,0 +1,23 @@
+import * as React from 'react';
+import { convertIcon } from '../components/Icon';
+function SvgComponent(props: React.SVGProps<SVGSVGElement>) {
+    return (
+        <svg
+            viewBox="0 0 20 20"
+            fill="none"
+            xmlns="http://www.w3.org/2000/svg"
+            width="1em"
+            height="1em"
+            focusable={false}
+            aria-hidden={true}
+            {...props}
+        >
+            <path
+                d="M12.6.67a1 1 0 0 1 .6.29l4.17 4.17a1 1 0 0 1 .3.7V17.5c0 1.01-.82 1.83-1.84 1.83H4.17a1.83 1.83 0 0 1-1.84-1.83v-15c0-1.01.82-1.83 1.84-1.83h8.43ZM7.5 6.5a1 1 0 0 0-.17.02H7.3l-.05.01-.04.01a1 1 0 0 0-.31.16l-.04.03a1 1 0 0 0-.36.77v6.67a1 1 0 0 0 2 0v-2.34h4a1 1 0 0 0 1-1V7.5a1 1 0 0 0-1-1h-5Zm4 3.33h-3V8.5h3v1.33Z"
+                fill="currentColor"
+            />
+        </svg>
+    );
+}
+const IconComponent = convertIcon(SvgComponent, 'pdf');
+export default IconComponent;

+ 23 - 0
packages/semi-icons/src/icons/IconWord.tsx

@@ -0,0 +1,23 @@
+import * as React from 'react';
+import { convertIcon } from '../components/Icon';
+function SvgComponent(props: React.SVGProps<SVGSVGElement>) {
+    return (
+        <svg
+            viewBox="0 0 20 20"
+            fill="none"
+            xmlns="http://www.w3.org/2000/svg"
+            width="1em"
+            height="1em"
+            focusable={false}
+            aria-hidden={true}
+            {...props}
+        >
+            <path
+                d="M12.6.67a1 1 0 0 1 .6.29l4.17 4.17a1 1 0 0 1 .3.7V17.5c0 1.01-.82 1.83-1.84 1.83H4.17a1.83 1.83 0 0 1-1.84-1.83v-15c0-1.01.82-1.83 1.84-1.83h8.43Zm.95 6.69a1 1 0 0 0-1.2.76l-.64 3.05-.81-1.62a1 1 0 0 0-1.72-.12l-.07.12-.81 1.62-.65-3.05a1 1 0 0 0-1.96.42l1.25 5.84a1 1 0 0 0 1.87.23l1.2-2.37 1.18 2.37a1 1 0 0 0 1.87-.23l1.25-5.84a1 1 0 0 0-.76-1.18Z"
+                fill="currentColor"
+            />
+        </svg>
+    );
+}
+const IconComponent = convertIcon(SvgComponent, 'word');
+export default IconComponent;

+ 3 - 1
packages/semi-icons/src/icons/index.ts

@@ -125,6 +125,7 @@ export { default as IconDesktop } from './IconDesktop';
 export { default as IconDisc } from './IconDisc';
 export { default as IconDislikeThumb } from './IconDislikeThumb';
 export { default as IconDivide } from './IconDivide';
+export { default as IconWord } from './IconWord';
 export { default as IconDongchediLogo } from './IconDongchediLogo';
 export { default as IconDoubleChevronLeft } from './IconDoubleChevronLeft';
 export { default as IconDoubleChevronRight } from './IconDoubleChevronRight';
@@ -137,6 +138,7 @@ export { default as IconEdit2Stroked } from './IconEdit2Stroked';
 export { default as IconEditStroked } from './IconEditStroked';
 export { default as IconElementStroked } from './IconElementStroked';
 export { default as IconEmoji } from './IconEmoji';
+export { default as IconExcel } from './IconExcel';
 export { default as IconExit } from './IconExit';
 export { default as IconExpand } from './IconExpand';
 export { default as IconExport } from './IconExport';
@@ -264,7 +266,6 @@ export { default as IconMenu } from './IconMenu';
 export { default as IconMicrophone } from './IconMicrophone';
 export { default as IconMicrophoneOff } from './IconMicrophoneOff';
 export { default as IconMinimize } from './IconMinimize';
-export { default as IconMiniPlayer } from './IconMiniPlayer';
 export { default as IconMinus } from './IconMinus';
 export { default as IconMinusCircle } from './IconMinusCircle';
 export { default as IconMinusCircleStroked } from './IconMinusCircleStroked';
@@ -285,6 +286,7 @@ export { default as IconOrderedList } from './IconOrderedList';
 export { default as IconOrderedListStroked } from './IconOrderedListStroked';
 export { default as IconPaperclip } from './IconPaperclip';
 export { default as IconPause } from './IconPause';
+export { default as IconPdf } from './IconPdf';
 export { default as IconPercentage } from './IconPercentage';
 export { default as IconPhone } from './IconPhone';
 export { default as IconPhoneStroke } from './IconPhoneStroke';

+ 3 - 0
packages/semi-icons/src/svgs/excel.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M12.5986 0.670898C12.8275 0.693652 13.043 0.794918 13.207 0.958984L17.373 5.12598C17.5606 5.31351 17.666 5.56779 17.666 5.83301V17.499C17.666 18.5116 16.8455 19.333 15.833 19.333H4.16602C3.15365 19.3328 2.33301 18.5115 2.33301 17.499V2.49902C2.33318 1.48676 3.15375 0.666191 4.16602 0.666016H12.5L12.5986 0.670898ZM7.91699 6.5C7.36471 6.5 6.91699 6.94772 6.91699 7.5V14.167C6.91717 14.7191 7.36482 15.167 7.91699 15.167H12.084C12.636 15.1668 13.0838 14.719 13.084 14.167C13.084 13.6148 12.6361 13.1672 12.084 13.167H8.91699V11.834H12.084C12.6361 11.8338 13.084 11.3862 13.084 10.834C13.084 10.2818 12.6361 9.83416 12.084 9.83398H8.91699V8.5H12.084C12.6361 8.49982 13.084 8.05218 13.084 7.5C13.084 6.94782 12.6361 6.50018 12.084 6.5H7.91699Z" fill="black"/>
+</svg>

+ 1 - 0
packages/semi-icons/src/svgs/pdf.svg

@@ -0,0 +1 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M12.5986 0.670898C12.8275 0.693652 13.043 0.794918 13.207 0.958984L17.373 5.12598C17.5606 5.31351 17.666 5.56779 17.666 5.83301V17.499C17.666 18.5116 16.8455 19.333 15.833 19.333H4.16602C3.15365 19.3328 2.33301 18.5115 2.33301 17.499V2.49902C2.33318 1.48676 3.15375 0.666191 4.16602 0.666016H12.5L12.5986 0.670898ZM7.5 6.5C7.44101 6.5 7.38334 6.50583 7.32715 6.51562C7.3184 6.51716 7.30948 6.51776 7.30078 6.51953C7.28463 6.5228 7.26879 6.52722 7.25293 6.53125C7.23733 6.53523 7.22143 6.53824 7.20605 6.54297C7.09282 6.57771 6.98866 6.6332 6.89648 6.70312C6.8852 6.71168 6.87325 6.71947 6.8623 6.72852C6.64065 6.91194 6.5 7.18982 6.5 7.5V14.167C6.50018 14.7191 6.94782 15.167 7.5 15.167C8.05218 15.167 8.49982 14.7191 8.5 14.167V11.832L12.501 11.8301C13.0528 11.8295 13.4999 11.3819 13.5 10.8301V7.5C13.5 6.94772 13.0523 6.5 12.5 6.5H7.5ZM11.5 9.83008L8.50195 9.83203L8.50098 8.5H11.5V9.83008Z" fill="black"/> </svg>

+ 3 - 0
packages/semi-icons/src/svgs/word.svg

@@ -0,0 +1,3 @@
+<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M12.5986 0.670898C12.8275 0.693652 13.043 0.794919 13.207 0.958984L17.373 5.12598C17.5606 5.31351 17.666 5.56779 17.666 5.83301V17.499C17.666 18.5116 16.8455 19.333 15.833 19.333H4.16602C3.15365 19.3328 2.33301 18.5115 2.33301 17.499V2.49902C2.33318 1.48676 3.15375 0.666191 4.16602 0.666016H12.5L12.5986 0.670898ZM13.5459 7.35645C13.006 7.24085 12.4743 7.58424 12.3584 8.12402L11.7051 11.1689L10.8975 9.55371C10.7281 9.21493 10.3817 9.00098 10.0029 9.00098C9.67163 9.00108 9.36554 9.16479 9.18066 9.43262L9.1084 9.55371L8.2998 11.1699L7.64746 8.12402C7.53154 7.58427 6.99983 7.24076 6.45996 7.35645C5.9202 7.47237 5.5767 8.00408 5.69238 8.54395L6.94238 14.377C7.03142 14.7921 7.37272 15.1057 7.79395 15.1592C8.21525 15.2127 8.62453 14.9941 8.81445 14.6143L10.0029 12.2363L11.1924 14.6143C11.3823 14.9941 11.7916 15.2127 12.2129 15.1592C12.634 15.1056 12.9755 14.792 13.0645 14.377L14.3145 8.54395C14.4302 8.00392 14.0859 7.47217 13.5459 7.35645Z" fill="black"/>
+</svg>