@lobehub/chat 1.44.2 → 1.45.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 (324) hide show
  1. package/.remarkrc.mdx.js +6 -0
  2. package/CHANGELOG.md +50 -0
  3. package/changelog/v1.json +18 -0
  4. package/docs/changelog/2023-09-09-plugin-system.mdx +5 -0
  5. package/docs/changelog/2023-09-09-plugin-system.zh-CN.mdx +5 -0
  6. package/docs/changelog/2023-11-14-gpt4-vision.mdx +6 -0
  7. package/docs/changelog/2023-11-14-gpt4-vision.zh-CN.mdx +6 -0
  8. package/docs/changelog/2023-11-19-tts-stt.mdx +6 -0
  9. package/docs/changelog/2023-11-19-tts-stt.zh-CN.mdx +7 -0
  10. package/docs/changelog/2023-12-22-dalle-3.mdx +6 -0
  11. package/docs/changelog/2023-12-22-dalle-3.zh-CN.mdx +4 -0
  12. package/docs/changelog/2024-02-08-sso-oauth.mdx +6 -0
  13. package/docs/changelog/2024-02-08-sso-oauth.zh-CN.mdx +6 -0
  14. package/docs/changelog/2024-02-14-ollama.mdx +6 -0
  15. package/docs/changelog/2024-02-14-ollama.zh-CN.mdx +5 -0
  16. package/docs/changelog/2024-06-19-lobe-chat-v1.mdx +6 -0
  17. package/docs/changelog/2024-06-19-lobe-chat-v1.zh-CN.mdx +5 -0
  18. package/docs/changelog/2024-07-19-gpt-4o-mini.mdx +5 -0
  19. package/docs/changelog/2024-07-19-gpt-4o-mini.zh-CN.mdx +4 -0
  20. package/docs/changelog/2024-08-02-lobe-chat-database-docker.mdx +6 -0
  21. package/docs/changelog/2024-08-02-lobe-chat-database-docker.zh-CN.mdx +5 -0
  22. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.mdx +6 -0
  23. package/docs/changelog/2024-08-21-file-upload-and-knowledge-base.zh-CN.mdx +5 -0
  24. package/docs/changelog/2024-09-13-openai-o1-models.mdx +6 -0
  25. package/docs/changelog/2024-09-13-openai-o1-models.zh-CN.mdx +6 -0
  26. package/docs/changelog/2024-09-20-artifacts.mdx +6 -0
  27. package/docs/changelog/2024-09-20-artifacts.zh-CN.mdx +6 -0
  28. package/docs/changelog/2024-10-27-pin-assistant.mdx +5 -0
  29. package/docs/changelog/2024-10-27-pin-assistant.zh-CN.mdx +4 -0
  30. package/docs/changelog/2024-11-06-share-text-json.mdx +4 -0
  31. package/docs/changelog/2024-11-06-share-text-json.zh-CN.mdx +4 -0
  32. package/docs/changelog/2024-11-25-november-providers.mdx +7 -0
  33. package/docs/changelog/2024-11-25-november-providers.zh-CN.mdx +7 -0
  34. package/docs/changelog/2024-11-27-forkable-chat.mdx +4 -0
  35. package/docs/changelog/2024-11-27-forkable-chat.zh-CN.mdx +5 -0
  36. package/docs/changelog/2025-01-03-user-profile.mdx +5 -0
  37. package/docs/changelog/2025-01-03-user-profile.zh-CN.mdx +4 -1
  38. package/docs/self-hosting/advanced/auth/clerk.mdx +25 -41
  39. package/docs/self-hosting/advanced/auth/clerk.zh-CN.mdx +23 -37
  40. package/docs/self-hosting/advanced/auth/next-auth/auth0.mdx +31 -58
  41. package/docs/self-hosting/advanced/auth/next-auth/auth0.zh-CN.mdx +30 -57
  42. package/docs/self-hosting/advanced/auth/next-auth/authelia.mdx +38 -38
  43. package/docs/self-hosting/advanced/auth/next-auth/authelia.zh-CN.mdx +37 -38
  44. package/docs/self-hosting/advanced/auth/next-auth/authentik.mdx +26 -31
  45. package/docs/self-hosting/advanced/auth/next-auth/authentik.zh-CN.mdx +25 -30
  46. package/docs/self-hosting/advanced/auth/next-auth/casdoor.mdx +74 -75
  47. package/docs/self-hosting/advanced/auth/next-auth/casdoor.zh-CN.mdx +72 -73
  48. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.mdx +24 -25
  49. package/docs/self-hosting/advanced/auth/next-auth/cloudflare-zero-trust.zh-CN.mdx +23 -24
  50. package/docs/self-hosting/advanced/auth/next-auth/github.mdx +46 -73
  51. package/docs/self-hosting/advanced/auth/next-auth/github.zh-CN.mdx +43 -70
  52. package/docs/self-hosting/advanced/auth/next-auth/logto.mdx +28 -37
  53. package/docs/self-hosting/advanced/auth/next-auth/logto.zh-CN.mdx +28 -37
  54. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.mdx +36 -49
  55. package/docs/self-hosting/advanced/auth/next-auth/microsoft-entra-id.zh-CN.mdx +30 -43
  56. package/docs/self-hosting/advanced/auth/next-auth/wechat.mdx +13 -14
  57. package/docs/self-hosting/advanced/auth/next-auth/wechat.zh-CN.mdx +14 -15
  58. package/docs/self-hosting/advanced/auth/next-auth/zitadel.mdx +35 -69
  59. package/docs/self-hosting/advanced/auth/next-auth/zitadel.zh-CN.mdx +34 -68
  60. package/docs/self-hosting/advanced/auth.mdx +14 -13
  61. package/docs/self-hosting/advanced/auth.zh-CN.mdx +15 -14
  62. package/docs/self-hosting/advanced/feature-flags.zh-CN.mdx +15 -15
  63. package/docs/self-hosting/advanced/knowledge-base.mdx +14 -3
  64. package/docs/self-hosting/advanced/knowledge-base.zh-CN.mdx +12 -3
  65. package/docs/self-hosting/advanced/model-list.zh-CN.mdx +5 -5
  66. package/docs/self-hosting/advanced/s3/cloudflare-r2.mdx +52 -81
  67. package/docs/self-hosting/advanced/s3/cloudflare-r2.zh-CN.mdx +51 -80
  68. package/docs/self-hosting/advanced/s3/tencent-cloud.mdx +20 -34
  69. package/docs/self-hosting/advanced/s3/tencent-cloud.zh-CN.mdx +28 -43
  70. package/docs/self-hosting/advanced/s3.mdx +30 -34
  71. package/docs/self-hosting/advanced/s3.zh-CN.mdx +28 -33
  72. package/docs/self-hosting/advanced/settings-url-share.mdx +6 -6
  73. package/docs/self-hosting/advanced/settings-url-share.zh-CN.mdx +19 -19
  74. package/docs/self-hosting/advanced/upstream-sync.mdx +73 -89
  75. package/docs/self-hosting/advanced/upstream-sync.zh-CN.mdx +71 -87
  76. package/docs/self-hosting/advanced/webrtc.mdx +14 -21
  77. package/docs/self-hosting/advanced/webrtc.zh-CN.mdx +19 -26
  78. package/docs/self-hosting/environment-variables/analytics.zh-CN.mdx +0 -3
  79. package/docs/self-hosting/environment-variables/auth.zh-CN.mdx +1 -1
  80. package/docs/self-hosting/environment-variables/basic.mdx +13 -13
  81. package/docs/self-hosting/environment-variables/basic.zh-CN.mdx +15 -15
  82. package/docs/self-hosting/environment-variables/model-provider.mdx +1 -1
  83. package/docs/self-hosting/environment-variables/model-provider.zh-CN.mdx +1 -1
  84. package/docs/self-hosting/environment-variables/s3.mdx +3 -4
  85. package/docs/self-hosting/environment-variables/s3.zh-CN.mdx +5 -7
  86. package/docs/self-hosting/environment-variables.mdx +8 -4
  87. package/docs/self-hosting/environment-variables.zh-CN.mdx +4 -0
  88. package/docs/self-hosting/examples/azure-openai.mdx +9 -12
  89. package/docs/self-hosting/examples/azure-openai.zh-CN.mdx +8 -11
  90. package/docs/self-hosting/examples/ollama.mdx +8 -7
  91. package/docs/self-hosting/examples/ollama.zh-CN.mdx +8 -7
  92. package/docs/self-hosting/platform/alibaba-cloud.mdx +5 -7
  93. package/docs/self-hosting/platform/alibaba-cloud.zh-CN.mdx +5 -7
  94. package/docs/self-hosting/platform/btpanel.mdx +3 -2
  95. package/docs/self-hosting/platform/btpanel.zh-CN.mdx +3 -3
  96. package/docs/self-hosting/platform/docker-compose.mdx +75 -85
  97. package/docs/self-hosting/platform/docker-compose.zh-CN.mdx +75 -85
  98. package/docs/self-hosting/platform/docker.mdx +87 -92
  99. package/docs/self-hosting/platform/docker.zh-CN.mdx +96 -115
  100. package/docs/self-hosting/platform/netlify.mdx +44 -94
  101. package/docs/self-hosting/platform/netlify.zh-CN.mdx +40 -90
  102. package/docs/self-hosting/platform/railway.mdx +6 -7
  103. package/docs/self-hosting/platform/railway.zh-CN.mdx +6 -7
  104. package/docs/self-hosting/platform/repocloud.mdx +6 -7
  105. package/docs/self-hosting/platform/repocloud.zh-CN.mdx +6 -7
  106. package/docs/self-hosting/platform/sealos.mdx +6 -7
  107. package/docs/self-hosting/platform/sealos.zh-CN.mdx +6 -7
  108. package/docs/self-hosting/platform/vercel.mdx +7 -8
  109. package/docs/self-hosting/platform/vercel.zh-CN.mdx +7 -8
  110. package/docs/self-hosting/platform/zeabur.mdx +29 -32
  111. package/docs/self-hosting/platform/zeabur.zh-CN.mdx +29 -32
  112. package/docs/self-hosting/server-database/docker-compose.mdx +44 -71
  113. package/docs/self-hosting/server-database/docker-compose.zh-CN.mdx +44 -71
  114. package/docs/self-hosting/server-database/docker.mdx +84 -88
  115. package/docs/self-hosting/server-database/docker.zh-CN.mdx +87 -91
  116. package/docs/self-hosting/server-database/dokploy.mdx +18 -1
  117. package/docs/self-hosting/server-database/dokploy.zh-CN.mdx +84 -68
  118. package/docs/self-hosting/server-database/repocloud.mdx +7 -9
  119. package/docs/self-hosting/server-database/repocloud.zh-CN.mdx +9 -11
  120. package/docs/self-hosting/server-database/vercel.mdx +158 -243
  121. package/docs/self-hosting/server-database/vercel.zh-CN.mdx +137 -205
  122. package/docs/self-hosting/server-database/zeabur.mdx +21 -23
  123. package/docs/self-hosting/server-database/zeabur.zh-CN.mdx +20 -22
  124. package/docs/self-hosting/server-database.mdx +34 -36
  125. package/docs/self-hosting/server-database.zh-CN.mdx +34 -37
  126. package/docs/self-hosting/start.mdx +1 -4
  127. package/docs/self-hosting/start.zh-CN.mdx +1 -1
  128. package/docs/usage/agents/agent-organization.mdx +5 -21
  129. package/docs/usage/agents/agent-organization.zh-CN.mdx +5 -21
  130. package/docs/usage/agents/concepts.mdx +4 -4
  131. package/docs/usage/agents/concepts.zh-CN.mdx +4 -4
  132. package/docs/usage/agents/custom-agent.mdx +2 -2
  133. package/docs/usage/agents/custom-agent.zh-CN.mdx +2 -2
  134. package/docs/usage/agents/model.mdx +4 -4
  135. package/docs/usage/agents/model.zh-CN.mdx +6 -6
  136. package/docs/usage/agents/prompt.mdx +5 -6
  137. package/docs/usage/agents/prompt.zh-CN.mdx +5 -6
  138. package/docs/usage/agents/topics.mdx +2 -2
  139. package/docs/usage/agents/topics.zh-CN.mdx +2 -2
  140. package/docs/usage/features/agent-market.mdx +2 -2
  141. package/docs/usage/features/agent-market.zh-CN.mdx +2 -2
  142. package/docs/usage/features/auth.mdx +1 -5
  143. package/docs/usage/features/auth.zh-CN.mdx +1 -5
  144. package/docs/usage/features/database.mdx +1 -5
  145. package/docs/usage/features/database.zh-CN.mdx +1 -5
  146. package/docs/usage/features/local-llm.mdx +2 -6
  147. package/docs/usage/features/local-llm.zh-CN.mdx +2 -6
  148. package/docs/usage/features/mobile.mdx +1 -5
  149. package/docs/usage/features/mobile.zh-CN.mdx +1 -5
  150. package/docs/usage/features/multi-ai-providers.mdx +3 -11
  151. package/docs/usage/features/multi-ai-providers.zh-CN.mdx +3 -11
  152. package/docs/usage/features/plugin-system.mdx +9 -10
  153. package/docs/usage/features/plugin-system.zh-CN.mdx +9 -10
  154. package/docs/usage/features/pwa.mdx +11 -25
  155. package/docs/usage/features/pwa.zh-CN.mdx +11 -25
  156. package/docs/usage/features/text-to-image.mdx +2 -2
  157. package/docs/usage/features/text-to-image.zh-CN.mdx +2 -2
  158. package/docs/usage/features/theme.mdx +1 -6
  159. package/docs/usage/features/theme.zh-CN.mdx +1 -6
  160. package/docs/usage/features/tts.mdx +3 -7
  161. package/docs/usage/features/tts.zh-CN.mdx +3 -7
  162. package/docs/usage/features/vision.mdx +2 -2
  163. package/docs/usage/features/vision.zh-CN.mdx +2 -2
  164. package/docs/usage/foundation/basic.mdx +7 -18
  165. package/docs/usage/foundation/basic.zh-CN.mdx +6 -16
  166. package/docs/usage/foundation/share.mdx +3 -13
  167. package/docs/usage/foundation/share.zh-CN.mdx +3 -13
  168. package/docs/usage/foundation/text2image.mdx +3 -12
  169. package/docs/usage/foundation/text2image.zh-CN.mdx +3 -12
  170. package/docs/usage/foundation/translate.mdx +3 -13
  171. package/docs/usage/foundation/translate.zh-CN.mdx +3 -13
  172. package/docs/usage/foundation/tts-stt.mdx +3 -12
  173. package/docs/usage/foundation/tts-stt.zh-CN.mdx +3 -12
  174. package/docs/usage/foundation/vision.mdx +4 -16
  175. package/docs/usage/foundation/vision.zh-CN.mdx +4 -16
  176. package/docs/usage/plugins/basic-usage.mdx +7 -30
  177. package/docs/usage/plugins/basic-usage.zh-CN.mdx +7 -30
  178. package/docs/usage/plugins/development.mdx +30 -78
  179. package/docs/usage/plugins/development.zh-CN.mdx +31 -79
  180. package/docs/usage/plugins/store.mdx +2 -10
  181. package/docs/usage/plugins/store.zh-CN.mdx +2 -10
  182. package/docs/usage/providers/ai21.mdx +17 -33
  183. package/docs/usage/providers/ai21.zh-CN.mdx +17 -33
  184. package/docs/usage/providers/ai360.mdx +17 -33
  185. package/docs/usage/providers/ai360.zh-CN.mdx +20 -36
  186. package/docs/usage/providers/anthropic.mdx +23 -45
  187. package/docs/usage/providers/anthropic.zh-CN.mdx +22 -44
  188. package/docs/usage/providers/azure.mdx +21 -51
  189. package/docs/usage/providers/azure.zh-CN.mdx +19 -48
  190. package/docs/usage/providers/baichuan.mdx +16 -34
  191. package/docs/usage/providers/baichuan.zh-CN.mdx +15 -33
  192. package/docs/usage/providers/bedrock.mdx +38 -87
  193. package/docs/usage/providers/bedrock.zh-CN.mdx +37 -86
  194. package/docs/usage/providers/cloudflare.mdx +25 -48
  195. package/docs/usage/providers/cloudflare.zh-CN.mdx +24 -45
  196. package/docs/usage/providers/deepseek.mdx +25 -51
  197. package/docs/usage/providers/deepseek.zh-CN.mdx +24 -50
  198. package/docs/usage/providers/fireworksai.mdx +23 -43
  199. package/docs/usage/providers/fireworksai.zh-CN.mdx +21 -41
  200. package/docs/usage/providers/gemini.mdx +20 -46
  201. package/docs/usage/providers/gemini.zh-CN.mdx +20 -46
  202. package/docs/usage/providers/giteeai.mdx +24 -45
  203. package/docs/usage/providers/giteeai.zh-CN.mdx +22 -43
  204. package/docs/usage/providers/github.mdx +19 -45
  205. package/docs/usage/providers/github.zh-CN.mdx +19 -44
  206. package/docs/usage/providers/groq.mdx +12 -29
  207. package/docs/usage/providers/groq.zh-CN.mdx +11 -28
  208. package/docs/usage/providers/hunyuan.mdx +19 -39
  209. package/docs/usage/providers/hunyuan.zh-CN.mdx +18 -38
  210. package/docs/usage/providers/internlm.mdx +21 -38
  211. package/docs/usage/providers/internlm.zh-CN.mdx +19 -36
  212. package/docs/usage/providers/minimax.mdx +24 -50
  213. package/docs/usage/providers/minimax.zh-CN.mdx +22 -48
  214. package/docs/usage/providers/mistral.mdx +21 -39
  215. package/docs/usage/providers/mistral.zh-CN.mdx +20 -38
  216. package/docs/usage/providers/moonshot.mdx +20 -38
  217. package/docs/usage/providers/moonshot.zh-CN.mdx +19 -37
  218. package/docs/usage/providers/novita.mdx +20 -43
  219. package/docs/usage/providers/novita.zh-CN.mdx +19 -42
  220. package/docs/usage/providers/ollama/gemma.mdx +12 -29
  221. package/docs/usage/providers/ollama/gemma.zh-CN.mdx +12 -30
  222. package/docs/usage/providers/ollama/qwen.mdx +17 -32
  223. package/docs/usage/providers/ollama/qwen.zh-CN.mdx +12 -27
  224. package/docs/usage/providers/ollama.mdx +67 -99
  225. package/docs/usage/providers/ollama.zh-CN.mdx +67 -99
  226. package/docs/usage/providers/openai.mdx +42 -56
  227. package/docs/usage/providers/openai.zh-CN.mdx +39 -52
  228. package/docs/usage/providers/openrouter.mdx +48 -84
  229. package/docs/usage/providers/openrouter.zh-CN.mdx +31 -67
  230. package/docs/usage/providers/perplexity.mdx +16 -34
  231. package/docs/usage/providers/perplexity.zh-CN.mdx +16 -34
  232. package/docs/usage/providers/qwen.mdx +26 -52
  233. package/docs/usage/providers/qwen.zh-CN.mdx +25 -51
  234. package/docs/usage/providers/sensenova.mdx +24 -45
  235. package/docs/usage/providers/sensenova.zh-CN.mdx +22 -43
  236. package/docs/usage/providers/siliconcloud.mdx +17 -33
  237. package/docs/usage/providers/siliconcloud.zh-CN.mdx +17 -33
  238. package/docs/usage/providers/spark.mdx +20 -40
  239. package/docs/usage/providers/spark.zh-CN.mdx +19 -39
  240. package/docs/usage/providers/stepfun.mdx +17 -35
  241. package/docs/usage/providers/stepfun.zh-CN.mdx +17 -35
  242. package/docs/usage/providers/taichu.mdx +16 -34
  243. package/docs/usage/providers/taichu.zh-CN.mdx +15 -33
  244. package/docs/usage/providers/togetherai.mdx +18 -40
  245. package/docs/usage/providers/togetherai.zh-CN.mdx +18 -40
  246. package/docs/usage/providers/upstage.mdx +18 -34
  247. package/docs/usage/providers/upstage.zh-CN.mdx +17 -33
  248. package/docs/usage/providers/wenxin.mdx +22 -42
  249. package/docs/usage/providers/wenxin.zh-CN.mdx +20 -40
  250. package/docs/usage/providers/xai.mdx +21 -38
  251. package/docs/usage/providers/xai.zh-CN.mdx +20 -37
  252. package/docs/usage/providers/zeroone.mdx +22 -48
  253. package/docs/usage/providers/zeroone.zh-CN.mdx +22 -48
  254. package/docs/usage/providers/zhipu.mdx +17 -35
  255. package/docs/usage/providers/zhipu.zh-CN.mdx +18 -34
  256. package/docs/usage/providers.mdx +1 -6
  257. package/docs/usage/providers.zh-CN.mdx +1 -6
  258. package/docs/usage/start.mdx +4 -18
  259. package/docs/usage/start.zh-CN.mdx +2 -19
  260. package/docs/usage/tools-calling/anthropic.mdx +18 -51
  261. package/docs/usage/tools-calling/anthropic.zh-CN.mdx +22 -55
  262. package/docs/usage/tools-calling/google.mdx +16 -23
  263. package/docs/usage/tools-calling/google.zh-CN.mdx +17 -24
  264. package/docs/usage/tools-calling/groq.mdx +9 -0
  265. package/docs/usage/tools-calling/groq.zh-CN.mdx +44 -70
  266. package/docs/usage/tools-calling/moonshot.mdx +9 -0
  267. package/docs/usage/tools-calling/openai.mdx +19 -44
  268. package/docs/usage/tools-calling/openai.zh-CN.mdx +20 -45
  269. package/docs/usage/tools-calling.mdx +9 -0
  270. package/docs/usage/tools-calling.zh-CN.mdx +60 -68
  271. package/package.json +42 -41
  272. package/scripts/mdxWorkflow/index.ts +7 -0
  273. package/src/app/(main)/(mobile)/me/(home)/features/Header.tsx +2 -1
  274. package/src/app/(main)/(mobile)/me/data/features/Header.tsx +1 -1
  275. package/src/app/(main)/(mobile)/me/profile/features/Header.tsx +1 -1
  276. package/src/app/(main)/(mobile)/me/settings/features/Header.tsx +1 -1
  277. package/src/app/(main)/@nav/_layout/Mobile.tsx +2 -1
  278. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/SystemRoleContent.tsx +2 -1
  279. package/src/app/(main)/chat/(workspace)/@topic/features/TopicListContent/ByTimeMode/GroupItem.tsx +2 -2
  280. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +2 -1
  281. package/src/app/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/index.tsx +1 -1
  282. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/ChatHeaderTitle.tsx +2 -1
  283. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +1 -1
  284. package/src/app/(main)/chat/@session/_layout/Mobile/SessionHeader.tsx +2 -1
  285. package/src/app/(main)/chat/settings/_layout/Desktop/Header.tsx +1 -1
  286. package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +1 -1
  287. package/src/app/(main)/discover/(detail)/provider/[slug]/features/InfoSidebar/SuggestionItem.tsx +8 -6
  288. package/src/app/(main)/discover/(list)/_layout/Desktop/Nav.tsx +1 -1
  289. package/src/app/(main)/discover/(list)/_layout/Mobile/Header.tsx +2 -1
  290. package/src/app/(main)/discover/_layout/Desktop/Header.tsx +1 -1
  291. package/src/app/(main)/discover/components/VirtuosoGridList/index.tsx +9 -5
  292. package/src/app/(main)/discover/search/_layout/Mobile/Header.tsx +1 -1
  293. package/src/app/(main)/files/(content)/@menu/features/KnowledgeBase/EmptyStatus.tsx +21 -13
  294. package/src/app/(main)/repos/[id]/evals/evaluation/EvaluationList/index.tsx +1 -1
  295. package/src/app/(main)/settings/sync/features/DeviceInfo/SystemIcon.tsx +2 -0
  296. package/src/components/Branding/ProductLogo/Custom.tsx +19 -20
  297. package/src/components/BrowserIcon/index.tsx +19 -30
  298. package/src/components/BubblesLoading/index.tsx +31 -23
  299. package/src/components/FunctionModal/createModalHooks.ts +6 -3
  300. package/src/components/StopLoading.tsx +10 -7
  301. package/src/database/repositories/aiInfra/index.ts +19 -7
  302. package/src/database/server/models/__tests__/aiModel.test.ts +4 -6
  303. package/src/database/server/models/aiModel.ts +6 -3
  304. package/src/features/ChatInput/Desktop/InputArea/index.tsx +2 -2
  305. package/src/features/InitClientDB/EnableModal.tsx +2 -2
  306. package/src/features/InitClientDB/{PGliteSVG.tsx → PGliteIcon.tsx} +17 -11
  307. package/src/features/ShareModal/ShareImage/index.tsx +32 -22
  308. package/src/features/ShareModal/ShareJSON/Preview.tsx +2 -2
  309. package/src/features/ShareModal/ShareJSON/index.tsx +49 -37
  310. package/src/features/ShareModal/ShareText/Preview.tsx +4 -1
  311. package/src/features/ShareModal/ShareText/index.tsx +49 -38
  312. package/src/features/ShareModal/index.tsx +1 -1
  313. package/src/features/ShareModal/style.ts +30 -0
  314. package/src/store/aiInfra/slices/aiProvider/action.ts +1 -1
  315. package/src/types/aiProvider.ts +1 -0
  316. package/src/utils/colorUtils.ts +1 -1
  317. package/src/components/BrowserIcon/components/Brave.tsx +0 -56
  318. package/src/components/BrowserIcon/components/Chrome.tsx +0 -14
  319. package/src/components/BrowserIcon/components/Chromium.tsx +0 -14
  320. package/src/components/BrowserIcon/components/Edge.tsx +0 -36
  321. package/src/components/BrowserIcon/components/Firefox.tsx +0 -38
  322. package/src/components/BrowserIcon/components/Opera.tsx +0 -19
  323. package/src/components/BrowserIcon/components/Safari.tsx +0 -23
  324. package/src/components/BrowserIcon/components/Samsung.tsx +0 -21
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { ChatHeader } from '@lobehub/ui';
3
+ import { ChatHeader } from '@lobehub/ui/chat';
4
4
  import { Button } from 'antd';
5
5
  import { createStyles } from 'antd-style';
6
6
  import Link from 'next/link';
@@ -1,6 +1,7 @@
1
1
  'use client';
2
2
 
3
- import { ActionIcon, MobileNavBar } from '@lobehub/ui';
3
+ import { ActionIcon } from '@lobehub/ui';
4
+ import { MobileNavBar } from '@lobehub/ui/mobile';
4
5
  import { createStyles } from 'antd-style';
5
6
  import { SearchIcon } from 'lucide-react';
6
7
  import { memo, useState } from 'react';
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { ChatHeader } from '@lobehub/ui';
3
+ import { ChatHeader } from '@lobehub/ui/chat';
4
4
  import Link from 'next/link';
5
5
  import { memo } from 'react';
6
6
 
@@ -1,5 +1,5 @@
1
- import { Grid } from '@lobehub/ui';
2
- import { memo } from 'react';
1
+ import { DivProps, Grid } from '@lobehub/ui';
2
+ import { forwardRef, memo } from 'react';
3
3
  import { Flexbox } from 'react-layout-kit';
4
4
  import { VirtuosoGrid, VirtuosoGridProps } from 'react-virtuoso';
5
5
 
@@ -10,7 +10,11 @@ export const VirtuosoList = memo<VirtuosoGridProps<any, any>>(({ data, ...rest }
10
10
  const initialItemCount = data && data?.length >= 8 ? 8 : data?.length;
11
11
  return (
12
12
  <VirtuosoGrid
13
- components={{ List: (props, ref) => <Flexbox gap={16} ref={ref} {...props} /> }}
13
+ components={{
14
+ List: forwardRef<HTMLDivElement, DivProps>((props, ref) => (
15
+ <Flexbox gap={16} ref={ref} {...props} />
16
+ )),
17
+ }}
14
18
  customScrollParent={scrollParent}
15
19
  data={data}
16
20
  initialItemCount={initialItemCount}
@@ -31,9 +35,9 @@ const VirtuosoGridList = memo<VirtuosoGridProps<any, any>>(
31
35
  return (
32
36
  <VirtuosoGrid
33
37
  components={{
34
- List: (props, ref) => (
38
+ List: forwardRef<HTMLDivElement, DivProps>((props, ref) => (
35
39
  <Grid gap={16} maxItemWidth={280} ref={ref} rows={rows} {...props} />
36
- ),
40
+ )),
37
41
  }}
38
42
  customScrollParent={scrollParent}
39
43
  data={data}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { MobileNavBar } from '@lobehub/ui';
3
+ import { MobileNavBar } from '@lobehub/ui/mobile';
4
4
  import { useRouter } from 'next/navigation';
5
5
  import { memo } from 'react';
6
6
  import urlJoin from 'url-join';
@@ -1,5 +1,6 @@
1
+ import type { IconType } from '@lobehub/icons';
1
2
  import { createStyles } from 'antd-style';
2
- import React from 'react';
3
+ import { forwardRef, memo } from 'react';
3
4
  import { Trans } from 'react-i18next';
4
5
  import { Flexbox } from 'react-layout-kit';
5
6
 
@@ -21,7 +22,23 @@ const useStyles = createStyles(({ css, token }) => ({
21
22
  }
22
23
  `,
23
24
  }));
24
- const EmptyStatus = () => {
25
+
26
+ const LineIcon: IconType = forwardRef(({ size = 130, style, ...rest }, ref) => (
27
+ <svg
28
+ fill="currentColor"
29
+ fillRule="evenodd"
30
+ ref={ref}
31
+ style={{ flex: 'none', lineHeight: 1, ...style }}
32
+ viewBox="0 0 126 64"
33
+ width={size}
34
+ xmlns="http://www.w3.org/2000/svg"
35
+ {...rest}
36
+ >
37
+ <path d="M.5 63a.5.5 0 001 0h-1zM122 1l-2.887 5h5.774L122 1zM1.5 62.042a.5.5 0 10-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 101 0h-1zm1-1.916a.5.5 0 10-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 101 0h-1zm1.063-1.938a.5.5 0 10-.991-.13l.991.13zm-.418-2.274a.5.5 0 00.924.383l-.924-.383zm1.904-1.312a.5.5 0 10-.793-.609l.793.61zm.776-2.178a.5.5 0 00.61.793l-.61-.793zm2.304-.187a.5.5 0 00-.383-.924l.383.924zm1.761-1.497a.5.5 0 00.13.991l-.13-.991zm2.12.928a.5.5 0 100-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 000-1v1zm2.018-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.019-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.018-1a.5.5 0 100 1v-1zm2.02 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.018-1a.5.5 0 100 1v-1zm2.02 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 000-1v1zm2.018-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.019-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.12.928a.501.501 0 00-.13-.991l.13.991zm1.761-1.497a.501.501 0 00.383.924l-.383-.924zm2.304-.187a.5.5 0 00-.609-.793l.609.793zm.776-2.178a.5.5 0 10.793.609l-.793-.61zm1.904-1.312a.5.5 0 10-.924-.383l.924.383zm-.418-2.274a.5.5 0 10.991.13l-.991-.13zm1.063-1.938a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.916a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zM1.5 63v-.958h-1V63h1zm0-2.875v-1.917h-1v1.917h1zm0-3.833v-1.917h-1v1.917h1zm0-3.834v-1.916h-1v1.916h1zm0-3.833v-1.917h-1v1.917h1zm0-3.833v-1.917h-1v1.917h1zm0-3.834V40h-1v.958h1zm0-.958c0-.333.022-.66.063-.98l-.991-.13A8.574 8.574 0 00.5 40h1zm.569-2.87c.253-.61.584-1.18.98-1.696l-.793-.609a8.49 8.49 0 00-1.11 1.921l.923.383zm2.365-3.08a7.487 7.487 0 011.695-.981l-.383-.924a8.495 8.495 0 00-1.92 1.111l.608.793zm3.586-1.487c.32-.041.648-.063.98-.063v-1c-.376 0-.746.024-1.11.072l.13.991zM9 32.5h1.01v-1H9v1zm3.029 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.019v-1h-2.019v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.019v1zm4.038 0H114v-1h-1.01v1zm1.01 0c.376 0 .746-.024 1.11-.072l-.13-.991c-.32.041-.648.063-.98.063v1zm3.254-.645a8.506 8.506 0 001.921-1.111l-.609-.793a7.519 7.519 0 01-1.695.98l.383.924zm3.49-2.68a8.516 8.516 0 001.111-1.921l-.924-.383a7.527 7.527 0 01-.98 1.695l.793.609zm1.684-4.066c.048-.363.072-.733.072-1.109h-1c0 .332-.022.66-.063.98l.991.13zM122.5 24v-.958h-1V24h1zm0-2.875v-1.917h-1v1.917h1zm0-3.833v-1.917h-1v1.917h1zm0-3.834v-1.916h-1v1.916h1zm0-3.833V7.708h-1v1.917h1zm0-3.833V3.875h-1v1.917h1z"></path>
38
+ </svg>
39
+ ));
40
+
41
+ const EmptyStatus = memo(() => {
25
42
  const { styles } = useStyles();
26
43
  return (
27
44
  <Flexbox
@@ -31,16 +48,7 @@ const EmptyStatus = () => {
31
48
  paddingInline={20}
32
49
  width={'100%'}
33
50
  >
34
- <svg
35
- fill="currentColor"
36
- fillRule="evenodd"
37
- style={{ flex: 'none', height: 'fit-content', lineHeight: 1 }}
38
- viewBox="0 0 126 64"
39
- width={130}
40
- xmlns="http://www.w3.org/2000/svg"
41
- >
42
- <path d="M.5 63a.5.5 0 001 0h-1zM122 1l-2.887 5h5.774L122 1zM1.5 62.042a.5.5 0 10-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 101 0h-1zm1-1.916a.5.5 0 10-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 101 0h-1zm1.063-1.938a.5.5 0 10-.991-.13l.991.13zm-.418-2.274a.5.5 0 00.924.383l-.924-.383zm1.904-1.312a.5.5 0 10-.793-.609l.793.61zm.776-2.178a.5.5 0 00.61.793l-.61-.793zm2.304-.187a.5.5 0 00-.383-.924l.383.924zm1.761-1.497a.5.5 0 00.13.991l-.13-.991zm2.12.928a.5.5 0 100-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 000-1v1zm2.018-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.019-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.018-1a.5.5 0 100 1v-1zm2.02 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.018-1a.5.5 0 100 1v-1zm2.02 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 000-1v1zm2.018-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 100-1v1zm2.019-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.02-1a.5.5 0 100 1v-1zm2.018 1a.5.5 0 100-1v1zm2.02-1a.5.5 0 100 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.02 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.019 1a.5.5 0 000-1v1zm2.019-1a.5.5 0 000 1v-1zm2.12.928a.501.501 0 00-.13-.991l.13.991zm1.761-1.497a.501.501 0 00.383.924l-.383-.924zm2.304-.187a.5.5 0 00-.609-.793l.609.793zm.776-2.178a.5.5 0 10.793.609l-.793-.61zm1.904-1.312a.5.5 0 10-.924-.383l.924.383zm-.418-2.274a.5.5 0 10.991.13l-.991-.13zm1.063-1.938a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.916a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.916a.5.5 0 001 0h-1zm1-1.917a.5.5 0 00-1 0h1zm-1-1.917a.5.5 0 001 0h-1zM1.5 63v-.958h-1V63h1zm0-2.875v-1.917h-1v1.917h1zm0-3.833v-1.917h-1v1.917h1zm0-3.834v-1.916h-1v1.916h1zm0-3.833v-1.917h-1v1.917h1zm0-3.833v-1.917h-1v1.917h1zm0-3.834V40h-1v.958h1zm0-.958c0-.333.022-.66.063-.98l-.991-.13A8.574 8.574 0 00.5 40h1zm.569-2.87c.253-.61.584-1.18.98-1.696l-.793-.609a8.49 8.49 0 00-1.11 1.921l.923.383zm2.365-3.08a7.487 7.487 0 011.695-.981l-.383-.924a8.495 8.495 0 00-1.92 1.111l.608.793zm3.586-1.487c.32-.041.648-.063.98-.063v-1c-.376 0-.746.024-1.11.072l.13.991zM9 32.5h1.01v-1H9v1zm3.029 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.02v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.02v1zm4.038 0h2.019v-1h-2.019v1zm4.038 0h2.02v-1h-2.02v1zm4.039 0h2.019v-1h-2.019v1zm4.038 0H114v-1h-1.01v1zm1.01 0c.376 0 .746-.024 1.11-.072l-.13-.991c-.32.041-.648.063-.98.063v1zm3.254-.645a8.506 8.506 0 001.921-1.111l-.609-.793a7.519 7.519 0 01-1.695.98l.383.924zm3.49-2.68a8.516 8.516 0 001.111-1.921l-.924-.383a7.527 7.527 0 01-.98 1.695l.793.609zm1.684-4.066c.048-.363.072-.733.072-1.109h-1c0 .332-.022.66-.063.98l.991.13zM122.5 24v-.958h-1V24h1zm0-2.875v-1.917h-1v1.917h1zm0-3.833v-1.917h-1v1.917h1zm0-3.834v-1.916h-1v1.916h1zm0-3.833V7.708h-1v1.917h1zm0-3.833V3.875h-1v1.917h1z"></path>
43
- </svg>
51
+ <LineIcon />
44
52
  <Flexbox align={'center'} className={styles.paragraph} horizontal>
45
53
  <Trans i18nKey={'knowledgeBase.list.empty'} ns={'file'}>
46
54
  点击 <kbd>+</kbd> 开始创建知识库
@@ -48,6 +56,6 @@ const EmptyStatus = () => {
48
56
  </Flexbox>
49
57
  </Flexbox>
50
58
  );
51
- };
59
+ });
52
60
 
53
61
  export default EmptyStatus;
@@ -45,7 +45,7 @@ const EvaluationList = ({ knowledgeBaseId }: { knowledgeBaseId: string }) => {
45
45
  ]);
46
46
  const [isCheckingStatus, setCheckingStatus] = useState(false);
47
47
  const { modal } = App.useApp();
48
- const actionRef = useRef<ActionType>();
48
+ const actionRef = useRef<ActionType>(null);
49
49
 
50
50
  const columns: ProColumns<RAGEvalEvaluationItem>[] = [
51
51
  {
@@ -13,6 +13,8 @@ const SystemIcon = memo<{ title?: string }>(({ title }) => {
13
13
 
14
14
  if (['Mac OS', 'iOS', 'iPadOS'].includes(title)) return <SiApple size={24} />;
15
15
 
16
+ // Remove Microsoft brands in @icons-pack/react-simple-icons v10
17
+ // https://github.com/simple-icons/simple-icons/pull/10019
16
18
  if (['Windows'].includes(title)) return <SiWindows11 size={24} />;
17
19
 
18
20
  if (title === 'Android') return <SiAndroid size={24} />;
@@ -1,8 +1,8 @@
1
- import type { DivProps, SvgProps } from '@lobehub/ui';
1
+ import type { IconType } from '@lobehub/icons';
2
2
  import type { LobeChatProps } from '@lobehub/ui/brand';
3
3
  import { createStyles, useTheme } from 'antd-style';
4
4
  import Image, { ImageProps } from 'next/image';
5
- import { ReactNode, memo } from 'react';
5
+ import { ReactNode, forwardRef, memo } from 'react';
6
6
  import { Flexbox, FlexboxProps } from 'react-layout-kit';
7
7
 
8
8
  import { BRANDING_LOGO_URL, BRANDING_NAME } from '@/const/branding';
@@ -48,24 +48,23 @@ const CustomImageLogo = memo<Omit<ImageProps, 'alt' | 'src'> & { size: number }>
48
48
  },
49
49
  );
50
50
 
51
- const Divider = memo<SvgProps & DivProps & { size?: number }>(
52
- ({ size = '1em', style, ...rest }) => (
53
- <svg
54
- fill="none"
55
- height={size}
56
- shapeRendering="geometricPrecision"
57
- stroke="currentColor"
58
- strokeLinecap="round"
59
- strokeLinejoin="round"
60
- style={{ flex: 'none', lineHeight: 1, ...style }}
61
- viewBox="0 0 24 24"
62
- width={size}
63
- {...rest}
64
- >
65
- <path d="M16.88 3.549L7.12 20.451" />
66
- </svg>
67
- ),
68
- );
51
+ const Divider: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => (
52
+ <svg
53
+ fill="none"
54
+ height={size}
55
+ ref={ref}
56
+ shapeRendering="geometricPrecision"
57
+ stroke="currentColor"
58
+ strokeLinecap="round"
59
+ strokeLinejoin="round"
60
+ style={{ flex: 'none', lineHeight: 1, ...style }}
61
+ viewBox="0 0 24 24"
62
+ width={size}
63
+ {...rest}
64
+ >
65
+ <path d="M16.88 3.549L7.12 20.451" />
66
+ </svg>
67
+ ));
69
68
 
70
69
  const CustomLogo = memo<LobeChatProps>(({ extra, size = 32, className, style, type, ...rest }) => {
71
70
  const theme = useTheme();
@@ -1,24 +1,24 @@
1
+ import {
2
+ SiBrave,
3
+ SiFirefox,
4
+ SiGooglechrome,
5
+ SiMicrosoftedge,
6
+ SiOpera,
7
+ SiSafari,
8
+ SiSamsung,
9
+ } from '@icons-pack/react-simple-icons';
1
10
  import React, { memo } from 'react';
2
11
 
3
- import Brave from './components/Brave';
4
- import Chrome from './components/Chrome';
5
- import Chromium from './components/Chromium';
6
- import Edge from './components/Edge';
7
- import Firefox from './components/Firefox';
8
- import Opera from './components/Opera';
9
- import Safari from './components/Safari';
10
- import Samsung from './components/Samsung';
11
-
12
12
  const lastVersion = {
13
- 'Brave': Brave,
14
- 'Chrome': Chrome,
15
- 'Chromium': Chromium,
16
- 'Edge': Edge,
17
- 'Firefox': Firefox,
18
- 'Mobile Safari': Safari,
19
- 'Opera': Opera,
20
- 'Safari': Safari,
21
- 'Samsung': Samsung,
13
+ 'Brave': SiBrave,
14
+ 'Chrome': SiGooglechrome,
15
+ 'Chromium': SiGooglechrome,
16
+ 'Edge': SiMicrosoftedge,
17
+ 'Firefox': SiFirefox,
18
+ 'Mobile Safari': SiSafari,
19
+ 'Opera': SiOpera,
20
+ 'Safari': SiSafari,
21
+ 'Samsung': SiSamsung,
22
22
  };
23
23
 
24
24
  export type Browsers = keyof typeof lastVersion;
@@ -35,16 +35,5 @@ export const BrowserIcon = memo<BrowserIconProps>(({ browser, className, style,
35
35
 
36
36
  if (!Component) return null;
37
37
 
38
- return (
39
- <Component
40
- className={className}
41
- height={size}
42
- style={{
43
- ...style,
44
- minHeight: size,
45
- minWidth: size,
46
- }}
47
- width={size}
48
- />
49
- );
38
+ return <Component className={className} size={size} style={style} />;
50
39
  });
@@ -1,61 +1,69 @@
1
+ import type { IconType } from '@lobehub/icons';
1
2
  import { css, cx, useTheme } from 'antd-style';
3
+ import { forwardRef, memo } from 'react';
2
4
  import { Center } from 'react-layout-kit';
3
5
 
4
6
  const container = css`
5
7
  circle {
6
8
  animation: bubble 1.5s cubic-bezier(0.05, 0.2, 0.35, 1) infinite;
7
- }
8
9
 
9
- circle:nth-child(2) {
10
- animation-delay: 0.3s;
11
- }
10
+ &:nth-child(2) {
11
+ animation-delay: 0.3s;
12
+ }
12
13
 
13
- circle:nth-child(3) {
14
- animation-delay: 0.6s;
14
+ &:nth-child(3) {
15
+ animation-delay: 0.6s;
16
+ }
15
17
  }
16
18
 
17
19
  @keyframes bubble {
18
20
  0% {
19
21
  opacity: 1;
20
-
21
- /* transform: translateY(0); */
22
22
  }
23
23
 
24
24
  25% {
25
25
  opacity: 0.5;
26
-
27
- /* transform: translateY(-4px); */
28
26
  }
29
27
 
30
28
  75% {
31
29
  opacity: 0.25;
32
-
33
- /* transform: translateY(4px); */
34
30
  }
35
31
 
36
32
  to {
37
33
  opacity: 1;
38
-
39
- /* transform: translateY(0); */
40
34
  }
41
35
  }
42
36
  `;
43
37
 
44
- const Svg = () => (
45
- <svg className={cx(container)} viewBox="0 0 60 32" xmlns="http://www.w3.org/2000/svg">
46
- <circle cx="7" cy="16" r="6"></circle>
47
- <circle cx="30" cy="16" r="6"></circle>
48
- <circle cx="53" cy="16" r="6"></circle>
49
- </svg>
38
+ const BubblesLoadingIcon: IconType = forwardRef(
39
+ ({ size = '1em', style, className, ...rest }, ref) => {
40
+ return (
41
+ <svg
42
+ className={cx(container, className)}
43
+ fill="currentColor"
44
+ fillRule="evenodd"
45
+ height={size}
46
+ ref={ref}
47
+ style={{ flex: 'none', lineHeight: 1, ...style }}
48
+ viewBox="0 0 60 32"
49
+ xmlns="http://www.w3.org/2000/svg"
50
+ {...rest}
51
+ >
52
+ <circle cx="7" cy="16" r="6"></circle>
53
+ <circle cx="30" cy="16" r="6"></circle>
54
+ <circle cx="53" cy="16" r="6"></circle>
55
+ </svg>
56
+ );
57
+ },
50
58
  );
51
59
 
52
- const BubblesLoading = () => {
60
+ const BubblesLoading = memo(() => {
53
61
  const theme = useTheme();
54
62
  return (
55
63
  <Center style={{ fill: theme.colorTextSecondary, height: 24, width: 32 }}>
56
- <Svg />
64
+ <BubblesLoadingIcon size={14} />
57
65
  </Center>
58
66
  );
59
- };
67
+ });
60
68
 
61
69
  export default BubblesLoading;
@@ -1,6 +1,6 @@
1
1
  import { App } from 'antd';
2
2
  import { ModalFuncProps } from 'antd/es/modal/interface';
3
- import { MutableRefObject, ReactNode, useRef } from 'react';
3
+ import { MutableRefObject, ReactNode, RefObject, useRef } from 'react';
4
4
 
5
5
  import { closeIcon, useStyles } from './style';
6
6
 
@@ -21,10 +21,13 @@ const createModal = <T>(params: CreateModalProps | PropsFunc<T>) => {
21
21
  const useModal = () => {
22
22
  const { styles } = useStyles();
23
23
  const { modal } = App.useApp();
24
- const instanceRef = useRef<ModalInstance>();
24
+ const instanceRef = useRef<ModalInstance>(null);
25
25
 
26
26
  const open = (outProps?: T) => {
27
- const props = typeof params === 'function' ? params(instanceRef, outProps) : params;
27
+ const props =
28
+ typeof params === 'function'
29
+ ? params(instanceRef as RefObject<ModalInstance>, outProps)
30
+ : params;
28
31
 
29
32
  instanceRef.current = modal.confirm({
30
33
  className: styles.content,
@@ -1,17 +1,20 @@
1
- import { useTheme } from 'antd-style';
2
- import { memo } from 'react';
1
+ import type { IconType } from '@lobehub/icons';
2
+ import { cx, useTheme } from 'antd-style';
3
+ import { forwardRef } from 'react';
3
4
 
4
- const StopLoadingIcon = memo(() => {
5
+ const StopLoadingIcon: IconType = forwardRef(({ size = 16, className, style, ...rest }, ref) => {
5
6
  const theme = useTheme();
6
7
  return (
7
8
  <svg
8
- className={'anticon'}
9
+ className={cx('anticon', className)}
9
10
  color="currentColor"
10
- height={16}
11
+ height={size}
12
+ ref={ref}
13
+ style={{ flex: 'none', lineHeight: 1, ...style }}
11
14
  viewBox="0 0 1024 1024"
12
- width={16}
15
+ width={size}
13
16
  xmlns="http://www.w3.org/2000/svg"
14
- xmlnsXlink="http://www.w3.org/1999/xlink"
17
+ {...rest}
15
18
  >
16
19
  <g fill="none">
17
20
  <circle cx="512" cy="512" fill="none" r="426" stroke={theme.colorBorder} strokeWidth="72" />
@@ -69,19 +69,28 @@ export class AiInfraRepos {
69
69
  const providers = await this.getAiProviderList();
70
70
  const enabledProviders = providers.filter((item) => item.enabled);
71
71
 
72
- const userEnabledModels = await this.aiModelModel.getEnabledModels();
72
+ const allModels = await this.aiModelModel.getAllModels();
73
+ const userEnabledModels = allModels.filter((item) => item.enabled);
74
+
73
75
  const modelList = await pMap(
74
76
  enabledProviders,
75
77
  async (provider) => {
76
78
  const aiModels = await this.fetchBuiltinModels(provider.id);
77
79
 
78
80
  return (aiModels || [])
79
- .filter((i) => i.enabled)
80
- .map<EnabledAiModel>((item) => ({
81
- ...item,
82
- abilities: item.abilities || {},
83
- providerId: provider.id,
84
- }));
81
+ .map<EnabledAiModel & { enabled?: boolean | null }>((item) => {
82
+ const user = allModels.find((m) => m.id === item.id && m.providerId === provider.id);
83
+
84
+ const enabled = !!user ? user.enabled : item.enabled;
85
+
86
+ return {
87
+ ...item,
88
+ abilities: item.abilities || {},
89
+ enabled,
90
+ providerId: provider.id,
91
+ };
92
+ })
93
+ .filter((i) => i.enabled);
85
94
  },
86
95
  { concurrency: 10 },
87
96
  );
@@ -100,6 +109,9 @@ export class AiInfraRepos {
100
109
  return mergeArrayById(defaultModels, aiModels) as AiProviderModelListItem[];
101
110
  };
102
111
 
112
+ /**
113
+ * Fetch builtin models from config
114
+ */
103
115
  private fetchBuiltinModels = async (
104
116
  providerId: string,
105
117
  ): Promise<AiProviderModelListItem[] | undefined> => {
@@ -193,17 +193,15 @@ describe('AiModelModel', () => {
193
193
  });
194
194
  });
195
195
 
196
- describe('getEnabledModels', () => {
196
+ describe('getAllModels', () => {
197
197
  it('should only return enabled models', async () => {
198
198
  await serverDB.insert(aiModels).values([
199
199
  { id: 'model1', providerId: 'openai', enabled: true, source: 'custom', userId },
200
- { id: 'model2', providerId: 'openai', enabled: false, source: 'custom', userId },
200
+ { id: 'model2', providerId: 'b', enabled: false, source: 'custom', userId },
201
201
  ]);
202
202
 
203
- const models = await aiProviderModel.getEnabledModels();
204
- expect(models).toHaveLength(1);
205
- expect(models[0].id).toBe('model1');
206
- expect(models[0].enabled).toBe(true);
203
+ const models = await aiProviderModel.getAllModels();
204
+ expect(models).toHaveLength(2);
207
205
  });
208
206
  });
209
207
 
@@ -8,6 +8,7 @@ import {
8
8
  AiProviderModelListItem,
9
9
  ToggleAiModelEnableParams,
10
10
  } from '@/types/aiModel';
11
+ import { EnabledAiModel } from '@/types/aiProvider';
11
12
 
12
13
  import { AiModelSelectItem, NewAiModelItem, aiModels } from '../../schemas';
13
14
 
@@ -83,8 +84,8 @@ export class AiModelModel {
83
84
  return result as AiProviderModelListItem[];
84
85
  };
85
86
 
86
- getEnabledModels = async () => {
87
- return this.db
87
+ getAllModels = async () => {
88
+ const data = await this.db
88
89
  .select({
89
90
  abilities: aiModels.abilities,
90
91
  config: aiModels.config,
@@ -98,7 +99,9 @@ export class AiModelModel {
98
99
  type: aiModels.type,
99
100
  })
100
101
  .from(aiModels)
101
- .where(and(eq(aiModels.userId, this.userId), eq(aiModels.enabled, true)));
102
+ .where(and(eq(aiModels.userId, this.userId)));
103
+
104
+ return data as EnabledAiModel[];
102
105
  };
103
106
 
104
107
  findById = async (id: string) => {
@@ -1,7 +1,7 @@
1
1
  import { TextArea } from '@lobehub/ui';
2
2
  import { createStyles } from 'antd-style';
3
3
  import { TextAreaRef } from 'antd/es/input/TextArea';
4
- import { memo, useEffect, useRef } from 'react';
4
+ import { RefObject, memo, useEffect, useRef } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
7
7
  import { useUserStore } from '@/store/user';
@@ -45,7 +45,7 @@ const InputArea = memo<InputAreaProps>(({ onSend, value, loading, onChange }) =>
45
45
 
46
46
  const useCmdEnterToSend = useUserStore(preferenceSelectors.useCmdEnterToSend);
47
47
 
48
- useAutoFocus(ref);
48
+ useAutoFocus(ref as RefObject<TextAreaRef>);
49
49
 
50
50
  const hasValue = !!value;
51
51
 
@@ -9,7 +9,7 @@ import { Center, Flexbox } from 'react-layout-kit';
9
9
  import DataStyleModal from '@/components/DataStyleModal';
10
10
  import { useGlobalStore } from '@/store/global';
11
11
 
12
- import { PGliteSVG } from './PGliteSVG';
12
+ import PGliteIcon from './PGliteIcon';
13
13
 
14
14
  const useStyles = createStyles(({ css, token, isDarkMode, responsive }) => ({
15
15
  desc: css`
@@ -59,7 +59,7 @@ const EnableClientDBModal = memo<EnableClientDBModalProps>(({ open }) => {
59
59
  const markPgliteEnabled = useGlobalStore((s) => s.markPgliteEnabled);
60
60
  const features = [
61
61
  {
62
- avatar: PGliteSVG,
62
+ avatar: PGliteIcon,
63
63
  desc: t('clientDB.modal.features.pglite.desc'),
64
64
  title: t('clientDB.modal.features.pglite.title'),
65
65
  },
@@ -1,22 +1,28 @@
1
- import { LucideIcon, LucideProps } from 'lucide-react';
1
+ 'use client';
2
+
3
+ import type { IconType } from '@lobehub/icons';
2
4
  import { forwardRef } from 'react';
3
5
 
4
- // @ts-expect-error 类型感觉不对,未来修正
5
- export const PGliteSVG: LucideIcon = forwardRef<SVGElement, Partial<Omit<LucideProps, 'ref'>>>(
6
- ({ size }, ref) => (
6
+ const PGliteIcon: IconType = forwardRef(({ size = '1em', style, ...rest }, ref) => {
7
+ return (
7
8
  <svg
8
9
  fill="currentColor"
10
+ fillRule="evenodd"
9
11
  height={size}
10
- ref={ref as any}
11
- viewBox={'0 0 1024 1024'}
12
+ ref={ref}
13
+ style={{ flex: 'none', lineHeight: 1, ...style }}
14
+ viewBox="0 0 1024 1024"
12
15
  width={size}
13
16
  xmlns="http://www.w3.org/2000/svg"
17
+ {...rest}
14
18
  >
19
+ <title>PGlite</title>
15
20
  <path
16
21
  clip-rule="evenodd"
17
- d="M941.581 335.737v460.806c0 15.926-12.913 28.836-28.832 28.818l-115.283-.137c-15.243-.018-27.706-11.88-28.703-26.877.011-.569.018-1.138.018-1.711l-.004-172.904c0-47.745-38.736-86.451-86.454-86.451-46.245 0-84.052-36.359-86.342-82.068V191.496l201.708.149c79.484.058 143.892 64.553 143.892 144.092Zm-576-144.281v201.818c0 47.746 38.682 86.456 86.4 86.456h86.4v-5.796c0 66.816 54.13 120.98 120.902 120.98 28.617 0 51.815 23.213 51.815 51.848v149.644c0 .688.011 1.372.025 2.057-.943 15.065-13.453 26.992-28.746 26.992l-144.982-.007.986-201.586c.079-15.915-12.755-28.88-28.66-28.959-15.904-.079-28.861 12.763-28.94 28.678l-.986 201.741v.118l-172.174-.01V623.722c0-15.915-12.895-28.819-28.8-28.819-15.906 0-28.8 12.904-28.8 28.819v201.704l-143.642-.007c-15.905-.004-28.798-12.904-28.798-28.819V335.547c0-79.58 64.471-144.093 144.001-144.092l143.999.001Zm446.544 173.693c0-23.874-19.343-43.228-43.2-43.228-23.861 0-43.2 19.354-43.2 43.228 0 23.875 19.339 43.226 43.2 43.226 23.857 0 43.2-19.351 43.2-43.226Z"
18
- fill-rule="evenodd"
19
- />
22
+ d="M941.581 335.737v460.806c0 15.926-12.913 28.836-28.832 28.818l-115.283-.137c-15.243-.018-27.706-11.88-28.703-26.877.011-.569.018-1.138.018-1.711l-.004-172.904c0-47.745-38.736-86.451-86.454-86.451-46.245 0-84.052-36.359-86.342-82.068V191.496l201.708.149c79.484.058 143.892 64.553 143.892 144.092zm-576-144.281v201.818c0 47.746 38.682 86.456 86.4 86.456h86.4v-5.796c0 66.816 54.13 120.98 120.902 120.98 28.617 0 51.815 23.213 51.815 51.848v149.644c0 .688.011 1.372.025 2.057-.943 15.065-13.453 26.992-28.746 26.992l-144.982-.007.986-201.586c.079-15.915-12.755-28.88-28.66-28.959-15.904-.079-28.861 12.763-28.94 28.678l-.986 201.741v.118l-172.174-.01V623.722c0-15.915-12.895-28.819-28.8-28.819-15.906 0-28.8 12.904-28.8 28.819v201.704l-143.642-.007c-15.905-.004-28.798-12.904-28.798-28.819V335.547c0-79.58 64.471-144.093 144.001-144.092l143.999.001zm446.544 173.693c0-23.874-19.343-43.228-43.2-43.228-23.861 0-43.2 19.354-43.2 43.228 0 23.875 19.339 43.226 43.2 43.226 23.857 0 43.2-19.351 43.2-43.226z"
23
+ ></path>
20
24
  </svg>
21
- ),
22
- );
25
+ );
26
+ });
27
+
28
+ export default PGliteIcon;