fix(ew): add Block Library to the tool panel dropdown#1115
Open
amol-anand wants to merge 3 commits into
Open
Conversation
Contributor
|
@amol-anand can you have a look at the link issues and we should add some tests as well |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds Block Library to the ew canvas tool panel dropdown
Description
Adds Block Library to the right tool panel dropdown, alongside the other tools (Outline, Files, Versions, Templates, Icons, Placeholders, AEM Assets).
Selecting it opens the same block library dialog that the slash menu and outline "+" button already open — inserting a variant drops it at the current cursor position in the editor.
Motivation and Context
Block Library is the odd one out: every other tool is reachable from the tool panel dropdown, but the block library was only accessible via the slash menu and a small, easy-to-miss + button on the outline section header rows. This puts it where users already look for tools, so it's discoverable in the same place as everything else — without removing the existing entry points.
Rather than rendering it inline like the other library tools (its tree + preview layout needs far more room than the side panel offers), the dropdown entry reuses the existing openBlockLibraryModal() flow. This keeps a single block-library UI and avoids offering two different experiences for the same feature.
Implementation
extensionToPanelViewspecial-cases the blocks extension to produce a view with a newexperience: 'modal'and anopenModal()that calls the existingopenBlockLibraryModal(), wiring insertion into the active editor view.ew-tool-panelhandles the new modal experience inshowPanel— mirroring the existing window case: it fires the action and returns without mounting anything inline or changing the active tab. The dropdown item shows the "opens externally" affordance.No changes to the block library modal component or its styles — it's the exact same dialog, now reachable from a third entry point.
How Has This Been Tested?
https://shwblock--da-live--adobe.aem.live/canvas#/aem-sandbox/block-collection/drafts/amol/shwblock
Verified Block Library appears in the tool panel dropdown for a site with a configured blocks library, grouped under Library.
Selecting it opens the block library dialog; searching, expanding blocks, and previewing variants all work as before.
Inserting a variant places the block at the current cursor position in the editor.
Confirmed the existing entry points (slash menu, outline section "+" button) still work unchanged.
Confirmed the dropdown entry does not appear for sites with no blocks library configured.
Screenshots (if appropriate):
Types of changes
Checklist: