Skip to content

feat(mermaid): expose header slot controls#135

Merged
cc-hearts merged 1 commit into
mainfrom
feat/mermaid-header-slot-actions
Jul 13, 2026
Merged

feat(mermaid): expose header slot controls#135
cc-hearts merged 1 commit into
mainfrom
feat/mermaid-header-slot-actions

Conversation

@cc-hearts

Copy link
Copy Markdown
Member

🤔 This is a ...

  • 🆕 New feature
  • 🐞 Bug fix
  • 📝 Site / documentation improvement
  • 📽️ Demo improvement
  • 💄 Component style improvement
  • 🤖 TypeScript definition improvement
  • 📦 Bundle size optimization
  • ⚡️ Performance optimization
  • ⭐️ Feature enhancement
  • 🌐 Internationalization
  • 🛠 Refactoring
  • 🎨 Code style optimization
  • ✅ Test Case
  • 🔀 Branch merge
  • ⏩ Workflow
  • ⌨️ Accessibility improvement
  • ❓ Other (about what?)

🔗 Related Issues

N/A

💡 Background and Solution

Custom Mermaid headers fully replace the default controls, leaving custom header implementations unable to reuse render-type switching, zooming, reset, download, or source-copy behavior.

Expose a typed MermaidHeaderSlotScope to the header slot with renderType, setRenderType, zoomIn, zoomOut, resetZoom, download, and copy. The existing default header remains unchanged, and image-only controls are no-ops in code mode.

The custom header demo now uses the slot scope, and the API documentation describes the full contract in English and Chinese.

📝 Change Log

Language Changelog
🇺🇸 English Mermaid: expose built-in controls through the header slot scope.
🇨🇳 Chinese Mermaid:通过 header 插槽作用域暴露内置操作能力。

@cc-hearts cc-hearts merged commit 9330c62 into main Jul 13, 2026
1 check passed
@cc-hearts cc-hearts deleted the feat/mermaid-header-slot-actions branch July 13, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant