From 7f19776adad40e75b1faee9c7209c4a81da900b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E7=88=B1=E5=90=83=E7=99=BD=E8=90=9D?= =?UTF-8?q?=E5=8D=9C?= Date: Wed, 20 Nov 2024 15:59:21 +0800 Subject: [PATCH] docs: Fill the cover & cat of overview (#192) * docs: reorder site * docs: all cover * test: update snapshot --- .../builtins/ComponentOverview/index.tsx | 22 +- .dumi/theme/themeConfig.ts | 32 +- .../attachments/FileList/FileListCard.tsx | 2 +- .../__snapshots__/demo-extend.test.ts.snap | 2065 +++-------------- .../__snapshots__/demo.test.tsx.snap | 2065 +++-------------- components/attachments/index.en-US.md | 8 +- components/attachments/index.zh-CN.md | 10 +- components/bubble/index.en-US.md | 6 +- components/bubble/index.zh-CN.md | 8 +- components/conversations/index.en-US.md | 6 +- components/conversations/index.zh-CN.md | 6 +- components/prompts/index.en-US.md | 9 +- components/prompts/index.zh-CN.md | 9 +- components/sender/index.en-US.md | 8 +- components/sender/index.zh-CN.md | 8 +- components/suggestion/index.en-US.md | 8 +- components/suggestion/index.zh-CN.md | 10 +- components/thought-chain/index.en-US.md | 8 +- components/thought-chain/index.zh-CN.md | 8 +- components/useXAgent/index.en-US.md | 8 +- components/useXAgent/index.zh-CN.md | 8 +- components/useXChat/index.en-US.md | 8 +- components/useXChat/index.zh-CN.md | 8 +- components/welcome/index.en-US.md | 9 +- components/welcome/index.zh-CN.md | 9 +- components/x-provider/index.en-US.md | 5 +- components/x-provider/index.zh-CN.md | 5 +- components/x-request/index.en-US.md | 6 +- components/x-request/index.zh-CN.md | 4 +- components/x-stream/index.en-US.md | 4 +- components/x-stream/index.zh-CN.md | 4 +- 31 files changed, 774 insertions(+), 3602 deletions(-) diff --git a/.dumi/theme/builtins/ComponentOverview/index.tsx b/.dumi/theme/builtins/ComponentOverview/index.tsx index a3dbb04f..e62a43b5 100644 --- a/.dumi/theme/builtins/ComponentOverview/index.tsx +++ b/.dumi/theme/builtins/ComponentOverview/index.tsx @@ -10,7 +10,7 @@ import scrollIntoView from 'scroll-into-view-if-needed'; import Link from '../../common/Link'; import SiteContext from '../../slots/SiteContext'; import type { Component } from './ProComponentsList'; -import proComponentsList from './ProComponentsList'; +// import proComponentsList from './ProComponentsList'; const useStyle = createStyles(({ token, css }) => ({ componentsOverviewGroupTitle: css` @@ -131,16 +131,16 @@ const Overview: React.FC = () => { coverDark: child.frontmatter?.coverDark, link: child.link, })), - })) - .concat([ - { - title: locale === 'zh-CN' ? '重型组件' : 'Others', - children: - locale === 'zh-CN' - ? proComponentsList - : proComponentsList.map((component) => ({ ...component, subtitle: '' })), - }, - ]), + })), + // .concat([ + // { + // title: locale === 'zh-CN' ? '重型组件' : 'Others', + // children: + // locale === 'zh-CN' + // ? proComponentsList + // : proComponentsList.map((component) => ({ ...component, subtitle: '' })), + // }, + // ]) [data, locale], ); return ( diff --git a/.dumi/theme/themeConfig.ts b/.dumi/theme/themeConfig.ts index 82be1be0..3a9d2f2a 100644 --- a/.dumi/theme/themeConfig.ts +++ b/.dumi/theme/themeConfig.ts @@ -13,23 +13,35 @@ export default { typeOrder: { // Component Overview: -1, - UI: 0, - Runtime: 1, - Tool: 2, - Other: 3, + // UI: 0, + // Runtime: 1, + // Tool: 2, + // Other: 3, + Common: 0, + Wake: 1, + Express: 2, + Confirm: 3, + Feedback: 4, + Tools: 5, 总览: -1, - 用户界面: 0, - 运行时: 1, - 工具: 2, - 其他: 3, + // 用户界面: 0, + // 运行时: 1, + // 工具: 2, + // 其他: 3, + 通用: 0, + 唤醒: 1, + 表达: 2, + 确认: 3, + 反馈: 4, + 工具: 5, // Design 原则: 1, Principles: 1, 全局规则: 2, - 重型组件: 8, - ProComponents: 8, + // 重型组件: 8, + // ProComponents: 8, 'Global Rules': 2, 模板文档: 3, 'Template Document': 3, diff --git a/components/attachments/FileList/FileListCard.tsx b/components/attachments/FileList/FileListCard.tsx index 6668c1e7..4c516365 100644 --- a/components/attachments/FileList/FileListCard.tsx +++ b/components/attachments/FileList/FileListCard.tsx @@ -178,7 +178,7 @@ function FileListCard(props: FileListCardProps, ref: React.Ref) // ============================= Render ============================= let content: React.ReactNode = null; const previewUrl = item.thumbUrl || item.url || previewImg; - const isImgPreview = isImg && item.originFileObj; + const isImgPreview = isImg && (item.originFileObj || previewUrl); if (isImgPreview) { // Preview Image style diff --git a/components/attachments/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/attachments/__tests__/__snapshots__/demo-extend.test.ts.snap index 9a054983..aca79554 100644 --- a/components/attachments/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/attachments/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -720,59 +720,12 @@ exports[`renders components/attachments/demo/files.tsx extend context correctly
-
- - - -
-
-
-
- image-file -
-
- .png -
-
-
-
- 121 KB -
-
-
+ preview
@@ -907,58 +860,45 @@ exports[`renders components/attachments/demo/overflow.tsx extend context correct class="ant-attachment-list ant-attachment-list-overflow-wrap" >
-
+
-
-
-
- file-0 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-1 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-2 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-3 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-4 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-5 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-6 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-7 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-8 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-9 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-10 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-11 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-12 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-13 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-14 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-15 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-16 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-17 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-18 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-19 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-20 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-21 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-22 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-23 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-24 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-25 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-26 -
-
- .jpg -
-
-
-
-
-
-
-
-
- - - -
-
-
-
- file-27 -
-
- .jpg -
-
-
-
-
-
-
+ preview
-
- - - -
-
-
-
- file-28 -
-
- .jpg -
-
-
-
-
-
-
+ preview
-
- - - -
-
-
-
- file-29 -
-
- .jpg -
-
-
-
-
-
-
+ preview
-
- - - -
-
-
-
- image-file -
-
- .png -
-
-
-
- 121 KB -
-
-
+ preview
@@ -825,58 +778,45 @@ exports[`renders components/attachments/demo/overflow.tsx correctly 1`] = ` class="ant-attachment-list ant-attachment-list-overflow-wrap" >
-
+
-
-
-
- file-0 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-1 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-2 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-3 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-4 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-5 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-6 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-7 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-8 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-9 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-10 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-11 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-12 -
-
- .jpg -
-
-
-
-
-
-
+ +
+
+ preview
-
+
-
-
-
- file-13 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-14 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-15 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-16 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-17 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-18 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-19 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-20 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-21 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-22 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-23 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-24 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-25 -
-
- .jpg -
-
-
-
-
-
-
- -
-
-
- - - -
-
-
-
- file-26 -
-
- .jpg -
-
-
-
-
-
-
-
-
- - - -
-
-
-
- file-27 -
-
- .jpg -
-
-
-
-
-
-
+ preview
-
- - - -
-
-
-
- file-28 -
-
- .jpg -
-
-
-
-
-
-
+ preview
-
- - - -
-
-
-
- file-29 -
-
- .jpg -
-
-
-
-
-
-
+ preview