1.3 KiB
1.3 KiB
kind, description
| kind | description |
|---|---|
| upgrade-guide | Client plugins must use the prefixed context menu types and hooks and register keyed icon components. |
Context menu types and icons
English | 中文
Change
The @deepseek-ai/dsh-client-ui-context-menu/client export MenuTarget is renamed to ContextMenuTarget, matching ContextMenuTargetMap. The old name has no compatibility alias. Target fields and runtime behavior are unchanged. Workspace and sidebar injections rename menuTarget / useMenuTarget to contextMenuTarget / useContextMenuTarget. Action icons accept { key, src? } instead of React nodes and render through the keyed contextMenu.icon Slot.
Migration
- Replace
MenuTargetimports and type references withContextMenuTarget. - Rename injected
menuTargetsources anduseMenuTargetconsumers tocontextMenuTargetanduseContextMenuTarget. - Replace action icon elements with
{ key: 'my-plugin.action' }; carry a captured image URL insrcwhen needed. Register the icon component under that key throughctx.slots.inject('contextMenu.icon', ...)andctx.slots.register(). See the menu package. - Rebuild custom Client plugins, confirm that type checks pass, and open their menus to verify icon rendering and plugin-unload cleanup.