@lobehub/chat 1.2.3 → 1.2.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,56 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ### [Version 1.2.5](https://github.com/lobehub/lobe-chat/compare/v1.2.4...v1.2.5)
6
+
7
+ <sup>Released on **2024-07-02**</sup>
8
+
9
+ #### 🐛 Bug Fixes
10
+
11
+ - **misc**: Fix clerk appearance is not applied correctly.
12
+
13
+ <br/>
14
+
15
+ <details>
16
+ <summary><kbd>Improvements and Fixes</kbd></summary>
17
+
18
+ #### What's fixed
19
+
20
+ - **misc**: Fix clerk appearance is not applied correctly, closes [#3105](https://github.com/lobehub/lobe-chat/issues/3105) ([cf9c145](https://github.com/lobehub/lobe-chat/commit/cf9c145))
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
+
30
+ ### [Version 1.2.4](https://github.com/lobehub/lobe-chat/compare/v1.2.3...v1.2.4)
31
+
32
+ <sup>Released on **2024-07-02**</sup>
33
+
34
+ #### 💄 Styles
35
+
36
+ - **misc**: Update ProviderAvatar for Baichuan & Stepfun.
37
+
38
+ <br/>
39
+
40
+ <details>
41
+ <summary><kbd>Improvements and Fixes</kbd></summary>
42
+
43
+ #### Styles
44
+
45
+ - **misc**: Update ProviderAvatar for Baichuan & Stepfun, closes [#3112](https://github.com/lobehub/lobe-chat/issues/3112) ([ae5987a](https://github.com/lobehub/lobe-chat/commit/ae5987a))
46
+
47
+ </details>
48
+
49
+ <div align="right">
50
+
51
+ [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
52
+
53
+ </div>
54
+
5
55
  ### [Version 1.2.3](https://github.com/lobehub/lobe-chat/compare/v1.2.2...v1.2.3)
6
56
 
7
57
  <sup>Released on **2024-07-01**</sup>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/chat",
3
- "version": "1.2.3",
3
+ "version": "1.2.5",
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",
@@ -80,7 +80,11 @@
80
80
  "*.json": [
81
81
  "prettier --write --no-error-on-unmatched-pattern"
82
82
  ],
83
- "*.{js,jsx,mjs,cjs}": [
83
+ "*.{mjs,cjs}": [
84
+ "prettier --write",
85
+ "eslint --fix"
86
+ ],
87
+ "*.{js,jsx}": [
84
88
  "prettier --write",
85
89
  "stylelint --fix",
86
90
  "eslint --fix"
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  Anthropic,
3
+ Baichuan,
3
4
  DeepSeek,
4
5
  Google,
5
6
  Groq,
@@ -9,6 +10,7 @@ import {
9
10
  OpenAI,
10
11
  OpenRouter,
11
12
  Perplexity,
13
+ Stepfun,
12
14
  Together,
13
15
  Tongyi,
14
16
  ZeroOne,
@@ -55,6 +57,10 @@ const ProviderAvatar = memo<ProviderAvatarProps>(({ provider }) => {
55
57
  return <Anthropic color={Anthropic.colorPrimary} size={52} />;
56
58
  }
57
59
 
60
+ case ModelProvider.Baichuan: {
61
+ return <Baichuan color={Baichuan.colorPrimary} size={56} />;
62
+ }
63
+
58
64
  case ModelProvider.DeepSeek: {
59
65
  return <DeepSeek color={DeepSeek.colorPrimary} size={56} />;
60
66
  }
@@ -71,6 +77,10 @@ const ProviderAvatar = memo<ProviderAvatarProps>(({ provider }) => {
71
77
  return <Tongyi color={Tongyi.colorPrimary} size={56} />;
72
78
  }
73
79
 
80
+ case ModelProvider.Stepfun: {
81
+ return <Stepfun color={Stepfun.colorPrimary} size={56} />;
82
+ }
83
+
74
84
  case ModelProvider.TogetherAI: {
75
85
  return <Together color={Together.colorPrimary} size={56} />;
76
86
  }
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { ClerkProvider } from '@clerk/nextjs';
4
- import { PropsWithChildren, memo, useMemo } from 'react';
4
+ import { PropsWithChildren, memo, useEffect, useMemo, useState, useTransition } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
7
7
  import UserUpdater from './UserUpdater';
@@ -15,6 +15,18 @@ const Clerk = memo(({ children }: PropsWithChildren) => {
15
15
 
16
16
  const localization = useMemo(() => getResourceBundle(language, 'clerk'), [language]);
17
17
 
18
+ // When useAppearance returns different result during SSR vs. client-side (when theme mode is auto), the appearance is not applied
19
+ // It's because Clerk internally re-applies SSR props after transition which overrides client-side props, see https://github.com/clerk/javascript/blob/main/packages/nextjs/src/app-router/client/ClerkProvider.tsx
20
+ // This re-renders the provider after transition to make sure client-side props are always applied
21
+ const [, setCount] = useState(0);
22
+ const [isPending, startTransition] = useTransition();
23
+ useEffect(() => {
24
+ if (isPending) return;
25
+ startTransition(() => {
26
+ setCount((count) => count + 1);
27
+ });
28
+ }, [isPending, startTransition]);
29
+
18
30
  return (
19
31
  <ClerkProvider appearance={appearance} localization={localization}>
20
32
  {children}