@lobehub/chat 0.89.0 → 0.89.1
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 +25 -0
- package/locales/en_US/common.json +1 -0
- package/locales/en_US/error.json +2 -1
- package/locales/en_US/setting.json +5 -0
- package/locales/ja_JP/common.json +1 -0
- package/locales/ja_JP/error.json +2 -1
- package/locales/ja_JP/setting.json +5 -0
- package/locales/ko_KR/common.json +1 -0
- package/locales/ko_KR/error.json +2 -1
- package/locales/ko_KR/setting.json +5 -0
- package/locales/ru_RU/common.json +1 -0
- package/locales/ru_RU/error.json +2 -1
- package/locales/ru_RU/setting.json +5 -0
- package/locales/zh_CN/common.json +1 -0
- package/locales/zh_CN/error.json +1 -0
- package/locales/zh_CN/setting.json +5 -0
- package/locales/zh_TW/common.json +1 -0
- package/locales/zh_TW/error.json +2 -1
- package/locales/zh_TW/setting.json +5 -0
- package/next.config.mjs +0 -1
- package/package.json +1 -1
- package/src/app/chat/(mobile)/features/TopicList.tsx +1 -2
- package/src/app/home/index.tsx +3 -14
- package/src/app/market/(desktop)/features/AgentDetail.tsx +1 -2
- package/src/app/market/(desktop)/index.tsx +6 -3
- package/src/app/market/(mobile)/features/AgentDetail.tsx +1 -2
- package/src/app/market/(mobile)/index.tsx +8 -3
- package/src/app/market/features/AgentCard/index.tsx +4 -8
- package/src/app/market/features/TagList/index.tsx +16 -12
- package/src/app/market/index.tsx +1 -3
- package/src/app/welcome/features/Banner/Hero.tsx +10 -11
- package/src/app/welcome/features/Banner/index.tsx +1 -3
- package/src/components/FullscreenLoading/index.tsx +20 -0
- package/src/layout/ResponsiveLayout.client.tsx +9 -2
- package/src/locales/default/common.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
|
|
5
|
+
### [Version 0.89.1](https://github.com/lobehub/lobe-chat/compare/v0.89.0...v0.89.1)
|
|
6
|
+
|
|
7
|
+
<sup>Released on **2023-10-12**</sup>
|
|
8
|
+
|
|
9
|
+
#### 🐛 Bug Fixes
|
|
10
|
+
|
|
11
|
+
- **misc**: Remove useless dynamic import.
|
|
12
|
+
|
|
13
|
+
<br/>
|
|
14
|
+
|
|
15
|
+
<details>
|
|
16
|
+
<summary><kbd>Improvements and Fixes</kbd></summary>
|
|
17
|
+
|
|
18
|
+
#### What's fixed
|
|
19
|
+
|
|
20
|
+
- **misc**: Remove useless dynamic import ([4a9c426](https://github.com/lobehub/lobe-chat/commit/4a9c426))
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
24
|
+
<div align="right">
|
|
25
|
+
|
|
26
|
+
[](#readme-top)
|
|
27
|
+
|
|
28
|
+
</div>
|
|
29
|
+
|
|
5
30
|
## [Version 0.89.0](https://github.com/lobehub/lobe-chat/compare/v0.88.0...v0.89.0)
|
|
6
31
|
|
|
7
32
|
<sup>Released on **2023-10-12**</sup>
|
package/locales/en_US/error.json
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"unlock": {
|
|
32
32
|
"apikey": {
|
|
33
33
|
"title": "Use Custom API Key",
|
|
34
|
-
"description": "Enter your OpenAI API Key to start the conversation. The application will not record your API Key."
|
|
34
|
+
"description": "Enter your OpenAI API Key to start the conversation. The application will not record your API Key.",
|
|
35
|
+
"addProxyUrl": "Add OpenAI Proxy URL (optional)"
|
|
35
36
|
},
|
|
36
37
|
"confirm": "Confirm and Retry",
|
|
37
38
|
"password": {
|
|
@@ -75,6 +75,11 @@
|
|
|
75
75
|
"fetch": "Get list",
|
|
76
76
|
"title": "Azure OpenAI",
|
|
77
77
|
"serverConfig": "The administrator has enabled Azure OpenAI on the server side, switching is prohibited"
|
|
78
|
+
},
|
|
79
|
+
"customModelName": {
|
|
80
|
+
"desc": "Add custom models, separate multiple models with commas (,)",
|
|
81
|
+
"placeholder": "model1,model2,model3",
|
|
82
|
+
"title": "Custom Model Name"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
"waitingForMore": "<1>Access to other models is planned</1>, so stay tuned ✨"
|
package/locales/ja_JP/error.json
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"unlock": {
|
|
32
32
|
"apikey": {
|
|
33
33
|
"title": "カスタムAPIキーの使用",
|
|
34
|
-
"description": "OpenAI APIキーを入力すると、会話を開始できます。アプリはあなたのAPIキーを記録しません。"
|
|
34
|
+
"description": "OpenAI APIキーを入力すると、会話を開始できます。アプリはあなたのAPIキーを記録しません。",
|
|
35
|
+
"addProxyUrl": "OpenAIプロキシURLを追加(オプション)"
|
|
35
36
|
},
|
|
36
37
|
"closeMessage": "ヒントを閉じる",
|
|
37
38
|
"confirm": "確認して再試行",
|
|
@@ -75,6 +75,11 @@
|
|
|
75
75
|
"fetch": "リストを取得",
|
|
76
76
|
"serverConfig": "管理者がサーバー側でAzure OpenAIを設定しており、切り替えが禁止されています",
|
|
77
77
|
"title": "Azure OpenAI"
|
|
78
|
+
},
|
|
79
|
+
"customModelName": {
|
|
80
|
+
"desc": "カスタムモデルを追加します。複数のモデルはカンマ(,)で区切ってください",
|
|
81
|
+
"placeholder": "model1,model2,model3",
|
|
82
|
+
"title": "カスタムモデル名"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
"waitingForMore": "他のモデルは現在 <1>計画中</1> です。お楽しみに ✨"
|
package/locales/ko_KR/error.json
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"unlock": {
|
|
32
32
|
"apikey": {
|
|
33
33
|
"title": "사용자 정의 API 키 사용",
|
|
34
|
-
"description": "OpenAI API 키를 입력하면 대화를 시작할 수 있습니다. 애플리케이션은 API 키를 기록하지 않습니다."
|
|
34
|
+
"description": "OpenAI API 키를 입력하면 대화를 시작할 수 있습니다. 애플리케이션은 API 키를 기록하지 않습니다.",
|
|
35
|
+
"addProxyUrl": "OpenAI 프록시 주소 추가하기 (선택 사항)"
|
|
35
36
|
},
|
|
36
37
|
"closeMessage": "알림 닫기",
|
|
37
38
|
"confirm": "확인 및 다시 시도",
|
|
@@ -75,6 +75,11 @@
|
|
|
75
75
|
"fetch": "목록 가져오기",
|
|
76
76
|
"serverConfig": "관리자가 서버에서 Azure OpenAI를 구성했으므로 변경이 금지되었습니다.",
|
|
77
77
|
"title": "Azure OpenAI"
|
|
78
|
+
},
|
|
79
|
+
"customModelName": {
|
|
80
|
+
"desc": "사용자 정의 모델 추가, 여러 모델은 쉼표(,)로 구분합니다",
|
|
81
|
+
"placeholder": "model1,model2,model3",
|
|
82
|
+
"title": "사용자 정의 모델 이름"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
"waitingForMore": "더 많은 모델이 <1>계획 중</1>에 있으니 기대해주세요 ✨"
|
package/locales/ru_RU/error.json
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"unlock": {
|
|
32
32
|
"apikey": {
|
|
33
33
|
"title": "Использовать собственный ключ API",
|
|
34
|
-
"description": "Введите свой ключ API OpenAI, чтобы начать сеанс. Приложение не будет сохранять ваш ключ API."
|
|
34
|
+
"description": "Введите свой ключ API OpenAI, чтобы начать сеанс. Приложение не будет сохранять ваш ключ API.",
|
|
35
|
+
"addProxyUrl": "Добавить адрес прокси OpenAI (необязательно)"
|
|
35
36
|
},
|
|
36
37
|
"confirm": "Подтвердить и повторить попытку",
|
|
37
38
|
"password": {
|
|
@@ -75,6 +75,11 @@
|
|
|
75
75
|
"fetch": "Получить список",
|
|
76
76
|
"title": "Azure OpenAI",
|
|
77
77
|
"serverConfig": "Администратор настроил сервер для использования Azure OpenAI. Переключение запрещено."
|
|
78
|
+
},
|
|
79
|
+
"customModelName": {
|
|
80
|
+
"desc": "Добавьте пользовательскую модель, разделяя их запятыми (,)",
|
|
81
|
+
"placeholder": "model1,model2,model3",
|
|
82
|
+
"title": "Название пользовательской модели"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
"waitingForMore": "<1>Планируется доступ к другим моделям</1>, так что следите за обновлениями ✨"
|
package/locales/zh_CN/error.json
CHANGED
|
@@ -50,6 +50,11 @@
|
|
|
50
50
|
"pass": "检查通过",
|
|
51
51
|
"title": "连通性检查"
|
|
52
52
|
},
|
|
53
|
+
"customModelName": {
|
|
54
|
+
"desc": "增加自定义模型,多个模型使用逗号(,) 隔开",
|
|
55
|
+
"placeholder": "model1,model2,model3",
|
|
56
|
+
"title": "自定义模型名称"
|
|
57
|
+
},
|
|
53
58
|
"endpoint": {
|
|
54
59
|
"desc": "除默认地址外,必须包含 http(s)://",
|
|
55
60
|
"placeholder": "https://api.openai.com/v1",
|
package/locales/zh_TW/error.json
CHANGED
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"unlock": {
|
|
32
32
|
"apikey": {
|
|
33
33
|
"title": "使用自定義 API Key",
|
|
34
|
-
"description": "輸入你的 OpenAI API Key 即可開始會話。應用程式不會記錄你的 API Key"
|
|
34
|
+
"description": "輸入你的 OpenAI API Key 即可開始會話。應用程式不會記錄你的 API Key",
|
|
35
|
+
"addProxyUrl": "添加 OpenAI 代理地址(可選)"
|
|
35
36
|
},
|
|
36
37
|
"confirm": "確認並重試",
|
|
37
38
|
"password": {
|
|
@@ -75,6 +75,11 @@
|
|
|
75
75
|
"fetch": "取得列表",
|
|
76
76
|
"title": "Azure OpenAI",
|
|
77
77
|
"serverConfig": "管理員已在伺服器端啟用 Azure OpenAI,禁止切換"
|
|
78
|
+
},
|
|
79
|
+
"customModelName": {
|
|
80
|
+
"desc": "增加自訂模型,多個模型使用逗號(,) 隔開",
|
|
81
|
+
"placeholder": "model1,model2,model3",
|
|
82
|
+
"title": "自訂模型名稱"
|
|
78
83
|
}
|
|
79
84
|
},
|
|
80
85
|
"waitingForMore": "<1>計劃支援其他模型</1>,敬請期待 ✨"
|
package/next.config.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/chat",
|
|
3
|
-
"version": "0.89.
|
|
3
|
+
"version": "0.89.1",
|
|
4
4
|
"description": "An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chatbot",
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Modal } from '@lobehub/ui';
|
|
2
|
-
import dynamic from 'next/dynamic';
|
|
3
2
|
import { memo } from 'react';
|
|
4
3
|
import { useTranslation } from 'react-i18next';
|
|
5
4
|
|
|
6
5
|
import { useGlobalStore } from '@/store/global';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
import TopicListContent from '../../features/TopicListContent';
|
|
9
8
|
|
|
10
9
|
const Topics = memo(() => {
|
|
11
10
|
const [showAgentSettings, toggleConfig] = useGlobalStore((s) => [
|
package/src/app/home/index.tsx
CHANGED
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { Icon, Logo } from '@lobehub/ui';
|
|
4
|
-
import { Loader2 } from 'lucide-react';
|
|
5
3
|
import { useTranslation } from 'react-i18next';
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
import FullscreenLoading from '@/components/FullscreenLoading';
|
|
7
6
|
|
|
8
7
|
const Loading = () => {
|
|
9
8
|
const { t } = useTranslation();
|
|
10
9
|
|
|
11
|
-
return (
|
|
12
|
-
<Flexbox height={'100%'} width={'100%'}>
|
|
13
|
-
<Center flex={1} gap={12} width={'100%'}>
|
|
14
|
-
<Logo extra={'Chat'} size={48} type={'combine'} />
|
|
15
|
-
<Center gap={16} horizontal>
|
|
16
|
-
<Icon icon={Loader2} spin />
|
|
17
|
-
{t('appInitializing', { ns: 'common' })}
|
|
18
|
-
</Center>
|
|
19
|
-
</Center>
|
|
20
|
-
</Flexbox>
|
|
21
|
-
);
|
|
10
|
+
return <FullscreenLoading title={t('switchMobileLayout')} />;
|
|
22
11
|
};
|
|
23
12
|
|
|
24
13
|
export default Loading;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { DraggablePanel, DraggablePanelBody, DraggablePanelContainer } from '@lobehub/ui';
|
|
2
2
|
import { createStyles } from 'antd-style';
|
|
3
|
-
import dynamic from 'next/dynamic';
|
|
4
3
|
import { memo, useState } from 'react';
|
|
5
4
|
|
|
6
5
|
import SafeSpacing from '@/components/SafeSpacing';
|
|
7
6
|
import { MARKET_SIDEBAR_WIDTH } from '@/const/layoutTokens';
|
|
8
7
|
import { agentMarketSelectors, useMarketStore } from '@/store/market';
|
|
9
8
|
|
|
10
|
-
|
|
9
|
+
import AgentDetailContent from '../../features/AgentDetailContent';
|
|
11
10
|
|
|
12
11
|
const useStyles = createStyles(({ css, token, stylish }) => ({
|
|
13
12
|
content: css`
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { SpotlightCard } from '@lobehub/ui';
|
|
3
4
|
import dynamic from 'next/dynamic';
|
|
4
5
|
import { FC, memo } from 'react';
|
|
5
6
|
|
|
6
|
-
import
|
|
7
|
+
import AgentCard from '@/app/market/features/AgentCard';
|
|
7
8
|
import ResponsiveIndex from '@/components/ResponsiveIndex';
|
|
9
|
+
import { AgentsMarketIndexItem } from '@/types/market';
|
|
8
10
|
|
|
9
11
|
import Index from '../index';
|
|
10
12
|
import Layout from './layout.desktop';
|
|
11
13
|
|
|
12
14
|
const Mobile: FC = dynamic(() => import('../(mobile)')) as FC;
|
|
13
|
-
export default memo<
|
|
15
|
+
export default memo<{ defaultAgents?: AgentsMarketIndexItem[] }>(({ defaultAgents }) => (
|
|
14
16
|
<ResponsiveIndex Mobile={Mobile}>
|
|
15
17
|
<Layout>
|
|
16
|
-
<Index
|
|
18
|
+
<Index />
|
|
19
|
+
<AgentCard CardRender={SpotlightCard} defaultAgents={defaultAgents} />
|
|
17
20
|
</Layout>
|
|
18
21
|
</ResponsiveIndex>
|
|
19
22
|
));
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Modal } from '@lobehub/ui';
|
|
2
|
-
import dynamic from 'next/dynamic';
|
|
3
2
|
import { memo } from 'react';
|
|
4
3
|
import { useTranslation } from 'react-i18next';
|
|
5
4
|
|
|
6
5
|
import { agentMarketSelectors, useMarketStore } from '@/store/market';
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
import AgentDetailContent from '../../features/AgentDetailContent';
|
|
9
8
|
|
|
10
9
|
const AgentDetail = memo(() => {
|
|
11
10
|
const [showAgentSidebar, deactivateAgent] = useMarketStore((s) => [
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
1
3
|
import { memo } from 'react';
|
|
2
4
|
|
|
3
|
-
import
|
|
5
|
+
import AgentCard from '@/app/market/features/AgentCard';
|
|
6
|
+
import { AgentsMarketIndexItem } from '@/types/market';
|
|
4
7
|
|
|
5
8
|
import Index from '../index';
|
|
9
|
+
import CardRender from './features/AgentCard';
|
|
6
10
|
import Layout from './layout.mobile';
|
|
7
11
|
|
|
8
|
-
export default memo<
|
|
12
|
+
export default memo<{ defaultAgents?: AgentsMarketIndexItem[] }>(({ defaultAgents }) => (
|
|
9
13
|
<Layout>
|
|
10
|
-
<Index
|
|
14
|
+
<Index />
|
|
15
|
+
<AgentCard CardRender={CardRender} defaultAgents={defaultAgents} />
|
|
11
16
|
</Layout>
|
|
12
17
|
));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { SpotlightCardProps } from '@lobehub/ui';
|
|
1
2
|
import { useResponsive } from 'antd-style';
|
|
2
|
-
import
|
|
3
|
-
import { memo, useMemo } from 'react';
|
|
3
|
+
import { FC, memo, useMemo } from 'react';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { Flexbox } from 'react-layout-kit';
|
|
6
6
|
|
|
@@ -12,16 +12,14 @@ import AgentCardItem from './AgentCardItem';
|
|
|
12
12
|
import Loading from './Loading';
|
|
13
13
|
import { useStyles } from './style';
|
|
14
14
|
|
|
15
|
-
const AgentCardMobile = dynamic(() => import('../../(mobile)/features/AgentCard'));
|
|
16
|
-
const AgentCardDesktop = dynamic(() => import('@lobehub/ui/es/SpotlightCard'));
|
|
17
|
-
|
|
18
15
|
const gridRender = (item: any) => <AgentCardItem {...item} />;
|
|
19
16
|
|
|
20
17
|
export interface AgentCardProps {
|
|
18
|
+
CardRender: FC<SpotlightCardProps>;
|
|
21
19
|
defaultAgents?: AgentsMarketIndexItem[];
|
|
22
20
|
}
|
|
23
21
|
|
|
24
|
-
const AgentCard = memo<AgentCardProps>(({ defaultAgents }) => {
|
|
22
|
+
const AgentCard = memo<AgentCardProps>(({ defaultAgents, CardRender }) => {
|
|
25
23
|
const { t } = useTranslation('market');
|
|
26
24
|
const { mobile } = useResponsive();
|
|
27
25
|
const { styles } = useStyles();
|
|
@@ -42,8 +40,6 @@ const AgentCard = memo<AgentCardProps>(({ defaultAgents }) => {
|
|
|
42
40
|
|
|
43
41
|
if (agentList.length === 0) return <Loading />;
|
|
44
42
|
|
|
45
|
-
const CardRender = mobile ? AgentCardMobile : AgentCardDesktop;
|
|
46
|
-
|
|
47
43
|
return (
|
|
48
44
|
<Flexbox gap={mobile ? 16 : 24}>
|
|
49
45
|
<TagList />
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from 'antd';
|
|
1
|
+
import { Button, Skeleton } from 'antd';
|
|
2
2
|
import isEqual from 'fast-deep-equal';
|
|
3
3
|
import { startCase } from 'lodash-es';
|
|
4
4
|
import { memo } from 'react';
|
|
@@ -12,17 +12,21 @@ const TagList = memo(() => {
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<Flexbox gap={6} horizontal style={{ flexWrap: 'wrap' }}>
|
|
15
|
-
{agentTagList
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
{agentTagList?.length > 0
|
|
16
|
+
? agentTagList.map((item) => (
|
|
17
|
+
<Button
|
|
18
|
+
key={item}
|
|
19
|
+
onClick={() => useMarketStore.setState({ searchKeywords: item })}
|
|
20
|
+
shape={'round'}
|
|
21
|
+
size={'small'}
|
|
22
|
+
type={keywords === item ? 'primary' : 'default'}
|
|
23
|
+
>
|
|
24
|
+
{startCase(item)}
|
|
25
|
+
</Button>
|
|
26
|
+
))
|
|
27
|
+
: Array.from({ length: 5 })
|
|
28
|
+
.fill('')
|
|
29
|
+
.map((_, index) => <Skeleton.Button key={index} shape={'round'} size={'small'} />)}
|
|
26
30
|
</Flexbox>
|
|
27
31
|
);
|
|
28
32
|
});
|
package/src/app/market/index.tsx
CHANGED
|
@@ -7,10 +7,9 @@ import PageTitle from '@/components/PageTitle';
|
|
|
7
7
|
import { useMarketStore } from '@/store/market';
|
|
8
8
|
import { genSiteHeadTitle } from '@/utils/genSiteHeadTitle';
|
|
9
9
|
|
|
10
|
-
import AgentCard, { AgentCardProps } from './features/AgentCard';
|
|
11
10
|
import AgentSearchBar from './features/AgentSearchBar';
|
|
12
11
|
|
|
13
|
-
const Market = memo
|
|
12
|
+
const Market = memo(() => {
|
|
14
13
|
const { t } = useTranslation('common');
|
|
15
14
|
const pageTitle = genSiteHeadTitle(t('tab.market'));
|
|
16
15
|
|
|
@@ -23,7 +22,6 @@ const Market = memo<AgentCardProps>(({ defaultAgents }) => {
|
|
|
23
22
|
<>
|
|
24
23
|
<PageTitle title={pageTitle} />
|
|
25
24
|
<AgentSearchBar />
|
|
26
|
-
<AgentCard defaultAgents={defaultAgents} />
|
|
27
25
|
</>
|
|
28
26
|
);
|
|
29
27
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import dynamic from 'next/dynamic';
|
|
2
|
-
import { memo
|
|
2
|
+
import { memo } from 'react';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
|
|
5
5
|
import { genSize, useStyles } from './style';
|
|
@@ -7,22 +7,21 @@ import { genSize, useStyles } from './style';
|
|
|
7
7
|
const LogoThree = dynamic(() => import('@lobehub/ui/es/LogoThree'));
|
|
8
8
|
|
|
9
9
|
const Hero = memo<{ mobile?: boolean; width: number }>(({ width, mobile }) => {
|
|
10
|
-
const size =
|
|
11
|
-
(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}),
|
|
17
|
-
[width],
|
|
18
|
-
);
|
|
10
|
+
const size = {
|
|
11
|
+
base: genSize(width / 3.5, 240),
|
|
12
|
+
desc: genSize(width / 50, 14),
|
|
13
|
+
logo: genSize(width / 3.8, 180),
|
|
14
|
+
title: genSize(width / 20, 32),
|
|
15
|
+
};
|
|
19
16
|
const { styles } = useStyles(size.base);
|
|
20
17
|
|
|
21
18
|
const { t } = useTranslation('welcome');
|
|
22
19
|
|
|
23
20
|
return (
|
|
24
21
|
<>
|
|
25
|
-
<
|
|
22
|
+
<div style={{ height: size.logo, marginTop: -size.logo / 5, width: size.logo }}>
|
|
23
|
+
<LogoThree size={size.logo} />
|
|
24
|
+
</div>
|
|
26
25
|
<div className={styles.title} style={{ fontSize: size.title }}>
|
|
27
26
|
<strong style={mobile ? { fontSize: '1.2em' } : {}}>LobeChat</strong>
|
|
28
27
|
{mobile ? <br /> : ' '}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { Icon } from '@lobehub/ui';
|
|
4
4
|
import { Button, Upload } from 'antd';
|
|
5
5
|
import { SendHorizonal } from 'lucide-react';
|
|
6
|
-
import dynamic from 'next/dynamic';
|
|
7
6
|
import { memo, useCallback } from 'react';
|
|
8
7
|
import { useTranslation } from 'react-i18next';
|
|
9
8
|
import { Flexbox } from 'react-layout-kit';
|
|
@@ -11,10 +10,9 @@ import { Flexbox } from 'react-layout-kit';
|
|
|
11
10
|
import { useImportConfig } from '@/hooks/useImportConfig';
|
|
12
11
|
import { useSessionStore } from '@/store/session';
|
|
13
12
|
|
|
13
|
+
import Hero from './Hero';
|
|
14
14
|
import { useStyles } from './style';
|
|
15
15
|
|
|
16
|
-
const Hero = dynamic(() => import('./Hero'));
|
|
17
|
-
|
|
18
16
|
const Banner = memo<{ mobile?: boolean }>(({ mobile }) => {
|
|
19
17
|
const { importConfig } = useImportConfig();
|
|
20
18
|
const { t } = useTranslation('welcome');
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Icon, Logo } from '@lobehub/ui';
|
|
2
|
+
import { Loader2 } from 'lucide-react';
|
|
3
|
+
import { memo } from 'react';
|
|
4
|
+
import { Center, Flexbox } from 'react-layout-kit';
|
|
5
|
+
|
|
6
|
+
const FullscreenLoading = memo<{ title?: string }>(({ title }) => {
|
|
7
|
+
return (
|
|
8
|
+
<Flexbox height={'100%'} width={'100%'}>
|
|
9
|
+
<Center flex={1} gap={12} width={'100%'}>
|
|
10
|
+
<Logo extra={'Chat'} size={48} type={'combine'} />
|
|
11
|
+
<Center gap={16} horizontal>
|
|
12
|
+
<Icon icon={Loader2} spin />
|
|
13
|
+
{title}
|
|
14
|
+
</Center>
|
|
15
|
+
</Center>
|
|
16
|
+
</Flexbox>
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default FullscreenLoading;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
import { PropsWithChildren, ReactNode, Suspense } from 'react';
|
|
4
|
+
import { useTranslation } from 'react-i18next';
|
|
4
5
|
|
|
6
|
+
import FullscreenLoading from '@/components/FullscreenLoading';
|
|
5
7
|
import { useIsMobile } from '@/hooks/useIsMobile';
|
|
6
8
|
|
|
7
9
|
interface ServerResponsiveLayoutProps {
|
|
@@ -10,9 +12,14 @@ interface ServerResponsiveLayoutProps {
|
|
|
10
12
|
children?: ReactNode;
|
|
11
13
|
}
|
|
12
14
|
const ResponsiveLayout = ({ children, Desktop, Mobile }: ServerResponsiveLayoutProps) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
13
16
|
const mobile = useIsMobile();
|
|
14
17
|
|
|
15
|
-
return
|
|
18
|
+
return (
|
|
19
|
+
<Suspense fallback={<FullscreenLoading title={t('appInitializing')} />}>
|
|
20
|
+
{mobile ? <Mobile>{children}</Mobile> : <Desktop>{children}</Desktop>}
|
|
21
|
+
</Suspense>
|
|
22
|
+
);
|
|
16
23
|
};
|
|
17
24
|
|
|
18
25
|
export default ResponsiveLayout;
|