Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Update BlockPreview component to accept multiple Blocks to preview #16033
Note: the Reusable Blocks previews are not currently working due to this unrelated bug #16808
How has this been tested?
Firstly confirm existing behaviour has been preserved with the change in API. To do this, manually test all instances where
To test multiple Blocks being rendered you can:
Places to check for previews
Types of changes
New feature (non-breaking change which adds functionality)
Show multiple blocks being previewed.
youknowriad left a comment
Right now that component expects name, attributes and innerBlocks prop to render the preview. I think if we want to expose it, it would be better to allow passing
Also, I think we might want to expose
This might require some adjustements to classnames and things like that.
I did some investigation during the weekend and I'm currently thinking between:
The smaller size is used in "Styles" panel for example and the full size can be seen inside the block switcher or in block inserter for reusable blocks
I'm personally leaning towards the latter
I also liked the approach when doing some prototypes locally, it was just a bit more work than expected as those two components do very different things and all places they are used from have to be updated.
With the rate #16113 is getting worked on and introducing a lot of changes, I think it might be wise to wait with this PR for that one to be merged. Otherwise, we will be doing some duplicate work about scaling etc…
changed the title
(3P) Export BlockPreview component and accept multiple Blocks to preview
Jul 29, 2019
I'm working separately on the unification of
With @getdave and @retrofox, we plan to spend some more time on various issues around block previews. To be able to ship gradual updates to these components, I would suggest to keep this PR only about the move from
Let's finish the support for
Suggest we filter this out if previews along with any other Block inserters.