mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-13 19:20:04 +00:00
⬆️ chore(deps): migrate @lobehub/ui to base-ui exports (#12587)
* ⬆️ 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 <tukon479@gmail.com> * ⬆️ chore(deps): update @lobehub/tts to version 5.1.2 Signed-off-by: Innei <tukon479@gmail.com> --------- Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
+6
-6
@@ -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",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd": "^6",
|
||||
"lucide-react": "*",
|
||||
"next": "*",
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd-style": "*",
|
||||
"lucide-react": "*",
|
||||
"react": "*",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd": "^6",
|
||||
"antd-style": "*",
|
||||
"lucide-react": "*",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd": "^6",
|
||||
"lucide-react": "*",
|
||||
"react": "*",
|
||||
|
||||
@@ -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": "*",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd": "^6",
|
||||
"antd-style": "*",
|
||||
"polished": "*",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd": "^6",
|
||||
"antd-style": "*",
|
||||
"lucide-react": "*",
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"promptfoo": "^0.120.17"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd-style": "*",
|
||||
"lucide-react": "*",
|
||||
"react": "*",
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd": "^6",
|
||||
"antd-style": "*",
|
||||
"lucide-react": "*",
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd-style": "*",
|
||||
"debug": "*",
|
||||
"lucide-react": "*",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "*",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd-style": "*",
|
||||
"react": "*",
|
||||
"react-i18next": "*"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "*",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd-style": "*",
|
||||
"react": "*",
|
||||
"react-i18next": "*"
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd": "^6",
|
||||
"antd-style": "*",
|
||||
"lucide-react": "*",
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
"@lobechat/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"antd-style": "*",
|
||||
"lucide-react": "*",
|
||||
"react": "*",
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@icons-pack/react-simple-icons": "^13.8.0",
|
||||
"@lobehub/ui": "^4",
|
||||
"@lobehub/ui": "^5",
|
||||
"klavis": "^2.15.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"lexical": "^0.39.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@lobehub/editor": "^3",
|
||||
"@lobehub/editor": "^4",
|
||||
"debug": "*"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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 });
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -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%' }}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user