Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#84] Parts Kit Integration #101

Merged
merged 5 commits into from
Jun 14, 2024
Merged

[#84] Parts Kit Integration #101

merged 5 commits into from
Jun 14, 2024

Conversation

bd-viget
Copy link
Contributor

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

  • 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

Testing Instructions

  1. Go to WP Admin > Tools > Parts Kit
  2. Use the navigation to the left to review the supported blocks.

Screenshots

Screenshot 2024-06-12 at 10 07 17 AM

Known Issues

These are things I have just learned to live with for now until we have more time to put into this:

  1. 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.
  2. I have no idea why some of the Core blocks do not have any output (like Details, which also affects the Accordion component)
  3. 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

  1. Support for Patterns - Make a separate group in the sidebar to render patterns, both built-in and created in the FSE.
  2. Better Core Block Support
  3. Better support for sample content (images, videos, etc)
  4. Get the Standalone Block Editor working
  5. Group Blocks By Block Category (rather than Namespace)

return [
'ID' => 000,
'id' => 000,
'title' => 'placeholder',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bd-viget bd-viget merged commit 93dc2ca into main Jun 14, 2024
@bd-viget bd-viget deleted the bd/84-parts-kit branch June 14, 2024 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants