Files
vectorcraft/crates
dotCooCoo 33c5835722 Plug-ins: a command's manifest can list it in the canvas and Layers panel context menus
At plug-in API level 2 a command's `menu` may give `context`: a list of
`{"menu": "canvas" | "layers", "when"?: condition}`, with or without a
`path`. The canvas context menu lists the command while objects are
selected, and the menu of a Layers panel layer, group or object row
lists it too, in a Plug-ins submenu that holds a submenu named after
each plug-in. `when` is one of selection, oneObject, typeObject and
layerRow (Layers panel only); while it fails the item is dimmed.

Choosing the item runs `plugin.<id>.<command>` with the selection, or
with the clicked or highlighted rows whatever is selected, as `ids`, as
one undo step. A command with parameters opens its dialog for those
objects first, and its preview and OK run on them.

A `context` that is not a list, an entry of the wrong shape, an unknown
menu or condition, layerRow for the canvas, a menu named twice and more
than 8 commands of one plug-in in one context menu are refused when the
module is installed, and the error names the command and the key.
`plugin.list` gives the command's `menu.context`. The three new
messages have an `@msg` row in each complete-message catalog.
2026-11-22 10:32:17 -08:00
..
2026-11-19 15:24:38 +07:00