Overview & Quick Start
Payload Lexical configuration
@nexload-sdk/payload-editor
v1.1.0 Stable ReleasedSemantic, deterministic Payload Lexical editor configuration.
Payload CMSNode.jsESM
@nexload-sdk/payload-editor transforms an explicit semantic feature definition into the official Payload CMS Lexical editor provider. It provides teams with named presets, deterministic feature merge rules, and safe extension seams without cluttering collection configurations with verbose Lexical boilerplate.
10-Second Code Snippet
Section titled “10-Second Code Snippet”import { createEditor } from "@nexload-sdk/payload-editor";import type { CollectionConfig } from "payload";
// 1. Define explicit editor policy from presetconst blogEditor = createEditor({ preset: "article", features: { heading: { sizes: ["h2", "h3"] }, // Restrict heading sizes upload: { allowedCollections: ["media"], maxDepth: 1 }, },});
// 2. Attach directly to Payload RichText fieldexport const Posts: CollectionConfig = { slug: "posts", fields: [ { name: "content", type: "richText", editor: blogEditor }, ],};What You Get
Section titled “What You Get”- Ready-to-Use Presets: Built-in presets for common editorial workflows:
compact,standard,structured-content,article, andproduct-description. - Deterministic Feature Merging: Clear override semantics:
falsedisables,trueenables with defaults, objects shallow-merge, and array options replace. - Custom Organization Presets: Define reusable corporate editor standards using
defineEditorPreset(). - Native Extension Seam: Seamlessly attach native Lexical features like
BlocksFeatureor custom AST nodes viaextendFeatures. - Zero UI Bloat: The package runs in server/config code, has no client React runtime, and declares no side effects.
Installation & Requirements
Section titled “Installation & Requirements”pnpm add @nexload-sdk/payload-editor @payloadcms/richtext-lexical payloadWith alternative package managers:
# npmnpm install @nexload-sdk/payload-editor @payloadcms/richtext-lexical payload
# bunbun add @nexload-sdk/payload-editor @payloadcms/richtext-lexical payloadCompatibility Requirements
Section titled “Compatibility Requirements”| Package / Runtime | Supported Range | Notes |
|---|---|---|
| Node.js | >=20.9.0 | Server/config safe |
| Payload CMS | >=3.85.0 <4.0.0 | Core headless CMS |
@payloadcms/richtext-lexical | >=3.85.0 <4.0.0 | Native Lexical editor provider |
| Module Format | ESM only | Declarative config safe |
Feature State Semantics
Section titled “Feature State Semantics”In createEditor({ features: { ... } }):
- Omitted key: Inherits configuration from the active preset (or disabled if no preset is used).
false: Completely disables and removes the feature from the editor toolbar.true: Enables the feature with default recommended options.{ ...options }: Enables the feature and shallow-merges your specific options. Any provided arrays replace preset arrays rather than appending.
Next Steps
Section titled “Next Steps”- Explore Production Guides & Presets for custom organization presets, blocks features, and troubleshooting.
- Check the API Reference & Signatures for all supported features and options.