diff --git a/bun.lockb b/bun.lockb index 3ba9a05a..1f99b682 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/conversations/GroupTitle.tsx b/components/conversations/GroupTitle.tsx index af7e9a70..b7c81b64 100644 --- a/components/conversations/GroupTitle.tsx +++ b/components/conversations/GroupTitle.tsx @@ -1,6 +1,7 @@ -import React from 'react'; -import { Divider, Typography } from 'antd'; +import { Typography } from 'antd'; import type { ConfigProviderProps, GetProp } from 'antd'; +import classnames from 'classnames'; +import React from 'react'; export interface GroupTitleProps { children?: React.ReactNode; @@ -9,16 +10,16 @@ export interface GroupTitleProps { // User should not care about internal state. // Which should pass by context instead. export const GroupTitleContext = React.createContext<{ - direction?: GetProp; + prefixCls?: GetProp; }>(null!); const GroupTitle: React.FC = ({ children }) => { - const { direction } = React.useContext(GroupTitleContext); + const { prefixCls } = React.useContext(GroupTitleContext); return ( - - {children && {children}} - +
+ {children && {children}} +
); }; diff --git a/components/conversations/Item.tsx b/components/conversations/Item.tsx index 8089c042..7a575c1c 100644 --- a/components/conversations/Item.tsx +++ b/components/conversations/Item.tsx @@ -1,12 +1,12 @@ -import React from 'react'; +import { EllipsisOutlined } from '@ant-design/icons'; +import { Dropdown, Tooltip, Typography } from 'antd'; import classnames from 'classnames'; -import { Tooltip, Typography, Dropdown } from 'antd'; -import { MoreOutlined } from '@ant-design/icons'; +import React from 'react'; import type { MenuProps } from 'antd'; import type { DirectionType } from 'antd/es/config-provider'; -import type { Conversation } from './interface'; import pickAttrs from 'rc-util/lib/pickAttrs'; +import type { Conversation } from './interface'; export interface ConversationsItemProps extends Omit, 'onClick'> { @@ -87,7 +87,7 @@ const ConversationsItem: React.FC = (props) => { disabled={disabled} onOpenChange={onOpenChange} > - +
  • + + Conversation Item 1 + +
  • +
    +
    +
    + +
    +
    +
  • + + Conversation Item 2 + +
  • +
    +
    +
    + +
    +
    +
  • + + Conversation Item 3 + +
  • +
    +
    +
    + +
    +
    +
  • + + Conversation Item 4 + +
  • +
    +
    +
    + +
    +
    + +`; + +exports[`renders components/conversations/demo/basic.tsx extend context correctly 2`] = `[]`; + +exports[`renders components/conversations/demo/controlled-mode.tsx extend context correctly 1`] = `
    +
      +
    • + + Conversation Item 1 + +
    • +
      +
      +
      + +
      +
      +
    • + + Conversation Item 2 + +
    • +
      +
      +
      + +
      +
      +
    • + + Conversation Item 3 + +
    • +
      +
      +
      + +
      +
      +
    + + +
    +
    +`; + +exports[`renders components/conversations/demo/controlled-mode.tsx extend context correctly 2`] = `[]`; + +exports[`renders components/conversations/demo/group.tsx extend context correctly 1`] = ` +
      +
    • +
      + + Group1 + +
      • -
        - - - -
        - What is Ant Design X? + Conversation Item 1
  • -
    - - - -
    -
    - Getting Started: - - Ant Design ! - -
    + Conversation Item 2
  • -
    - - - -
    - In Docker, use 🐑 Ollama and initialize + Conversation Item 3
  • + + +
  • +
    + + Group2 + +
    +
    • - Expired, please go to the recycle bin to check + Conversation Item 4
    - - +
  • + `; -exports[`renders components/conversations/demo/basic.tsx extend context correctly 2`] = `[]`; +exports[`renders components/conversations/demo/group.tsx extend context correctly 2`] = `[]`; -exports[`renders components/conversations/demo/controlled-mode.tsx extend context correctly 1`] = ` -
    -
    +
  • -
      -
    • - - Conversation Item 1 - -
    • -
      - + +
      -
      -
    • - - Conversation Item 2 - -
    • -
      -
      - + + Today +
      -
    • - - Conversation Item 3 - -
    • -
      -
      + +
      +
        +
      • + + Conversation 1732204800000 + +
      • +
        +
        +
        -
      -
      -
      -
      -
    +
  • +
  • +
    - - Active First + +
    +
    + + + +
    +
    + + Yesterday + +
    +
    - - -
    -
  • +
  • + + Conversation 1732204728000 + +
  • +
    +
    +
    + +
    +
    +
  • + + Conversation 1732204731600 + +
  • +
    +
    +
    + +
    +
    + + + `; -exports[`renders components/conversations/demo/controlled-mode.tsx extend context correctly 2`] = `[]`; +exports[`renders components/conversations/demo/group-sort.tsx extend context correctly 2`] = `[]`; -exports[`renders components/conversations/demo/group.tsx extend context correctly 1`] = ` +exports[`renders components/conversations/demo/infinite-load.tsx extend context correctly 1`] = `
    -
      -
    • +
        +
        +
        +
    +
    +
    +`; + +exports[`renders components/conversations/demo/infinite-load.tsx extend context correctly 2`] = `[]`; + +exports[`renders components/conversations/demo/with-menu.tsx extend context correctly 1`] = ` +
    +
      +
    • + + Conversation Item 1 + + + + +
    • + />
    - - -
  • - -
      -
      -
      - -
      -
    • + + + - Expired, please go to the recycle bin to check + Operation 3
    • + />
    -
  • - -
    -
    -`; - -exports[`renders components/conversations/demo/group.tsx extend context correctly 2`] = `[]`; - -exports[`renders components/conversations/demo/group-sort.tsx extend context correctly 1`] = ` -
    -
    -
    + +
    -
  • +
    +
    +
    +
    +
  • + + Conversation Item 2 + + + + +
  • + />
    - - -
  • - -
  • -
  • +
  • +
    +
    +
    + +
    +
  • + + Conversation Item 3 + + + + +
    +
    -
      -
    • - Expired, please go to the recycle bin to check + Operation 1
    • + />
  • - - - -
    -
    -`; - -exports[`renders components/conversations/demo/group-sort.tsx extend context correctly 2`] = `[]`; - -exports[`renders components/conversations/demo/infinite-load.tsx extend context correctly 1`] = ` -
    -
    -
    -
    -
      -
      - -
      -
    -
    -
    -
    -`; - -exports[`renders components/conversations/demo/infinite-load.tsx extend context correctly 2`] = `[]`; - -exports[`renders components/conversations/demo/with-menu.tsx extend context correctly 1`] = ` -
    -
    -
    -
      -
    • - - Conversation Item 1 - - - - + Operation 2 + +
    • - - -
      -
      -
      -
      -
    • - - Conversation Item 2 - - - - -
      - - -
    • -
      -
      -
      - -
      -
      -
    • - - Conversation Item 3 - - - + - - - + Operation 3 + +
    • - - -
      -
      -
      -
      -
    • + +
    • +
      +
      +
      + +
      +
      +
    • + + Conversation Item 4 + +
    • +
      +
      +
    +
    -
    + `; diff --git a/components/conversations/__tests__/__snapshots__/demo.test.ts.snap b/components/conversations/__tests__/__snapshots__/demo.test.ts.snap index 14d8f9be..c013023a 100644 --- a/components/conversations/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/conversations/__tests__/__snapshots__/demo.test.ts.snap @@ -1,182 +1,85 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`renders components/conversations/demo/basic.tsx correctly 1`] = ` -
    -
    -
      -
    • -
      - - - -
      - - What is Ant Design X? - -
    • -
    • -
      - - - -
      - -
      - Getting Started: - - - Ant Design ! - -
      -
      -
    • -
    • -
      - - - -
      - - In Docker, use 🐑 Ollama and initialize - -
    • -
    • - - Expired, please go to the recycle bin to check - -
    • -
    -
    -
    + Conversation Item 1 + + +
  • + + Conversation Item 2 + +
  • +
  • + + Conversation Item 3 + +
  • +
  • + + Conversation Item 4 + +
  • + `; exports[`renders components/conversations/demo/controlled-mode.tsx correctly 1`] = `
    -
    -
    -
      -
    • - - Conversation Item 1 - -
    • -
    • - - Conversation Item 2 - -
    • -
    • - - Conversation Item 3 - -
    • -
    -
    -
    + Conversation Item 1 + + +
  • + + Conversation Item 2 + +
  • +
  • + + Conversation Item 3 + +
  • +
    @@ -201,472 +104,286 @@ exports[`renders components/conversations/demo/controlled-mode.tsx correctly 1`] `; exports[`renders components/conversations/demo/group.tsx correctly 1`] = ` -
    -
    +
  • +
    + + Group1 + +
      -
    • - -
        + +
      • + -
      • -
        - - - -
        - - What is Ant Design X ? - -
      • -
      • -
        - - - -
        - -
        - Getting Started: - - - Ant Design ! - -
        -
        -
      • -
      + Conversation Item 2 +
    • -
    • - -
        + +
      +
    • +
    • +
      + + Group2 + +
      +
        +
      • + -
      • -
        - - - -
        - - In Docker, use 🐑 Ollama and initialize - -
      • -
      • - - Expired, please go to the recycle bin to check - -
      • -
      + Conversation Item 4 +
    -
  • -
    + + `; exports[`renders components/conversations/demo/group-sort.tsx correctly 1`] = ` -
    -
    -
      +
      -
    • + -
        -
      • - - - What is Ant Design X ? + +