Commit Graph

76 Commits

Author SHA1 Message Date
Farnabaz e30219d2db docs: document codeBlockMaxHeight and tableMaxHeight
Cover defaults, disable values, and streaming auto-scroll pin behavior
in configuration, code blocks, and GFM docs.
2026-08-19 21:04:23 +02:00
Shayan 7e824007a3 fix: detect static text direction per block (#569)
Co-authored-by: Shayan SalehiRad <youtforsh@gmail.com>
Co-authored-by: Farnabaz <farnabaz@gmail.com>
2026-08-14 15:59:00 +02:00
Dmitrii d6666b6de3 feat: add lineNumbers prop to disable line numbers in code blocks (#460)
* feat: add lineNumbers prop to disable line numbers in code blocks

* docs: add lineNumbers prop and noLineNumbers meta string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Dmitrii Troitskii <jsleitor@gmail.com>
Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-12 17:31:46 -07:00
Hayden Bleasel 51f5ba6cf7 Update remend priorities 2026-03-10 16:47:15 -07:00
Hayden Bleasel 716a5f05a9 Resolves #445 2026-03-10 16:46:10 -07:00
Hayden Bleasel 2cf559d500 Resolves #191 2026-03-03 18:10:56 -08:00
Hayden Bleasel 781178b99c Resolves #272 2026-03-03 17:05:57 -08:00
Hayden Bleasel 71184cce30 Resolves #329 2026-03-03 16:58:12 -08:00
Hayden Bleasel ad21f7d69e Resolves #317 2026-03-03 16:51:44 -08:00
Udit Kumar fb76275ef4 Feat/table fullscreen (#390)
* feat(streamdown): add fullscreen support for tables

* test(streamdown): add fullscreen behavior tests

* docs: document fullscreen styling and usage

* add: changeset

* fix: prevent unintended fullscreen close

* fix: resolve shiki theme style mapping

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-03 16:16:10 -08:00
Hayden Bleasel ff390bb114 Update docs 2026-03-03 15:43:20 -08:00
Hayden Bleasel 80bcc5f29d Improve table docs 2026-03-03 13:19:49 -08:00
Hayden Bleasel dbcfa12857 Update docs 2026-03-03 13:18:50 -08:00
Lucas Estevão 27c7b037d0 feat: export table action components and utilities (#421)
Export TableCopyDropdown, TableDownloadButton, TableDownloadDropdown,
and table utility functions (extractTableDataFromElement, tableDataToCSV,
tableDataToTSV, tableDataToMarkdown, escapeMarkdownTableCell, TableData)
from the main entry point, enabling custom table overrides to preserve
copy/download interactivity.

Also fixes a type error in table components where `size` prop was passed
to SVG icons that only accept standard SVG attributes (width/height).

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-03 13:17:26 -08:00
Hayden Bleasel 7b404379d9 Fix plugin docs 2026-03-03 13:09:00 -08:00
Aradhya C P 5edff75c13 docs: add code, cjk, math, and mermaid to @source (#430)
* docs: update Tailwind CSS setup instructions to include additional Streamdown modules in README.md

* docs: update FAQ to include additional Streamdown module sources in globals.css

* docs: update Tailwind CSS configuration to include additional Streamdown module sources in getting-started.mdx

* docs: update migration guide to include additional Streamdown module sources in globals.css

* docs: update Tailwind CSS configuration in SKILL.md to include additional Streamdown module sources

* chore: add changeset for @source documentation updates

* docs: update README to include optional Streamdown plugin installation instructions

* docs: update FAQ to include instructions for optional Streamdown plugins in globals.css

* docs: update Tailwind CSS configuration in getting-started.mdx to clarify optional plugin integration

* docs: add Tailwind CSS configuration instructions for @streamdown/code plugin

* docs: update migration guide to include plugin source path instructions for Tailwind CSS

* docs: add Tailwind CSS integration instructions for @streamdown/cjk plugin

* docs: add Tailwind CSS integration instructions for @streamdown/math plugin

* docs: add Tailwind CSS integration instructions for @streamdown/mermaid plugin

* docs: update the changeset

* docs: update Tailwind CSS configuration instructions for clarity

* docs: update links for plugin documentation
2026-03-03 13:07:22 -08:00
Hayden Bleasel e4c37b73c0 Create migration guide 2026-02-25 11:58:57 -08:00
Hayden Bleasel 1102f1855e Fix all Biome lint and formatting errors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 20:57:01 -08:00
Hayden Bleasel 69761f2ab7 Update meta.json 2026-02-18 10:20:48 -08:00
Hayden Bleasel d79ebb7227 Merge Mermaid pages 2026-02-18 10:20:38 -08:00
Hayden Bleasel 7bfc313c43 Merge Math pages 2026-02-18 10:18:55 -08:00
Hayden Bleasel 5eba3f120a Merge CJK pages 2026-02-18 10:17:51 -08:00
Hayden Bleasel 883d6c0183 Destructure plugin pages 2026-02-18 10:12:18 -08:00
Hayden Bleasel 604953075e Update docs 2026-02-18 09:41:14 -08:00
Hayden Bleasel cfd16ea2f7 Update docs 2026-02-18 09:13:57 -08:00
PaulSenon 15645da72e Feat/code block cls lower lazy boundary (#392)
* feat: Improve code block visual stability by moving lazy highlight boundary

* style: update contributing linter rules and fixed missed linter issues

* revert superfluous changes to CONTRIBUTING.md and geistdocs.tsx

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 16:36:48 -08:00
Waseem 3657e42bcc feat: add useIsBlockIncomplete hook for detecting incomplete streaming blocks (#381)
* feat: add useIsBlockIncomplete hook for detecting incomplete streaming blocks

Custom components can now detect when the block they're rendering is still
being streamed (incomplete). This is useful for showing loading states in
code blocks during streaming.

- Add BlockIncompleteContext and useIsBlockIncomplete hook
- Add hasIncompleteCodeFence utility to detect unclosed code fences
- Calculate isIncomplete state per block during render
- Default CodeComponent uses the hook to set data-incomplete attribute
- Add comprehensive tests for the new functionality

* docs: add useIsBlockIncomplete documentation

- Add "Streaming State" section to components.mdx explaining the hook
- Add "Avoid Continuous Re-rendering" section to mermaid.mdx with example

* fix: support tilde code fences in hasIncompleteCodeFence

Adds support for detecting incomplete ~~~ code fences in addition to
backtick fences, per CommonMark/GFM spec.

* fix: address PR review — line-based fence detection, rename hook/context

- rewrite hasIncompleteCodeFence to walk line-by-line per CommonMark spec
  - fixes 6+ backtick fences being miscounted
  - fixes false positives from inline backticks in prose
  - respects fence character matching and length requirements
- rename block-position-context.ts → block-incomplete-context.ts
- rename useIsBlockIncomplete → useIsCodeFenceIncomplete
- add tests for edge cases (long fences, inline backticks, indentation)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Hayden Bleasel <hello@haydenbleasel.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 16:14:57 -08:00
zhdzb 7f9127b843 Add normalizeHtmlIndentation prop to prevent indented HTML tags from being treated as code blocks (#264) 2026-02-17 16:04:51 -08:00
Dmitrii 5c99dfe48b docs: fix incorrect line-break behavior description in GFM docs (#399)
* docs: fix incorrect line-break behavior description in GFM docs

The GFM documentation incorrectly stated that single newlines are
preserved as visible line breaks. In reality, remark-gfm (like
standard Markdown) treats single newlines as soft breaks, rendering
them as spaces.

Updated the Line Breaks section to:
- Correctly explain soft break behavior
- Document hard break syntax (trailing spaces and backslash)
- Show how to add remark-breaks plugin for automatic line breaks

Fixes #388

* fix: use PluggableList array for remarkPlugins example

Co-authored-by: vercel[bot] <vercel[bot]@users.noreply.github.com>

---------

Co-authored-by: Shurik <shurik@openclaw.ai>
Co-authored-by: vercel[bot] <vercel[bot]@users.noreply.github.com>
2026-02-17 15:49:23 -08:00
Dmitrii 9118cc001b docs: clarify that custom components replace default styles (#398)
Document that custom components fully replace default implementations
including their built-in Tailwind classes. The className prop only
contains classes from the Markdown AST, not Streamdown's default styles.

Add a warning callout and a before/after example showing how to
preserve default h2 styles when overriding.

Fixes #394

Co-authored-by: Shurik <shurik@openclaw.ai>
2026-02-17 15:47:07 -08:00
Hayden Bleasel e6ab579a89 Add md-metadata 2026-02-11 17:06:45 -08:00
Hayden Bleasel 4be8f6c258 Merge animate into main library 2026-02-08 15:25:00 -08:00
Hayden Bleasel 48756b5c88 Resolves #298 2026-02-08 13:12:11 -08:00
Hayden Bleasel 573ece690d Resolves #350 2026-02-08 12:48:50 -08:00
Hayden Bleasel c1e1e66a0f Resolves #290, resolves #371, resolves #153 2026-02-07 18:12:43 -08:00
Hayden Bleasel 82bc4a6336 Resolves #373 2026-02-07 17:26:09 -08:00
Hayden Bleasel cc066dc818 Resolves #362 2026-01-20 14:34:56 -08:00
Obada Khalili a12de57496 Custom tags in components (#359)
* allow custom tags in components

* comment

* tests

* docs

* lint

* changeset
2026-01-20 14:18:48 -08:00
Hayden Bleasel 169d5b6e9a Docs fixes 2026-01-18 12:40:44 -08:00
Hayden Bleasel 5a06a01385 Resolves #305 2026-01-17 18:02:04 -08:00
Hayden Bleasel 1569c47e0b Remove defaultRehypePlugins.katex 2026-01-17 17:51:49 -08:00
Hayden Bleasel add8edaeab Resolves #301 2026-01-17 16:59:58 -08:00
Hayden Bleasel 337625516c Resolves #332 2026-01-17 15:06:24 -08:00
Hayden Bleasel 8cfb2628ec Update refs 2026-01-17 14:49:21 -08:00
Hayden Bleasel cbf4febef5 Rename plugin exports, update docs 2026-01-17 14:45:55 -08:00
Hayden Bleasel 0b80aed583 Switch to plugin architecture (#352)
* Plugin trial

* Update docs and tests

* Update homepage add new section

* Update usage.tsx

* Split out CJK plugin

* Extract plugins into new packages

* Misc fixes

* Fix lint / formatting

* Fix: The Streamdown component's memo comparison doesn't compare the plugins prop, preventing re-renders when plugins change while other props stay the same

Co-authored-by: haydenbleasel <hello@haydenbleasel.com>

* Fix: TypeScript type mismatch at line 89 in `index.ts`: the visitor function's `index` parameter is typed as `number | undefined`, but the `visit` function expects `number | null`. The `undefined` type is not assignable to `number | null`.

This commit fixes the issue reported at /vercel/path0/packages/streamdown-cjk/index.ts:89

## TypeScript type incompatibility in visitor callback

**What fails:** TypeScript compiler fails during DTS (type definitions) build in `packages/streamdown-cjk/index.ts` at line 89

**How to reproduce:**
```bash
cd packages/streamdown-cjk
pnpm build
```

**Result:**
```
index.ts(89,3): error TS2769: No overload matches this call.
  Overload 1 of 2, '(tree: Root, check: "link", visitor: BuildVisitor<Root, "link">, reverse?: boolean | null | undefined): undefined', gave the following error.
    Argument of type '(node: Link, index: number | null, parent?: Parent) => number | undefined' is not assignable to parameter of type 'BuildVisitor<Root, "link">'.
      Types of parameters 'index' and 'index' are incompatible.
        Type 'number | undefined' is not assignable to type 'number | null'.
          Type 'undefined' is not assignable to type 'number | null'.
```

**Root cause:** The visitor callback function passed to the `visit()` function from `unist-util-visit` was declaring the `index` parameter as `number | null`, but the visitor can also receive `undefined` as the index value. The `BuildVisitor` type signature expects the callback to accept `number | null | undefined` to properly match the library's API.

**Fix:** Updated the `index` parameter type annotation on line 89 from `number | null` to `number | null | undefined` to match the actual possible values that the visitor receives and the expected `BuildVisitor` type signature.

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: haydenbleasel <hello@haydenbleasel.com>

* Fix tests

* Remove CDN paths

* Fix tests

* More cleanup

* Remove shiki from main bundle

* Update index.ts

* Cleanup test repo

* Cleanup website

* Delete next-env files

* Update .gitignore

* Fix lockfile

* Upgrade Next and React

* Simplify themes

* Update test site

* Misc fixes

* Type fixes

* Create perky-cobras-punch.md

---------

Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
2026-01-17 14:38:20 -08:00
Hayden Bleasel 61b368512d Fix Streamdown URL 2026-01-11 21:06:59 -08:00
Hayden Bleasel 5e39418bc4 Rename offline mode to self-hosting cdn 2026-01-09 14:07:03 -08:00
Hayden Bleasel 2b26070ebc Fix CDN implementation 2026-01-06 16:29:58 -08:00
Hayden Bleasel d21ac293e0 Load Mermaid from CDN when required 2026-01-06 15:03:13 -08:00