@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.
Files changed (149) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +2 -2
  3. package/README.zh-CN.md +8 -8
  4. package/package.json +1 -1
  5. package/src/app/(main)/(mobile)/me/features/Header.tsx +2 -9
  6. package/src/app/(main)/(mobile)/me/loading.tsx +1 -12
  7. package/src/app/(main)/(mobile)/me/page.tsx +2 -5
  8. package/src/app/(main)/@nav/_layout/Mobile.tsx +1 -1
  9. package/src/app/(main)/_layout/Mobile.tsx +5 -1
  10. package/src/app/(main)/chat/(workspace)/@conversation/default.tsx +23 -0
  11. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/index.tsx +2 -1
  12. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.test.tsx +6 -6
  13. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/TextArea.tsx +2 -1
  14. package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/index.tsx +6 -2
  15. package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/index.tsx +9 -4
  16. package/src/app/(main)/chat/(workspace)/@topic/default.tsx +19 -0
  17. package/src/app/(main)/chat/{(desktop)/features/SideBar/SystemRole/index.tsx → (workspace)/@topic/features/SystemRole/SystemRoleContent.tsx} +2 -0
  18. package/src/app/(main)/chat/(workspace)/@topic/features/SystemRole/index.tsx +18 -0
  19. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Header.tsx +2 -0
  20. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/index.tsx +26 -28
  21. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/TopicSearchBar/index.tsx +4 -2
  22. package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/index.tsx +3 -4
  23. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/HeaderAction.tsx +2 -0
  24. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Main.tsx +3 -1
  25. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/Tags.tsx +1 -1
  26. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/ChatHeader/index.tsx +1 -2
  27. package/src/app/(main)/chat/{(desktop)/features → (workspace)/_layout/Desktop}/HotKeys.tsx +2 -0
  28. package/src/app/(main)/chat/{(desktop)/features/SideBar/index.tsx → (workspace)/_layout/Desktop/TopicPanel.tsx} +23 -20
  29. package/src/app/(main)/chat/(workspace)/_layout/Desktop/index.tsx +35 -0
  30. package/src/app/(main)/chat/(workspace)/_layout/Mobile/ChatHeader/index.tsx +35 -0
  31. package/src/app/(main)/chat/(workspace)/_layout/Mobile/TopicModal.tsx +26 -0
  32. package/src/app/(main)/chat/(workspace)/_layout/Mobile/index.tsx +21 -0
  33. package/src/app/(main)/chat/(workspace)/_layout/type.ts +7 -0
  34. package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/index.tsx +2 -0
  35. package/src/app/(main)/chat/{features → (workspace)/features}/SettingButton.tsx +3 -1
  36. package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/index.tsx +5 -6
  37. package/src/app/(main)/chat/{features/TelemetryNotification/index.tsx → (workspace)/features/TelemetryNotification.tsx} +2 -0
  38. package/src/app/(main)/chat/(workspace)/features/useWorkspaceModal.tsx +27 -0
  39. package/src/app/(main)/chat/(workspace)/layout.ts +11 -0
  40. package/src/app/(main)/chat/(workspace)/page.tsx +19 -0
  41. package/src/app/(main)/chat/@session/_layout/Desktop/PanelBody.tsx +22 -0
  42. package/src/app/(main)/chat/{_layout → @session/_layout}/Desktop/SessionHeader.tsx +2 -0
  43. package/src/app/(main)/chat/@session/_layout/Desktop/index.tsx +15 -0
  44. package/src/app/(main)/chat/{(mobile)/features → @session/_layout/Mobile}/SessionHeader.tsx +7 -20
  45. package/src/app/(main)/chat/@session/_layout/Mobile/index.tsx +19 -0
  46. package/src/app/(main)/chat/@session/default.tsx +23 -0
  47. package/src/app/(main)/chat/{components/SessionHydration/index.tsx → @session/features/SessionHydration.tsx} +1 -0
  48. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/DefaultMode.tsx +3 -3
  49. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Inbox/index.tsx +2 -2
  50. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/index.tsx +2 -1
  51. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/index.tsx +3 -4
  52. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/ListItem/index.tsx +12 -10
  53. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/SearchMode.tsx +4 -2
  54. package/src/app/(main)/chat/{features → @session/features}/SessionListContent/index.tsx +2 -0
  55. package/src/app/(main)/chat/{features/SessionSearchBar/index.tsx → @session/features/SessionSearchBar.tsx} +3 -5
  56. package/src/app/(main)/chat/_layout/Desktop/SessionPanel.tsx +79 -0
  57. package/src/app/(main)/chat/_layout/Desktop/index.tsx +11 -7
  58. package/src/app/(main)/chat/_layout/Mobile.tsx +52 -0
  59. package/src/app/(main)/chat/_layout/type.ts +1 -0
  60. package/src/app/(main)/chat/error.tsx +5 -0
  61. package/src/app/(main)/chat/features/Migration/index.tsx +3 -8
  62. package/src/app/(main)/chat/not-found.tsx +3 -0
  63. package/src/app/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -4
  64. package/src/app/(main)/chat/settings/features/HeaderContent.tsx +2 -2
  65. package/src/app/(main)/chat/settings/features/SubmitAgentButton/index.tsx +2 -2
  66. package/src/app/(main)/market/@detail/features/Header.tsx +2 -2
  67. package/src/components/Cell/Divider.tsx +2 -2
  68. package/src/components/Cell/index.tsx +2 -2
  69. package/src/components/ModelTag/ModelIcon.tsx +2 -2
  70. package/src/components/StoreHydration/ChatHydration/index.tsx +2 -2
  71. package/src/const/session.ts +2 -0
  72. package/src/const/url.ts +5 -1
  73. package/src/features/ChatInput/ActionBar/Tools/index.tsx +3 -2
  74. package/src/features/ChatInput/STT/browser.tsx +2 -1
  75. package/src/features/ChatInput/STT/openai.tsx +2 -1
  76. package/src/features/ChatInput/useChatInput.ts +2 -1
  77. package/src/features/ChatInput/useSend.ts +2 -1
  78. package/src/features/Conversation/Actions/customAction.ts +9 -0
  79. package/src/features/Conversation/Extras/Assistant.tsx +2 -1
  80. package/src/features/Conversation/Extras/User.tsx +2 -1
  81. package/src/features/Conversation/components/AutoScroll.tsx +1 -1
  82. package/src/features/Conversation/components/ChatItem/index.tsx +22 -12
  83. package/src/features/Conversation/components/InboxWelcome/AgentsSuggest.tsx +1 -1
  84. package/src/features/Conversation/components/InboxWelcome/index.tsx +2 -2
  85. package/src/features/Conversation/components/SkeletonList.tsx +21 -8
  86. package/src/features/Conversation/components/VirtualizedList/index.tsx +19 -17
  87. package/src/features/Conversation/index.tsx +12 -31
  88. package/src/features/PluginStore/InstalledPluginList.tsx +28 -21
  89. package/src/features/PluginStore/OnlineList.tsx +4 -10
  90. package/src/features/PluginStore/PluginItem/Action.tsx +3 -2
  91. package/src/features/PluginStore/PluginItem/index.tsx +2 -0
  92. package/src/features/PluginStore/index.tsx +4 -2
  93. package/src/features/User/UserAvatar.tsx +2 -1
  94. package/src/features/User/UserPanel/useMenu.tsx +1 -1
  95. package/src/layout/GlobalProvider/AppTheme.tsx +7 -17
  96. package/src/libs/agent-runtime/openrouter/index.ts +4 -1
  97. package/src/store/chat/slices/message/action.test.ts +52 -2
  98. package/src/store/chat/slices/message/action.ts +40 -13
  99. package/src/store/chat/slices/message/initialState.ts +13 -1
  100. package/src/store/chat/slices/message/selectors.test.ts +1 -1
  101. package/src/store/chat/slices/message/selectors.ts +10 -1
  102. package/src/store/chat/slices/plugin/action.test.ts +10 -2
  103. package/src/store/chat/slices/plugin/action.ts +6 -2
  104. package/src/store/global/action.ts +2 -0
  105. package/src/store/global/initialState.ts +2 -0
  106. package/src/styles/global.ts +12 -9
  107. package/src/styles/mobileHeader.ts +1 -1
  108. package/src/app/(main)/(mobile)/me/features/AvatarBanner.tsx +0 -27
  109. package/src/app/(main)/(mobile)/me/features/style.ts +0 -29
  110. package/src/app/(main)/chat/(desktop)/features/Conversation.tsx +0 -19
  111. package/src/app/(main)/chat/(desktop)/index.tsx +0 -22
  112. package/src/app/(main)/chat/(mobile)/features/SessionList.tsx +0 -17
  113. package/src/app/(main)/chat/(mobile)/features/TopicList.tsx +0 -29
  114. package/src/app/(main)/chat/(mobile)/index.tsx +0 -26
  115. package/src/app/(main)/chat/(mobile)/mobile/ChatHeader/index.tsx +0 -56
  116. package/src/app/(main)/chat/(mobile)/mobile/page.tsx +0 -26
  117. package/src/app/(main)/chat/_layout/Desktop/SessionList.tsx +0 -39
  118. package/src/app/(main)/chat/_layout/Mobile/index.tsx +0 -9
  119. package/src/app/(main)/chat/page.tsx +0 -25
  120. package/src/features/FolderPanel/index.tsx +0 -60
  121. package/src/utils/screen.ts +0 -14
  122. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/DragUpload.tsx +0 -0
  123. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/LocalFiles.tsx +0 -0
  124. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Footer/SendMore.tsx +0 -0
  125. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/Header/index.tsx +0 -0
  126. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/__tests__/useAutoFocus.test.ts +0 -0
  127. /package/src/app/(main)/chat/{(desktop)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Desktop}/useAutoFocus.ts +0 -0
  128. /package/src/app/(main)/chat/{(mobile)/features/ChatInput → (workspace)/@conversation/features/ChatInput/Mobile}/Files.tsx +0 -0
  129. /package/src/app/(main)/chat/{(desktop)/features/SideBar → (workspace)/@topic/features}/SystemRole/style.ts +0 -0
  130. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/DefaultContent.tsx +0 -0
  131. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/SkeletonList.tsx +0 -0
  132. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicContent.tsx +0 -0
  133. /package/src/app/(main)/chat/{features → (workspace)/@topic/features}/TopicListContent/Topic/TopicItem.tsx +0 -0
  134. /package/src/app/(main)/chat/{(mobile)/mobile → (workspace)/_layout/Mobile}/ChatHeader/ChatHeaderTitle.tsx +0 -0
  135. /package/src/app/(main)/chat/{features → (workspace)/features}/PluginTag/PluginStatus.tsx +0 -0
  136. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/Preview.tsx +0 -0
  137. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/ShareModal.tsx +0 -0
  138. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/style.ts +0 -0
  139. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/type.ts +0 -0
  140. /package/src/app/(main)/chat/{features → (workspace)/features}/ShareButton/useScreenshot.ts +0 -0
  141. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/Actions.tsx +0 -0
  142. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/CollapseGroup/index.tsx +0 -0
  143. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/AddButton.tsx +0 -0
  144. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/List/Item/Actions.tsx +0 -0
  145. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/GroupItem.tsx +0 -0
  146. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/ConfigGroupModal/index.tsx +0 -0
  147. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/CreateGroupModal.tsx +0 -0
  148. /package/src/app/(main)/chat/{features → @session/features}/SessionListContent/Modals/RenameGroupModal.tsx +0 -0
  149. /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;
@@ -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
- };