@lobehub/chat 0.154.6 → 0.155.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.
- package/CHANGELOG.md +50 -0
- package/locales/ar/common.json +6 -0
- package/locales/bg-BG/common.json +6 -0
- package/locales/de-DE/common.json +6 -0
- package/locales/en-US/common.json +6 -0
- package/locales/es-ES/common.json +6 -0
- package/locales/fr-FR/common.json +6 -0
- package/locales/it-IT/common.json +6 -0
- package/locales/ja-JP/common.json +6 -0
- package/locales/ko-KR/common.json +6 -0
- package/locales/nl-NL/common.json +6 -0
- package/locales/pl-PL/common.json +6 -0
- package/locales/pt-BR/common.json +6 -0
- package/locales/ru-RU/common.json +6 -0
- package/locales/tr-TR/common.json +6 -0
- package/locales/vi-VN/common.json +6 -0
- package/locales/zh-CN/common.json +6 -0
- package/locales/zh-TW/common.json +6 -0
- package/package.json +1 -1
- package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +2 -3
- package/src/app/(main)/(mobile)/me/loading.tsx +19 -2
- package/src/app/(main)/(mobile)/me/page.tsx +6 -1
- package/src/database/client/models/topic.ts +4 -0
- package/src/features/Conversation/Error/APIKeyForm/index.tsx +1 -1
- package/src/features/Conversation/Error/AccessCodeForm.tsx +1 -1
- package/src/features/Conversation/Error/ClerkLogin/index.tsx +1 -1
- package/src/features/Conversation/Error/OAuthForm.tsx +1 -1
- package/src/features/Conversation/Error/PluginSettings.tsx +1 -1
- package/src/features/User/DataStatistics.tsx +153 -0
- package/src/features/User/UserPanel/PanelContent.tsx +2 -0
- package/src/locales/default/common.ts +6 -1
- package/src/services/message/client.ts +9 -0
- package/src/services/session/client.ts +1 -0
- package/src/services/topic/client.test.ts +28 -0
- package/src/services/topic/client.ts +4 -0
- package/src/store/chat/slices/enchance/action.ts +4 -4
- package/src/store/chat/slices/message/action.test.ts +56 -39
- package/src/store/chat/slices/message/action.ts +66 -66
- package/src/store/chat/slices/plugin/action.test.ts +26 -26
- package/src/store/chat/slices/plugin/action.ts +14 -14
- package/src/store/chat/slices/tool/action.test.ts +3 -3
- package/src/store/chat/slices/tool/action.ts +1 -1
|
@@ -60,7 +60,7 @@ describe('chatToolSlice', () => {
|
|
|
60
60
|
draft[0].previewUrl = 'new-url';
|
|
61
61
|
draft[0].imageId = 'new-id';
|
|
62
62
|
};
|
|
63
|
-
vi.spyOn(result.current, '
|
|
63
|
+
vi.spyOn(result.current, 'internal_updateMessageContent');
|
|
64
64
|
|
|
65
65
|
// 模拟 getMessageById 返回消息内容
|
|
66
66
|
vi.spyOn(chatSelectors, 'getMessageById').mockImplementationOnce(
|
|
@@ -75,8 +75,8 @@ describe('chatToolSlice', () => {
|
|
|
75
75
|
await result.current.updateImageItem(messageId, updateFunction);
|
|
76
76
|
});
|
|
77
77
|
|
|
78
|
-
// 验证
|
|
79
|
-
expect(result.current.
|
|
78
|
+
// 验证 internal_updateMessageContent 是否被正确调用以更新内容
|
|
79
|
+
expect(result.current.internal_updateMessageContent).toHaveBeenCalledWith(
|
|
80
80
|
messageId,
|
|
81
81
|
JSON.stringify([{ prompt: 'test prompt', previewUrl: 'new-url', imageId: 'new-id' }]),
|
|
82
82
|
);
|
|
@@ -81,6 +81,6 @@ export const chatToolSlice: StateCreator<
|
|
|
81
81
|
const data: DallEImageItem[] = JSON.parse(message.content);
|
|
82
82
|
|
|
83
83
|
const nextContent = produce(data, updater);
|
|
84
|
-
await get().
|
|
84
|
+
await get().internal_updateMessageContent(id, JSON.stringify(nextContent));
|
|
85
85
|
},
|
|
86
86
|
});
|