Skip to content

Commit

Permalink
🎨 refactor: clear code and md
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Oct 20, 2023
1 parent cb2eb56 commit 78e6bd7
Show file tree
Hide file tree
Showing 85 changed files with 69 additions and 1,245 deletions.
9 changes: 0 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,7 @@
"@ant-design/icons": "^5",
"@babel/runtime": "^7",
"@floating-ui/react": "^0",
"@giscus/react": "^2",
"@lobehub/chat-plugin-sdk": "latest",
"@lobehub/emojilib": "latest",
"@react-spring/three": "^9",
"@react-spring/web": "^9",
"@react-three/drei": "^9",
"@react-three/fiber": "^8",
"ahooks": "^3",
"antd": "^5",
"chroma-js": "^2",
Expand All @@ -81,19 +75,16 @@
"lucide-react": "^0.288.0",
"polished": "^4",
"prism-react-renderer": "^2",
"rc-footer": "^0",
"re-resizable": "^6",
"react-error-boundary": "^4",
"react-layout-kit": "^1.7.1",
"react-markdown": "^8",
"react-rnd": "^10",
"react-simple-code-editor": "^0",
"rehype-katex": "^6",
"remark-gfm": "^3",
"remark-math": "^5",
"shikiji": "^0",
"swr": "^2",
"three": "^0.150",
"ts-md5": "^1",
"url-join": "^5",
"use-merge-value": "^1",
Expand Down
4 changes: 2 additions & 2 deletions src/ActionIcon/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { Loader2 } from 'lucide-react';
import { forwardRef, useMemo } from 'react';

import Icon, { type IconProps } from '@/Icon';
import Spotlight from '@/Spotlight';
import Tooltip, { type TooltipProps } from '@/Tooltip';
import Spotlight from '@/components/Spotlight';
import { DivProps } from '@/types';
import { Tooltip, type TooltipProps } from 'antd';

import { useStyles } from './style';

Expand Down
2 changes: 1 addition & 1 deletion src/ActionIconGroup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ActionIcon, { ActionIconProps } from '@/ActionIcon';
import Icon from '@/Icon';
import Spotlight from '@/Spotlight';
import Spotlight from '@/components/Spotlight';

import { Dropdown } from 'antd';
import { MoreHorizontal, type LucideIcon } from 'lucide-react';
Expand Down
5 changes: 0 additions & 5 deletions src/Avatar/demos/Emoji.tsx

This file was deleted.

38 changes: 0 additions & 38 deletions src/Avatar/demos/index.tsx

This file was deleted.

18 changes: 0 additions & 18 deletions src/Avatar/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/ChatInputArea/Desktop.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { CSSProperties, forwardRef, useCallback, useRef } from 'react';
import useControlledState from 'use-merge-value';

import Icon from '@/Icon';
import { TextArea, type TextAreaProps } from '@/Input';
import { TextArea, type TextAreaProps } from '@/components/Input';

import Action from './Action';
import { useStyles } from './style';
Expand Down
11 changes: 6 additions & 5 deletions src/ChatInputArea/demos/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { ActionIcon, ChatInputArea, DraggablePanel, Icon, TokenTag } from '@ant-design/pro-chat';
import { Button } from 'antd';
import { Archive, Eraser, Languages } from 'lucide-react';
/**
* compact: true
*/
import { ActionIcon, ChatInputArea, DraggablePanel, TokenTag } from '@ant-design/pro-chat';
import { Eraser, Languages } from 'lucide-react';
import { useState } from 'react';
import { Flexbox } from 'react-layout-kit';

Expand All @@ -10,7 +12,7 @@ export default () => {
return (
<Flexbox height={400}>
<div style={{ flex: 1 }}></div>
<DraggablePanel expandable={false} fullscreen={expand} minHeight={200} placement="bottom">
<DraggablePanel fullscreen={expand} minHeight={200} placement="bottom">
<ChatInputArea
actions={
<>
Expand All @@ -20,7 +22,6 @@ export default () => {
</>
}
expand={expand}
footer={<Button icon={<Icon icon={Archive} />} />}
minHeight={200}
onExpandChange={setExpand}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/ChatItem/components/Avatar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { memo } from 'react';
import { Flexbox } from 'react-layout-kit';

import A from '@/Avatar';
import A from '@/components/Avatar';

import { useStyles } from '../style';
import type { ChatItemProps } from '../type';
Expand Down
2 changes: 1 addition & 1 deletion src/ChatList/HistoryDivider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Timer } from 'lucide-react';
import { memo } from 'react';

import Icon from '@/Icon';
import Tag from '@/Tag';
import Tag from '@/components/Tag';

interface HistoryDividerProps {
enable?: boolean;
Expand Down
30 changes: 0 additions & 30 deletions src/ConfigProvider/index.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/CopyButton/demos/index.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/CopyButton/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion src/EditableMessage/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
nav: Components
group: Chat
group: Message
title: EditableMessage
description: The EditableMessage component is used to display a message that can be edited by the user. It consists of a Markdown component and an optional modal for editing the message. When the user clicks on the message, it enters editing mode and displays an input field for editing the message.
---
Expand Down
2 changes: 1 addition & 1 deletion src/EditableMessageList/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
nav: Components
group: Chat
group: Message
title: EditableMessageList
description: EditableMessageList is a React component that allows users to edit a list of chat messages, including their content and role. It is designed to be used in chatbot building applications.
---
Expand Down
5 changes: 0 additions & 5 deletions src/EditableText/demos/index.tsx

This file was deleted.

14 changes: 0 additions & 14 deletions src/EditableText/index.md

This file was deleted.

50 changes: 0 additions & 50 deletions src/EditableText/index.tsx

This file was deleted.

32 changes: 32 additions & 0 deletions src/Emoji/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { memo } from 'react';

import { DivProps } from '../types';

import { useStyles } from './style';

export interface EmojiProps extends DivProps {
/**
* @description The emoji character to be rendered
*/
emoji: string;
/**
* @description Size of the emoji
* @default 40
*/
size?: number;
}

const Emoji = memo<EmojiProps>(({ emoji, className, style, size = 40 }) => {
const { cx, styles } = useStyles();

return (
<div
className={cx(styles.container, className)}
style={{ fontSize: size * 0.9, height: size, width: size, ...style }}
>
{emoji}
</div>
);
});

export default Emoji;
File renamed without changes.
13 changes: 0 additions & 13 deletions src/EmptyCard/demos/WithCover.tsx

This file was deleted.

5 changes: 0 additions & 5 deletions src/EmptyCard/demos/index.tsx

This file was deleted.

17 changes: 0 additions & 17 deletions src/EmptyCard/index.md

This file was deleted.

Loading

0 comments on commit 78e6bd7

Please sign in to comment.