mirror of
https://github.com/run-llama/chat-ui.git
synced 2026-07-21 03:15:21 -04:00
[PR #85] [MERGED] Feature/mermaid support #107
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/run-llama/chat-ui/pull/85
Author: @chiradeepv
Created: 5/12/2025
Status: ✅ Merged
Merged: 5/27/2025
Merged by: @marcusschiesser
Base:
main← Head:feature/mermaid-support📝 Commits (10+)
9b55efdfeat: integrate Mermaid for diagram rendering in chat UI769dac4revert tsconfig changee56a961handle inevitable mermaid errors when generated by llmf0614fbformatting7da0a18refactor: move mermaid out of codeblockf5a007brefactor: move mermaid out of codeblocka17f681make mermaid dependency a peer24a9017make mermaid dependency a peer0f0217erefactor mermaid demo to its own page2423ea4refactor mermaid support📊 Changes
14 files changed (+2212 additions, -1290 deletions)
View changed files
➕
.changeset/social-jokes-design.md(+6 -0)📝
README.md(+4 -0)➕
apps/web/app/demo/mermaid/mermaid-diagram.tsx(+166 -0)➕
apps/web/app/demo/mermaid/page.tsx(+132 -0)📝
apps/web/app/page.tsx(+5 -0)➕
apps/web/components/ui/button.tsx(+59 -0)📝
apps/web/package.json(+5 -3)📝
packages/chat-ui/package.json(+19 -19)📝
packages/chat-ui/src/chat/chat-message.tsx(+7 -1)📝
packages/chat-ui/src/widgets/index.tsx(+1 -1)📝
packages/chat-ui/src/widgets/markdown.tsx(+17 -2)📝
packages/chat-ui/tsconfig.json(+1 -1)➖
packages/chat-ui/tsup.config.js(+0 -25)📝
pnpm-lock.yaml(+1790 -1238)📄 Description
Add Mermaid Diagram Rendering and SVG Download to CodeBlock
Summary
This PR adds robust support for rendering Mermaid diagrams in code blocks within the chat UI. It also introduces the ability to download rendered Mermaid diagrams as SVG files, and provides user-friendly error handling for invalid Mermaid syntax.
Features
Mermaid Diagram Rendering:
language="mermaid"are now rendered as diagrams using Mermaid.js.SVG Download:
.mmd.Error Handling:
Closes: #83
Type: Feature
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.