@lobehub/chat 0.155.4 → 0.155.6
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/README.md +2 -2
- package/README.zh-CN.md +8 -8
- package/package.json +1 -1
- package/src/app/(main)/(mobile)/me/features/Header.tsx +2 -9
- package/src/app/(main)/(mobile)/me/loading.tsx +1 -12
- package/src/app/(main)/(mobile)/me/page.tsx +2 -5
- package/src/app/(main)/@nav/_layout/Mobile.tsx +1 -1
- package/src/app/(main)/_layout/Mobile.tsx +5 -1
- package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +23 -0
- package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/index.tsx +2 -1
- package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.test.tsx +6 -6
- package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.tsx +2 -1
- package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/index.tsx +6 -2
- package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/index.tsx +9 -4
- package/src/app/(main)/chat/(workspace)/@topic/default.tsx +19 -0
- package/src/app/(main)/chat/{(desktop)/features/SideBar/SystemRole/index.tsx → (workspace)/@topic/features/SystemRole/SystemRoleContent.tsx} +2 -0
- package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/index.tsx +18 -0
- package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Header.tsx +2 -0
- package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/index.tsx +26 -28
- package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/TopicSearchBar/index.tsx +4 -2
- package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/index.tsx +3 -4
- package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/HeaderAction.tsx +2 -0
- package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Main.tsx +3 -1
- package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Tags.tsx +1 -1
- package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/index.tsx +1 -2
- package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/HotKeys.tsx +2 -0
- package/src/app/(main)/chat/{(desktop)/features/SideBar/index.tsx → (workspace)/_layout/Desktop/TopicPanel.tsx} +23 -20
- package/src/app/(main)/chat/(workspace)/_layout/Desktop/index.tsx +35 -0
- package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +35 -0
- package/src/app/(main)/chat/(workspace)/_layout/Mobile/TopicModal.tsx +26 -0
- package/src/app/(main)/chat/(workspace)/_layout/Mobile/index.tsx +21 -0
- package/src/app/(main)/chat/(workspace)/_layout/type.ts +7 -0
- package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/index.tsx +2 -0
- package/src/app/(main)/chat/{features → (workspace)/features}/SettingButton.tsx +3 -1
- package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/index.tsx +5 -6
- package/src/app/(main)/chat/{features/TelemetryNotification/index.tsx → (workspace)/features/TelemetryNotification.tsx} +2 -0
- package/src/app/(main)/chat/(workspace)/features/useWorkspaceModal.tsx +27 -0
- package/src/app/(main)/chat/(workspace)/layout.ts +11 -0
- package/src/app/(main)/chat/(workspace)/page.tsx +19 -0
- package/src/app/(main)/chat/@session/_layout/Desktop/PanelBody.tsx +22 -0
- package/src/app/(main)/chat/{_layout → @session/_layout}/Desktop/SessionHeader.tsx +2 -0
- package/src/app/(main)/chat/@session/_layout/Desktop/index.tsx +15 -0
- package/src/app/(main)/chat/{(mobile)/features → @session/_layout/Mobile}/SessionHeader.tsx +7 -20
- package/src/app/(main)/chat/@session/_layout/Mobile/index.tsx +19 -0
- package/src/app/(main)/chat/@session/default.tsx +23 -0
- package/src/app/(main)/chat/{components/SessionHydration/index.tsx → @session/features/SessionHydration.tsx} +1 -0
- package/src/app/(main)/chat/{features → @session/features}/SessionListContent/DefaultMode.tsx +3 -3
- package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Inbox/index.tsx +2 -2
- package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/index.tsx +2 -1
- package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/index.tsx +3 -4
- package/src/app/(main)/chat/{features → @session/features}/SessionListContent/ListItem/index.tsx +12 -10
- package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SearchMode.tsx +4 -2
- package/src/app/(main)/chat/{features → @session/features}/SessionListContent/index.tsx +2 -0
- package/src/app/(main)/chat/{features/SessionSearchBar/index.tsx → @session/features/SessionSearchBar.tsx} +3 -5
- package/src/app/(main)/chat/_layout/Desktop/SessionPanel.tsx +79 -0
- package/src/app/(main)/chat/_layout/Desktop/index.tsx +11 -7
- package/src/app/(main)/chat/_layout/Mobile.tsx +52 -0
- package/src/app/(main)/chat/_layout/type.ts +1 -0
- package/src/app/(main)/chat/error.tsx +5 -0
- package/src/app/(main)/chat/features/Migration/index.tsx +3 -8
- package/src/app/(main)/chat/not-found.tsx +3 -0
- package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -4
- package/src/app/(main)/chat/settings/features/HeaderContent.tsx +2 -2
- package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +2 -2
- package/src/app/(main)/market/@detail/features/Header.tsx +2 -2
- package/src/components/Cell/Divider.tsx +2 -2
- package/src/components/Cell/index.tsx +2 -2
- package/src/components/ModelTag/ModelIcon.tsx +2 -2
- package/src/components/StoreHydration/ChatHydration/index.tsx +2 -2
- package/src/const/session.ts +2 -0
- package/src/const/url.ts +5 -1
- package/src/features/ChatInput/ActionBar/Tools/index.tsx +3 -2
- package/src/features/ChatInput/STT/browser.tsx +2 -1
- package/src/features/ChatInput/STT/openai.tsx +2 -1
- package/src/features/ChatInput/useChatInput.ts +2 -1
- package/src/features/ChatInput/useSend.ts +2 -1
- package/src/features/Conversation/Actions/customAction.ts +9 -0
- package/src/features/Conversation/Extras/Assistant.tsx +2 -1
- package/src/features/Conversation/Extras/User.tsx +2 -1
- package/src/features/Conversation/components/AutoScroll.tsx +1 -1
- package/src/features/Conversation/components/ChatItem/index.tsx +22 -12
- package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +1 -1
- package/src/features/Conversation/components/InboxWelcome/index.tsx +2 -2
- package/src/features/Conversation/components/SkeletonList.tsx +21 -8
- package/src/features/Conversation/components/VirtualizedList/index.tsx +19 -17
- package/src/features/Conversation/index.tsx +12 -31
- package/src/features/PluginStore/InstalledPluginList.tsx +28 -21
- package/src/features/PluginStore/OnlineList.tsx +4 -10
- package/src/features/PluginStore/PluginItem/Action.tsx +3 -2
- package/src/features/PluginStore/PluginItem/index.tsx +2 -0
- package/src/features/PluginStore/index.tsx +4 -2
- package/src/features/User/UserAvatar.tsx +2 -1
- package/src/features/User/UserPanel/useMenu.tsx +1 -1
- package/src/layout/GlobalProvider/AppTheme.tsx +7 -17
- package/src/libs/agent-runtime/openrouter/index.ts +4 -1
- package/src/store/chat/slices/message/action.test.ts +52 -2
- package/src/store/chat/slices/message/action.ts +40 -13
- package/src/store/chat/slices/message/initialState.ts +13 -1
- package/src/store/chat/slices/message/selectors.test.ts +1 -1
- package/src/store/chat/slices/message/selectors.ts +10 -1
- package/src/store/chat/slices/plugin/action.test.ts +10 -2
- package/src/store/chat/slices/plugin/action.ts +6 -2
- package/src/store/global/action.ts +2 -0
- package/src/store/global/initialState.ts +2 -0
- package/src/styles/global.ts +12 -9
- package/src/styles/mobileHeader.ts +1 -1
- package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +0 -27
- package/src/app/(main)/(mobile)/me/features/style.ts +0 -29
- package/src/app/(main)/chat/(desktop)/features/Conversation.tsx +0 -19
- package/src/app/(main)/chat/(desktop)/index.tsx +0 -22
- package/src/app/(main)/chat/(mobile)/features/SessionList.tsx +0 -17
- package/src/app/(main)/chat/(mobile)/features/TopicList.tsx +0 -29
- package/src/app/(main)/chat/(mobile)/index.tsx +0 -26
- package/src/app/(main)/chat/(mobile)/mobile/ChatHeader/index.tsx +0 -56
- package/src/app/(main)/chat/(mobile)/mobile/page.tsx +0 -26
- package/src/app/(main)/chat/_layout/Desktop/SessionList.tsx +0 -39
- package/src/app/(main)/chat/_layout/Mobile/index.tsx +0 -9
- package/src/app/(main)/chat/page.tsx +0 -25
- package/src/features/FolderPanel/index.tsx +0 -60
- package/src/utils/screen.ts +0 -14
- /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/DragUpload.tsx +0 -0
- /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/LocalFiles.tsx +0 -0
- /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/SendMore.tsx +0 -0
- /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Header/index.tsx +0 -0
- /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/__tests__/useAutoFocus.test.ts +0 -0
- /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/useAutoFocus.ts +0 -0
- /package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/Files.tsx +0 -0
- /package/src/app/(main)/chat/{(desktop)/features/SideBar → (workspace)/@topic/features}/SystemRole/style.ts +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/DefaultContent.tsx +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/SkeletonList.tsx +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicContent.tsx +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicItem.tsx +0 -0
- /package/src/app/(main)/chat/{(mobile)/mobile → (workspace)/_layout/Mobile}/ChatHeader/ChatHeaderTitle.tsx +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/PluginStatus.tsx +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/Preview.tsx +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/ShareModal.tsx +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/style.ts +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/type.ts +0 -0
- /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/useScreenshot.ts +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/Actions.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/index.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/AddButton.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/Actions.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/index.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/CreateGroupModal.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/RenameGroupModal.tsx +0 -0
- /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SkeletonList.tsx +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { isMobileDevice } from '@/utils/responsive';
|
|
2
|
-
|
|
3
|
-
import DesktopPage from './(desktop)';
|
|
4
|
-
import MobilePage from './(mobile)';
|
|
5
|
-
import SessionHydration from './components/SessionHydration';
|
|
6
|
-
import Migration from './features/Migration';
|
|
7
|
-
import PageTitle from './features/PageTitle';
|
|
8
|
-
|
|
9
|
-
const Page = () => {
|
|
10
|
-
const mobile = isMobileDevice();
|
|
11
|
-
|
|
12
|
-
const Page = mobile ? MobilePage : DesktopPage;
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<>
|
|
16
|
-
<Migration>
|
|
17
|
-
<PageTitle />
|
|
18
|
-
<Page />
|
|
19
|
-
</Migration>
|
|
20
|
-
<SessionHydration />
|
|
21
|
-
</>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export default Page;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui';
|
|
2
|
-
import { createStyles } from 'antd-style';
|
|
3
|
-
import isEqual from 'fast-deep-equal';
|
|
4
|
-
import { PropsWithChildren, memo, useState } from 'react';
|
|
5
|
-
|
|
6
|
-
import { FOLDER_WIDTH } from '@/const/layoutTokens';
|
|
7
|
-
import { useGlobalStore } from '@/store/global';
|
|
8
|
-
|
|
9
|
-
export const useStyles = createStyles(({ css, token }) => ({
|
|
10
|
-
panel: css`
|
|
11
|
-
height: 100%;
|
|
12
|
-
color: ${token.colorTextSecondary};
|
|
13
|
-
background: ${token.colorBgContainer};
|
|
14
|
-
`,
|
|
15
|
-
}));
|
|
16
|
-
|
|
17
|
-
const FolderPanel = memo<PropsWithChildren>(({ children }) => {
|
|
18
|
-
const { styles } = useStyles();
|
|
19
|
-
const [sessionsWidth, sessionExpandable, updatePreference] = useGlobalStore((s) => [
|
|
20
|
-
s.preference.sessionsWidth,
|
|
21
|
-
s.preference.showSessionPanel,
|
|
22
|
-
s.updatePreference,
|
|
23
|
-
]);
|
|
24
|
-
const [tmpWidth, setWidth] = useState(sessionsWidth);
|
|
25
|
-
if (tmpWidth !== sessionsWidth) setWidth(sessionsWidth);
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<DraggablePanel
|
|
29
|
-
className={styles.panel}
|
|
30
|
-
defaultSize={{ width: tmpWidth }}
|
|
31
|
-
expand={sessionExpandable}
|
|
32
|
-
maxWidth={400}
|
|
33
|
-
minWidth={FOLDER_WIDTH}
|
|
34
|
-
onExpandChange={(expand) => {
|
|
35
|
-
updatePreference({
|
|
36
|
-
sessionsWidth: expand ? 320 : 0,
|
|
37
|
-
showSessionPanel: expand,
|
|
38
|
-
});
|
|
39
|
-
}}
|
|
40
|
-
onSizeChange={(_, size) => {
|
|
41
|
-
if (!size) return;
|
|
42
|
-
|
|
43
|
-
const nextWidth = typeof size.width === 'string' ? Number.parseInt(size.width) : size.width;
|
|
44
|
-
|
|
45
|
-
if (isEqual(nextWidth, sessionsWidth)) return;
|
|
46
|
-
|
|
47
|
-
setWidth(nextWidth);
|
|
48
|
-
updatePreference({ sessionsWidth: nextWidth });
|
|
49
|
-
}}
|
|
50
|
-
placement="left"
|
|
51
|
-
size={{ height: '100%', width: sessionsWidth }}
|
|
52
|
-
>
|
|
53
|
-
<DraggablePanelContainer style={{ flex: 'none', height: '100%', minWidth: FOLDER_WIDTH }}>
|
|
54
|
-
{children}
|
|
55
|
-
</DraggablePanelContainer>
|
|
56
|
-
</DraggablePanel>
|
|
57
|
-
);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
export default FolderPanel;
|
package/src/utils/screen.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// mobile 设备宽度
|
|
2
|
-
// https://github.com/ant-design/ant-design/blob/master/components/theme/util/alias.ts#L28
|
|
3
|
-
export const screenSM = 576;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* check mobile device in browser
|
|
7
|
-
*/
|
|
8
|
-
export const isMobileScreen = () => {
|
|
9
|
-
if (typeof window === 'undefined') {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return window.innerWidth <= screenSM;
|
|
14
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/AddButton.tsx
RENAMED
|
File without changes
|
/package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/Actions.tsx
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SkeletonList.tsx
RENAMED
|
File without changes
|