6.4 Backport: Add new wp patterns package #5235
Closed
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.
Description
Adds the newly created @wordpress/patterns package. Currently there is duplicated code for adding patterns in post editor (imported from reusable-blocks) and site editor (local modal component), which means any changes need to be applied in two places, so the patterns package was added in order to allow sharing of this code, and also as a means to start slowly deprecating the @wordpress/reusable-blocks package
Trac ticket: https://core.trac.wordpress.org/ticket/59380
Testing Instructions
This can't be properly tested until the latest GB packages are backported.
Create pattern
block menu to create both a synced and an unsynced pattern and make sure both options work as expectedCreate pattern
block menu to create both a synced and an unsynced pattern and make sure both options work as expected and also make sure the Detach pattern and Manage patterns options on the block overflow menu work correctlyScreenshots or screencast
patterns-share.mp4
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.