listpage-next 0.0.262 → 0.0.263

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,9 +14,11 @@ const Bubble = (props)=>{
14
14
  const hovered = containerHovered || feedbackHovered;
15
15
  const cursorPlaceholder = 'pending' === status && 'assistant' === role ? '<placeholder type="pending" />' : '';
16
16
  const messageMarkdownEle = markdownRender ? markdownRender(content || '', status) : /*#__PURE__*/ jsx(Markdown, {
17
+ hasNextChunk: 'success' !== status,
17
18
  content: (content || '') + cursorPlaceholder
18
19
  });
19
20
  const reasoningMarkdownEle = reasoningMarkdownRender ? reasoningMarkdownRender(reasoning_content || '', status) : /*#__PURE__*/ jsx(Markdown, {
21
+ hasNextChunk: !content,
20
22
  content: reasoning_content || ''
21
23
  });
22
24
  const message = 'user' === role ? /*#__PURE__*/ jsx(UserContentWrapper, {
@@ -1,4 +1,8 @@
1
+ import { XMarkdownProps } from '@ant-design/x-markdown';
2
+ import '@ant-design/x-markdown/themes/light.css';
1
3
  export interface MarkdownProps {
2
4
  content: string;
5
+ hasNextChunk?: boolean;
6
+ components?: XMarkdownProps['components'];
3
7
  }
4
8
  export declare const Markdown: (props: MarkdownProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,39 +1,19 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import markdown_it from "markdown-it";
3
2
  import styled_components from "styled-components";
4
- const md = markdown_it({
5
- html: true,
6
- breaks: true
7
- });
8
- const defaultLinkOpen = md.renderer.rules.link_open || function(tokens, idx, options, env, self) {
9
- return self.renderToken(tokens, idx, options);
10
- };
11
- md.renderer.rules.link_open = function(tokens, idx, options, env, self) {
12
- const targetIndex = tokens[idx].attrIndex('target');
13
- if (targetIndex < 0) tokens[idx].attrPush([
14
- 'target',
15
- '_blank'
16
- ]);
17
- else tokens[idx].attrs[targetIndex][1] = '_blank';
18
- const relIndex = tokens[idx].attrIndex('rel');
19
- if (relIndex < 0) tokens[idx].attrPush([
20
- 'rel',
21
- 'noopener noreferrer'
22
- ]);
23
- else tokens[idx].attrs[relIndex][1] = 'noopener noreferrer';
24
- return defaultLinkOpen(tokens, idx, options, env, self);
25
- };
26
- md.renderer.rules.text = (tokens, idx)=>{
27
- let text = tokens[idx].content;
28
- text = text.replace(/\[\[(-?\d+(\.\d+)?)\]\]/g, '<sup>[$1]</sup>');
29
- return text;
30
- };
3
+ import x_markdown from "@ant-design/x-markdown";
4
+ import "@ant-design/x-markdown/themes/light.css";
31
5
  const Markdown = (props)=>/*#__PURE__*/ jsx(MarkdownBody, {
32
- dangerouslySetInnerHTML: {
33
- __html: md.render(props.content)
34
- }
6
+ streaming: {
7
+ enableAnimation: true,
8
+ hasNextChunk: props.hasNextChunk,
9
+ animationConfig: {
10
+ fadeDuration: 400
11
+ }
12
+ },
13
+ content: props.content,
14
+ openLinksInNewTab: true
35
15
  });
36
- const MarkdownBody = styled_components.div`
16
+ const MarkdownBody = styled_components(x_markdown)`
37
17
  h1 {
38
18
  font-size: 18px;
39
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.262",
3
+ "version": "0.0.263",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -95,6 +95,7 @@
95
95
  "json-schema-faker": "~0.5.9",
96
96
  "ansi-to-html": "~0.7.2",
97
97
  "@aws-sdk/client-s3": "~3.946.0",
98
- "@google/genai": "~1.31.0"
98
+ "@google/genai": "~1.31.0",
99
+ "@ant-design/x-markdown": "~2.1.1"
99
100
  }
100
101
  }