Adds collaborative commenting to Payload's Lexical editor. It creates a comments collection and a CommentFeature that can be enabled globally or per richText field. Commented text is highlighted with mark nodes and managed from a comment panel. Requires Payload 3.17.1 or newer and the Lexical rich text package.
A Payload CMS Lexical editor plugin that adds collaborative commenting functionality
Installation
npm i payload-lexical-collaboration13
Stars
1
Forks
3
Open Issues
1 years ago
Last Updated
75
Weekly Downloads
v1.0.4
npm Version
265.1 KB
Unpacked Size
0
Dependencies
130 since Sep 7
| Date | Stars |
|---|---|
| Dec 6, 2026 | 13 |
| Dec 5, 2026 | 13 |
| Dec 4, 2026 | 13 |
| Dec 3, 2026 | 13 |
| Dec 2, 2026 | 13 |
| Dec 1, 2026 | 13 |
| Nov 30, 2026 | 13 |
| Nov 29, 2026 | 13 |
| Nov 28, 2026 | 13 |
| Nov 27, 2026 | 13 |
| Nov 26, 2026 | 13 |
| Nov 25, 2026 | 13 |
| Nov 24, 2026 | 13 |
| Nov 23, 2026 | 13 |
| Nov 22, 2026 | 13 |
| Nov 21, 2026 | 13 |
| Nov 20, 2026 | 13 |
| Nov 19, 2026 | 13 |
| Nov 18, 2026 | 13 |
| Nov 17, 2026 | 13 |
| Nov 16, 2026 | 13 |
| Nov 15, 2026 | 13 |
| Nov 14, 2026 | 13 |
| Nov 13, 2026 | 13 |
| Nov 12, 2026 | 13 |
| Nov 11, 2026 | 13 |
| Nov 10, 2026 | 13 |
| Nov 9, 2026 | 13 |
| Nov 8, 2026 | 13 |
| Nov 7, 2026 | 13 |
| Nov 6, 2026 | 13 |
| Nov 5, 2026 | 13 |
| Nov 4, 2026 | 13 |
| Nov 3, 2026 | 14 |
| Nov 2, 2026 | 14 |
| Nov 1, 2026 | 14 |
| Oct 31, 2026 | 14 |
| Oct 30, 2026 | 14 |
| Oct 29, 2026 | 14 |
| Oct 28, 2026 | 14 |
| Oct 27, 2026 | 14 |
| Oct 26, 2026 | 14 |
| Oct 25, 2026 | 14 |
| Oct 24, 2026 | 14 |
| Oct 23, 2026 | 14 |
| Oct 22, 2026 | 14 |
| Oct 21, 2026 | 13 |
| Oct 20, 2026 | 13 |
| Oct 19, 2026 | 13 |
| Oct 18, 2026 | 13 |
| Oct 17, 2026 | 13 |
| Oct 16, 2026 | 13 |
| Oct 15, 2026 | 13 |
| Oct 14, 2026 | 13 |
| Oct 13, 2026 | 13 |
| Oct 12, 2026 | 13 |
| Oct 11, 2026 | 13 |
| Oct 10, 2026 | 13 |
| Oct 9, 2026 | 13 |
| Oct 8, 2026 | 13 |
| Oct 7, 2026 | 13 |
| Oct 6, 2026 | 13 |
| Oct 5, 2026 | 13 |
| Oct 4, 2026 | 13 |
| Oct 3, 2026 | 13 |
| Oct 2, 2026 | 13 |
| Oct 1, 2026 | 13 |
| Sep 30, 2026 | 13 |
| Sep 29, 2026 | 13 |
| Sep 28, 2026 | 13 |
| Sep 27, 2026 | 13 |
| Sep 26, 2026 | 13 |
| Sep 25, 2026 | 13 |
| Sep 24, 2026 | 13 |
| Sep 23, 2026 | 13 |
| Sep 22, 2026 | 13 |
| Sep 21, 2026 | 13 |
| Sep 20, 2026 | 13 |
| Sep 19, 2026 | 13 |
| Sep 18, 2026 | 13 |
| Sep 17, 2026 | 13 |
| Sep 16, 2026 | 13 |
| Sep 15, 2026 | 13 |
| Sep 14, 2026 | 13 |
| Sep 13, 2026 | 13 |
| Sep 12, 2026 | 13 |
| Sep 11, 2026 | 13 |
| Sep 10, 2026 | 13 |
| Sep 9, 2026 | 13 |
| Sep 8, 2026 | 13 |
| Sep 7, 2026 | 13 |
81−60 since Sep 7
| Date | Weekly downloads |
|---|---|
| Dec 6, 2026 | 81 |
| Dec 5, 2026 | 91 |
| Dec 4, 2026 | 66 |
| Dec 3, 2026 | 69 |
| Dec 2, 2026 | 65 |
| Dec 1, 2026 | 81 |
| Nov 30, 2026 | 91 |
| Nov 29, 2026 | 98 |
| Nov 28, 2026 | 93 |
| Nov 27, 2026 | 98 |
| Nov 26, 2026 | 119 |
| Nov 25, 2026 | 117 |
| Nov 24, 2026 | 109 |
| Nov 23, 2026 | 111 |
| Nov 22, 2026 | 128 |
| Nov 21, 2026 | 114 |
| Nov 20, 2026 | 108 |
| Nov 19, 2026 | 96 |
| Nov 18, 2026 | 107 |
| Nov 17, 2026 | 125 |
| Nov 16, 2026 | 137 |
| Nov 15, 2026 | 159 |
| Nov 14, 2026 | 171 |
| Nov 13, 2026 | 188 |
| Nov 12, 2026 | 194 |
| Nov 11, 2026 | 189 |
| Nov 10, 2026 | 192 |
| Nov 9, 2026 | 184 |
| Nov 8, 2026 | 164 |
| Nov 7, 2026 | 167 |
| Nov 6, 2026 | 152 |
| Nov 5, 2026 | 158 |
| Nov 4, 2026 | 178 |
| Nov 3, 2026 | 177 |
| Nov 2, 2026 | 199 |
| Nov 1, 2026 | 206 |
| Oct 31, 2026 | 209 |
| Oct 30, 2026 | 222 |
| Oct 29, 2026 | 190 |
| Oct 28, 2026 | 155 |
| Oct 27, 2026 | 153 |
| Oct 26, 2026 | 134 |
| Oct 25, 2026 | 130 |
| Oct 24, 2026 | 120 |
| Oct 23, 2026 | 96 |
| Oct 22, 2026 | 155 |
| Oct 21, 2026 | 210 |
| Oct 20, 2026 | 207 |
| Oct 19, 2026 | 202 |
| Oct 18, 2026 | 185 |
| Oct 17, 2026 | 215 |
| Oct 16, 2026 | 245 |
| Oct 15, 2026 | 228 |
| Oct 14, 2026 | 207 |
| Oct 13, 2026 | 208 |
| Oct 12, 2026 | 210 |
| Oct 11, 2026 | 224 |
| Oct 10, 2026 | 208 |
| Oct 9, 2026 | 205 |
| Oct 8, 2026 | 201 |
| Oct 7, 2026 | 198 |
| Oct 6, 2026 | 176 |
| Oct 5, 2026 | 177 |
| Oct 4, 2026 | 151 |
| Oct 3, 2026 | 129 |
| Oct 2, 2026 | 105 |
| Oct 1, 2026 | 67 |
| Sep 30, 2026 | 36 |
| Sep 29, 2026 | 45 |
| Sep 28, 2026 | 31 |
| Sep 27, 2026 | 31 |
| Sep 26, 2026 | 34 |
| Sep 25, 2026 | 36 |
| Sep 24, 2026 | 50 |
| Sep 23, 2026 | 52 |
| Sep 22, 2026 | 56 |
| Sep 21, 2026 | 54 |
| Sep 20, 2026 | 65 |
| Sep 19, 2026 | 62 |
| Sep 18, 2026 | 63 |
| Sep 17, 2026 | 50 |
| Sep 16, 2026 | 70 |
| Sep 15, 2026 | 57 |
| Sep 14, 2026 | 61 |
| Sep 13, 2026 | 71 |
| Sep 12, 2026 | 111 |
| Sep 11, 2026 | 130 |
| Sep 10, 2026 | 145 |
| Sep 9, 2026 | 128 |
| Sep 8, 2026 | 140 |
| Sep 7, 2026 | 141 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/953493610-root)<a href="https://payloaddirectory.dev/plugins/953493610-root"><img src="https://payloaddirectory.dev/badge/953493610-root.svg" alt="Payload Directory"></a>README
A Payload CMS plugin that adds collaborative commenting functionality to the Lexical rich text editor, enabling content teams to discuss and collaborate on content directly within the editor. Based on the example on https://playground.lexical.dev/ and the Payload plugin template.
npm install payload-lexical-collaboration
# or
yarn add payload-lexical-collaboration
# or
pnpm add payload-lexical-collaboration
import { buildConfig } from 'payload/config';
import { payloadLexicalCollaboration } from 'payload-lexical-collaboration';
export default buildConfig({
// ... other config
plugins: [
payloadLexicalCollaboration({
// Optional configuration options
// disabled: false,
// collections: { users: true } // Specify collections to add custom fields to
}),
],
});
You can add the CommentFeature in two ways:
import { buildConfig } from 'payload/config';
import { lexicalEditor } from '@payloadcms/richtext-lexical';
import { CommentFeature } from 'payload-lexical-collaboration';
export default buildConfig({
// ... other config
editor: lexicalEditor({
features: [
// ... other global features
CommentFeature({
// Optional configuration options
// enabled: true,
}),
],
}),
// ... rest of config
});
import { CommentFeature } from 'payload-lexical-collaboration';
const Page = {
slug: 'posts',
fields: [
{
name: 'content',
type: 'richText',
features: [
// ... other features
CommentFeature({
// Optional configuration options
// enabled: true,
}),
],
},
],
};
The plugin consists of several key components:
Payload Plugin: Creates a new collection called lexical-collaboration-plugin-comments to store comments and their associated metadata.
Lexical Feature: Adds UI components and functionality to the Lexical editor for creating, viewing, and managing comments.
Comment Store: Manages the state of comments and provides methods for adding, deleting, and updating comments.
Mark Nodes: Uses Lexical's mark nodes to highlight commented text in the editor.
API Integration: Communicates with Payload's REST API to persist comments and sync them across users.
Comments are stored with the following structure:
The payloadLexicalCollaboration function accepts the following options:
| Option | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disable the plugin entirely while preserving database schema |
collections | Partial<Record<CollectionSlug, true>> | {} | Specify collections to add custom fields to |
When you need to disable the plugin, there are two recommended approaches:
disabled property (Recommended)payloadLexicalCollaboration({
collections: {
posts: true,
},
disabled: true, // This preserves comment marks in documents
})
This approach is recommended because it:
MarkNode registered to prevent "parseEditorState: type 'mark' not found" errorsenabled: falseCommentFeature({ enabled: false })
This approach:
MarkNode to prevent errorsImportant: Avoid completely commenting out the plugin in your config if you have documents with comment marks. This will cause "parseEditorState: type 'mark' not found" errors when loading those documents.
The CommentFeature function accepts the following options:
| Option | Type | Default | Description |
|---|---|---|---|
enabled | boolean | true | Enable or disable the commenting feature for a specific field |
Before completely removing the plugin from your project, it's important to follow these steps to ensure your content remains accessible:
Leaving comment highlights in your documents will create node types that cannot be read without the plugin installed. This can cause errors when loading documents after the plugin is removed.
Delete all comments: Before uninstalling, ensure all comments and their highlights are removed from your documents.
Temporarily disable the plugin: Use one of the disabling options mentioned above before completely removing it:
payloadLexicalCollaboration({
disabled: true
})
Verify content integrity: Open your documents to ensure they load correctly with the plugin disabled
Remove the plugin: Once you've confirmed all documents load correctly, you can safely:
npm uninstall payload-lexical-collaboration
# or
yarn remove payload-lexical-collaboration
# or
pnpm remove payload-lexical-collaboration
Note: If you've already uninstalled the plugin and are experiencing "parseEditorState: type 'mark' not found" errors, you'll need to reinstall the plugin, delete all comments, and then follow the safe uninstallation process.
src/
├── index.ts # Main plugin entry point
├── exports/ # Export files for client and RSC
└── features/
└── commenting/ # Commenting feature implementation
├── api/ # API services
├── components/ # React components
├── hooks/ # React hooks
├── services/ # Service classes
├── types/ # TypeScript types
├── utils/ # Utility functions
├── command.ts # Lexical commands
├── feature.client.tsx # Client-side feature implementation
├── feature.server.ts # Server-side feature implementation
└── store.ts # Comment state management
# Install dependencies
pnpm install
# Build the plugin
pnpm build
This plugin includes a development environment with a pre-configured Payload CMS instance for testing:
Create a .env file in the dev directory (you can copy from .env.example):
DATABASE_URL=file:./payload.db
PAYLOAD_SECRET=YOUR_SECRET_HERE
Start the development server:
pnpm dev
The server will start at http://localhost:3000/admin with the following credentials:
The dev environment includes:
posts collection with the commenting feature enabledThis development environment is ideal for testing changes to the plugin or exploring its functionality before integrating it into your own project.
MIT
Topics
payload plugin comments
Inline comment threads on Lexical rich text with a sidebar panel, in English and French
589/wk0v3
payload better preview
Live preview with block hover highlighting and two-way scroll sync between the Payload admin and the preview
4846/wk16v3
pages
Adds a versioned pages collection with configurable page types, localized fields, drafts and autosave
6430/wk0v4
plugin
On-page editing and draft preview links for Payload collections and globals on a Next.js frontend
6068/wk4v3 v4
payload better editor
Side-by-side live-preview iframe with a sidebar for editing individual blocks in the Payload edit view
781.2k/wk119v3
payload plugin comments
Document-level and field-level comments with mentions, resolution and email notifications for Payload admin
757.0k/wk37v3