rete-context-menu-plugin
packageSignal types produced by ContextMenuPlugin instance
type ContextMenuExtra = RenderSignal<
"contextmenu",
{ items: Item[]; searchBar: boolean; onHide: unknown }
>;
Plugin for context menu. Responsible for initialing rendering of context menu with predefined items.
class ContextMenuPlugin<Schemes extends BaseSchemes>
Parameter | Extends | Description |
---|---|---|
Schemes | BaseSchemes |
Extends Scope<never, Requires
Emits render
unmount
Listens unmount
contextmenu
pointerdown
constructor(props: Props<Schemes>): ContextMenuPlugin<Schemes>
Parameter | Type | Description |
---|---|---|
props | Props<Schemes> | Properties |
Returns ContextMenuPlugin<Schemes>
Context menu plugin props
type Props<Schemes extends BaseSchemes> = {
delay: number;
items: Items<Schemes>;
};
Parameter | Extends | Description |
---|---|---|
Schemes | BaseSchemes |
Presets that create items for root and node specific context menu.
Classic context menu preset. Configures nodes/actions items for root and Delete/Clone items for nodes
setup(nodes: ItemDefinition<Schemes>[]): Items<Schemes>
Examples
Presets.classic.setup([
["Math", [
["Number", () => new NumberNode()],
]]
])
Parameter | Type | Description |
---|---|---|
nodes | ItemDefinition<Schemes>[] | List of items |
Returns Items<Schemes>