Skip to content

feat(plugin): add custom styles, icons, and class names for context-menu plugin#5107

Open
mealcomes wants to merge 1 commit intoVisActor:developfrom
mealcomes:feat/contextmenu-custom-style
Open

feat(plugin): add custom styles, icons, and class names for context-menu plugin#5107
mealcomes wants to merge 1 commit intoVisActor:developfrom
mealcomes:feat/contextmenu-custom-style

Conversation

@mealcomes
Copy link
Copy Markdown

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Refactoring
  • Update dependency
  • Code style optimization
  • Test Case
  • Branch merge
  • Site / documentation update
  • Demo update
  • Workflow
  • Chore
  • Release
  • Other (about what?)

🔗 Related issue link

related: #2032 #4151

💡 Background and solution

基于右键菜单插件 (context-menu) 无法自定义类名和样式的问题,进行配置的更新,具体如下:

  • 菜单样式和类名通过 CustomMenuAttributions 统一配置
  • 图标类型说明
    • iconName: 'copy' — 内置 emoji 图标(兼容原版本)
    • customIcon: { svg: '...', width: 16, height: 16 } — SVG 图标
    • customIcon: (menuItem) => HTMLElement — 渲染函数
  • 自定义类名说明
    • CustomMenuAttributions.class — 统一追加类名
    • MenuItem.customClassName — 单项精细化类名

具体使用示例见 context-menu.ts

📝 Changelog

Language Changelog
🇺🇸 English add custom styles, icons, and class names for context-menu plugin
🇨🇳 Chinese 为右键菜单插件添加自定义样式、图标和类名称

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated
  • TypeScript definition is updated
  • Changelog is provided or not needed

🚀 Summary

copilot:summary

🔍 Walkthrough

copilot:walkthrough

@mealcomes mealcomes changed the title Add custom styles, icons, and class names for context-menu plugin feat(plugin): add custom styles, icons, and class names for context-menu plugin Apr 10, 2026
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