@mbraun/rete-react-contextmenu-plugin

A contextmenu-plugin for retejs which is developed with the react-framework in mind


Keywords
rete, react, contextmenu
License
MIT
Install
npm install @mbraun/rete-react-contextmenu-plugin@0.0.1-beta.4

Documentation

@mbraun/rete-react-contextmenu-plugin

Usage

This package could be used with and without an config-object. When no config is provided the default components are used.

import ContextMenuPlugin from '@mbraun/rete-react-contextmenu-plugin';
import {
    COMPONENT_NODE,
    COMPONENT_NODE_CONTAINER,
    COMPONENT_CONTEXT,
    COMPONENT_CONTEXT_CONTAINER,
} from '@mbraun/rete-react-contextmenu-plugin/lib/constants/components';

editor.use(ContextMenuPlugin, {
    components: {
        [COMPONENT_CONTEXT]: ContextMenu,
        [COMPONENT_CONTEXT_CONTAINER]: ContextMenuContainer,
        [COMPONENT_NODE]: NodeMenu,
        [COMPONENT_NODE_CONTAINER]: NodeMenuContainer,
    }
});