@lobehub/chat 0.149.0 → 0.149.2
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 +42 -0
- package/locales/ar/chat.json +4 -1
- package/locales/ar/modelProvider.json +1 -3
- package/locales/bg-BG/chat.json +4 -1
- package/locales/bg-BG/modelProvider.json +1 -3
- package/locales/de-DE/chat.json +4 -1
- package/locales/de-DE/modelProvider.json +1 -3
- package/locales/en-US/chat.json +7 -4
- package/locales/en-US/modelProvider.json +1 -3
- package/locales/es-ES/chat.json +4 -1
- package/locales/es-ES/modelProvider.json +1 -3
- package/locales/fr-FR/chat.json +7 -4
- package/locales/fr-FR/modelProvider.json +1 -3
- package/locales/it-IT/chat.json +4 -1
- package/locales/it-IT/modelProvider.json +16 -17
- package/locales/ja-JP/chat.json +4 -1
- package/locales/ja-JP/modelProvider.json +14 -16
- package/locales/ko-KR/chat.json +4 -1
- package/locales/ko-KR/modelProvider.json +1 -3
- package/locales/nl-NL/chat.json +4 -1
- package/locales/nl-NL/modelProvider.json +1 -3
- package/locales/pl-PL/chat.json +4 -1
- package/locales/pl-PL/modelProvider.json +1 -3
- package/locales/pt-BR/chat.json +4 -1
- package/locales/pt-BR/modelProvider.json +1 -3
- package/locales/ru-RU/chat.json +4 -1
- package/locales/ru-RU/modelProvider.json +1 -3
- package/locales/tr-TR/chat.json +4 -1
- package/locales/tr-TR/modelProvider.json +1 -3
- package/locales/vi-VN/chat.json +4 -1
- package/locales/vi-VN/modelProvider.json +1 -3
- package/locales/zh-CN/chat.json +4 -1
- package/locales/zh-CN/modelProvider.json +1 -3
- package/locales/zh-TW/chat.json +4 -1
- package/locales/zh-TW/modelProvider.json +1 -3
- package/package.json +1 -1
- package/src/app/chat/(desktop)/features/ChatInput/Footer/SendMore.tsx +117 -0
- package/src/app/chat/(desktop)/features/ChatInput/Footer/index.tsx +9 -56
- package/src/app/chat/(desktop)/features/ChatInput/TextArea.tsx +1 -1
- package/src/app/chat/(desktop)/features/HotKeys.tsx +3 -3
- package/src/app/chat/features/TopicListContent/Topic/TopicContent.tsx +15 -6
- package/src/components/HotKeys/index.tsx +14 -18
- package/src/const/hotkeys.ts +1 -1
- package/src/features/ChatInput/ActionBar/Clear.tsx +3 -3
- package/src/features/ChatInput/Topic/index.tsx +3 -3
- package/src/features/Conversation/Actions/Assistant.tsx +1 -1
- package/src/features/Conversation/Error/OllamaBizError/SetupGuide.tsx +159 -70
- package/src/locales/default/chat.ts +4 -1
- package/src/locales/default/modelProvider.ts +1 -3
- package/src/store/chat/slices/message/action.ts +15 -0
- package/src/store/chat/slices/topic/action.test.ts +8 -4
- package/src/store/chat/slices/topic/action.ts +70 -28
- package/src/store/chat/slices/topic/initialState.ts +2 -1
- package/src/store/chat/slices/topic/reducer.test.ts +3 -5
- package/src/store/chat/slices/topic/reducer.ts +9 -9
|
@@ -5,14 +5,13 @@ import { ChatTopic } from '@/types/topic';
|
|
|
5
5
|
|
|
6
6
|
interface AddChatTopicAction {
|
|
7
7
|
type: 'addTopic';
|
|
8
|
-
value: CreateTopicParams;
|
|
8
|
+
value: CreateTopicParams & { id?: string };
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
interface UpdateChatTopicAction {
|
|
12
12
|
id: string;
|
|
13
|
-
key: keyof ChatTopic;
|
|
14
13
|
type: 'updateTopic';
|
|
15
|
-
value:
|
|
14
|
+
value: Partial<ChatTopic>;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
interface DeleteChatTopicAction {
|
|
@@ -29,24 +28,25 @@ export const topicReducer = (state: ChatTopic[] = [], payload: ChatTopicDispatch
|
|
|
29
28
|
draftState.unshift({
|
|
30
29
|
...payload.value,
|
|
31
30
|
createdAt: Date.now(),
|
|
32
|
-
|
|
31
|
+
favorite: false,
|
|
32
|
+
id: payload.value.id ?? Date.now().toString(),
|
|
33
33
|
sessionId: payload.value.sessionId ? payload.value.sessionId : undefined,
|
|
34
34
|
updatedAt: Date.now(),
|
|
35
35
|
});
|
|
36
|
+
|
|
37
|
+
return draftState.sort((a, b) => Number(b.favorite) - Number(a.favorite));
|
|
36
38
|
});
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
case 'updateTopic': {
|
|
40
42
|
return produce(state, (draftState) => {
|
|
41
|
-
const {
|
|
43
|
+
const { value, id } = payload;
|
|
42
44
|
const topicIndex = draftState.findIndex((topic) => topic.id === id);
|
|
43
45
|
|
|
44
46
|
if (topicIndex !== -1) {
|
|
45
|
-
|
|
47
|
+
// TODO: updatedAt 类型后续需要修改为 Date
|
|
46
48
|
// @ts-ignore
|
|
47
|
-
|
|
48
|
-
draftState[topicIndex] = updatedTopic;
|
|
49
|
-
updatedTopic.updatedAt = Date.now();
|
|
49
|
+
draftState[topicIndex] = { ...draftState[topicIndex], ...value, updatedAt: new Date() };
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}
|