Expose Patterns Modal to core/interface
store like the Preferences modal
#54199
Labels
[Feature] Patterns
A collection of blocks that can be synced (previously reusable blocks) or unsynced
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
The only way to open the Patterns modal is to click on the Block Inserter, go to the Patterns tab, and then click "Explore All Patterns." This makes it more difficult for users to discover patterns. The Patterns modal visibility is controlled via
useState
in the BlockPatternsTabs component.gutenberg/packages/block-editor/src/components/inserter/block-patterns-tab.js
Lines 255 to 263 in bcaac56
What is your proposed solution?
If the Patterns modal were accessible via the
core/interface
data store like the Preferences modal, then the Patterns modal could be opened via other methods.gutenberg/packages/edit-site/src/components/preferences-modal/index.js
Lines 21 to 29 in bcaac56
We could then use
wp.data.dispatch('core/interface').openModal(PATTERNS_MODAL_NAME)
to open the modal.The text was updated successfully, but these errors were encountered: