You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add new, simpler link control for use by core extenders #65092
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.
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. 🤔
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.
Activity
ndiego commentedon Sep 5, 2024
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
LinkControlitself is primarily used to link text within blocks. So perhaps some sort ofLinkButtonControlwould 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. 🤔Mamaduka commentedon Sep 5, 2024
Somewhat related #56384.
markhowellsmead commentedon Sep 5, 2024
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.