From c4d85d100c77b383caef70618e6cb356b4177a44 Mon Sep 17 00:00:00 2001 From: Innei Date: Mon, 2 Mar 2026 22:40:46 +0800 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20chore(deps):=20migrate=20@?= =?UTF-8?q?lobehub/ui=20to=20base-ui=20exports=20(#12587)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ⬆️ chore(deps): migrate @lobehub/ui to base-ui exports - Migrate LobeSelect → Select from @lobehub/ui/base-ui - Migrate LobeSwitch → Switch from @lobehub/ui/base-ui - Fix DropdownItem import (use main package instead of internal path) - Add initialWidth, popupWidth support to ModelSelect Made-with: Cursor * ⬆️ chore(deps): update @lobehub packages to latest versions - Upgrade @lobehub/charts to ^5.0.0 - Upgrade @lobehub/editor to ^4.0.0 - Upgrade @lobehub/icons to ^5.0.0 - Upgrade @lobehub/market-sdk to ^0.31.1 - Upgrade @lobehub/tts to ^5.0.0 - Upgrade @lobehub/ui to ^5.0.0 across multiple packages - Update peer dependencies for various packages to align with new @lobehub/ui version Made-with: Cursor Signed-off-by: Innei * ⬆️ chore(deps): update @lobehub/tts to version 5.1.2 Signed-off-by: Innei --------- Signed-off-by: Innei --- package.json | 12 ++-- .../builtin-tool-agent-builder/package.json | 2 +- packages/builtin-tool-calculator/package.json | 2 +- .../builtin-tool-cloud-sandbox/package.json | 2 +- .../package.json | 2 +- packages/builtin-tool-gtd/package.json | 4 +- .../builtin-tool-knowledge-base/package.json | 2 +- .../builtin-tool-local-system/package.json | 2 +- packages/builtin-tool-memory/package.json | 2 +- packages/builtin-tool-notebook/package.json | 2 +- packages/builtin-tool-page-agent/package.json | 2 +- .../builtin-tool-skill-store/package.json | 2 +- packages/builtin-tool-skills/package.json | 2 +- .../builtin-tool-web-browsing/package.json | 2 +- packages/builtin-tools/package.json | 2 +- packages/const/package.json | 2 +- packages/editor-runtime/package.json | 2 +- packages/types/package.json | 4 +- .../FunctionCallingModelSelect/index.tsx | 13 ++-- src/features/ModelSelect/index.tsx | 69 ++++++++++--------- src/features/SharePopover/index.tsx | 4 +- .../cron/[cronId]/features/CronJobHeader.tsx | 3 +- .../features/CronJobScheduleConfig.tsx | 3 +- .../Header/HeaderActions/useMenu.tsx | 2 +- .../features/ChatAppearance/index.tsx | 3 +- .../common/features/Common/Common.tsx | 5 +- .../features/ProviderConfig/Checker.tsx | 3 +- 27 files changed, 83 insertions(+), 72 deletions(-) diff --git a/package.json b/package.json index 27e81ad5d0..79a698fad9 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 823cacbe36..62131fb007 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 bbb64e9530..dcd76702c3 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 f05d785c17..2c204f508d 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 595e5ceb5b..56c7e00f7a 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 18a88540b3..1057d4541a 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 50c2744529..c4cbae5cf1 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 86acf9f575..b9a3e305c2 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 aab255df0d..f5e6b16b8d 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 b5258fc776..8cb3b9db2b 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 3c9c4d055f..0f7330ef60 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 9dd21d5c46..0a5ba98ce7 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 6081af0419..ad0243f2c8 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 0eda903fb9..d1b65733da 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 b51129c43f..f6b88828ef 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 5af6655326..4f37ce373d 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 e95884929c..038d3818d6 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 2bcc27c3ab..83ce92aeb3 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 6d8a600fca..4fd07f1ee5 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 { +interface ModelSelectProps extends Omit { onChange?: (props: WorkingModel) => void; showAbility?: boolean; value?: WorkingModel; @@ -34,7 +34,7 @@ interface ModelSelectProps extends Omit { const ModelSelect = memo(({ value, onChange, ...rest }) => { const enabledList = useEnabledChatModels(); - const options = useMemo(() => { + const options = useMemo(() => { const getChatModels = (provider: EnabledProviderWithModels) => provider.children .filter((model) => !!model.abilities.functionCall) @@ -71,14 +71,15 @@ const ModelSelect = memo(({ value, onChange, ...rest }) => { return ( - { - 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 51ecce0e60..d2d17fb8ec 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; id: string; label: ReactNode; provider: string; value: string; } -interface ModelSelectProps extends Pick { +interface ModelSelectProps extends Pick { 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( ({ 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(() => { + const options = useMemo(() => { const getChatModels = (provider: EnabledProviderWithModels) => { const models = requiredAbilities && requiredAbilities.length > 0 @@ -96,41 +109,35 @@ const ModelSelect = memo( options: opts, }; }) - .filter(Boolean) as LobeSelectProps['options']; + .filter(Boolean) as SelectProps['options']; }, [enabledList, requiredAbilities, showAbility]); return ( - { - const data = option as unknown as ModelOption; - return ( - - ); - }} + optionRender={(option) => ( + + )} 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 25a770813b..561155d34d 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(({ onOpenModal }) => {t('shareModal.popover.visibility')} -