docs: improvements in rich text section (#9954)

- fixed broken links
- improved introduction of `overview` and `slate` sections
This commit is contained in:
Germán Jabloñski
2025-01-24 17:33:43 -03:00
committed by GitHub
parent ace755742c
commit 6a39279697
4 changed files with 19 additions and 15 deletions

View File

@@ -1102,7 +1102,7 @@ plugins: [
## `@payloadcms/richtext-lexical` ## `@payloadcms/richtext-lexical`
If you have custom features for `@payloadcms/richtext-lexical` you will need to migrate your code to the new API. Read more about the new API in the [documentation](https://payloadcms.com/docs/lexical/building-custom-features). If you have custom features for `@payloadcms/richtext-lexical` you will need to migrate your code to the new API. Read more about the new API in the [documentation](https://payloadcms.com/docs/rich-text/building-custom-features).
## Upgrade from previous beta ## Upgrade from previous beta

View File

@@ -1,8 +1,8 @@
--- ---
title: Lexical Building Custom Features title: Custom Features
label: Custom Features label: Custom Features
order: 40 order: 40
desc: Building custom lexical features desc: Building custom features
keywords: lexical, rich text, editor, headless cms, feature, features keywords: lexical, rich text, editor, headless cms, feature, features
--- ---

View File

@@ -7,21 +7,21 @@ title: Rich Text Editor
--- ---
<Banner type="success"> <Banner type="success">
The Payload editor is based on Lexical, Meta's rich text editor. The previous default editor was based on Slate and is still supported. You can read [its documentation](../rich-text/slate), or the optional [migration guide](../rich-text/migration) to migrate from Slate to Lexical (recommended).
This documentation is about our new editor, based on Lexical (Meta's rich text editor). The previous default
editor was based on Slate and is still supported. You can read [its documentation](/docs/rich-text/slate),
or the optional [migration guide](/docs/rich-text/migration) to migrate from Slate to Lexical (recommended).
</Banner> </Banner>
One of Payload's goals is to build the best rich text editor experience that we possibly can. We want to combine the beauty and polish of the Medium editing experience with the strength and features of the Notion editor - all in one place. The editor is the most important property of the [rich text field](/docs/fields/rich-text).
Classically, we've used SlateJS to work toward this goal, but building custom elements into Slate has proven to be more difficult than we'd like, and we've been keeping our options open. As a key part of Payload, we are proud to offer you the best editing experience you can imagine. With healthy
defaults out of the box, but also with the flexibility to customize every detail: from the “/” menu
and toolbars (whether inline or fixed) to inserting any component or subfield you can imagine.
Lexical is extremely impressive and trivializes a lot of the hard parts of building new elements into a rich text editor. It has a few distinct advantages over Slate, including the following:
1. A "/" menu, which allows editors to easily add new elements while never leaving their keyboard To use the rich text editor, first you need to install it:
2. A "hover" toolbar that pops up if you select text
3. It supports Payload blocks natively, directly within your rich text editor
4. Custom elements, called "features", are much easier to build in Lexical vs. Slate
To use the Lexical editor, first you need to install it:
```bash ```bash
pnpm install @payloadcms/richtext-lexical pnpm install @payloadcms/richtext-lexical

View File

@@ -6,9 +6,13 @@ desc: The Slate editor has been supported by Payload since beta. It's very power
keywords: slatejs, slate, rich text, editor, headless cms keywords: slatejs, slate, rich text, editor, headless cms
--- ---
The Slate editor has been supported by Payload since we released our initial beta. It's battle-tested and will continue to be supported into the future. <Banner type="warning">
If you are migrating a Payload project from 1.x or earlier, you can continue to use the Slate editor as long as you'd like. The [default Payload editor](/docs/rich-text/overview) is currently based on Lexical. This documentation
is about our old Slate-based editor. You can continue using it because it is still supported, or you can
see the optional [migration guide](/docs/rich-text/migration) to migrate from Slate to Lexical (recommended).
</Banner>
To use the Slate editor, first you need to install it: To use the Slate editor, first you need to install it: