@lobehub/chat 0.157.2 → 0.158.0

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 (92) hide show
  1. package/.eslintignore +1 -2
  2. package/CHANGELOG.md +25 -0
  3. package/locales/ar/auth.json +2 -0
  4. package/locales/ar/common.json +1 -0
  5. package/locales/bg-BG/auth.json +2 -0
  6. package/locales/bg-BG/common.json +1 -0
  7. package/locales/bg-BG/error.json +3 -3
  8. package/locales/de-DE/auth.json +2 -0
  9. package/locales/de-DE/common.json +1 -0
  10. package/locales/en-US/auth.json +2 -0
  11. package/locales/en-US/common.json +1 -0
  12. package/locales/es-ES/auth.json +2 -0
  13. package/locales/es-ES/common.json +1 -0
  14. package/locales/fr-FR/auth.json +2 -0
  15. package/locales/fr-FR/common.json +1 -0
  16. package/locales/it-IT/auth.json +2 -0
  17. package/locales/it-IT/common.json +1 -0
  18. package/locales/ja-JP/auth.json +2 -0
  19. package/locales/ja-JP/common.json +1 -0
  20. package/locales/ko-KR/auth.json +2 -0
  21. package/locales/ko-KR/common.json +1 -0
  22. package/locales/nl-NL/auth.json +2 -0
  23. package/locales/nl-NL/common.json +50 -49
  24. package/locales/pl-PL/auth.json +2 -0
  25. package/locales/pl-PL/common.json +1 -0
  26. package/locales/pl-PL/error.json +3 -3
  27. package/locales/pt-BR/auth.json +2 -0
  28. package/locales/pt-BR/common.json +1 -0
  29. package/locales/ru-RU/auth.json +2 -0
  30. package/locales/ru-RU/common.json +1 -0
  31. package/locales/ru-RU/error.json +3 -3
  32. package/locales/tr-TR/auth.json +2 -0
  33. package/locales/tr-TR/common.json +1 -0
  34. package/locales/vi-VN/auth.json +2 -0
  35. package/locales/vi-VN/common.json +1 -0
  36. package/locales/zh-CN/auth.json +2 -0
  37. package/locales/zh-CN/common.json +1 -0
  38. package/locales/zh-TW/auth.json +2 -0
  39. package/locales/zh-TW/common.json +1 -0
  40. package/package.json +1 -1
  41. package/src/app/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +80 -0
  42. package/src/app/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +116 -0
  43. package/src/app/(main)/(mobile)/me/(home)/features/Category.tsx +15 -0
  44. package/src/app/(main)/(mobile)/me/(home)/features/UserBanner.tsx +37 -0
  45. package/src/app/(main)/(mobile)/me/(home)/features/useCategory.tsx +95 -0
  46. package/src/app/(main)/(mobile)/me/{page.tsx → (home)/page.tsx} +6 -10
  47. package/src/app/(main)/(mobile)/me/data/features/Category.tsx +48 -0
  48. package/src/app/(main)/(mobile)/me/data/features/Header.tsx +33 -0
  49. package/src/app/(main)/(mobile)/me/data/layout.tsx +13 -0
  50. package/src/app/(main)/(mobile)/me/data/loading.tsx +5 -0
  51. package/src/app/(main)/(mobile)/me/data/page.tsx +17 -0
  52. package/src/app/(main)/(mobile)/me/profile/features/Category.tsx +45 -0
  53. package/src/app/(main)/(mobile)/me/profile/features/Header.tsx +33 -0
  54. package/src/app/(main)/(mobile)/me/profile/layout.tsx +16 -0
  55. package/src/app/(main)/(mobile)/me/profile/loading.tsx +5 -0
  56. package/src/app/(main)/(mobile)/me/profile/page.tsx +17 -0
  57. package/src/app/(main)/(mobile)/me/settings/features/Category.tsx +15 -0
  58. package/src/app/(main)/(mobile)/me/settings/features/Header.tsx +33 -0
  59. package/src/app/(main)/(mobile)/me/settings/features/useCategory.tsx +57 -0
  60. package/src/app/(main)/(mobile)/me/settings/layout.tsx +13 -0
  61. package/src/app/(main)/(mobile)/me/settings/loading.tsx +5 -0
  62. package/src/app/(main)/(mobile)/me/settings/page.tsx +17 -0
  63. package/src/app/(main)/_layout/Mobile.tsx +5 -4
  64. package/src/app/(main)/profile/[[...slugs]]/Client.tsx +74 -0
  65. package/src/app/(main)/profile/[[...slugs]]/page.tsx +18 -0
  66. package/src/app/(main)/profile/_layout/Mobile/Header.tsx +26 -0
  67. package/src/app/(main)/profile/_layout/Mobile/index.tsx +16 -0
  68. package/src/app/(main)/profile/layout.tsx +20 -0
  69. package/src/app/(main)/profile/loading.tsx +23 -0
  70. package/src/app/(main)/settings/_layout/Mobile/Header.tsx +2 -1
  71. package/src/app/(main)/settings/hooks/useCategory.tsx +7 -13
  72. package/src/app/@modal/layout.tsx +3 -0
  73. package/src/components/Cell/Divider.tsx +3 -2
  74. package/src/components/Cell/index.tsx +28 -18
  75. package/src/features/User/DataStatistics.tsx +3 -1
  76. package/src/features/User/UserLoginOrSignup.tsx +2 -2
  77. package/src/features/User/UserPanel/PanelContent.tsx +9 -3
  78. package/src/features/User/UserPanel/useMenu.tsx +29 -29
  79. package/src/features/User/__tests__/PanelContent.test.tsx +7 -0
  80. package/src/features/User/__tests__/useMenu.test.tsx +142 -0
  81. package/src/layout/AuthProvider/Clerk/useAppearance.ts +5 -4
  82. package/src/locales/default/auth.ts +2 -0
  83. package/src/locales/default/common.ts +1 -0
  84. package/src/store/user/slices/auth/selectors.ts +2 -1
  85. package/src/app/(auth)/profile/[[...slugs]]/PageTitle.tsx +0 -13
  86. package/src/app/(auth)/profile/[[...slugs]]/page.tsx +0 -14
  87. package/src/app/(main)/(mobile)/me/features/Cate.tsx +0 -33
  88. package/src/app/(main)/(mobile)/me/features/ExtraCate.tsx +0 -24
  89. package/src/app/(main)/(mobile)/me/features/useExtraCate.tsx +0 -62
  90. /package/src/app/(main)/(mobile)/me/{features → (home)/features}/Header.tsx +0 -0
  91. /package/src/app/(main)/(mobile)/me/{layout.tsx → (home)/layout.tsx} +0 -0
  92. /package/src/app/(main)/(mobile)/me/{loading.tsx → (home)/loading.tsx} +0 -0
package/.eslintignore CHANGED
@@ -10,9 +10,8 @@ coverage
10
10
 
11
11
  # test
12
12
  jest*
13
- _test_
14
- __test__
15
13
  *.test.ts
14
+ *.test.tsx
16
15
 
17
16
  # umi
18
17
  .umi
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## [Version 0.158.0](https://github.com/lobehub/lobe-chat/compare/v0.157.2...v0.158.0)
6
+
7
+ <sup>Released on **2024-05-13**</sup>
8
+
9
+ #### ✨ Features
10
+
11
+ - **misc**: Add user profile page.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's improved
19
+
20
+ - **misc**: Add user profile page, closes [#2433](https://github.com/lobehub/lobe-chat/issues/2433) ([91f7294](https://github.com/lobehub/lobe-chat/commit/91f7294))
21
+
22
+ </details>
23
+
24
+ <div align="right">
25
+
26
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
27
+
28
+ </div>
29
+
5
30
  ### [Version 0.157.2](https://github.com/lobehub/lobe-chat/compare/v0.157.1...v0.157.2)
6
31
 
7
32
  <sup>Released on **2024-05-13**</sup>
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "تسجيل الدخول",
3
3
  "loginOrSignup": "تسجيل الدخول / التسجيل",
4
+ "profile": "الملف الشخصي",
5
+ "security": "الأمان",
4
6
  "signout": "تسجيل الخروج",
5
7
  "signup": "التسجيل"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "مستخدم مجهول",
171
171
  "billing": "إدارة الفواتير",
172
+ "data": "تخزين البيانات",
172
173
  "defaultNickname": "مستخدم النسخة المجتمعية",
173
174
  "discord": "الدعم المجتمعي",
174
175
  "docs": "وثائق الاستخدام",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Вход",
3
3
  "loginOrSignup": "Вход / Регистрация",
4
+ "profile": "Профил",
5
+ "security": "Сигурност",
4
6
  "signout": "Изход",
5
7
  "signup": "Регистрация"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Анонимен потребител",
171
171
  "billing": "Управление на сметките",
172
+ "data": "Съхранение на данни",
172
173
  "defaultNickname": "Потребител на общността",
173
174
  "discord": "Поддръжка на общността",
174
175
  "docs": "Документация",
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "clerkAuth": {
3
3
  "loginSuccess": {
4
- "action": "继续会话",
5
- "desc": "{{greeting}},很高兴能够继续为你服务。让我们接着刚刚的话题聊下去吧",
6
- "title": "欢迎回来, {{nickName}}"
4
+ "action": "Continue Session",
5
+ "desc": "{{greeting}}, I'm glad to continue serving you. Let's pick up where we left off.",
6
+ "title": "Welcome back, {{nickName}}"
7
7
  }
8
8
  },
9
9
  "error": {
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Anmelden",
3
3
  "loginOrSignup": "Anmelden / Registrieren",
4
+ "profile": "Profil",
5
+ "security": "Sicherheit",
4
6
  "signout": "Abmelden",
5
7
  "signup": "Registrieren"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Anonymer Benutzer",
171
171
  "billing": "Abrechnung verwalten",
172
+ "data": "Daten speichern",
172
173
  "defaultNickname": "Community User",
173
174
  "discord": "Community-Support",
174
175
  "docs": "Dokumentation",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Login",
3
3
  "loginOrSignup": "Log in / Sign up",
4
+ "profile": "Profile",
5
+ "security": "Security",
4
6
  "signout": "Sign out",
5
7
  "signup": "Sign up"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Anonymous User",
171
171
  "billing": "Billing Management",
172
+ "data": "Data Storage",
172
173
  "defaultNickname": "Community User",
173
174
  "discord": "Community Support",
174
175
  "docs": "Documentation",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Iniciar sesión",
3
3
  "loginOrSignup": "Iniciar sesión / Registrarse",
4
+ "profile": "Perfil",
5
+ "security": "Seguridad",
4
6
  "signout": "Cerrar sesión",
5
7
  "signup": "Registrarse"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Usuario Anónimo",
171
171
  "billing": "Gestión de facturación",
172
+ "data": "Almacenamiento de datos",
172
173
  "defaultNickname": "Usuario de la comunidad",
173
174
  "discord": "Soporte de la comunidad",
174
175
  "docs": "Documentación de uso",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Connexion",
3
3
  "loginOrSignup": "Connexion / Inscription",
4
+ "profile": "Profil",
5
+ "security": "Sécurité",
4
6
  "signout": "Déconnexion",
5
7
  "signup": "Inscription"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Utilisateur anonyme",
171
171
  "billing": "Gestion de la facturation",
172
+ "data": "Stockage des données",
172
173
  "defaultNickname": "Utilisateur de la version communautaire",
173
174
  "discord": "Support de la communauté",
174
175
  "docs": "Documentation d'utilisation",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Accedi",
3
3
  "loginOrSignup": "Accedi / Registrati",
4
+ "profile": "Profilo",
5
+ "security": "Sicurezza",
4
6
  "signout": "Esci",
5
7
  "signup": "Registrati"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Utente Anonimo",
171
171
  "billing": "Gestione fatturazione",
172
+ "data": "Archiviazione dati",
172
173
  "defaultNickname": "Utente Community",
173
174
  "discord": "Supporto della community",
174
175
  "docs": "Documentazione",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "ログイン",
3
3
  "loginOrSignup": "ログイン / 登録",
4
+ "profile": "プロフィール",
5
+ "security": "セキュリティ",
4
6
  "signout": "ログアウト",
5
7
  "signup": "サインアップ"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "匿名ユーザー",
171
171
  "billing": "請求管理",
172
+ "data": "データストレージ",
172
173
  "defaultNickname": "コミュニティユーザー",
173
174
  "discord": "コミュニティサポート",
174
175
  "docs": "使用文書",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "로그인",
3
3
  "loginOrSignup": "로그인 / 가입",
4
+ "profile": "프로필",
5
+ "security": "보안",
4
6
  "signout": "로그아웃",
5
7
  "signup": "가입"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "익명 사용자",
171
171
  "billing": "결제 관리",
172
+ "data": "데이터 저장",
172
173
  "defaultNickname": "커뮤니티 사용자",
173
174
  "discord": "커뮤니티 지원",
174
175
  "docs": "사용 설명서",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Inloggen",
3
3
  "loginOrSignup": "Inloggen / Registreren",
4
+ "profile": "Profiel",
5
+ "security": "Veiligheid",
4
6
  "signout": "Uitloggen",
5
7
  "signup": "Registreren"
6
8
  }
@@ -104,52 +104,52 @@
104
104
  "pin": "Vastzetten",
105
105
  "pinOff": "Vastzetten uitschakelen",
106
106
  "privacy": "Privacybeleid",
107
- "regenerate": "重新生成",
108
- "rename": "重命名",
109
- "reset": "重置",
110
- "retry": "重试",
111
- "send": "发送",
112
- "setting": "设置",
113
- "share": "分享",
114
- "stop": "停止",
107
+ "regenerate": "Opnieuw genereren",
108
+ "rename": "Naam wijzigen",
109
+ "reset": "Resetten",
110
+ "retry": "Opnieuw proberen",
111
+ "send": "Verzenden",
112
+ "setting": "Instelling",
113
+ "share": "Delen",
114
+ "stop": "Stoppen",
115
115
  "sync": {
116
116
  "actions": {
117
- "settings": "同步设置",
118
- "sync": "立即同步"
117
+ "settings": "Synchronisatie-instellingen",
118
+ "sync": "Nu synchroniseren"
119
119
  },
120
120
  "awareness": {
121
- "current": "当前设备"
121
+ "current": "Huidig apparaat"
122
122
  },
123
- "channel": "频道",
123
+ "channel": "Kanaal",
124
124
  "disabled": {
125
125
  "actions": {
126
- "enable": "开启云端同步",
127
- "settings": "配置同步参数"
126
+ "enable": "Cloudsynchronisatie inschakelen",
127
+ "settings": "Synchronisatie-instellingen configureren"
128
128
  },
129
- "desc": "当前会话数据仅存储于此浏览器中。如果你需要在多个设备间同步数据,请配置并开启云端同步。",
130
- "title": "数据同步未开启"
129
+ "desc": "De huidige gespreksgegevens worden alleen opgeslagen in deze browser. Als u gegevens wilt synchroniseren tussen meerdere apparaten, configureer en schakel dan cloudsynchronisatie in.",
130
+ "title": "Gegevenssynchronisatie is uitgeschakeld"
131
131
  },
132
132
  "enabled": {
133
- "title": "数据同步"
133
+ "title": "Gegevenssynchronisatie"
134
134
  },
135
135
  "status": {
136
- "connecting": "连接中",
137
- "disabled": "同步未开启",
138
- "ready": "已连接",
139
- "synced": "已同步",
140
- "syncing": "同步中",
141
- "unconnected": "连接失败"
136
+ "connecting": "Verbinding maken",
137
+ "disabled": "Synchronisatie is uitgeschakeld",
138
+ "ready": "Verbonden",
139
+ "synced": "Gesynchroniseerd",
140
+ "syncing": "Synchroniseren",
141
+ "unconnected": "Verbinding mislukt"
142
142
  },
143
- "title": "同步状态",
143
+ "title": "Synchronisatiestatus",
144
144
  "unconnected": {
145
- "tip": "信令服务器连接失败,将无法建立点对点通信频道,请检查网络后重试"
145
+ "tip": "Verbindingsfout met de signaleringsserver. Er kan geen point-to-point-communicatiekanaal worden opgezet. Controleer het netwerk en probeer het opnieuw."
146
146
  }
147
147
  },
148
148
  "tab": {
149
- "chat": "会话",
150
- "market": "发现",
151
- "me": "",
152
- "setting": "设置"
149
+ "chat": "Chat",
150
+ "market": "Ontdekken",
151
+ "me": "Ik",
152
+ "setting": "Instellingen"
153
153
  },
154
154
  "telemetry": {
155
155
  "allow": "Toestaan",
@@ -158,28 +158,29 @@
158
158
  "learnMore": "Meer informatie",
159
159
  "title": "Help LobeChat verbeteren"
160
160
  },
161
- "temp": "临时",
162
- "terms": "Algemene voorwaarden",
163
- "updateAgent": "更新助理信息",
161
+ "temp": "tijdelijk",
162
+ "terms": "algemene voorwaarden",
163
+ "updateAgent": "update assistent",
164
164
  "upgradeVersion": {
165
- "action": "升级",
166
- "hasNew": "有可用更新",
167
- "newVersion": "有新版本可用:{{version}}"
165
+ "action": "upgraden",
166
+ "hasNew": "nieuwe versie beschikbaar",
167
+ "newVersion": "nieuwe versie beschikbaar: {{version}}"
168
168
  },
169
169
  "userPanel": {
170
- "anonymousNickName": "Anonieme gebruiker",
171
- "billing": "账单管理",
172
- "defaultNickname": "Standaardgebruiker",
173
- "discord": "社区支持",
174
- "docs": "使用文档",
175
- "email": "邮件支持",
176
- "feedback": "反馈与建议",
177
- "help": "帮助中心",
178
- "moveGuide": "De instellingenknop is hierheen verplaatst",
179
- "plans": "订阅方案",
180
- "preview": "Voorbeeld",
181
- "profile": "账户管理",
182
- "setting": "应用设置",
183
- "usages": "用量统计"
170
+ "anonymousNickName": "anonieme gebruiker",
171
+ "billing": "facturatie",
172
+ "data": "gegevensopslag",
173
+ "defaultNickname": "communitygebruiker",
174
+ "discord": "communityondersteuning",
175
+ "docs": "gebruiksaanwijzing",
176
+ "email": "e-mailondersteuning",
177
+ "feedback": "feedback en suggesties",
178
+ "help": "helpcentrum",
179
+ "moveGuide": "instellingen verplaatst naar hier",
180
+ "plans": "abonnementen",
181
+ "preview": "voorbeeldversie",
182
+ "profile": "accountbeheer",
183
+ "setting": "app-instellingen",
184
+ "usages": "gebruiksstatistieken"
184
185
  }
185
186
  }
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Zaloguj się",
3
3
  "loginOrSignup": "Zaloguj się / Zarejestruj się",
4
+ "profile": "Profil użytkownika",
5
+ "security": "Bezpieczeństwo",
4
6
  "signout": "Wyloguj",
5
7
  "signup": "Zarejestruj się"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Użytkownik Anonimowy",
171
171
  "billing": "Zarządzanie rachunkami",
172
+ "data": "Przechowywanie danych",
172
173
  "defaultNickname": "Użytkownik Wersji Społecznościowej",
173
174
  "discord": "Wsparcie społeczności",
174
175
  "docs": "Dokumentacja",
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "clerkAuth": {
3
3
  "loginSuccess": {
4
- "action": "继续会话",
5
- "desc": "{{greeting}},很高兴能够继续为你服务。让我们接着刚刚的话题聊下去吧",
6
- "title": "欢迎回来, {{nickName}}"
4
+ "action": "Continue session",
5
+ "desc": "{{greeting}}, it's great to continue serving you. Let's continue our previous conversation.",
6
+ "title": "Welcome back, {{nickName}}"
7
7
  }
8
8
  },
9
9
  "error": {
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Entrar",
3
3
  "loginOrSignup": "Entrar / Registrar",
4
+ "profile": "Perfil",
5
+ "security": "Segurança",
4
6
  "signout": "Sair",
5
7
  "signup": "Cadastre-se"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Usuário Anônimo",
171
171
  "billing": "Gerenciamento de faturas",
172
+ "data": "Armazenamento de dados",
172
173
  "defaultNickname": "Usuário da Comunidade",
173
174
  "discord": "Suporte da Comunidade",
174
175
  "docs": "Documentação",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Войти",
3
3
  "loginOrSignup": "Войти / Зарегистрироваться",
4
+ "profile": "Профиль",
5
+ "security": "Безопасность",
4
6
  "signout": "Выйти",
5
7
  "signup": "Зарегистрироваться"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Анонимный пользователь",
171
171
  "billing": "Управление счетами",
172
+ "data": "Хранилище данных",
172
173
  "defaultNickname": "Пользователь сообщества",
173
174
  "discord": "Поддержка сообщества",
174
175
  "docs": "Документация",
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "clerkAuth": {
3
3
  "loginSuccess": {
4
- "action": "继续会话",
5
- "desc": "{{greeting}},很高兴能够继续为你服务。让我们接着刚刚的话题聊下去吧",
6
- "title": "欢迎回来, {{nickName}}"
4
+ "action": "Продолжить разговор",
5
+ "desc": "{{greeting}}, рады снова быть к вашим услугам. Давайте продолжим нашу беседу",
6
+ "title": "Добро пожаловать обратно, {{nickName}}"
7
7
  }
8
8
  },
9
9
  "error": {
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Giriş Yap",
3
3
  "loginOrSignup": "Giriş Yap / Kayıt Ol",
4
+ "profile": "Profil",
5
+ "security": "Güvenlik",
4
6
  "signout": "Çıkış Yap",
5
7
  "signup": "Kaydol"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Anonim Kullanıcı",
171
171
  "billing": "Fatura Yönetimi",
172
+ "data": "Veri Depolama",
172
173
  "defaultNickname": "Topluluk Kullanıcısı",
173
174
  "discord": "Topluluk Destek",
174
175
  "docs": "Belgeler",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "Đăng nhập",
3
3
  "loginOrSignup": "Đăng nhập / Đăng ký",
4
+ "profile": "Hồ sơ cá nhân",
5
+ "security": "Bảo mật",
4
6
  "signout": "Đăng xuất",
5
7
  "signup": "Đăng ký"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "Người dùng ẩn danh",
171
171
  "billing": "Quản lý hóa đơn",
172
+ "data": "Lưu trữ dữ liệu",
172
173
  "defaultNickname": "Người dùng phiên bản cộng đồng",
173
174
  "discord": "Hỗ trợ cộng đồng",
174
175
  "docs": "Tài liệu sử dụng",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "登录",
3
3
  "loginOrSignup": "登录 / 注册",
4
+ "profile": "个人资料",
5
+ "security": "安全",
4
6
  "signout": "退出登录",
5
7
  "signup": "注册"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "匿名用户",
171
171
  "billing": "账单管理",
172
+ "data": "数据存储",
172
173
  "defaultNickname": "社区版用户",
173
174
  "discord": "社区支持",
174
175
  "docs": "使用文档",
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "login": "登入",
3
3
  "loginOrSignup": "登入 / 註冊",
4
+ "profile": "個人檔案",
5
+ "security": "安全",
4
6
  "signout": "登出",
5
7
  "signup": "註冊"
6
8
  }
@@ -169,6 +169,7 @@
169
169
  "userPanel": {
170
170
  "anonymousNickName": "匿名使用者",
171
171
  "billing": "帳單管理",
172
+ "data": "資料儲存",
172
173
  "defaultNickname": "社群版使用者",
173
174
  "discord": "社區支援",
174
175
  "docs": "使用文件",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "0.157.2",
3
+ "version": "0.158.0",
4
4
  "description": "Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
5
5
  "keywords": [
6
6
  "framework",
@@ -0,0 +1,80 @@
1
+ import { act, render, screen } from '@testing-library/react';
2
+ import { afterEach, describe, expect, it, vi } from 'vitest';
3
+
4
+ import { useUserStore } from '@/store/user';
5
+
6
+ import UserBanner from '../features/UserBanner';
7
+
8
+ // Mock dependencies
9
+ vi.mock('next/navigation', () => ({
10
+ useRouter: vi.fn(() => ({
11
+ push: vi.fn(),
12
+ })),
13
+ }));
14
+
15
+ vi.mock('@/features/User/UserInfo', () => ({
16
+ default: vi.fn(() => <div>Mocked UserInfo</div>),
17
+ }));
18
+
19
+ vi.mock('@/features/User/DataStatistics', () => ({
20
+ default: vi.fn(() => <div>Mocked DataStatistics</div>),
21
+ }));
22
+
23
+ vi.mock('@/features/User/UserLoginOrSignup', () => ({
24
+ default: vi.fn(() => <div>Mocked UserLoginOrSignup</div>),
25
+ }));
26
+
27
+ // 定义一个变量来存储 enableAuth 的值
28
+ let enableAuth = true;
29
+
30
+ // 模拟 @/const/auth 模块
31
+ vi.mock('@/const/auth', () => ({
32
+ get enableAuth() {
33
+ return enableAuth;
34
+ },
35
+ }));
36
+
37
+ afterEach(() => {
38
+ enableAuth = true;
39
+ });
40
+
41
+ describe('UserBanner', () => {
42
+ it('should render UserInfo and DataStatistics when auth is disabled', () => {
43
+ act(() => {
44
+ useUserStore.setState({ isSignedIn: false });
45
+ });
46
+ enableAuth = false;
47
+
48
+ render(<UserBanner />);
49
+
50
+ expect(screen.getByText('Mocked UserInfo')).toBeInTheDocument();
51
+ expect(screen.getByText('Mocked DataStatistics')).toBeInTheDocument();
52
+ expect(screen.queryByText('Mocked UserLoginOrSignup')).not.toBeInTheDocument();
53
+ });
54
+
55
+ it('should render UserInfo and DataStatistics when user is logged in with auth enabled', () => {
56
+ act(() => {
57
+ useUserStore.setState({ isSignedIn: true });
58
+ });
59
+ enableAuth = true;
60
+
61
+ render(<UserBanner />);
62
+
63
+ expect(screen.getByText('Mocked UserInfo')).toBeInTheDocument();
64
+ expect(screen.getByText('Mocked DataStatistics')).toBeInTheDocument();
65
+ expect(screen.queryByText('Mocked UserLoginOrSignup')).not.toBeInTheDocument();
66
+ });
67
+
68
+ it('should render UserLoginOrSignup when user is not logged in with auth enabled', () => {
69
+ act(() => {
70
+ useUserStore.setState({ isSignedIn: false });
71
+ });
72
+ enableAuth = true;
73
+
74
+ render(<UserBanner />);
75
+
76
+ expect(screen.getByText('Mocked UserLoginOrSignup')).toBeInTheDocument();
77
+ expect(screen.queryByText('Mocked UserInfo')).not.toBeInTheDocument();
78
+ expect(screen.queryByText('Mocked DataStatistics')).not.toBeInTheDocument();
79
+ });
80
+ });