The Comments Plugin provides comprehensive commenting functionality for the on-CodeMerge editor, allowing users to add, edit, and manage comments on selected text with visual markers and tooltips.
<!-- Text with comment --><span class="commented-text"> This text has a comment </span><span class="comment-marker" data-comment-id="comment-123"> 💬 </span>
<p> This is a paragraph with <span class="commented-text">multiple comments</span> <span class="comment-marker" data-comment-id="comment-1">💬</span> and <span class="commented-text">another comment</span> <span class="comment-marker" data-comment-id="comment-2">💬</span> on different parts.</p>
<div class="comment-container"> <span class="commented-text highlighted"> This text is highlighted and commented </span> <span class="comment-marker" data-comment-id="comment-456"> 💬 </span></div>
{ id: "comment-uuid-123", content: "This is a comment about the selected text", createdAt: 1640995200000, // Timestamp updatedAt: 1640995200000 // Timestamp}
Comments Plugin
The Comments Plugin provides comprehensive commenting functionality for the on-CodeMerge editor, allowing users to add, edit, and manage comments on selected text with visual markers and tooltips.
Features
Basic Usage
Demo
Public API (v2)
Factory:
CommentsPlugin().addCommenteditor.command('addComment')Keyboard shortcuts
Mod-Shift-caddCommentComment Workflow
Adding Comments
Editing Comments
Deleting Comments
Examples
Basic Comment Usage
Multiple Comments
Comment with Styling
Integration Examples
React Integration
Vue Integration
Styling
Default Styles
Custom Comment Themes
Responsive Comment Styles
Comment Data Structure
Comment Object
Comment Marker HTML
Commented Text HTML
Troubleshooting
Common Issues
Comment not adding
Comment marker not showing
Tooltip not appearing
Comment not editing
Debug Mode
Enable debug logging:
Browser Support
Performance Considerations
Accessibility
License
MIT License - see LICENSE file for details.