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

[Heading Plugin] Customise Heading levels #3162

Merged
merged 6 commits into from
Apr 30, 2024
Merged

Conversation

emilienbidet
Copy link
Contributor

Description

I would like to add the headings nodes to h3 without the h1 node.

So I changed the API to make it more customisable.

Example

Before

createHeadingPlugin({ options: { levels: 3 } })
// Create headings from 1 to 3

After

createHeadingPlugin({ options: { levels: [2, 3] } })
// Create headings 2 and 3

Copy link

changeset-bot bot commented Apr 30, 2024

🦋 Changeset detected

Latest commit: 49e1ec6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@udecode/plate-heading Minor
@udecode/plate-basic-elements Minor
@udecode/plate Minor
@udecode/plate-serializer-docx Minor
@udecode/plate-serializer-md Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Apr 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
plate ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 30, 2024 9:16am

@emilienbidet
Copy link
Contributor Author

It is a breaking change because the previous method will not work any more. Should I handle this behaviour?

@12joan
Copy link
Collaborator

12joan commented Apr 30, 2024

It is a breaking change because the previous method will not work any more. Should I handle this behaviour?

Thanks for the PR! If you change the type to HeadingLevel | HeadingLevel[] (where type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6), you could handle the former case to build the array.

Then the changeset on the heading plugin should be minor.

@emilienbidet
Copy link
Contributor Author

Okay I do this, thanks

Copy link
Collaborator

@12joan 12joan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making that change. Can you also add a changeset using yarn changeset?

@emilienbidet emilienbidet requested a review from 12joan April 30, 2024 08:42
@zbeyens zbeyens merged commit a7798f8 into udecode:main Apr 30, 2024
6 checks passed
@emilienbidet emilienbidet deleted the patch-1 branch April 30, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants