@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.
Files changed (40) hide show
  1. package/README.md +2 -31
  2. package/dist/collections/ArticleCollection.ts +19 -0
  3. package/dist/collections/BlogCollection.ts +28 -0
  4. package/dist/collections/CourseCollection.ts +11 -0
  5. package/dist/collections/ExperimentCollection.ts +18 -0
  6. package/dist/collections/LessonCollection.ts +25 -0
  7. package/dist/collections/MetaCollection.ts +17 -0
  8. package/dist/components/containers/Main.astro +2 -2
  9. package/dist/components/data-display/TeamMembers.astro +1 -1
  10. package/dist/components/display/Card.astro +0 -3
  11. package/dist/components/display/CodeBlock.astro +1 -2
  12. package/dist/components/display/Modal.astro +1 -2
  13. package/dist/components/icons/SearchIcon.astro +30 -34
  14. package/dist/components/icons/SunCloudyIcon.astro +35 -39
  15. package/dist/components/layouts/AppLayout.astro +2 -2
  16. package/dist/components/layouts/BaseLayout.astro +4 -3
  17. package/dist/components/layouts/Footer.astro +8 -14
  18. package/dist/components/layouts/Header.astro +6 -6
  19. package/dist/components/layouts/Sidebar.astro +2 -2
  20. package/dist/components/layouts/SidebarNav.astro +6 -6
  21. package/dist/components/navigation/TableOfContents.astro +6 -3
  22. package/dist/components/typography/Article.astro +2 -2
  23. package/dist/components/typography/Text.astro +1 -1
  24. package/dist/entities/MetaDoc.ts +10 -10
  25. package/dist/entities/SidebarItem.ts +68 -72
  26. package/dist/entities/Tag.ts +9 -9
  27. package/dist/index.ts +21 -1
  28. package/dist/types/article.ts +19 -19
  29. package/dist/types/footer.ts +4 -13
  30. package/dist/types/header.ts +4 -4
  31. package/dist/types/heading.ts +8 -8
  32. package/dist/types/layout.ts +59 -59
  33. package/dist/types/main.ts +68 -57
  34. package/dist/types/meta.ts +49 -49
  35. package/dist/types/nav.ts +1 -0
  36. package/dist/types/product.ts +10 -0
  37. package/dist/types/sidebar.ts +29 -26
  38. package/dist/types/static-path.ts +1 -1
  39. package/dist/utils/lang_package.ts +205 -206
  40. package/package.json +3 -3
@@ -1,69 +1,80 @@
1
- export interface MainContentProps {
2
- /**
3
- * 容器大小
4
- * @default "md"
5
- */
6
- size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
1
+ export interface IMainContentProps {
2
+ /**
3
+ * 容器大小
4
+ * @default "md"
5
+ */
6
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
7
7
 
8
- /**
9
- * 水平内边距(通过 Container 组件的 padding 属性设置)
10
- * @default "md"
11
- */
12
- padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
8
+ /**
9
+ * 水平内边距(通过 Container 组件的 padding 属性设置)
10
+ * @default "md"
11
+ */
12
+ padding?: 'none' | 'sm' | 'md' | 'lg' | 'xl';
13
13
 
14
- /**
15
- * 布局方式
16
- * @default 'column'
17
- */
18
- layout?: 'row' | 'column';
14
+ /**
15
+ * 布局方式
16
+ * @default 'column'
17
+ */
18
+ layout?: 'row' | 'column';
19
19
 
20
- /**
21
- * 当前语言
22
- */
23
- currentLocale?: string;
20
+ /**
21
+ * 当前语言
22
+ */
23
+ currentLocale?: string;
24
24
 
25
- /**
26
- * 垂直内边距
27
- * @default "md"
28
- */
29
- verticalPadding?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | string;
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
- * @default true
34
- */
35
- centered?: boolean;
42
+ /**
43
+ * 是否居中显示内容
44
+ * @default true
45
+ */
46
+ centered?: boolean;
36
47
 
37
- /**
38
- * 是否为文章布局
39
- * @default false
40
- */
41
- isArticle?: boolean;
48
+ /**
49
+ * 是否为文章布局
50
+ * @default false
51
+ */
52
+ isArticle?: boolean;
42
53
 
43
- /**
44
- * 是否显示目录
45
- * @default false
46
- */
47
- showTableOfContents?: boolean;
54
+ /**
55
+ * 是否显示目录
56
+ * @default false
57
+ */
58
+ showTableOfContents?: boolean;
48
59
 
49
- /**
50
- * 背景颜色
51
- * @default undefined
52
- */
53
- backgroundColor?: 'primary' | 'secondary' | 'tertiary' | 'light' | 'dark' | string;
60
+ /**
61
+ * 背景颜色
62
+ * @default undefined
63
+ */
64
+ backgroundColor?: 'primary' | 'secondary' | 'tertiary' | 'light' | 'dark' | string;
54
65
 
55
- /**
56
- * HTML id 属性
57
- */
58
- id?: string;
66
+ /**
67
+ * HTML id 属性
68
+ */
69
+ id?: string;
59
70
 
60
- /**
61
- * 类名
62
- */
63
- class?: string;
71
+ /**
72
+ * 类名
73
+ */
74
+ class?: string;
64
75
 
65
- /**
66
- * 类名列表
67
- */
68
- 'class:list'?: any;
76
+ /**
77
+ * 类名列表
78
+ */
79
+ 'class:list'?: any;
69
80
  }
@@ -1,50 +1,50 @@
1
- export interface MetaProps {
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;
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 };
@@ -0,0 +1,10 @@
1
+ export interface ILogo {
2
+ src: string;
3
+ alt: string;
4
+ }
5
+
6
+ export interface IProduct {
7
+ name: string;
8
+ href: string;
9
+ external?: boolean;
10
+ }
@@ -1,36 +1,39 @@
1
1
  /**
2
2
  * 侧边栏项目
3
3
  */
4
- export interface SidebarItem {
5
- href: string;
6
- text: string;
7
- items?: SidebarItem[];
4
+ export interface ISidebarItem {
5
+ href: string;
6
+ text: string;
7
+ items?: ISidebarItem[];
8
8
  }
9
9
 
10
- export interface SidebarProps {
11
- /**
12
- * 侧边栏项目
13
- */
14
- sidebarItems: SidebarItem[];
10
+ /**
11
+ * 侧边栏配置
12
+ */
13
+ export interface ISidebarProps {
14
+ /**
15
+ * 侧边栏项目
16
+ */
17
+ sidebarItems: ISidebarItem[];
15
18
 
16
- /**
17
- * 桌面端类名
18
- */
19
- class?: string;
19
+ /**
20
+ * 桌面端类名
21
+ */
22
+ class?: string;
20
23
 
21
- /**
22
- * 是否开启调试模式,显示边框
23
- * @default false
24
- */
25
- debug?: boolean;
24
+ /**
25
+ * 是否开启调试模式,显示边框
26
+ * @default false
27
+ */
28
+ debug?: boolean;
26
29
 
27
- /**
28
- * 侧边栏顶部外边距
29
- */
30
- marginTop?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | string;
30
+ /**
31
+ * 侧边栏顶部外边距
32
+ */
33
+ marginTop?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | string;
31
34
 
32
- /**
33
- * 侧边栏底部外边距
34
- */
35
- marginBottom?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | string;
35
+ /**
36
+ * 侧边栏底部外边距
37
+ */
38
+ marginBottom?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | string;
36
39
  }
@@ -1,4 +1,4 @@
1
- export interface TagStaticPath {
1
+ export interface ITagStaticPath {
2
2
  params: {
3
3
  slug: string;
4
4
  };