@coffic/cosy-ui 0.5.12 → 0.6.2
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/README.md +2 -31
- package/dist/collections/ArticleCollection.ts +19 -0
- package/dist/collections/BlogCollection.ts +28 -0
- package/dist/collections/CourseCollection.ts +11 -0
- package/dist/collections/ExperimentCollection.ts +18 -0
- package/dist/collections/LessonCollection.ts +25 -0
- package/dist/collections/MetaCollection.ts +17 -0
- package/dist/components/containers/Main.astro +2 -2
- package/dist/components/data-display/TeamMembers.astro +1 -1
- package/dist/components/display/Card.astro +0 -3
- package/dist/components/display/CodeBlock.astro +1 -2
- package/dist/components/display/Modal.astro +1 -2
- package/dist/components/icons/SearchIcon.astro +30 -34
- package/dist/components/icons/SunCloudyIcon.astro +35 -39
- package/dist/components/layouts/AppLayout.astro +2 -2
- package/dist/components/layouts/BaseLayout.astro +4 -3
- package/dist/components/layouts/Footer.astro +8 -14
- package/dist/components/layouts/Header.astro +6 -6
- package/dist/components/layouts/Sidebar.astro +2 -2
- package/dist/components/layouts/SidebarNav.astro +6 -6
- package/dist/components/navigation/TableOfContents.astro +6 -3
- package/dist/components/typography/Article.astro +2 -2
- package/dist/components/typography/Text.astro +1 -1
- package/dist/entities/MetaDoc.ts +10 -10
- package/dist/entities/SidebarItem.ts +68 -72
- package/dist/entities/Tag.ts +9 -9
- package/dist/index.ts +21 -1
- package/dist/types/article.ts +19 -19
- package/dist/types/footer.ts +4 -13
- package/dist/types/header.ts +4 -4
- package/dist/types/heading.ts +8 -8
- package/dist/types/layout.ts +59 -59
- package/dist/types/main.ts +68 -57
- package/dist/types/meta.ts +49 -49
- package/dist/types/nav.ts +1 -0
- package/dist/types/product.ts +10 -0
- package/dist/types/sidebar.ts +29 -26
- package/dist/types/static-path.ts +1 -1
- package/dist/utils/lang_package.ts +205 -206
- package/package.json +3 -3
package/dist/types/main.ts
CHANGED
@@ -1,69 +1,80 @@
|
|
1
|
-
export interface
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
1
|
+
export interface IMainContentProps {
|
2
|
+
/**
|
3
|
+
* 容器大小
|
4
|
+
* @default "md"
|
5
|
+
*/
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
/**
|
9
|
+
* 水平内边距(通过 Container 组件的 padding 属性设置)
|
10
|
+
* @default "md"
|
11
|
+
*/
|
12
|
+
padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
/**
|
15
|
+
* 布局方式
|
16
|
+
* @default 'column'
|
17
|
+
*/
|
18
|
+
layout?: 'row' | 'column';
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
/**
|
21
|
+
* 当前语言
|
22
|
+
*/
|
23
|
+
currentLocale?: string;
|
24
24
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
/**
|
26
|
+
* 垂直内边距
|
27
|
+
* @default "md"
|
28
|
+
*/
|
29
|
+
verticalPadding?:
|
30
|
+
| 'none'
|
31
|
+
| 'xs'
|
32
|
+
| 'sm'
|
33
|
+
| 'md'
|
34
|
+
| 'lg'
|
35
|
+
| 'xl'
|
36
|
+
| '2xl'
|
37
|
+
| '3xl'
|
38
|
+
| '4xl'
|
39
|
+
| '5xl'
|
40
|
+
| string;
|
30
41
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
42
|
+
/**
|
43
|
+
* 是否居中显示内容
|
44
|
+
* @default true
|
45
|
+
*/
|
46
|
+
centered?: boolean;
|
36
47
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
48
|
+
/**
|
49
|
+
* 是否为文章布局
|
50
|
+
* @default false
|
51
|
+
*/
|
52
|
+
isArticle?: boolean;
|
42
53
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
54
|
+
/**
|
55
|
+
* 是否显示目录
|
56
|
+
* @default false
|
57
|
+
*/
|
58
|
+
showTableOfContents?: boolean;
|
48
59
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
60
|
+
/**
|
61
|
+
* 背景颜色
|
62
|
+
* @default undefined
|
63
|
+
*/
|
64
|
+
backgroundColor?: 'primary' | 'secondary' | 'tertiary' | 'light' | 'dark' | string;
|
54
65
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
66
|
+
/**
|
67
|
+
* HTML id 属性
|
68
|
+
*/
|
69
|
+
id?: string;
|
59
70
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
71
|
+
/**
|
72
|
+
* 类名
|
73
|
+
*/
|
74
|
+
class?: string;
|
64
75
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
76
|
+
/**
|
77
|
+
* 类名列表
|
78
|
+
*/
|
79
|
+
'class:list'?: any;
|
69
80
|
}
|
package/dist/types/meta.ts
CHANGED
@@ -1,50 +1,50 @@
|
|
1
|
-
export interface
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
1
|
+
export interface IMetaProps {
|
2
|
+
title: string;
|
3
|
+
description: string;
|
4
|
+
keywords: string;
|
5
|
+
author: string;
|
6
|
+
robots: string;
|
7
|
+
|
8
|
+
/**
|
9
|
+
* 基础路径,用于处理网站部署在二级目录的情况
|
10
|
+
* @default ""
|
11
|
+
*/
|
12
|
+
basePath?: string;
|
13
|
+
|
14
|
+
/**
|
15
|
+
* 站点名称
|
16
|
+
*/
|
17
|
+
siteName?: string;
|
18
|
+
|
19
|
+
/**
|
20
|
+
* 页面语言
|
21
|
+
* @default "zh-CN"
|
22
|
+
*/
|
23
|
+
lang?: string;
|
24
|
+
|
25
|
+
/**
|
26
|
+
* 是否包含视口元标签
|
27
|
+
* @default true
|
28
|
+
*/
|
29
|
+
viewport?: boolean;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* 自定义CSS
|
33
|
+
*/
|
34
|
+
customStyles?: string;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* 自定义头部内容
|
38
|
+
*/
|
39
|
+
head?: astroHTML.JSX.Element;
|
40
|
+
|
41
|
+
/**
|
42
|
+
* 页面类名
|
43
|
+
*/
|
44
|
+
class?: string;
|
45
|
+
|
46
|
+
/**
|
47
|
+
* 类名列表
|
48
|
+
*/
|
49
|
+
'class:list'?: any;
|
50
50
|
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export type INavItem = { href: string; label: string };
|
package/dist/types/sidebar.ts
CHANGED
@@ -1,36 +1,39 @@
|
|
1
1
|
/**
|
2
2
|
* 侧边栏项目
|
3
3
|
*/
|
4
|
-
export interface
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
export interface ISidebarItem {
|
5
|
+
href: string;
|
6
|
+
text: string;
|
7
|
+
items?: ISidebarItem[];
|
8
8
|
}
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
/**
|
11
|
+
* 侧边栏配置
|
12
|
+
*/
|
13
|
+
export interface ISidebarProps {
|
14
|
+
/**
|
15
|
+
* 侧边栏项目
|
16
|
+
*/
|
17
|
+
sidebarItems: ISidebarItem[];
|
15
18
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
19
|
+
/**
|
20
|
+
* 桌面端类名
|
21
|
+
*/
|
22
|
+
class?: string;
|
20
23
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
/**
|
25
|
+
* 是否开启调试模式,显示边框
|
26
|
+
* @default false
|
27
|
+
*/
|
28
|
+
debug?: boolean;
|
26
29
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
30
|
+
/**
|
31
|
+
* 侧边栏顶部外边距
|
32
|
+
*/
|
33
|
+
marginTop?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | string;
|
31
34
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
/**
|
36
|
+
* 侧边栏底部外边距
|
37
|
+
*/
|
38
|
+
marginBottom?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | string;
|
36
39
|
}
|