Skip to content

Commit 91b1245

Browse files
Version Packages
1 parent 1c07a91 commit 91b1245

File tree

5 files changed

+42
-41
lines changed

5 files changed

+42
-41
lines changed

.changeset/add-block-incomplete-hook.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

.changeset/five-points-brake.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/normalize-html-indentation.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/streamdown/CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,46 @@
11
# streamdown
22

3+
## 2.3.0
4+
5+
### Minor Changes
6+
7+
- 3657e42: Add `useIsCodeFenceIncomplete` hook for detecting incomplete code fences during streaming
8+
9+
Custom components can now detect when the code fence in their block is still being streamed. This is useful for deferring expensive renders (syntax highlighting, Mermaid diagrams) until the code block is complete.
10+
11+
```tsx
12+
import { useIsCodeFenceIncomplete } from "streamdown";
13+
14+
const MyCodeBlock = ({ children }) => {
15+
const isIncomplete = useIsCodeFenceIncomplete();
16+
17+
if (isIncomplete) {
18+
return <div>Loading code...</div>;
19+
}
20+
21+
return (
22+
<pre>
23+
<code>{children}</code>
24+
</pre>
25+
);
26+
};
27+
```
28+
29+
The hook returns `true` when:
30+
31+
- Streaming is active (`isAnimating={true}`)
32+
- The component is in the last block being streamed
33+
- That block has an unclosed code fence
34+
35+
The default code block component now uses this hook to set a `data-incomplete` attribute when incomplete, enabling CSS-based loading states.
36+
37+
### Patch Changes
38+
39+
- 5d438ca: Add support for copying table data as Markdown in TableCopyDropdown.
40+
Introduces a Markdown copy option alongside existing formats.
41+
Allows users to quickly copy tables in valid Markdown format.
42+
- 7f9127b: Add `normalizeHtmlIndentation` prop to prevent indented HTML tags from being treated as code blocks
43+
344
## 2.2.0
445

546
### Minor Changes

packages/streamdown/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "streamdown",
3-
"version": "2.2.0",
3+
"version": "2.3.0",
44
"type": "module",
55
"main": "./dist/index.js",
66
"module": "./dist/index.js",

0 commit comments

Comments
 (0)