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

Add new, simpler link control for use by core extenders #65092

Open
markhowellsmead opened this issue Sep 5, 2024 · 3 comments
Open

Add new, simpler link control for use by core extenders #65092

markhowellsmead opened this issue Sep 5, 2024 · 3 comments
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Feature] UI Components Impacts or related to the UI component system [Type] Enhancement A suggestion for improvement.

Comments

@markhowellsmead
Copy link

What problem does this address?

The amount of React code required to make a link control is quite considerable. Developers would find it much easier to implement if this were available as a reusable component. See https://github.com/ndiego/enable-linked-groups/blob/main/src/index.js for an example.

What is your proposed solution?

Take the code which has been written here for the control, make it into a simpler reusable wrapped component, and add to one of the core component packages.

@markhowellsmead markhowellsmead added the [Type] Enhancement A suggestion for improvement. label Sep 5, 2024
@ndiego
Copy link
Member

ndiego commented Sep 5, 2024

Take the code which has been written here for the control, make it into a simpler reusable wrapped component, and add to one of the core component packages.

I am not 100% convinced by this solution, or maybe I just can't quite conceptualize it. While creating a wrapper component would definitely be possible, if you wanted to add custom functionality, you would still need to compose your own component.

That said, the LinkControl itself is primarily used to link text within blocks. So perhaps some sort of LinkButtonControl would add the UI similar to the Image block and what I built, and then have some sort of extensibility mechanism to define the menu options presented. 🤔

Image block
linked-group-image-link

@ndiego ndiego added [Feature] UI Components Impacts or related to the UI component system [Feature] Extensibility The ability to extend blocks or the editing experience labels Sep 5, 2024
@ndiego ndiego moved this to Needs discussion in Increase Gutenberg Extensibility Sep 5, 2024
@Mamaduka
Copy link
Member

Mamaduka commented Sep 5, 2024

Somewhat related #56384.

@markhowellsmead
Copy link
Author

My intention and hope is that the entire component would be available as a complete React component, including a standardised popover, link targeting, rel etc, data/attribute handling and visual commonality with core blocks. I'd also note that the editorial linking experience is different across various blocks, which should also be standardised. Right now, it's a fairly large amount of work to add a control like this one to the toolbar, when it should be simple, as a very common use-case on custom blocks / custom core block extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extensibility The ability to extend blocks or the editing experience [Feature] UI Components Impacts or related to the UI component system [Type] Enhancement A suggestion for improvement.
Projects
Status: Needs discussion
Development

No branches or pull requests

3 participants