Overview
The Comments plugin enables real-time collaborative commenting on document content. Users can add comments to specific sections, reply to comments, resolve discussions, and track all changes with contributor information.
Features
- â Real-time comments
- â Threaded discussions
- â Comment replies
- â Resolve/mark as done
- â User attribution
- â Comment threading
- â Mention notifications
- â Comment export
Installation
npm install @editora/plugin-comments
Basic Usage
import Editora from '@editora/core';
import CommentsPlugin from '@editora/plugin-comments';
const editor = new Editora('#editor');
editor.use(CommentsPlugin, {
userId: 'user123',
userName: 'John Doe',
serverUrl: 'https://your-server.com/comments'
});
Comment Management
Work with comments effectively:
- Add Comment: Select text and add a comment
- Reply: Add replies to existing comments
- Resolve: Mark comments as resolved
- Filter: View all, open, or resolved comments
API Methods
- addComment(text): Add comment to selection
- replyToComment(id, text): Reply to existing comment
- resolveComment(id): Mark comment as resolved
- getComments(): Get all comments for document
Best Practices
- Be Specific: Highlight exact text when commenting
- Use Mentions: Tag team members using @username
- Resolve: Mark comments as resolved when addressed
- Threads: Keep related discussion in comment threads