Skip to content

Conversation

@mogmarsh
Copy link
Collaborator

@mogmarsh mogmarsh commented Oct 8, 2025

Summary

wp-curate issue #51: Add support for selecting a layout

This PR introduces comprehensive support for selecting layouts and block patterns in the wp-curate/query block, aligning it with the functionality found in the Columns and Query Loop blocks. The implementation includes both JavaScript/React and PHP enhancements to enable variation and pattern selection, as well as improved extensibility for future layouts.

Notes for reviewers

  • The block now supports a layout property, enabling users to choose among different layout options (with "list" as the default).
  • Pattern and variation selection modals have been integrated, allowing users to initialize blocks with custom content or layouts.
  • Block variations and block patterns are now registered via both JavaScript (block.json, registerBlockVariation()) and new PHP classes.
  • Utility functions and TypeScript types have been introduced to support pattern searching, selection, and transformation.
  • The main plugin initialization now includes new features for block variations and block patterns.
  • The PR includes dependency upgrades and some minor code cleanup and refactoring.

Changelog entries

Added

  • Support for selecting a layout in wp-curate, following the pattern used in the Columns and Query Loop blocks.
  • A layout property to the query block schema, allowing selection of different layouts (defaulting to "list").
  • Ability to register block variations via block.json, registerBlockVariation(), or PHP filter get_block_type_variations.
  • Integration of a variation picker modal (using __experimentalBlockVariationPicker or a custom component) for layout selection.
  • Pattern selection modal and placeholder React components for enhanced block initialization.
  • Utility functions and hooks for pattern searching and block transformation.
  • New TypeScript types for block and block patterns.
  • New PHP feature classes for registering block patterns and block variations.
  • Initialization of block variation and pattern features in the main plugin entrypoint.

Changed

  • Updated import source for PluginDocumentSettingPanel reflecting changes in WordPress package structure.
  • Upgraded various @wordpress/* dependencies to the latest versions.

Deprecated

None.

Removed

  • Hardcoded InnerBlocks template for the Query block, replaced by a more flexible pattern-based approach.

Fixed

  • Improved error handling and preview display during pattern and layout selection.
  • Linting and code cleanup.

Security

None.

Ticket(s)

@mogmarsh mogmarsh added enhancement New feature or request gutenberg Requires understanding Gutenberg javascript Requires understanding JavaScript labels Oct 8, 2025
@mogmarsh mogmarsh marked this pull request as ready for review October 15, 2025 02:30
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are proof of concept patterns. The real patterns will be better named, be more different, etc.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These are proof of concept variations. The real variations will be better named, be more different, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gutenberg Requires understanding Gutenberg javascript Requires understanding JavaScript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant