1.0.0-beta6 • Published 5 years ago

stage0-rete-context-menu-plugin v1.0.0-beta6

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

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");
            }
        }
    }
});
OptionsDescriptionDefault
searchBarShowing search bartrue
delayDelay hide, ms1000
allocatefunction 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
1.0.0-beta6

5 years ago

1.0.0-beta5

5 years ago

1.0.0-beta4

5 years ago

1.0.0-beta3

5 years ago

1.0.0-beta2

5 years ago

1.0.0-beta1

5 years ago