Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(richtext-lexical)!: finalize ClientFeature interface #6191

Merged
merged 7 commits into from May 3, 2024

Conversation

AlessioGr
Copy link
Member

@AlessioGr AlessioGr commented May 2, 2024

Description

Various changes to the ClientFeature interface, as well as adding a new toolbarFixed property (not implemented yet).

BREAKING:
If you have own, custom lexical features, there will be a bunch of breaking API changes for you. The saved JSON data is not affected.

  • floatingSelectToolbar has been changed to toolbarInline

  • slashMenu.dynamicOptions and slashMenu.options have been changed to slashMenu.groups and slashMenu.dynamicGroups

  • toolbarFixed.sections is now toolbarFixed.groups

  • Slash menu group options and toolbar group entries have both been renamed to items

  • Toolbar group item onClick has been renamed to onSelect to match slash menu properties

  • slashMenu item onSelect is no longer auto-wrapped inside an editor.update. If you perform editor updates in them, you have to wrap it inside an editor.update callback yourself. Within our own features this extra control has removed a good amount of unnecessary, nested editor.update calls, which is good

  • Slash menu items are no longer initialized using the new keyword, as they are now types and no longer classes. You can convert them to an object and add the key property as an object property instead of an argument to the previous SlashMenuItem constructor

  • CSS classnames for slash menu and toolbars have changed

  • CheckListFeature is now exported as and has been renamed to ChecklistFeature

For guidance on migration, check out how we migrated our own features in this PR's diff: https://github.com/payloadcms/payload/pull/6191/files

  • I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • Chore (non-breaking change which does not add functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Change to the templates directory (does not affect core functionality)
  • Change to the examples directory (does not affect core functionality)
  • This change requires a documentation update

Checklist:

  • I have added tests that prove my fix is effective or that my feature works
  • Existing test suite passes locally with my changes
  • I have made corresponding changes to the documentation

@AlessioGr AlessioGr added the plugin: richtext-lexical @payloadcms/richtext-lexical label May 2, 2024
@AlessioGr AlessioGr requested a review from paulpopus May 2, 2024 22:13
@AlessioGr AlessioGr merged commit 7ab156e into beta May 3, 2024
5 checks passed
@AlessioGr AlessioGr deleted the feat/lexical-fixed-toolbar branch May 3, 2024 01:38
paulpopus pushed a commit that referenced this pull request May 6, 2024
**BREAKING:**
If you have own, custom lexical features, there will be a bunch of breaking API changes for you. The saved JSON data is not affected.

- `floatingSelectToolbar` has been changed to `toolbarInline`

- `slashMenu.dynamicOptions `and `slashMenu.options` have been changed to `slashMenu.groups` and `slashMenu.dynamicGroups`

- `toolbarFixed.sections` is now `toolbarFixed.groups`

- Slash menu group `options` and toolbar group `entries` have both been renamed to `items`

- Toolbar group item `onClick` has been renamed to `onSelect` to match slash menu properties

- slashMenu item `onSelect` is no longer auto-wrapped inside an `editor.update`. If you perform editor updates in them, you have to wrap it inside an `editor.update` callback yourself. Within our own features this extra control has removed a good amount of unnecessary, nested `editor.update` calls, which is good

- Slash menu items are no longer initialized using the `new` keyword, as they are now types and no longer classes. You can convert them to an object and add the `key` property as an object property instead of an argument to the previous SlashMenuItem constructor

- CSS classnames for slash menu and toolbars, as well as their items, have changed

- `CheckListFeature` is now exported as and has been renamed to `ChecklistFeature`

For guidance on migration, check out how we migrated our own features in this PR's diff: https://github.com/payloadcms/payload/pull/6191/files
JessChowdhury pushed a commit that referenced this pull request May 13, 2024
**BREAKING:**
If you have own, custom lexical features, there will be a bunch of breaking API changes for you. The saved JSON data is not affected.

- `floatingSelectToolbar` has been changed to `toolbarInline`

- `slashMenu.dynamicOptions `and `slashMenu.options` have been changed to `slashMenu.groups` and `slashMenu.dynamicGroups`

- `toolbarFixed.sections` is now `toolbarFixed.groups`

- Slash menu group `options` and toolbar group `entries` have both been renamed to `items`

- Toolbar group item `onClick` has been renamed to `onSelect` to match slash menu properties

- slashMenu item `onSelect` is no longer auto-wrapped inside an `editor.update`. If you perform editor updates in them, you have to wrap it inside an `editor.update` callback yourself. Within our own features this extra control has removed a good amount of unnecessary, nested `editor.update` calls, which is good

- Slash menu items are no longer initialized using the `new` keyword, as they are now types and no longer classes. You can convert them to an object and add the `key` property as an object property instead of an argument to the previous SlashMenuItem constructor

- CSS classnames for slash menu and toolbars, as well as their items, have changed

- `CheckListFeature` is now exported as and has been renamed to `ChecklistFeature`

For guidance on migration, check out how we migrated our own features in this PR's diff: https://github.com/payloadcms/payload/pull/6191/files
JessChowdhury pushed a commit that referenced this pull request May 14, 2024
**BREAKING:**
If you have own, custom lexical features, there will be a bunch of breaking API changes for you. The saved JSON data is not affected.

- `floatingSelectToolbar` has been changed to `toolbarInline`

- `slashMenu.dynamicOptions `and `slashMenu.options` have been changed to `slashMenu.groups` and `slashMenu.dynamicGroups`

- `toolbarFixed.sections` is now `toolbarFixed.groups`

- Slash menu group `options` and toolbar group `entries` have both been renamed to `items`

- Toolbar group item `onClick` has been renamed to `onSelect` to match slash menu properties

- slashMenu item `onSelect` is no longer auto-wrapped inside an `editor.update`. If you perform editor updates in them, you have to wrap it inside an `editor.update` callback yourself. Within our own features this extra control has removed a good amount of unnecessary, nested `editor.update` calls, which is good

- Slash menu items are no longer initialized using the `new` keyword, as they are now types and no longer classes. You can convert them to an object and add the `key` property as an object property instead of an argument to the previous SlashMenuItem constructor

- CSS classnames for slash menu and toolbars, as well as their items, have changed

- `CheckListFeature` is now exported as and has been renamed to `ChecklistFeature`

For guidance on migration, check out how we migrated our own features in this PR's diff: https://github.com/payloadcms/payload/pull/6191/files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin: richtext-lexical @payloadcms/richtext-lexical
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants