Commit ba3bd74
authored
feat(richtext-lexical): upgrade lexical from 0.35.0 to 0.41.0 (#15760)
## Summary
Upgrades the lexical dependency from 0.35.0 to 0.41.0.
Keeping up with Lexical releases avoids accumulating too large a gap,
which makes future upgrades risky and time-consuming. This upgrade also
brings in the upstream `normalizeMarkdown` fix
([facebook/lexical#7812](facebook/lexical#7812)),
which means we can eventually drop our vendored copy of that function.
If you installed lexical manually, update it to 0.41.0. Installing
lexical manually is not recommended, as it may break between updates,
and our re-exported versions should be used. See the [yellow banner
box](https://payloadcms.com/docs/rich-text/custom-features) for details.
If you still encounter richtext-lexical errors, do the following, in
this order:
- Delete node_modules
- Delete your lockfile (e.g. pnpm-lock.json)
- Reinstall your dependencies (e.g. pnpm install)
## Lexical Breaking Changes
The following Lexical releases contain breaking changes. We recommend
reading them if you're using Lexical APIs directly
(`@payloadcms/richtext-lexical/lexical/*`).
- [v0.41.0](https://github.com/facebook/lexical/releases/tag/v0.41.0) —
`--lexical-indent-base-value` CSS custom property is now only read from
the editor root element, not from indented elements. **Payload already
handles this change internally** — no action required.
- [v0.39.0](https://github.com/facebook/lexical/releases/tag/v0.39.0) —
`ElementNode` JSON serialization: `textFormat` and `textStyle` are now
only serialized when necessary (when the node has no direct TextNode
children). May affect code that reads these properties from serialized
data.
- [v0.38.0](https://github.com/facebook/lexical/releases/tag/v0.38.1) —
Static transforms from superclasses are now always applied. Table
selection handler priorities lowered from CRITICAL to HIGH.
- [v0.36.1](https://github.com/facebook/lexical/releases/tag/v0.36.1) —
`DecoratorNode.decorate()` return type widened to `null | T`.
Collaboration context changes (not used by Payload).
None of these breaking changes require action from Payload users under
normal usage.
## Changes
- Bump all `@lexical/*` and `lexical` from 0.35.0 to 0.41.0
- Update `lexicalTargetVersion` constant
- Move `--lexical-indent-base-value` CSS variable from
`.LexicalEditorTheme__indent` to the `.LexicalEditorTheme` root selector
(v0.41.0 breaking change)
- Update `textFormat` test expectations for inline code paragraphs
(v0.39.0 serialization change)
- Update pnpm-lock.yaml
## Previous Lexical Upgrades
- [#13715](#13715) — 0.34.0 →
0.35.0
- [#13622](#13622) — 0.28.0 →
0.34.0
- [#11764](#11764) — 0.27.2 →
0.28.0
- [#11564](#11564) — 0.21.0 →
0.27.11 parent a1d6733 commit ba3bd74
5 files changed
Lines changed: 271 additions & 219 deletions
File tree
- packages/richtext-lexical
- src
- lexical/theme
- test/lexical-mdx/tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
| |||
387 | 387 | | |
388 | 388 | | |
389 | 389 | | |
390 | | - | |
| 390 | + | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| |||
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
| 405 | + | |
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | 90 | | |
93 | 91 | | |
94 | 92 | | |
| |||
0 commit comments