llm-message-react 0.1.3 → 0.3.0

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.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { HTMLAttributes } from 'react';
3
- import { L as LLMMessageClassNames, a as LLMMessageComponents, C as CodeHighlighter, b as CodeToHtml } from './types-Dz7GupgB.js';
4
- export { A as AnchorProps, c as CheckboxProps, d as CodeBlockProps, e as CodeHighlighterProps, f as CopyButtonProps, E as ElementProps, I as ImageProps, g as InlineCodeProps } from './types-Dz7GupgB.js';
3
+ import { L as LLMMessageClassNames, a as LLMMessageComponents, C as CodeHighlighter, b as CodeToHtml } from './types-DETvxTAd.js';
4
+ export { A as AnchorProps, c as CheckboxProps, d as CodeBlockProps, e as CodeHighlighterProps, f as CopyButtonProps, E as ElementProps, I as ImageProps, g as InlineCodeProps } from './types-DETvxTAd.js';
5
5
 
6
6
  interface LLMMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, "children" | "content"> {
7
7
  /** The LLM message content as a markdown string. */
@@ -29,6 +29,32 @@ interface LLMMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, "children
29
29
  * `completePartialTokens` is enabled. Defaults to `true`.
30
30
  */
31
31
  showUnfinishedLatexBlocks?: boolean;
32
+ /**
33
+ * Fade newly-streamed text in character-by-character (and complex blocks as a
34
+ * whole) instead of popping it in. Purely visual: text is always in the DOM
35
+ * immediately, it just eases from transparent. Respects
36
+ * `prefers-reduced-motion`. Defaults to `false`.
37
+ */
38
+ smoothReveal?: boolean;
39
+ /**
40
+ * The reveal window for a freshly-arrived chunk, in milliseconds. Each batch
41
+ * of new characters is staggered so it finishes within roughly this window;
42
+ * when a new chunk arrives mid-animation the leftover plus the new text reveal
43
+ * over a fresh window. Only relevant while `smoothReveal` is enabled.
44
+ * Defaults to `300`.
45
+ */
46
+ smoothRevealDuration?: number;
47
+ /**
48
+ * Split the message into top-level markdown blocks and render each as its own
49
+ * memoized subtree, so a streaming update only re-parses/re-renders the last
50
+ * (currently growing) block instead of the whole message. This keeps KaTeX
51
+ * and code highlighting in earlier blocks from re-running on every chunk.
52
+ *
53
+ * Set to `false` to render the whole message as a single tree (needed for
54
+ * documents that rely on constructs spanning blocks, e.g. footnote or link
55
+ * reference definitions). Defaults to `true`.
56
+ */
57
+ blockMemoization?: boolean;
32
58
  /**
33
59
  * Optional syntax highlighter for fenced code blocks. When omitted, code
34
60
  * blocks render as plain text (so no highlighter bundle is pulled in). Pass
@@ -37,7 +63,7 @@ interface LLMMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, "children
37
63
  */
38
64
  highlighter?: CodeHighlighter;
39
65
  }
40
- declare function LLMMessage({ children, content, className, classNames, components, completePartialTokens: repairPartialTokens, showUnfinishedLatexBlocks, highlighter, ...rest }: LLMMessageProps): react.JSX.Element;
66
+ declare function LLMMessage({ children, content, className, classNames, components, completePartialTokens: repairPartialTokens, showUnfinishedLatexBlocks, smoothReveal, smoothRevealDuration, blockMemoization, highlighter, style, ...rest }: LLMMessageProps): react.JSX.Element;
41
67
 
42
68
  /**
43
69
  * Preprocesses LaTeX content by replacing delimiters and escaping certain characters.