@lobehub/lobehub 2.0.0-next.297 → 2.0.0-next.299

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 (88) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/changelog/v1.json +18 -0
  3. package/package.json +2 -2
  4. package/src/app/[variants]/(main)/agent/_layout/Sidebar/Cron/Actions.tsx +4 -13
  5. package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/Actions.tsx +4 -13
  6. package/src/app/[variants]/(main)/agent/_layout/Sidebar/Topic/index.tsx +2 -9
  7. package/src/app/[variants]/(main)/agent/features/Conversation/ConversationArea.tsx +2 -2
  8. package/src/app/[variants]/(main)/agent/features/Conversation/Header/Tags/KnowledgeTag.tsx +3 -4
  9. package/src/app/[variants]/(main)/agent/profile/features/ProfileEditor/MentionList/types.ts +4 -2
  10. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Nav.tsx +0 -1
  11. package/src/app/[variants]/(main)/community/(detail)/group_agent/features/Details/Related/index.tsx +9 -5
  12. package/src/app/[variants]/(main)/community/(detail)/model/features/Sidebar/ActionButton/ChatWithModel.tsx +3 -8
  13. package/src/app/[variants]/(main)/community/(list)/assistant/features/MarketSourceSwitch.tsx +44 -23
  14. package/src/app/[variants]/(main)/community/(list)/features/SortButton/index.tsx +40 -19
  15. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/Actions.tsx +4 -13
  16. package/src/app/[variants]/(main)/group/_layout/Sidebar/Topic/index.tsx +2 -9
  17. package/src/app/[variants]/(main)/group/features/Conversation/ConversationArea.tsx +2 -2
  18. package/src/app/[variants]/(main)/group/features/Conversation/Header/Tags/KnowledgeTag.tsx +3 -4
  19. package/src/app/[variants]/(main)/group/profile/features/AgentBuilder/AgentBuilderProvider.tsx +2 -2
  20. package/src/app/[variants]/(main)/group/profile/features/MemberProfile/MentionList/types.ts +4 -2
  21. package/src/app/[variants]/(main)/home/_layout/Body/Agent/Actions.tsx +3 -11
  22. package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Actions.tsx +3 -12
  23. package/src/app/[variants]/(main)/home/_layout/Body/Agent/List/Group/Item.tsx +2 -9
  24. package/src/app/[variants]/(main)/home/_layout/Body/Agent/index.tsx +2 -9
  25. package/src/app/[variants]/(main)/home/_layout/Body/Project/index.tsx +2 -9
  26. package/src/app/[variants]/(main)/home/_layout/HomeAgentIdSync.tsx +23 -0
  27. package/src/app/[variants]/(main)/home/_layout/index.tsx +2 -0
  28. package/src/app/[variants]/(main)/home/features/CommunityAgents/index.tsx +11 -13
  29. package/src/app/[variants]/(main)/home/features/FeaturedPlugins/index.tsx +11 -13
  30. package/src/app/[variants]/(main)/home/features/RecentPage/index.tsx +12 -14
  31. package/src/app/[variants]/(main)/home/features/RecentResource/index.tsx +12 -14
  32. package/src/app/[variants]/(main)/memory/contexts/features/ContextDropdown.tsx +5 -3
  33. package/src/app/[variants]/(main)/memory/experiences/features/ExperienceDropdown.tsx +5 -3
  34. package/src/app/[variants]/(main)/memory/identities/features/IdentityDropdown.tsx +5 -3
  35. package/src/app/[variants]/(main)/memory/preferences/features/PreferenceDropdown.tsx +5 -3
  36. package/src/app/[variants]/(main)/page/_layout/Body/Actions.tsx +3 -13
  37. package/src/app/[variants]/(main)/page/_layout/Body/index.tsx +2 -9
  38. package/src/app/[variants]/(main)/resource/features/DndContextWrapper.tsx +1 -1
  39. package/src/app/[variants]/(main)/settings/profile/features/SSOProvidersList/index.tsx +3 -3
  40. package/src/app/[variants]/(main)/settings/provider/ProviderMenu/Actions.tsx +3 -11
  41. package/src/app/[variants]/(main)/settings/provider/ProviderMenu/List.tsx +12 -28
  42. package/src/app/[variants]/(main)/settings/provider/features/ModelList/DisabledModels.tsx +7 -8
  43. package/src/app/[variants]/(main)/settings/provider/features/ModelList/ModelTitle/index.tsx +18 -20
  44. package/src/app/[variants]/(mobile)/(home)/features/SessionListContent/CollapseGroup/Actions.tsx +10 -14
  45. package/src/app/[variants]/(mobile)/(home)/features/SessionListContent/List/Item/Actions.tsx +3 -13
  46. package/src/app/[variants]/share/t/[id]/SharedMessageList.tsx +2 -2
  47. package/src/business/server/lambda-routers/file.ts +1 -1
  48. package/src/features/AgentBuilder/AgentBuilderProvider.tsx +2 -2
  49. package/src/features/ChatInput/ActionBar/History/index.tsx +1 -1
  50. package/src/features/ChatInput/ActionBar/STT/common.tsx +1 -1
  51. package/src/features/ChatInput/ActionBar/Search/index.tsx +1 -1
  52. package/src/features/ChatInput/ActionBar/Upload/ServerMode.tsx +1 -0
  53. package/src/features/ChatInput/ActionBar/components/Action.tsx +4 -8
  54. package/src/features/ChatInput/ActionBar/components/ActionDropdown.tsx +225 -37
  55. package/src/features/Conversation/ConversationProvider.tsx +2 -1
  56. package/src/features/Conversation/Messages/Assistant/Actions/index.tsx +10 -6
  57. package/src/features/Conversation/Messages/AssistantGroup/Actions/index.tsx +10 -6
  58. package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ApprovalActions.tsx +11 -13
  59. package/src/features/Conversation/Messages/AssistantGroup/Tool/Detail/Intervention/ModeSelector.tsx +8 -10
  60. package/src/features/Conversation/Messages/Supervisor/Actions/index.tsx +10 -6
  61. package/src/features/Conversation/Messages/Task/Actions/index.tsx +10 -6
  62. package/src/features/Conversation/Messages/User/Actions/index.tsx +10 -6
  63. package/src/features/Conversation/StoreUpdater.tsx +1 -1
  64. package/src/features/Conversation/store/initialState.ts +3 -1
  65. package/src/features/Conversation/store/slices/data/action.ts +6 -5
  66. package/src/features/LibraryModal/AssignKnowledgeBase/Item/Action.tsx +23 -26
  67. package/src/features/ModelSwitchPanel/components/List/MultipleProvidersModelItem.tsx +16 -18
  68. package/src/features/ModelSwitchPanel/styles.ts +18 -1
  69. package/src/features/PageEditor/Copilot/AgentSelector/Actions.tsx +6 -13
  70. package/src/features/PageEditor/PageAgentProvider.tsx +2 -2
  71. package/src/features/PluginStore/InstalledList/List/Item/Action.tsx +33 -36
  72. package/src/features/PluginStore/McpList/List/Action.tsx +25 -28
  73. package/src/features/PluginStore/PluginList/List/Action.tsx +25 -28
  74. package/src/features/PluginTag/index.tsx +3 -4
  75. package/src/features/Portal/Artifacts/Body/Renderer/SVG.tsx +14 -11
  76. package/src/features/Portal/Thread/Chat/index.tsx +2 -2
  77. package/src/features/ProfileEditor/AgentTool.tsx +1 -1
  78. package/src/features/ResourceManager/components/Explorer/ToolBar/SortDropdown.tsx +21 -18
  79. package/src/features/ResourceManager/components/Explorer/ToolBar/ViewSwitcher.tsx +7 -13
  80. package/src/features/ResourceManager/components/Header/AddButton.tsx +4 -11
  81. package/src/features/User/UserPanel/LangButton.tsx +56 -44
  82. package/src/layout/AuthProvider/MarketAuth/MarketAuthProvider.tsx +1 -1
  83. package/src/services/discover.ts +6 -4
  84. package/src/services/document/index.ts +11 -1
  85. package/src/store/page/slices/crud/action.ts +0 -48
  86. package/src/store/tool/slices/lobehubSkillStore/action.ts +1 -2
  87. package/src/styles/global.ts +2 -2
  88. package/src/types/shim-lobe-ui.d.ts +7 -0
@@ -1,4 +1,4 @@
1
- import { ActionIcon, Dropdown, type MenuProps } from '@lobehub/ui';
1
+ import { ActionIcon, DropdownMenu, type MenuProps } from '@lobehub/ui';
2
2
  import { MoreHorizontalIcon } from 'lucide-react';
3
3
  import { memo } from 'react';
4
4
 
@@ -9,22 +9,14 @@ interface ActionsProps {
9
9
 
10
10
  const Actions = memo<ActionsProps>(({ dropdownMenu, isLoading }) => {
11
11
  return (
12
- <Dropdown
13
- menu={{
14
- items: dropdownMenu,
15
- onClick: ({ domEvent }) => {
16
- domEvent.stopPropagation();
17
- },
18
- }}
19
- trigger={['click']}
20
- >
12
+ <DropdownMenu items={dropdownMenu}>
21
13
  <ActionIcon
22
14
  icon={MoreHorizontalIcon}
23
15
  loading={isLoading}
24
16
  size={'small'}
25
17
  style={{ flex: 'none' }}
26
18
  />
27
- </Dropdown>
19
+ </DropdownMenu>
28
20
  );
29
21
  });
30
22
 
@@ -1,4 +1,4 @@
1
- import { ActionIcon, Dropdown, type MenuProps } from '@lobehub/ui';
1
+ import { ActionIcon, DropdownMenu, type MenuProps } from '@lobehub/ui';
2
2
  import { MoreHorizontalIcon } from 'lucide-react';
3
3
  import { memo } from 'react';
4
4
 
@@ -9,16 +9,7 @@ interface ActionsProps {
9
9
 
10
10
  const Actions = memo<ActionsProps>(({ dropdownMenu, isLoading }) => {
11
11
  return (
12
- <Dropdown
13
- arrow={false}
14
- menu={{
15
- items: dropdownMenu,
16
- onClick: ({ domEvent }) => {
17
- domEvent.stopPropagation();
18
- },
19
- }}
20
- trigger={['click']}
21
- >
12
+ <DropdownMenu items={dropdownMenu}>
22
13
  <ActionIcon
23
14
  icon={MoreHorizontalIcon}
24
15
  loading={isLoading}
@@ -27,7 +18,7 @@ const Actions = memo<ActionsProps>(({ dropdownMenu, isLoading }) => {
27
18
  }}
28
19
  size={'small'}
29
20
  />
30
- </Dropdown>
21
+ </DropdownMenu>
31
22
  );
32
23
  });
33
24
 
@@ -1,5 +1,5 @@
1
1
  import type { SidebarGroup } from '@lobechat/types';
2
- import { AccordionItem, Dropdown, Flexbox, Icon, Text } from '@lobehub/ui';
2
+ import { AccordionItem, ContextMenuTrigger, Flexbox, Icon, Text } from '@lobehub/ui';
3
3
  import { createStaticStyles } from 'antd-style';
4
4
  import { HashIcon, Loader2 } from 'lucide-react';
5
5
  import React, { memo, useCallback, useMemo } from 'react';
@@ -61,14 +61,7 @@ const GroupItem = memo<SidebarGroup>(({ items, id, name }) => {
61
61
  action={<Actions dropdownMenu={dropdownMenu} isLoading={isLoading} />}
62
62
  disabled={editing || isUpdating}
63
63
  headerWrapper={(header) => (
64
- <Dropdown
65
- menu={{
66
- items: dropdownMenu,
67
- }}
68
- trigger={['contextMenu']}
69
- >
70
- {header}
71
- </Dropdown>
64
+ <ContextMenuTrigger items={dropdownMenu}>{header}</ContextMenuTrigger>
72
65
  )}
73
66
  itemKey={id}
74
67
  key={id}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { AccordionItem, Dropdown, Flexbox, Text } from '@lobehub/ui';
3
+ import { AccordionItem, ContextMenuTrigger, Flexbox, Text } from '@lobehub/ui';
4
4
  import React, { Suspense, memo, useCallback } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
@@ -39,14 +39,7 @@ const Agent = memo<AgentProps>(({ itemKey }) => {
39
39
  <AccordionItem
40
40
  action={<Actions dropdownMenu={dropdownMenu} isLoading={isLoading} />}
41
41
  headerWrapper={(header) => (
42
- <Dropdown
43
- menu={{
44
- items: dropdownMenu,
45
- }}
46
- trigger={['contextMenu']}
47
- >
48
- {header}
49
- </Dropdown>
42
+ <ContextMenuTrigger items={dropdownMenu}>{header}</ContextMenuTrigger>
50
43
  )}
51
44
  itemKey={itemKey}
52
45
  paddingBlock={4}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { AccordionItem, Dropdown, Text } from '@lobehub/ui';
3
+ import { AccordionItem, ContextMenuTrigger, Text } from '@lobehub/ui';
4
4
  import React, { Suspense, memo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
@@ -21,14 +21,7 @@ const Project = memo<ProjectProps>(({ itemKey }) => {
21
21
  <AccordionItem
22
22
  action={<Actions />}
23
23
  headerWrapper={(header) => (
24
- <Dropdown
25
- menu={{
26
- items: dropdownMenu,
27
- }}
28
- trigger={['contextMenu']}
29
- >
30
- {header}
31
- </Dropdown>
24
+ <ContextMenuTrigger items={dropdownMenu}>{header}</ContextMenuTrigger>
32
25
  )}
33
26
  itemKey={itemKey}
34
27
  paddingBlock={4}
@@ -0,0 +1,23 @@
1
+ import { useUnmount } from 'ahooks';
2
+ import { createStoreUpdater } from 'zustand-utils';
3
+
4
+ import { useAgentStore } from '@/store/agent';
5
+ import { builtinAgentSelectors } from '@/store/agent/selectors';
6
+
7
+ const HomeAgentIdSync = () => {
8
+ const useAgentStoreUpdater = createStoreUpdater(useAgentStore);
9
+
10
+ const inboxAgentId = useAgentStore(builtinAgentSelectors.inboxAgentId);
11
+
12
+ // Sync inbox agent id to activeAgentId when on home page
13
+ useAgentStoreUpdater('activeAgentId', inboxAgentId);
14
+
15
+ // Clear activeAgentId when unmounting (leaving home page)
16
+ useUnmount(() => {
17
+ useAgentStore.setState({ activeAgentId: undefined });
18
+ });
19
+
20
+ return null;
21
+ };
22
+
23
+ export default HomeAgentIdSync;
@@ -6,6 +6,7 @@ import { Outlet, useLocation, useNavigate } from 'react-router-dom';
6
6
  import { useIsDark } from '@/hooks/useIsDark';
7
7
  import { useHomeStore } from '@/store/home';
8
8
 
9
+ import HomeAgentIdSync from './HomeAgentIdSync';
9
10
  import RecentHydration from './RecentHydration';
10
11
  import Sidebar from './Sidebar';
11
12
  import { styles } from './style';
@@ -56,6 +57,7 @@ const Layout: FC<LayoutProps> = ({ children }) => {
56
57
  {content}
57
58
  </Flexbox>
58
59
 
60
+ <HomeAgentIdSync />
59
61
  <RecentHydration />
60
62
  </Flexbox>
61
63
  </Activity>
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { ActionIcon, Dropdown } from '@lobehub/ui';
3
+ import { ActionIcon, DropdownMenu } from '@lobehub/ui';
4
4
  import { BotIcon, MoreHorizontal } from 'lucide-react';
5
5
  import { Suspense, memo } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
@@ -18,21 +18,19 @@ const CommunityAgents = memo(() => {
18
18
  return (
19
19
  <GroupBlock
20
20
  action={
21
- <Dropdown
22
- menu={{
23
- items: [
24
- {
25
- key: 'all-assistants',
26
- label: t('home.more'),
27
- onClick: () => {
28
- navigate('/community/assistant');
29
- },
21
+ <DropdownMenu
22
+ items={[
23
+ {
24
+ key: 'all-assistants',
25
+ label: t('home.more'),
26
+ onClick: () => {
27
+ navigate('/community/assistant');
30
28
  },
31
- ],
32
- }}
29
+ },
30
+ ]}
33
31
  >
34
32
  <ActionIcon icon={MoreHorizontal} size="small" />
35
- </Dropdown>
33
+ </DropdownMenu>
36
34
  }
37
35
  icon={BotIcon}
38
36
  title={t('home.communityAgents')}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { MCP } from '@lobehub/icons';
4
- import { ActionIcon, Dropdown, Grid } from '@lobehub/ui';
4
+ import { ActionIcon, DropdownMenu, Grid } from '@lobehub/ui';
5
5
  import { cssVar } from 'antd-style';
6
6
  import { MoreHorizontal } from 'lucide-react';
7
7
  import { Suspense, memo } from 'react';
@@ -20,21 +20,19 @@ const FeaturedPlugins = memo(() => {
20
20
  return (
21
21
  <GroupBlock
22
22
  action={
23
- <Dropdown
24
- menu={{
25
- items: [
26
- {
27
- key: 'all-plugins',
28
- label: t('home.more'),
29
- onClick: () => {
30
- navigate('/community/mcp');
31
- },
23
+ <DropdownMenu
24
+ items={[
25
+ {
26
+ key: 'all-plugins',
27
+ label: t('home.more'),
28
+ onClick: () => {
29
+ navigate('/community/mcp');
32
30
  },
33
- ],
34
- }}
31
+ },
32
+ ]}
35
33
  >
36
34
  <ActionIcon icon={MoreHorizontal} size="small" />
37
- </Dropdown>
35
+ </DropdownMenu>
38
36
  }
39
37
  icon={<MCP color={cssVar.colorTextDescription} size={18} />}
40
38
  title={t('home.featuredPlugins')}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { ActionIcon, Dropdown } from '@lobehub/ui';
3
+ import { ActionIcon, DropdownMenu } from '@lobehub/ui';
4
4
  import { FileTextIcon, MoreHorizontal } from 'lucide-react';
5
5
  import { Suspense, memo } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
@@ -37,22 +37,20 @@ const RecentPage = memo(() => {
37
37
  action={
38
38
  <>
39
39
  {isRevalidating && <NeuralNetworkLoading size={14} />}
40
- <Dropdown
41
- menu={{
42
- items: [
43
- {
44
- key: 'all-documents',
45
- label: t('menu.allPages'),
46
- onClick: () => {
47
- setCategory(FilesTabs.Pages);
48
- navigate('/resource');
49
- },
40
+ <DropdownMenu
41
+ items={[
42
+ {
43
+ key: 'all-documents',
44
+ label: t('menu.allPages'),
45
+ onClick: () => {
46
+ setCategory(FilesTabs.Pages);
47
+ navigate('/resource');
50
48
  },
51
- ],
52
- }}
49
+ },
50
+ ]}
53
51
  >
54
52
  <ActionIcon icon={MoreHorizontal} size="small" />
55
- </Dropdown>
53
+ </DropdownMenu>
56
54
  </>
57
55
  }
58
56
  icon={FileTextIcon}
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { ActionIcon, Dropdown } from '@lobehub/ui';
3
+ import { ActionIcon, DropdownMenu } from '@lobehub/ui';
4
4
  import { Clock, MoreHorizontal } from 'lucide-react';
5
5
  import { Suspense, memo } from 'react';
6
6
  import { useTranslation } from 'react-i18next';
@@ -37,22 +37,20 @@ const RecentResource = memo(() => {
37
37
  action={
38
38
  <>
39
39
  {isRevalidating && <NeuralNetworkLoading size={14} />}
40
- <Dropdown
41
- menu={{
42
- items: [
43
- {
44
- key: 'all-files',
45
- label: t('menu.allFiles'),
46
- onClick: () => {
47
- setCategory(FilesTabs.All);
48
- navigate('/resource');
49
- },
40
+ <DropdownMenu
41
+ items={[
42
+ {
43
+ key: 'all-files',
44
+ label: t('menu.allFiles'),
45
+ onClick: () => {
46
+ setCategory(FilesTabs.All);
47
+ navigate('/resource');
50
48
  },
51
- ],
52
- }}
49
+ },
50
+ ]}
53
51
  >
54
52
  <ActionIcon icon={MoreHorizontal} size="small" />
55
- </Dropdown>
53
+ </DropdownMenu>
56
54
  </>
57
55
  }
58
56
  icon={Clock}
@@ -1,4 +1,4 @@
1
- import { ActionIcon, type ActionIconProps, Dropdown } from '@lobehub/ui';
1
+ import { ActionIcon, type ActionIconProps, DropdownMenu } from '@lobehub/ui';
2
2
  import { App } from 'antd';
3
3
  import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react';
4
4
  import { type KeyboardEvent, type MouseEvent, memo } from 'react';
@@ -47,19 +47,21 @@ const ContextDropdown = memo<ContextDropdownProps>(({ id, size = 'small' }) => {
47
47
  icon: <Pencil size={14} />,
48
48
  key: 'edit',
49
49
  label: t('context.actions.edit'),
50
+ onClick: handleMenuClick,
50
51
  },
51
52
  {
52
53
  danger: true,
53
54
  icon: <Trash2 size={14} />,
54
55
  key: 'delete',
55
56
  label: t('context.actions.delete'),
57
+ onClick: handleMenuClick,
56
58
  },
57
59
  ];
58
60
 
59
61
  return (
60
- <Dropdown menu={{ items: menuItems, onClick: handleMenuClick }} trigger={['click']}>
62
+ <DropdownMenu items={menuItems}>
61
63
  <ActionIcon icon={MoreHorizontal} size={size} />
62
- </Dropdown>
64
+ </DropdownMenu>
63
65
  );
64
66
  });
65
67
 
@@ -1,4 +1,4 @@
1
- import { ActionIcon, type ActionIconProps, Dropdown } from '@lobehub/ui';
1
+ import { ActionIcon, type ActionIconProps, DropdownMenu } from '@lobehub/ui';
2
2
  import { App } from 'antd';
3
3
  import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react';
4
4
  import { type KeyboardEvent, type MouseEvent, memo } from 'react';
@@ -47,19 +47,21 @@ const ExperienceDropdown = memo<ExperienceDropdownProps>(({ id, size = 'small' }
47
47
  icon: <Pencil size={14} />,
48
48
  key: 'edit',
49
49
  label: t('experience.actions.edit'),
50
+ onClick: handleMenuClick,
50
51
  },
51
52
  {
52
53
  danger: true,
53
54
  icon: <Trash2 size={14} />,
54
55
  key: 'delete',
55
56
  label: t('experience.actions.delete'),
57
+ onClick: handleMenuClick,
56
58
  },
57
59
  ];
58
60
 
59
61
  return (
60
- <Dropdown menu={{ items: menuItems, onClick: handleMenuClick }} trigger={['click']}>
62
+ <DropdownMenu items={menuItems}>
61
63
  <ActionIcon icon={MoreHorizontal} size={size} />
62
- </Dropdown>
64
+ </DropdownMenu>
63
65
  );
64
66
  });
65
67
 
@@ -1,4 +1,4 @@
1
- import { ActionIcon, type ActionIconProps, Dropdown } from '@lobehub/ui';
1
+ import { ActionIcon, type ActionIconProps, DropdownMenu } from '@lobehub/ui';
2
2
  import { App } from 'antd';
3
3
  import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react';
4
4
  import { type KeyboardEvent, type MouseEvent, memo } from 'react';
@@ -47,19 +47,21 @@ const IdentityDropdown = memo<IdentityDropdownProps>(({ id, size = 'small' }) =>
47
47
  icon: <Pencil size={14} />,
48
48
  key: 'edit',
49
49
  label: t('edit', { ns: 'common' }),
50
+ onClick: handleMenuClick,
50
51
  },
51
52
  {
52
53
  danger: true,
53
54
  icon: <Trash2 size={14} />,
54
55
  key: 'delete',
55
56
  label: t('delete', { ns: 'common' }),
57
+ onClick: handleMenuClick,
56
58
  },
57
59
  ];
58
60
 
59
61
  return (
60
- <Dropdown menu={{ items: menuItems, onClick: handleMenuClick }} trigger={['click']}>
62
+ <DropdownMenu items={menuItems}>
61
63
  <ActionIcon icon={MoreHorizontal} size={size} />
62
- </Dropdown>
64
+ </DropdownMenu>
63
65
  );
64
66
  });
65
67
 
@@ -1,4 +1,4 @@
1
- import { ActionIcon, type ActionIconProps, Dropdown } from '@lobehub/ui';
1
+ import { ActionIcon, type ActionIconProps, DropdownMenu } from '@lobehub/ui';
2
2
  import { App } from 'antd';
3
3
  import { MoreHorizontal, Pencil, Trash2 } from 'lucide-react';
4
4
  import { type KeyboardEvent, type MouseEvent, memo } from 'react';
@@ -47,19 +47,21 @@ const PreferenceDropdown = memo<PreferenceDropdownProps>(({ id, size = 'small' }
47
47
  icon: <Pencil size={14} />,
48
48
  key: 'edit',
49
49
  label: t('preference.actions.edit'),
50
+ onClick: handleMenuClick,
50
51
  },
51
52
  {
52
53
  danger: true,
53
54
  icon: <Trash2 size={14} />,
54
55
  key: 'delete',
55
56
  label: t('preference.actions.delete'),
57
+ onClick: handleMenuClick,
56
58
  },
57
59
  ];
58
60
 
59
61
  return (
60
- <Dropdown menu={{ items: menuItems, onClick: handleMenuClick }} trigger={['click']}>
62
+ <DropdownMenu items={menuItems}>
61
63
  <ActionIcon icon={MoreHorizontal} size={size} />
62
- </Dropdown>
64
+ </DropdownMenu>
63
65
  );
64
66
  });
65
67
 
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { ActionIcon, Dropdown } from '@lobehub/ui';
4
- import type { MenuProps } from '@lobehub/ui';
3
+ import { ActionIcon, DropdownMenu, type MenuProps } from '@lobehub/ui';
5
4
  import { MoreHorizontal } from 'lucide-react';
6
5
  import { memo } from 'react';
7
6
 
@@ -11,18 +10,9 @@ const Actions = memo(() => {
11
10
  const items: MenuProps['items'] = useDropdownMenu();
12
11
 
13
12
  return (
14
- <Dropdown
15
- arrow={false}
16
- menu={{
17
- items,
18
- onClick: ({ domEvent }) => {
19
- domEvent.stopPropagation();
20
- },
21
- }}
22
- trigger={['click']}
23
- >
13
+ <DropdownMenu items={items}>
24
14
  <ActionIcon icon={MoreHorizontal} size={'small'} />
25
- </Dropdown>
15
+ </DropdownMenu>
26
16
  );
27
17
  });
28
18
 
@@ -1,6 +1,6 @@
1
1
  'use client';
2
2
 
3
- import { Accordion, AccordionItem, Dropdown, Flexbox, Text } from '@lobehub/ui';
3
+ import { Accordion, AccordionItem, ContextMenuTrigger, Flexbox, Text } from '@lobehub/ui';
4
4
  import React, { Suspense, memo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
 
@@ -44,14 +44,7 @@ const Body = memo(() => {
44
44
  <AccordionItem
45
45
  action={<Actions />}
46
46
  headerWrapper={(header) => (
47
- <Dropdown
48
- menu={{
49
- items: dropdownMenu,
50
- }}
51
- trigger={['contextMenu']}
52
- >
53
- {header}
54
- </Dropdown>
47
+ <ContextMenuTrigger items={dropdownMenu}>{header}</ContextMenuTrigger>
55
48
  )}
56
49
  itemKey={GroupKey.AllPages}
57
50
  paddingBlock={4}
@@ -61,7 +61,7 @@ interface DragState {
61
61
  const DragStateContext = createContext<{
62
62
  currentDrag: DragState | null;
63
63
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
64
- setCurrentDrag: (state: DragState | null) => void;
64
+ setCurrentDrag: (_state: DragState | null) => void;
65
65
  }>({
66
66
  currentDrag: null,
67
67
  setCurrentDrag: () => {},
@@ -1,5 +1,5 @@
1
1
  import { isDesktop } from '@lobechat/const';
2
- import { ActionIcon, Dropdown, Flexbox, type MenuProps, Text } from '@lobehub/ui';
2
+ import { ActionIcon, DropdownMenu, Flexbox, type MenuProps, Text } from '@lobehub/ui';
3
3
  import { ArrowRight, Plus, Unlink } from 'lucide-react';
4
4
  import { type CSSProperties, memo, useMemo } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
@@ -120,13 +120,13 @@ export const SSOProvidersList = memo(() => {
120
120
 
121
121
  {/* Link Account Button - Only show for Better-Auth users with available providers */}
122
122
  {enableBetterAuthActions && availableProviders.length > 0 && (
123
- <Dropdown menu={{ items: linkMenuItems, style: { maxWidth: '200px' } }} trigger={['click']}>
123
+ <DropdownMenu items={linkMenuItems} popupProps={{ style: { maxWidth: '200px' } }}>
124
124
  <Flexbox align={'center'} gap={6} horizontal style={{ cursor: 'pointer', fontSize: 12 }}>
125
125
  <Plus size={14} />
126
126
  <span>{t('profile.sso.link.button')}</span>
127
127
  <ArrowRight size={14} />
128
128
  </Flexbox>
129
- </Dropdown>
129
+ </DropdownMenu>
130
130
  )}
131
131
  </Flexbox>
132
132
  );
@@ -1,4 +1,4 @@
1
- import { ActionIcon, Dropdown, type MenuProps } from '@lobehub/ui';
1
+ import { ActionIcon, DropdownMenu, type MenuProps } from '@lobehub/ui';
2
2
  import { MoreHorizontalIcon } from 'lucide-react';
3
3
  import { memo } from 'react';
4
4
 
@@ -8,17 +8,9 @@ interface ActionsProps {
8
8
 
9
9
  const Actions = memo<ActionsProps>(({ dropdownMenu }) => {
10
10
  return (
11
- <Dropdown
12
- menu={{
13
- items: dropdownMenu,
14
- onClick: ({ domEvent }) => {
15
- domEvent.stopPropagation();
16
- },
17
- }}
18
- trigger={['click']}
19
- >
11
+ <DropdownMenu items={dropdownMenu}>
20
12
  <ActionIcon icon={MoreHorizontalIcon} size={'small'} style={{ flex: 'none' }} />
21
- </Dropdown>
13
+ </DropdownMenu>
22
14
  );
23
15
  });
24
16
 
@@ -1,6 +1,13 @@
1
1
  'use client';
2
2
 
3
- import { Accordion, AccordionItem, ActionIcon, Dropdown, Flexbox, Text } from '@lobehub/ui';
3
+ import {
4
+ Accordion,
5
+ AccordionItem,
6
+ ActionIcon,
7
+ ContextMenuTrigger,
8
+ Flexbox,
9
+ Text,
10
+ } from '@lobehub/ui';
4
11
  import isEqual from 'fast-deep-equal';
5
12
  import { ArrowDownUpIcon } from 'lucide-react';
6
13
  import { useCallback, useMemo, useState } from 'react';
@@ -113,16 +120,7 @@ const ProviderList = (props: {
113
120
  />
114
121
  </div>
115
122
  }
116
- headerWrapper={(header) => (
117
- <Dropdown
118
- menu={{
119
- items: [],
120
- }}
121
- trigger={['contextMenu']}
122
- >
123
- {header}
124
- </Dropdown>
125
- )}
123
+ headerWrapper={(header) => <ContextMenuTrigger items={[]}>{header}</ContextMenuTrigger>}
126
124
  itemKey="enabled"
127
125
  paddingBlock={4}
128
126
  paddingInline={'8px 4px'}
@@ -142,16 +140,7 @@ const ProviderList = (props: {
142
140
  {/* Custom Providers */}
143
141
  {disabledCustomProviderList.length > 0 && (
144
142
  <AccordionItem
145
- headerWrapper={(header) => (
146
- <Dropdown
147
- menu={{
148
- items: [],
149
- }}
150
- trigger={['contextMenu']}
151
- >
152
- {header}
153
- </Dropdown>
154
- )}
143
+ headerWrapper={(header) => <ContextMenuTrigger items={[]}>{header}</ContextMenuTrigger>}
155
144
  itemKey="custom"
156
145
  paddingBlock={4}
157
146
  paddingInline={'8px 4px'}
@@ -177,14 +166,9 @@ const ProviderList = (props: {
177
166
  ) : undefined
178
167
  }
179
168
  headerWrapper={(header) => (
180
- <Dropdown
181
- menu={{
182
- items: disabledModelProviderList.length > 1 ? dropdownMenu : [],
183
- }}
184
- trigger={['contextMenu']}
185
- >
169
+ <ContextMenuTrigger items={disabledModelProviderList.length > 1 ? dropdownMenu : []}>
186
170
  {header}
187
- </Dropdown>
171
+ </ContextMenuTrigger>
188
172
  )}
189
173
  itemKey="disabled"
190
174
  paddingBlock={4}