This PR adds a version of the Parts Kit integration to WP Site Starter. I went back and forth with rending the block content vs rendering the block inside a standalone Block Editor, but ultimately ended up just displaying the rendered block. This isn't a perfect solution because some blocks do not return any HTML when using render_block().
Features
Blocks are nested by Namespace, and then by Parent Block (see Text & Icon Cards > Text & Icon Card)
The theme's stylesheet is automatically loaded and the components are styled as they would appear in the theme.
I added a "Markup Toggle" allowing you to quickly see the components full markup without having to use "Inspect Element/Dev Tools".
Links inside the Block Preview are disabled automatically (but display a wavy underline)
The plugin attempts to recursively render InnerBlocks and inject Sample Content where applicable, however, this didn't always work correctly when the InnerBlocks template uses a core/pattern.
Issues
84
Testing Instructions
Go to WP Admin > Tools > Parts Kit
Use the navigation to the left to review the supported blocks.
Screenshots
Known Issues
These are things I have just learned to live with for now until we have more time to put into this:
Most of the code to render the Block Editor inside the Parts Kit is still in this PR - I made some good progress on this, but hit a few roadblocks trying to get it to recognize custom blocks as well as generate the correct expected markup to pre-load a block.
I have no idea why some of the Core blocks do not have any output (like Details, which also affects the Accordion component)
When viewing the Navigation Container block in "Mobile" view, the menu toggle doesn't work (not sure if this is a pointer-events: none issue, or a JS loading issue).
Future Enhancements
Support for Patterns - Make a separate group in the sidebar to render patterns, both built-in and created in the FSE.
Better Core Block Support
Better support for sample content (images, videos, etc)
Get the Standalone Block Editor working
Group Blocks By Block Category (rather than Namespace)
Summary
This PR adds a version of the Parts Kit integration to WP Site Starter. I went back and forth with rending the block content vs rendering the block inside a standalone Block Editor, but ultimately ended up just displaying the rendered block. This isn't a perfect solution because some blocks do not return any HTML when using
render_block()
.Features
InnerBlocks
and inject Sample Content where applicable, however, this didn't always work correctly when the InnerBlocks template uses acore/pattern
.Issues
84
Testing Instructions
Screenshots
Known Issues
These are things I have just learned to live with for now until we have more time to put into this:
Details
, which also affects theAccordion
component)pointer-events: none
issue, or a JS loading issue).Future Enhancements