Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

⬆️ chore(deps): migrate @lobehub/ui to base-ui exports (#12587)

Inneic4d85d100c77
diff --git a/package.json b/package.json
index 27e81ad5d0c..79a698fad97 100644
--- a/package.json
+++ b/package.json
@@ -228,15 +228,15 @@
"@lobechat/utils": "workspace:*",
"@lobechat/web-crawler": "workspace:*",
"@lobehub/analytics": "^1.6.0",
- "@lobehub/charts": "^4.0.3",
+ "@lobehub/charts": "^5.0.0",
"@lobehub/chat-plugin-sdk": "^1.32.4",
"@lobehub/chat-plugins-gateway": "^1.9.0",
"@lobehub/desktop-ipc-typings": "workspace:*",
- "@lobehub/editor": "^3.16.1",
- "@lobehub/icons": "^4.9.0",
- "@lobehub/market-sdk": "^0.30.3",
- "@lobehub/tts": "^4.0.2",
- "@lobehub/ui": "^4.38.4",
+ "@lobehub/editor": "^4.0.0",
+ "@lobehub/icons": "^5.0.0",
+ "@lobehub/market-sdk": "^0.31.1",
+ "@lobehub/tts": "^5.1.2",
+ "@lobehub/ui": "^5.0.0",
"@modelcontextprotocol/sdk": "^1.26.0",
"@napi-rs/canvas": "^0.1.88",
"@neondatabase/serverless": "^1.0.2",
diff --git a/packages/builtin-tool-agent-builder/package.json b/packages/builtin-tool-agent-builder/package.json
index 823cacbe364..62131fb007a 100644
--- a/packages/builtin-tool-agent-builder/package.json
+++ b/packages/builtin-tool-agent-builder/package.json
@@ -18,7 +18,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"lucide-react": "*",
"next": "*",
diff --git a/packages/builtin-tool-calculator/package.json b/packages/builtin-tool-calculator/package.json
index bbb64e95305..dcd76702c31 100644
--- a/packages/builtin-tool-calculator/package.json
+++ b/packages/builtin-tool-calculator/package.json
@@ -18,7 +18,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd-style": "*",
"lucide-react": "*",
"react": "*",
diff --git a/packages/builtin-tool-cloud-sandbox/package.json b/packages/builtin-tool-cloud-sandbox/package.json
index f05d785c173..2c204f508d4 100644
--- a/packages/builtin-tool-cloud-sandbox/package.json
+++ b/packages/builtin-tool-cloud-sandbox/package.json
@@ -13,7 +13,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"antd-style": "*",
"lucide-react": "*",
diff --git a/packages/builtin-tool-group-agent-builder/package.json b/packages/builtin-tool-group-agent-builder/package.json
index 595e5ceb5bc..56c7e00f7a2 100644
--- a/packages/builtin-tool-group-agent-builder/package.json
+++ b/packages/builtin-tool-group-agent-builder/package.json
@@ -17,7 +17,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"lucide-react": "*",
"react": "*",
diff --git a/packages/builtin-tool-gtd/package.json b/packages/builtin-tool-gtd/package.json
index 18a88540b37..1057d4541a7 100644
--- a/packages/builtin-tool-gtd/package.json
+++ b/packages/builtin-tool-gtd/package.json
@@ -16,8 +16,8 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/editor": "^3",
- "@lobehub/ui": "^4",
+ "@lobehub/editor": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"antd-style": "*",
"lucide-react": "*",
diff --git a/packages/builtin-tool-knowledge-base/package.json b/packages/builtin-tool-knowledge-base/package.json
index 50c2744529b..c4cbae5cf10 100644
--- a/packages/builtin-tool-knowledge-base/package.json
+++ b/packages/builtin-tool-knowledge-base/package.json
@@ -16,7 +16,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"antd-style": "*",
"polished": "*",
diff --git a/packages/builtin-tool-local-system/package.json b/packages/builtin-tool-local-system/package.json
index 86acf9f575f..b9a3e305c28 100644
--- a/packages/builtin-tool-local-system/package.json
+++ b/packages/builtin-tool-local-system/package.json
@@ -15,7 +15,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"antd-style": "*",
"lucide-react": "*",
diff --git a/packages/builtin-tool-memory/package.json b/packages/builtin-tool-memory/package.json
index aab255df0d3..f5e6b16b8d3 100644
--- a/packages/builtin-tool-memory/package.json
+++ b/packages/builtin-tool-memory/package.json
@@ -23,7 +23,7 @@
"promptfoo": "^0.120.17"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd-style": "*",
"lucide-react": "*",
"react": "*",
diff --git a/packages/builtin-tool-notebook/package.json b/packages/builtin-tool-notebook/package.json
index b5258fc7762..8cb3b9db2be 100644
--- a/packages/builtin-tool-notebook/package.json
+++ b/packages/builtin-tool-notebook/package.json
@@ -16,7 +16,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"antd-style": "*",
"lucide-react": "*",
diff --git a/packages/builtin-tool-page-agent/package.json b/packages/builtin-tool-page-agent/package.json
index 3c9c4d055f8..0f7330ef608 100644
--- a/packages/builtin-tool-page-agent/package.json
+++ b/packages/builtin-tool-page-agent/package.json
@@ -15,7 +15,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd-style": "*",
"debug": "*",
"lucide-react": "*",
diff --git a/packages/builtin-tool-skill-store/package.json b/packages/builtin-tool-skill-store/package.json
index 9dd21d5c46c..0a5ba98ce76 100644
--- a/packages/builtin-tool-skill-store/package.json
+++ b/packages/builtin-tool-skill-store/package.json
@@ -13,7 +13,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "*",
+ "@lobehub/ui": "^5",
"antd-style": "*",
"react": "*",
"react-i18next": "*"
diff --git a/packages/builtin-tool-skills/package.json b/packages/builtin-tool-skills/package.json
index 6081af04191..ad0243f2c8c 100644
--- a/packages/builtin-tool-skills/package.json
+++ b/packages/builtin-tool-skills/package.json
@@ -17,7 +17,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "*",
+ "@lobehub/ui": "^5",
"antd-style": "*",
"react": "*",
"react-i18next": "*"
diff --git a/packages/builtin-tool-web-browsing/package.json b/packages/builtin-tool-web-browsing/package.json
index 0eda903fb9a..d1b65733dad 100644
--- a/packages/builtin-tool-web-browsing/package.json
+++ b/packages/builtin-tool-web-browsing/package.json
@@ -15,7 +15,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd": "^6",
"antd-style": "*",
"lucide-react": "*",
diff --git a/packages/builtin-tools/package.json b/packages/builtin-tools/package.json
index b51129c43f9..f6b88828ef3 100644
--- a/packages/builtin-tools/package.json
+++ b/packages/builtin-tools/package.json
@@ -36,7 +36,7 @@
"@lobechat/types": "workspace:*"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"antd-style": "*",
"lucide-react": "*",
"react": "*",
diff --git a/packages/const/package.json b/packages/const/package.json
index 5af6655326c..4f37ce373d0 100644
--- a/packages/const/package.json
+++ b/packages/const/package.json
@@ -17,7 +17,7 @@
},
"peerDependencies": {
"@icons-pack/react-simple-icons": "^13.8.0",
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"klavis": "^2.15.0"
}
}
diff --git a/packages/editor-runtime/package.json b/packages/editor-runtime/package.json
index e95884929cf..038d3818d6e 100644
--- a/packages/editor-runtime/package.json
+++ b/packages/editor-runtime/package.json
@@ -13,7 +13,7 @@
"lexical": "^0.39.0"
},
"peerDependencies": {
- "@lobehub/editor": "^3",
+ "@lobehub/editor": "^4",
"debug": "*"
}
}
diff --git a/packages/types/package.json b/packages/types/package.json
index 2bcc27c3ab6..83ce92aeb36 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -8,14 +8,14 @@
"@lobechat/python-interpreter": "workspace:*",
"@lobechat/web-crawler": "workspace:*",
"@lobehub/chat-plugin-sdk": "^1.32.4",
- "@lobehub/market-sdk": "0.29.3",
+ "@lobehub/market-sdk": "^0.31.1",
"@lobehub/market-types": "^1.12.3",
"model-bank": "workspace:*",
"type-fest": "^4.41.0",
"zustand": "5.0.4"
},
"peerDependencies": {
- "@lobehub/ui": "^4",
+ "@lobehub/ui": "^5",
"react": "*",
"zod": "^3.25.76"
}
diff --git a/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx b/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx
index 6d8a600fca3..4fd07f1ee5b 100644
--- a/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx
+++ b/src/features/ChatInput/ActionBar/Search/FunctionCallingModelSelect/index.tsx
@@ -1,5 +1,5 @@
-import { type LobeSelectProps } from '@lobehub/ui';
-import { LobeSelect, TooltipGroup } from '@lobehub/ui';
+import { TooltipGroup } from '@lobehub/ui';
+import { Select, type SelectProps } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { type ReactNode } from 'react';
import { memo, useMemo } from 'react';
@@ -25,7 +25,7 @@ interface ModelOption {
value: string;
}
-interface ModelSelectProps extends Omit<LobeSelectProps, 'onChange' | 'value'> {
+interface ModelSelectProps extends Omit<SelectProps, 'onChange' | 'value'> {
onChange?: (props: WorkingModel) => void;
showAbility?: boolean;
value?: WorkingModel;
@@ -34,7 +34,7 @@ interface ModelSelectProps extends Omit<LobeSelectProps, 'onChange' | 'value'> {
const ModelSelect = memo<ModelSelectProps>(({ value, onChange, ...rest }) => {
const enabledList = useEnabledChatModels();
- const options = useMemo<LobeSelectProps['options']>(() => {
+ const options = useMemo<SelectProps['options']>(() => {
const getChatModels = (provider: EnabledProviderWithModels) =>
provider.children
.filter((model) => !!model.abilities.functionCall)
@@ -71,14 +71,15 @@ const ModelSelect = memo<ModelSelectProps>(({ value, onChange, ...rest }) => {
return (
<TooltipGroup>
- <LobeSelect
+ <Select
options={options}
popupClassName={styles.select}
popupMatchSelectWidth={false}
value={`${value?.provider}/${value?.model}`}
variant={'filled'}
onChange={(value, option) => {
- const model = value.split('/').slice(1).join('/');
+ if (!value) return;
+ const model = (value as string).split('/').slice(1).join('/');
onChange?.({ model, provider: (option as unknown as ModelOption).provider });
}}
{...rest}
diff --git a/src/features/ModelSelect/index.tsx b/src/features/ModelSelect/index.tsx
index 51ecce0e604..d2d17fb8ec4 100644
--- a/src/features/ModelSelect/index.tsx
+++ b/src/features/ModelSelect/index.tsx
@@ -1,13 +1,15 @@
-import { type LobeSelectProps } from '@lobehub/ui';
-import { LobeSelect, TooltipGroup } from '@lobehub/ui';
-import { createStyles } from 'antd-style';
+import { TooltipGroup } from '@lobehub/ui';
+import { Select, type SelectProps } from '@lobehub/ui/base-ui';
+import { createStaticStyles, createStyles } from 'antd-style';
import { type ReactNode } from 'react';
import { memo, useMemo } from 'react';
-import { ModelItemRender, ProviderItemRender } from '@/components/ModelSelect';
+import { ModelItemRender, ProviderItemRender, TAG_CLASSNAME } from '@/components/ModelSelect';
import { useEnabledChatModels } from '@/hooks/useEnabledChatModels';
import { type EnabledProviderWithModels } from '@/types/aiProvider';
+const prefixCls = 'ant';
+
const useStyles = createStyles(({ css }, { popupWidth }: { popupWidth?: number | string }) => ({
popup: css`
width: ${popupWidth
@@ -18,25 +20,36 @@ const useStyles = createStyles(({ css }, { popupWidth }: { popupWidth?: number |
`,
}));
-type ModelAbilities = EnabledProviderWithModels['children'][number]['abilities'];
+const styles = createStaticStyles(({ css }) => ({
+ popup: css`
+ &.${prefixCls}-select-dropdown .${prefixCls}-select-item-option-grouped {
+ padding-inline-start: 12px;
+ }
+ `,
+ select: css`
+ .${prefixCls}-select-selection-item {
+ .${TAG_CLASSNAME} {
+ display: none;
+ }
+ }
+ `,
+}));
interface ModelOption {
- abilities?: ModelAbilities;
- displayName?: string;
+ abilities?: Record<string, boolean>;
id: string;
label: ReactNode;
provider: string;
value: string;
}
-interface ModelSelectProps extends Pick<LobeSelectProps, 'loading' | 'size' | 'style' | 'variant'> {
+interface ModelSelectProps extends Pick<SelectProps, 'loading' | 'size' | 'style' | 'variant'> {
defaultValue?: { model: string; provider?: string };
initialWidth?: boolean;
onChange?: (props: { model: string; provider: string }) => void;
popupWidth?: number | string;
requiredAbilities?: (keyof EnabledProviderWithModels['children'][number]['abilities'])[];
showAbility?: boolean;
-
value?: { model: string; provider?: string };
}
@@ -44,19 +57,19 @@ const ModelSelect = memo<ModelSelectProps>(
({
value,
onChange,
- initialWidth = false,
showAbility = true,
requiredAbilities,
loading,
- popupWidth,
size,
style,
variant,
+ initialWidth = false,
+ popupWidth,
}) => {
- const { styles } = useStyles({ popupWidth });
+ const { styles: dynamicStyles } = useStyles({ popupWidth });
const enabledList = useEnabledChatModels();
- const options = useMemo<LobeSelectProps['options']>(() => {
+ const options = useMemo<SelectProps['options']>(() => {
const getChatModels = (provider: EnabledProviderWithModels) => {
const models =
requiredAbilities && requiredAbilities.length > 0
@@ -96,41 +109,35 @@ const ModelSelect = memo<ModelSelectProps>(
options: opts,
};
})
- .filter(Boolean) as LobeSelectProps['options'];
+ .filter(Boolean) as SelectProps['options'];
}, [enabledList, requiredAbilities, showAbility]);
return (
<TooltipGroup>
- <LobeSelect
- virtual
+ <Select
+ className={styles.select}
defaultValue={`${value?.provider}/${value?.model}`}
loading={loading}
options={options}
- popupClassName={styles.popup}
+ popupClassName={popupWidth ? `${styles.popup} ${dynamicStyles.popup}` : styles.popup}
popupMatchSelectWidth={false}
- selectedIndicatorVariant="bold"
size={size}
value={`${value?.provider}/${value?.model}`}
variant={variant}
- optionRender={(option) => {
- const data = option as unknown as ModelOption;
- return (
- <ModelItemRender
- displayName={data.displayName}
- id={data.id}
- showInfoTag={false}
- {...data.abilities}
- />
- );
- }}
+ optionRender={(option) => (
+ <ModelItemRender
+ {...(option as ModelOption)}
+ {...(option as ModelOption).abilities}
+ showInfoTag
+ />
+ )}
style={{
minWidth: 200,
width: initialWidth ? 'initial' : undefined,
...style,
}}
onChange={(value, option) => {
- if (!value) return;
- const model = (value as string).split('/').slice(1).join('/');
+ const model = value.split('/').slice(1).join('/');
onChange?.({ model, provider: (option as unknown as ModelOption).provider });
}}
/>
diff --git a/src/features/SharePopover/index.tsx b/src/features/SharePopover/index.tsx
index 25a770813ba..561155d34dc 100644
--- a/src/features/SharePopover/index.tsx
+++ b/src/features/SharePopover/index.tsx
@@ -5,12 +5,12 @@ import {
Checkbox,
copyToClipboard,
Flexbox,
- LobeSelect,
Popover,
Skeleton,
Text,
usePopoverContext,
} from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { App, Divider } from 'antd';
import { ExternalLinkIcon, LinkIcon, LockIcon } from 'lucide-react';
import { type ReactNode } from 'react';
@@ -187,7 +187,7 @@ const SharePopoverContent = memo<SharePopoverContentProps>(({ onOpenModal }) =>
<Flexbox gap={4}>
<Text type="secondary">{t('shareModal.popover.visibility')}</Text>
- <LobeSelect
+ <Select
disabled={updating}
options={visibilityOptions}
style={{ width: '100%' }}
diff --git a/src/routes/(main)/agent/cron/[cronId]/features/CronJobHeader.tsx b/src/routes/(main)/agent/cron/[cronId]/features/CronJobHeader.tsx
index a30d2bd3a8b..4f29914a7e8 100644
--- a/src/routes/(main)/agent/cron/[cronId]/features/CronJobHeader.tsx
+++ b/src/routes/(main)/agent/cron/[cronId]/features/CronJobHeader.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Flexbox, Input, LobeSwitch as Switch } from '@lobehub/ui';
+import { Flexbox, Input } from '@lobehub/ui';
+import { Switch } from '@lobehub/ui/base-ui';
import { createStaticStyles } from 'antd-style';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx b/src/routes/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx
index 20f35b5bd6c..c73e6769ad5 100644
--- a/src/routes/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx
+++ b/src/routes/(main)/agent/cron/[cronId]/features/CronJobScheduleConfig.tsx
@@ -1,6 +1,7 @@
'use client';
-import { Checkbox, Flexbox, FormGroup, LobeSelect as Select, Text } from '@lobehub/ui';
+import { Checkbox, Flexbox, FormGroup, Text } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { Divider, InputNumber, TimePicker } from 'antd';
import { createStaticStyles, cx } from 'antd-style';
import { type Dayjs } from 'dayjs';
diff --git a/src/routes/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx b/src/routes/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx
index 34c756e4c58..e6d2eb17f7f 100644
--- a/src/routes/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx
+++ b/src/routes/(main)/agent/features/Conversation/Header/HeaderActions/useMenu.tsx
@@ -1,7 +1,7 @@
'use client';
import { Icon } from '@lobehub/ui';
-import { type DropdownItem } from '@lobehub/ui/es/DropdownMenu/type';
+import { type DropdownItem } from '@lobehub/ui';
import { Maximize2 } from 'lucide-react';
import { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
diff --git a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx b/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
index ccf016b9343..940824a12d0 100644
--- a/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
+++ b/src/routes/(main)/settings/chat-appearance/features/ChatAppearance/index.tsx
@@ -5,13 +5,12 @@ import {
FormGroup,
highlighterThemes,
Icon,
- LobeSwitch as Switch,
mermaidThemes,
Segmented,
- Select,
Skeleton,
SliderWithInput,
} from '@lobehub/ui';
+import { Select, Switch } from '@lobehub/ui/base-ui';
import isEqual from 'fast-deep-equal';
import { Loader2Icon } from 'lucide-react';
import { memo, useState } from 'react';
diff --git a/src/routes/(main)/settings/common/features/Common/Common.tsx b/src/routes/(main)/settings/common/features/Common/Common.tsx
index 95d98adc2f7..6683e055737 100644
--- a/src/routes/(main)/settings/common/features/Common/Common.tsx
+++ b/src/routes/(main)/settings/common/features/Common/Common.tsx
@@ -1,8 +1,9 @@
'use client';
import { type FormGroupItemType } from '@lobehub/ui';
-import { Flexbox, Form, Icon, ImageSelect, LobeSelect as Select, Skeleton } from '@lobehub/ui';
-import { Segmented, Switch } from 'antd';
+import { Flexbox, Form, Icon, ImageSelect, Skeleton } from '@lobehub/ui';
+import { Select, Switch } from '@lobehub/ui/base-ui';
+import { Segmented } from 'antd';
import isEqual from 'fast-deep-equal';
import { Ban, Gauge, Loader2Icon, Monitor, Moon, Mouse, Sun, Waves } from 'lucide-react';
import { useTheme as useNextThemesTheme } from 'next-themes';
diff --git a/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx b/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx
index 9ec0613b791..3613594d8d2 100644
--- a/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx
+++ b/src/routes/(main)/settings/provider/features/ProviderConfig/Checker.tsx
@@ -4,7 +4,8 @@ import { CheckCircleFilled } from '@ant-design/icons';
import { type ChatMessageError } from '@lobechat/types';
import { TraceNameMap } from '@lobechat/types';
import { ModelIcon } from '@lobehub/icons';
-import { Alert, Button, Flexbox, Highlighter, Icon, LobeSelect as Select } from '@lobehub/ui';
+import { Alert, Button, Flexbox, Highlighter, Icon } from '@lobehub/ui';
+import { Select } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar, cx } from 'antd-style';
import { Loader2Icon } from 'lucide-react';
import { type ReactNode } from 'react';