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

How to add back default annotations for the "block" field marks? #7483

Open
mitchuman opened this issue Sep 9, 2024 · 0 comments
Open

How to add back default annotations for the "block" field marks? #7483

mitchuman opened this issue Sep 9, 2024 · 0 comments

Comments

@mitchuman
Copy link

Is your feature request related to a problem? Please describe.
Is there a way to pull the default values for annotations for the block type (aka. richtext/portable text field)?

Describe the solution you'd like
I don't want to have to recreate the existing "link" annotation from scratch each time I add a new custom annotation.
Ideal solution (or something of the likes):

{
  type: 'block',
  marks: {
    annotations: [
      ...defaultAnnotationsEtc(), // 👈 here
      myCustomAnnotation,
    ]
  }
}

Describe alternatives you've considered
I had attempted to recreate the default "link" annotation using an href string field but the Input popover component in the Studio stretches wider than what the default looked like. Additionally, the validation was behaving weird too where it didn't accept internal URLs (starting with /).

Additional context
Add any other context or screenshots about the feature request here.

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

No branches or pull requests

1 participant