Skip to content

glebov-andrey/comment-plugin

 
 

Repository files navigation

Rete comment plugin

Rete.js plugin

  • Add inline comment: Shift + C
  • Add frame comment: select nodes, Shift + F
  • Delete comment: Select comment and press Delete
  • Edit comment: Call context menu
import CommentPlugin from 'rete-comment-plugin';

editor.use(CommentPlugin, { 
    margin: 20 // indent for new frame comments by default 30 (px)
})

editor.trigger('addcomment', ({ type: 'frame', text, nodes }))
editor.trigger('addcomment', ({ type: 'inline', text, position }))

editor.trigger('removecomment', { comment })
editor.trigger('removecomment', { type })

Edit comment using custom modal (instead of prompt)

editor.use(CommentPlugin, { disableBuiltInEdit: true });

editor.on('editcomment', async (comment) => {
    comment.text = await openEditModal(comment.text);
    comment.update();
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 96.9%
  • CSS 3.1%