-
+
{valueLeft > 0
? [
mobile
diff --git a/src/Tooltip/demos/index.tsx b/src/Tooltip/demos/index.tsx
deleted file mode 100644
index b04e5c02..00000000
--- a/src/Tooltip/demos/index.tsx
+++ /dev/null
@@ -1,10 +0,0 @@
-import { Tooltip } from '@ant-design/pro-chat';
-import { Button } from 'antd';
-
-export default () => {
- return (
-
-
-
- );
-};
diff --git a/src/Tooltip/index.md b/src/Tooltip/index.md
deleted file mode 100644
index b4d681ae..00000000
--- a/src/Tooltip/index.md
+++ /dev/null
@@ -1,14 +0,0 @@
----
-nav: Components
-group: Data Display
-title: Tooltip
-description: The Tooltip component is used to provide additional information to the user when they hover over a specific element.
----
-
-## Default
-
-
-
-## APIs
-
-
diff --git a/src/Tooltip/index.tsx b/src/Tooltip/index.tsx
deleted file mode 100644
index f51f8c45..00000000
--- a/src/Tooltip/index.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import { Tooltip as AntdTooltip, TooltipProps as AntdTooltipProps } from 'antd';
-import { memo } from 'react';
-
-import { useStyles } from './style';
-
-export type TooltipProps = AntdTooltipProps;
-
-const Tooltip = memo
(({ className, arrow = false, ...props }) => {
- const { styles, cx } = useStyles();
-
- return ;
-});
-
-export default Tooltip;
diff --git a/src/Tooltip/style.ts b/src/Tooltip/style.ts
deleted file mode 100644
index 30f57e00..00000000
--- a/src/Tooltip/style.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { createStyles } from 'antd-style';
-
-export const useStyles = createStyles(({ css, token, prefixCls }) => {
- return {
- tooltip: css`
- .${prefixCls}-tooltip-inner {
- display: flex;
- align-items: center;
- justify-content: center;
-
- min-height: unset;
- padding: 4px 8px;
-
- color: ${token.colorBgLayout};
-
- background-color: ${token.colorText};
- border-radius: ${token.borderRadiusSM}px;
- }
-
- .${prefixCls}-tooltip-arrow {
- &::before,
- &::after {
- background: ${token.colorText};
- }
- }
- `,
- };
-});
diff --git a/src/Avatar/index.tsx b/src/components/Avatar/index.tsx
similarity index 93%
rename from src/Avatar/index.tsx
rename to src/components/Avatar/index.tsx
index 49ee9103..c01f16c7 100644
--- a/src/Avatar/index.tsx
+++ b/src/components/Avatar/index.tsx
@@ -1,7 +1,7 @@
import { Avatar as AntAvatar, type AvatarProps as AntAvatarProps } from 'antd';
import { memo, useMemo } from 'react';
-import FluentEmoji from '@/FluentEmoji';
+import Emoji from '@/Emoji';
import { getEmoji } from '@/utils/getEmojiByCharacter';
import { useStyles } from './style';
@@ -72,7 +72,7 @@ const Avatar = memo(
) : (
{emoji ? (
-
+
) : (
text?.toUpperCase().slice(0, 2)
)}
diff --git a/src/Avatar/style.ts b/src/components/Avatar/style.ts
similarity index 100%
rename from src/Avatar/style.ts
rename to src/components/Avatar/style.ts
diff --git a/src/components/ControlInput.tsx b/src/components/ControlInput.tsx
index 1d63f7e3..26ba3c09 100644
--- a/src/components/ControlInput.tsx
+++ b/src/components/ControlInput.tsx
@@ -3,7 +3,7 @@ import { RotateCcw, Save } from 'lucide-react';
import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
import ActionIcon from '@/ActionIcon';
-import { Input, InputProps } from '@/Input';
+import { Input, InputProps } from '@/components/Input';
export interface ControlInputProps extends Omit {
/**
diff --git a/src/CopyButton/index.tsx b/src/components/CopyButton/index.tsx
similarity index 96%
rename from src/CopyButton/index.tsx
rename to src/components/CopyButton/index.tsx
index a3056259..797a054d 100644
--- a/src/CopyButton/index.tsx
+++ b/src/components/CopyButton/index.tsx
@@ -3,9 +3,9 @@ import { Copy } from 'lucide-react';
import { memo } from 'react';
import ActionIcon, { type ActionIconSize } from '@/ActionIcon';
-import { type TooltipProps } from '@/Tooltip';
import { useCopied } from '@/hooks/useCopied';
import { DivProps } from '@/types';
+import { type TooltipProps } from 'antd';
export interface CopyButtonProps extends DivProps {
/**
diff --git a/src/Form/components/FormDivider.tsx b/src/components/Form/components/FormDivider.tsx
similarity index 100%
rename from src/Form/components/FormDivider.tsx
rename to src/components/Form/components/FormDivider.tsx
diff --git a/src/Form/components/FormFooter.tsx b/src/components/Form/components/FormFooter.tsx
similarity index 100%
rename from src/Form/components/FormFooter.tsx
rename to src/components/Form/components/FormFooter.tsx
diff --git a/src/Form/components/FormGroup.tsx b/src/components/Form/components/FormGroup.tsx
similarity index 96%
rename from src/Form/components/FormGroup.tsx
rename to src/components/Form/components/FormGroup.tsx
index b3a713b3..69c3d3ca 100644
--- a/src/Form/components/FormGroup.tsx
+++ b/src/components/Form/components/FormGroup.tsx
@@ -1,4 +1,4 @@
-import { Icon, type IconProps } from '@ant-design/pro-chat';
+import Icon, { type IconProps } from '@/Icon';
import { Collapse, type CollapseProps } from 'antd';
import { useResponsive } from 'antd-style';
import { ChevronDown } from 'lucide-react';
diff --git a/src/Form/components/FormItem.tsx b/src/components/Form/components/FormItem.tsx
similarity index 100%
rename from src/Form/components/FormItem.tsx
rename to src/components/Form/components/FormItem.tsx
diff --git a/src/Form/components/FormTitle.tsx b/src/components/Form/components/FormTitle.tsx
similarity index 96%
rename from src/Form/components/FormTitle.tsx
rename to src/components/Form/components/FormTitle.tsx
index c7e33feb..d1e8e502 100644
--- a/src/Form/components/FormTitle.tsx
+++ b/src/components/Form/components/FormTitle.tsx
@@ -1,7 +1,7 @@
import { ReactNode, memo } from 'react';
import { Flexbox } from 'react-layout-kit';
-import Tag from '@/Tag';
+import Tag from '@/components/Tag';
import { DivProps } from '@/types';
import { useStyles } from './style';
diff --git a/src/Form/components/style.ts b/src/components/Form/components/style.ts
similarity index 100%
rename from src/Form/components/style.ts
rename to src/components/Form/components/style.ts
diff --git a/src/Form/index.tsx b/src/components/Form/index.tsx
similarity index 100%
rename from src/Form/index.tsx
rename to src/components/Form/index.tsx
diff --git a/src/Form/style.ts b/src/components/Form/style.ts
similarity index 100%
rename from src/Form/style.ts
rename to src/components/Form/style.ts
diff --git a/src/Input/index.tsx b/src/components/Input/index.tsx
similarity index 100%
rename from src/Input/index.tsx
rename to src/components/Input/index.tsx
diff --git a/src/Input/style.ts b/src/components/Input/style.ts
similarity index 100%
rename from src/Input/style.ts
rename to src/components/Input/style.ts
diff --git a/src/SliderWithInput/index.tsx b/src/components/SliderWithInput/index.tsx
similarity index 100%
rename from src/SliderWithInput/index.tsx
rename to src/components/SliderWithInput/index.tsx
diff --git a/src/Spotlight/index.tsx b/src/components/Spotlight/index.tsx
similarity index 100%
rename from src/Spotlight/index.tsx
rename to src/components/Spotlight/index.tsx
diff --git a/src/Spotlight/style.ts b/src/components/Spotlight/style.ts
similarity index 100%
rename from src/Spotlight/style.ts
rename to src/components/Spotlight/style.ts
diff --git a/src/Tag/index.tsx b/src/components/Tag/index.tsx
similarity index 100%
rename from src/Tag/index.tsx
rename to src/components/Tag/index.tsx
diff --git a/src/index.ts b/src/index.ts
index a4b50b1e..e6c8a8ae 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,6 +1,5 @@
export { default as ActionIcon, type ActionIconProps, type ActionIconSize } from './ActionIcon';
export { default as ActionIconGroup, type ActionIconGroupProps } from './ActionIconGroup';
-export { default as Avatar, type AvatarProps } from './Avatar';
export { default as BackBottom, type BackBottomProps } from './BackBottom';
export { default as ChatInputArea, type ChatInputAreaProps } from './ChatInputArea';
export { default as ChatItem, type ChatItemProps } from './ChatItem';
@@ -17,8 +16,6 @@ export type {
} from './ChatList';
export { default as ActionsBar, type ActionsBarProps } from './ChatList/ActionsBar';
-export { default as ConfigProvider, useCdnFn, type Config } from './ConfigProvider';
-export { default as CopyButton, type CopyButtonProps } from './CopyButton';
export { default as DraggablePanel, type DraggablePanelProps } from './DraggablePanel';
export {
default as DraggablePanelBody,
@@ -41,15 +38,7 @@ export {
default as EditableMessageList,
type EditableMessageListProps,
} from './EditableMessageList';
-export { default as EditableText, type EditableTextProps } from './EditableText';
-export { default as EmptyCard, type EmptyCardProps } from './EmptyCard';
-export { default as FluentEmoji, type FluentEmojiProps } from './FluentEmoji';
-export { default as Form, type FormProps, type ItemGroup } from './Form';
-export { default as FormDivider, type FormDividerProps } from './Form/components/FormDivider';
-export { default as FormFooter, type FormFooterProps } from './Form/components/FormFooter';
-export { default as FormGroup, type FormGroupProps } from './Form/components/FormGroup';
-export { default as FormItem, type FormItemProps } from './Form/components/FormItem';
-export { default as FormTitle, type FormTitleProps } from './Form/components/FormTitle';
+export { default as CopyButton, type CopyButtonProps } from './components/CopyButton';
export {
default as Highlighter,
@@ -57,9 +46,6 @@ export {
type HighlighterProps,
type SyntaxHighlighterProps,
} from './Highlighter';
-export { default as Icon, type IconProps, type IconSize } from './Icon';
-export * from './Icon/icons';
-export { Input, TextArea, type InputProps, type TextAreaProps } from './Input';
export { default as List } from './List';
@@ -68,14 +54,8 @@ export { default as MessageInput, type MessageInputProps } from './MessageInput'
export { default as MessageModal, type MessageModalProps } from './MessageModal';
export { default as GlobalStyle } from './GlobalStyle';
-export { default as SearchBar, type SearchBarProps } from './SearchBar';
-export { default as SliderWithInput, type SliderWithInputProps } from './SliderWithInput';
export { default as Snippet, type SnippetProps } from './Snippet';
-export { default as Tag, type TagProps } from './Tag';
export { default as TokenTag, type TokenTagProps } from './TokenTag';
-export { default as Tooltip, type TooltipProps } from './Tooltip';
export { useChatListActionsBar } from './hooks/useChatListActionsBar';
export * from './styles';
export type * from './types';
-export { genCdnUrl, type CDN } from './utils/genCdnUrl';
-export { getEmoji, getEmojiNameByCharacter } from './utils/getEmojiByCharacter';
diff --git a/src/utils/genCdnUrl.ts b/src/utils/genCdnUrl.ts
deleted file mode 100644
index 48bdd07b..00000000
--- a/src/utils/genCdnUrl.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import urlJoin from 'url-join';
-
-const UNPKG_API = 'https://unpkg.com';
-const ALIYUN_API = 'https://registry.npmmirror.com';
-
-export type CDN = 'aliyun' | 'unpkg';
-export interface CdnApi {
- path: string;
- pkg: string;
- proxy?: CDN;
- version?: string;
-}
-
-export const genCdnUrl = ({ pkg, version = 'latest', path, proxy }: CdnApi): string => {
- switch (proxy) {
- case 'unpkg': {
- return urlJoin(UNPKG_API, `${pkg}@${version}`, path);
- }
- default: {
- return urlJoin(ALIYUN_API, pkg, version, 'files', path);
- }
- }
-};
diff --git a/src/utils/getEmojiByCharacter.ts b/src/utils/getEmojiByCharacter.ts
index ccc32b0e..ce15c56d 100644
--- a/src/utils/getEmojiByCharacter.ts
+++ b/src/utils/getEmojiByCharacter.ts
@@ -1,15 +1,6 @@
-import emojilib from '@lobehub/emojilib';
import emojiRegex from 'emoji-regex';
export const getEmoji = (emoji: string): string | undefined => {
const regex = emojiRegex();
- const pureEmoji = emoji.match(regex)?.[0];
- return pureEmoji;
-};
-
-export const getEmojiNameByCharacter = (emoji: string): string | undefined => {
- const pureEmoji = getEmoji(emoji);
- if (!pureEmoji) return;
- const EmojiLab: any = emojilib;
- return EmojiLab?.[pureEmoji];
+ return emoji.match(regex)?.[0];
};
diff --git a/tsconfig.json b/tsconfig.json
index 4622c110..e487b65e 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -12,8 +12,7 @@
"paths": {
"@@/*": [".dumi/tmp/*"],
"@/*": ["src/*"],
- "@ant-design/pro-chat": ["src"],
- "@ant-design/pro-chat/*": ["src/*", "*"]
+ "@ant-design/pro-chat": ["src"]
}
}
}