stage0-rete-context-menu-plugin

1.0.0-beta6 • Public • Published

Rete Stage0 renderer context menu plugin

Rete.js plugin

import ContextMenuPlugin from 'stage0-rete-context-menu-plugin';

editor.use(ContextMenuPlugin, {
    searchBar: false,
    delay: 100,
    docked: true, // If you want Blender style docked menu
    allocate(component) {
        if (component.name == "Number") {
            return false; // Don't add
        }
        return ["submenu", "subsubmenu"];
    },
    items: { // Hand crafted menu
        "Menu": {
            "Add component": components[1],
            "Fn": () => {
                alert("Fn");
            }
        }
    }
});
Options Description Default
searchBar Showing search bar true
delay Delay hide, ms 1000
allocate function for placing of components into submenu () => []

You can arbitrarily put a component in a submenu. Examples:

allocate() { return ["Single submenu"] }
allocate(component) { return component.path } // where path is a stack of menu for every component

Readme

Keywords

none

Package Sidebar

Install

npm i stage0-rete-context-menu-plugin

Weekly Downloads

7

Version

1.0.0-beta6

License

ISC

Unpacked Size

88.9 kB

Total Files

16

Last publish

Collaborators

  • npm