@coffic/cosy-ui 0.8.20 → 0.8.21

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.
@@ -1,129 +1,134 @@
1
1
  import type { ILogo, IProduct } from './product';
2
2
 
3
3
  export interface IFooterProps {
4
- /**
5
- * 关于链接
6
- */
7
- aboutLink?: string;
8
-
9
- /**
10
- * 博客链接
11
- */
12
- blogLink?: string;
13
-
14
- /**
15
- * 职业链接
16
- */
17
- careersLink?: string;
18
-
19
- /**
20
- * 公司名称
21
- */
22
- company: string;
23
-
24
- /**
25
- * 联系链接
26
- */
27
- contactLink?: string;
28
-
29
- /**
30
- * 版权信息
31
- */
32
- copyright: string;
33
-
34
- /**
35
- * 调试模式
36
- */
37
- debug?: boolean;
38
-
39
- /**
40
- * 是否启用日志输出
41
- * @default false
42
- */
43
- enableLogging?: boolean;
44
-
45
- /**
46
- * 常见问题链接
47
- */
48
- faqLink?: string;
49
-
50
- /**
51
- * 历史链接
52
- */
53
- historyLink?: string;
54
-
55
- /**
56
- * 首页链接
57
- */
58
- homeLink: string;
59
-
60
- /**
61
- * ICP备案号
62
- */
63
- icp?: string;
64
-
65
- /**
66
- * 激励标语
67
- */
68
- inspirationalSlogan: string;
69
-
70
- /**
71
- * 徽标
72
- */
73
- logo?: ILogo;
74
-
75
- /**
76
- * 媒体链接
77
- */
78
- mediaLink?: string;
79
-
80
- /**
81
- * 新闻链接
82
- */
83
- newsLink?: string;
84
-
85
- /**
86
- * 合作伙伴链接
87
- */
88
- partnersLink?: string;
89
-
90
- /**
91
- * 隐私链接
92
- */
93
- privacyLink?: string;
94
-
95
- /**
96
- * 产品
97
- */
98
- products?: IProduct[];
99
-
100
- /**
101
- * 站点名称
102
- */
103
- siteName: string;
104
-
105
- /**
106
- * 标语
107
- */
108
- slogan: string;
109
-
110
- /**
111
- * 社交链接
112
- */
113
- socialLinks?: string[];
114
-
115
- /**
116
- * 团队链接
117
- */
118
- teamLink?: string;
119
-
120
- /**
121
- * 技术栈链接
122
- */
123
- techStackLink?: string;
124
-
125
- /**
126
- * 条款链接
127
- */
128
- termsLink?: string;
4
+ /**
5
+ * 关于链接
6
+ */
7
+ aboutLink?: string;
8
+
9
+ /**
10
+ * 博客链接
11
+ */
12
+ blogLink?: string;
13
+
14
+ /**
15
+ * 职业链接
16
+ */
17
+ careersLink?: string;
18
+
19
+ /**
20
+ * 公司名称
21
+ */
22
+ company: string;
23
+
24
+ /**
25
+ * 联系链接
26
+ */
27
+ contactLink?: string;
28
+
29
+ /**
30
+ * 版权信息
31
+ */
32
+ copyright: string;
33
+
34
+ /**
35
+ * 调试模式
36
+ */
37
+ debug?: boolean;
38
+
39
+ /**
40
+ * 是否启用日志输出
41
+ * @default false
42
+ */
43
+ enableLogging?: boolean;
44
+
45
+ /**
46
+ * 常见问题链接
47
+ */
48
+ faqLink?: string;
49
+
50
+ /**
51
+ * 友情链接
52
+ */
53
+ friendlyLinks?: IProduct[];
54
+
55
+ /**
56
+ * 历史链接
57
+ */
58
+ historyLink?: string;
59
+
60
+ /**
61
+ * 首页链接
62
+ */
63
+ homeLink: string;
64
+
65
+ /**
66
+ * ICP备案号
67
+ */
68
+ icp?: string;
69
+
70
+ /**
71
+ * 激励标语
72
+ */
73
+ inspirationalSlogan: string;
74
+
75
+ /**
76
+ * 徽标
77
+ */
78
+ logo?: ILogo;
79
+
80
+ /**
81
+ * 媒体链接
82
+ */
83
+ mediaLink?: string;
84
+
85
+ /**
86
+ * 新闻链接
87
+ */
88
+ newsLink?: string;
89
+
90
+ /**
91
+ * 合作伙伴链接
92
+ */
93
+ partnersLink?: string;
94
+
95
+ /**
96
+ * 隐私链接
97
+ */
98
+ privacyLink?: string;
99
+
100
+ /**
101
+ * 产品
102
+ */
103
+ products?: IProduct[];
104
+
105
+ /**
106
+ * 站点名称
107
+ */
108
+ siteName: string;
109
+
110
+ /**
111
+ * 标语
112
+ */
113
+ slogan: string;
114
+
115
+ /**
116
+ * 社交链接
117
+ */
118
+ socialLinks?: string[];
119
+
120
+ /**
121
+ * 团队链接
122
+ */
123
+ teamLink?: string;
124
+
125
+ /**
126
+ * 技术栈链接
127
+ */
128
+ techStackLink?: string;
129
+
130
+ /**
131
+ * 条款链接
132
+ */
133
+ termsLink?: string;
129
134
  }
@@ -144,10 +144,6 @@ export default defineComponent({
144
144
  const showAlertDialog = ref(false);
145
145
  const alertMessage = ref('');
146
146
 
147
- // 获取图片URL
148
- const frameSrc =
149
- typeof iphoneFrame === 'string' ? iphoneFrame : iphoneFrame.src;
150
-
151
147
  // 计算当前高度的缩放比例
152
148
  const getScaleRatio = () => {
153
149
  const heightValues = {
@@ -168,7 +164,7 @@ export default defineComponent({
168
164
  return {
169
165
  showAlertDialog,
170
166
  alertMessage,
171
- frameSrc,
167
+ iphoneFrame: (iphoneFrame as any).src || iphoneFrame,
172
168
  heightClasses,
173
169
  mainContentWidthAspectRatio,
174
170
  mainContentHeightAspectRatio,
@@ -191,7 +187,7 @@ export default defineComponent({
191
187
  backgroundColor: debug ? 'rgba(255, 255, 0, 0.3)' : 'transparent',
192
188
  }">
193
189
  <!-- iPhone 边框 -->
194
- <img v-if="showFrame" style="max-width: 100%; max-height: 100%;" :src="frameSrc" alt="iPhone frame" />
190
+ <img v-if="showFrame" style="max-width: 100%; max-height: 100%;" :src="iphoneFrame" alt="iPhone frame" />
195
191
 
196
192
  <!-- 顶部状态栏 -->
197
193
  <div :style="{
@@ -9,56 +9,58 @@ type TextContent = Record<string, Record<string, string>>;
9
9
 
10
10
  // 多语言文本内容
11
11
  export const texts: Record<string, TextContent> = {
12
- en: {
13
- tableOfContents: {
14
- title: 'Table of Contents',
15
- loading: 'Loading...',
12
+ en: {
13
+ tableOfContents: {
14
+ title: 'Table of Contents',
15
+ loading: 'Loading...',
16
+ },
17
+ footer: {
18
+ products: 'Products',
19
+ about: 'About',
20
+ aboutUs: 'About Us',
21
+ team: 'Our Team',
22
+ careers: 'Careers',
23
+ contactUs: 'Contact Us',
24
+ resources: 'Resources',
25
+ news: 'News',
26
+ blog: 'Blog',
27
+ faq: 'FAQ',
28
+ history: 'History',
29
+ techStack: 'Tech Stack',
30
+ legal: 'Legal',
31
+ terms: 'Terms of Service',
32
+ privacy: 'Privacy Policy',
33
+ slogan: 'Build a beautiful digital experience',
34
+ allRightsReserved: 'All Rights Reserved',
35
+ friendlyLinks: 'Friendly Links',
36
+ },
16
37
  },
17
- footer: {
18
- products: 'Products',
19
- about: 'About',
20
- aboutUs: 'About Us',
21
- team: 'Our Team',
22
- careers: 'Careers',
23
- contactUs: 'Contact Us',
24
- resources: 'Resources',
25
- news: 'News',
26
- blog: 'Blog',
27
- faq: 'FAQ',
28
- history: 'History',
29
- techStack: 'Tech Stack',
30
- legal: 'Legal',
31
- terms: 'Terms of Service',
32
- privacy: 'Privacy Policy',
33
- slogan: 'Build a beautiful digital experience',
34
- allRightsReserved: 'All Rights Reserved',
38
+ 'zh-cn': {
39
+ tableOfContents: {
40
+ title: '目录',
41
+ loading: '加载中...',
42
+ },
43
+ footer: {
44
+ products: '产品',
45
+ about: '关于',
46
+ aboutUs: '关于我们',
47
+ team: '团队介绍',
48
+ careers: '加入我们',
49
+ contactUs: '联系我们',
50
+ defaultSlogan: '优雅、高效的组件库',
51
+ resources: '资源',
52
+ news: '新闻动态',
53
+ blog: '技术博客',
54
+ faq: '常见问题',
55
+ history: '发展历程',
56
+ techStack: '技术栈',
57
+ legal: '法律',
58
+ terms: '服务条款',
59
+ privacy: '隐私政策',
60
+ allRightsReserved: '保留所有权利',
61
+ friendlyLinks: '友情链接',
62
+ },
35
63
  },
36
- },
37
- 'zh-cn': {
38
- tableOfContents: {
39
- title: '目录',
40
- loading: '加载中...',
41
- },
42
- footer: {
43
- products: '产品',
44
- about: '关于',
45
- aboutUs: '关于我们',
46
- team: '团队介绍',
47
- careers: '加入我们',
48
- contactUs: '联系我们',
49
- defaultSlogan: '优雅、高效的组件库',
50
- resources: '资源',
51
- news: '新闻动态',
52
- blog: '技术博客',
53
- faq: '常见问题',
54
- history: '发展历程',
55
- techStack: '技术栈',
56
- legal: '法律',
57
- terms: '服务条款',
58
- privacy: '隐私政策',
59
- allRightsReserved: '保留所有权利',
60
- },
61
- },
62
64
  };
63
65
 
64
66
  /**
@@ -69,7 +71,7 @@ export const texts: Record<string, TextContent> = {
69
71
  * @returns 对应的文本内容
70
72
  */
71
73
  export function getText(lang: string, component: string, key: string): string {
72
- return texts[lang]?.[component]?.[key] || texts['en'][component]?.[key] || '';
74
+ return texts[lang]?.[component]?.[key] || texts['en'][component]?.[key] || '';
73
75
  }
74
76
 
75
77
  /**
@@ -79,5 +81,5 @@ export function getText(lang: string, component: string, key: string): string {
79
81
  * @returns 文本获取函数
80
82
  */
81
83
  export function createTextGetter(langInfo: string, component: string) {
82
- return (key: string): string => getText(langInfo, component, key);
84
+ return (key: string): string => getText(langInfo, component, key);
83
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coffic/cosy-ui",
3
- "version": "0.8.20",
3
+ "version": "0.8.21",
4
4
  "description": "An astro component library",
5
5
  "author": {
6
6
  "name": "nookery",
@@ -1,30 +0,0 @@
1
- ---
2
- import NavItems from './NavItems.astro';
3
-
4
- const navItems = [
5
- {
6
- label: '首页',
7
- href: '/',
8
- },
9
- {
10
- label: '文档',
11
- href: '/docs',
12
- },
13
- {
14
- label: '组件',
15
- href: '/components',
16
- },
17
- {
18
- label: '博客',
19
- href: '/blog',
20
- },
21
- ];
22
- ---
23
-
24
- <div class="cosy:bg-base-100 cosy:p-4">
25
- <NavItems
26
- navItems={navItems}
27
- activeLink="/docs"
28
- linkHeightClass="cosy:h-10"
29
- />
30
- </div>