Commit 0f0df492e63 for woocommerce
commit 0f0df492e634363fb77c2aa8f77d85ec35a5f6c9
Author: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
Date: Fri Jul 3 14:10:12 2026 +0200
Update block references automatically (#66114)
* Update block reference documentation
* Add block reference documentation automation
* Fix block reference hook failure handling
diff --git a/.github/workflows/block-reference-docs.yml b/.github/workflows/block-reference-docs.yml
new file mode 100644
index 00000000000..194220edb9c
--- /dev/null
+++ b/.github/workflows/block-reference-docs.yml
@@ -0,0 +1,65 @@
+name: 'Block Reference Documentation'
+
+on:
+ pull_request:
+ types: [opened, synchronize, reopened, ready_for_review]
+ paths:
+ - 'plugins/woocommerce/client/blocks/assets/js/**/block.json'
+ - '.github/workflows/block-reference-docs.yml'
+ workflow_dispatch:
+
+concurrency:
+ group: block-reference-docs-${{ github.event.pull_request.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ update-block-reference-docs:
+ name: 'Validate block reference docs'
+ runs-on: ubuntu-latest
+ timeout-minutes: 10
+ permissions:
+ contents: read
+ pull-requests: read
+
+ steps:
+ - name: 'Checkout'
+ uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
+
+ - name: 'Check for block metadata changes'
+ if: ${{ github.event_name == 'pull_request' }}
+ id: changes
+ uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
+ with:
+ filters: |
+ block-json:
+ - 'plugins/woocommerce/client/blocks/assets/js/**/block.json'
+
+ - name: 'Setup WooCommerce monorepo'
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.changes.outputs.block-json == 'true' }}
+ uses: ./.github/actions/setup-woocommerce-monorepo
+ with:
+ php-version: false
+ install: '@woocommerce/block-library'
+ pull-package-deps: '@woocommerce/block-library'
+
+ - name: 'Generate block reference docs'
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.changes.outputs.block-json == 'true' }}
+ run: pnpm --filter=@woocommerce/block-library build:docs:block-references
+
+ - name: 'Check generated docs'
+ if: ${{ github.event_name == 'workflow_dispatch' || steps.changes.outputs.block-json == 'true' }}
+ id: docs
+ run: |
+ if git diff --quiet -- docs/block-development/reference/block-references.md; then
+ echo "changed=false" >> "$GITHUB_OUTPUT"
+ else
+ echo "changed=true" >> "$GITHUB_OUTPUT"
+ fi
+
+ - name: 'Fail when generated docs are out of date'
+ if: ${{ steps.docs.outputs.changed == 'true' }}
+ run: |
+ echo "Block reference documentation is out of date." >&2
+ echo "Run pnpm --filter=@woocommerce/block-library build:docs:block-references and commit the result." >&2
+ git diff -- docs/block-development/reference/block-references.md >&2
+ exit 1
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 00000000000..89ffb0e7fa4
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,14 @@
+changed_block_metadata=$(git diff --cached --name-only --diff-filter=ACMR -- 'plugins/woocommerce/client/blocks/assets/js/**/block.json')
+
+if [ -z "$changed_block_metadata" ]; then
+ exit 0
+fi
+
+printf '%s\n' 'Staged WooCommerce block metadata changes detected. Updating block reference documentation...'
+
+if ! corepack pnpm --filter=@woocommerce/block-library build:docs:block-references; then
+ printf '%s\n' 'Failed to regenerate block reference documentation. Aborting commit.' >&2
+ exit 1
+fi
+
+git add docs/block-development/reference/block-references.md
diff --git a/docs/block-development/reference/block-references.md b/docs/block-development/reference/block-references.md
index a3e8fcebcea..297144044fd 100644
--- a/docs/block-development/reference/block-references.md
+++ b/docs/block-development/reference/block-references.md
@@ -301,6 +301,15 @@ Display any product variations available to select from and add to cart.
- **Ancestor:** woocommerce/add-to-cart-with-options
- **Supports:** interactivity
+## Add to Wishlist Button - woocommerce/add-to-wishlist-button
+
+Lets shoppers add the current product to their wishlist from the single-product page.
+
+- **Name:** woocommerce/add-to-wishlist-button
+- **Category:** woocommerce
+- **Ancestor:** woocommerce/add-to-cart-with-options
+- **Supports:** color (background, text), interactivity, spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~multiple~~, ~~reusable~~
+
## Filter by Attribute Controls - woocommerce/attribute-filter
Enable customers to filter the product grid by selecting one or more attributes, such as color.
@@ -825,7 +834,7 @@ Display options in a dropdown.
- **Name:** woocommerce/dropdown
- **Category:** woocommerce
- **Ancestor:** woocommerce/add-to-cart-with-options-variation-selector-attribute
-- **Supports:** interactivity
+- **Supports:** interactivity, woocommerce (innerBlockDisplayStyle)
## Email Content - woocommerce/email-content
@@ -1230,8 +1239,8 @@ Let shoppers filter products displayed on the page.
- **Name:** woocommerce/product-filters
- **Category:** woocommerce
-- **Supports:** align, color (background, button, heading, text, ~~enableContrastChecker~~), inserter, interactivity, layout (default, ~~allowEditing~~), spacing (blockGap), typography (fontSize), ~~multiple~~
-- **Attributes:** isPreview
+- **Supports:** align, color (background, button, heading, text, ~~enableContrastChecker~~), inserter, interactivity, layout (default, ~~allowEditing~~), spacing (blockGap), typography (fontSize)
+- **Attributes:** isPreview, showFilterDrawer
## Active Filters - woocommerce/product-filter-active
@@ -1259,7 +1268,7 @@ Display a list of filter options.
- **Name:** woocommerce/product-filter-checkbox-list
- **Category:** woocommerce
- **Ancestor:** woocommerce/product-filter-attribute, woocommerce/product-filter-status, woocommerce/product-filter-taxonomy, woocommerce/product-filter-rating
-- **Supports:** interactivity
+- **Supports:** interactivity, woocommerce (innerBlockDisplayStyle)
- **Attributes:** customLabelElement, customOptionElement, customOptionElementBorder, customOptionElementSelected, labelElement, optionElement, optionElementBorder, optionElementSelected
## Chips - woocommerce/product-filter-chips
@@ -1269,7 +1278,7 @@ Display filter options as chips.
- **Name:** woocommerce/product-filter-chips
- **Category:** woocommerce
- **Ancestor:** woocommerce/product-filter-attribute, woocommerce/product-filter-taxonomy, woocommerce/product-filter-status, woocommerce/add-to-cart-with-options-variation-selector-attribute
-- **Supports:** interactivity
+- **Supports:** interactivity, woocommerce (innerBlockDisplayStyle)
- **Attributes:** chipBackground, chipBorder, chipText, customChipBackground, customChipBorder, customChipText, customSelectedChipBackground, customSelectedChipBorder, customSelectedChipText, selectedChipBackground, selectedChipBorder, selectedChipText
## Clear filters - woocommerce/product-filter-clear-button
@@ -1320,9 +1329,9 @@ Display removable active filters as chips.
- **Supports:** interactivity, layout (default, ~~allowInheriting~~, ~~allowSwitching~~, ~~allowVerticalAlignment~~)
- **Attributes:** chipBackground, chipBorder, chipText, customChipBackground, customChipBorder, customChipText
-## Status Filter - woocommerce/product-filter-status
+## Availability filter - woocommerce/product-filter-status
-Let shoppers filter products by choosing stock status.
+Let shoppers filter products by availability.
- **Name:** woocommerce/product-filter-status
- **Category:** woocommerce
@@ -1598,6 +1607,15 @@ Display reviews for your products.
- **Category:** woocommerce
- **Supports:** color (text, ~~background~~), interactivity (clientNavigation), typography (fontSize), ~~html~~
+## Saved for Later - woocommerce/saved-for-later
+
+Display items the shopper has saved from their cart for later.
+
+- **Name:** woocommerce/saved-for-later
+- **Category:** woocommerce
+- **Supports:** align (full, wide), color (background, text), interactivity, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
+- **Attributes:** columnCount
+
## Product - woocommerce/single-product
Display a single product of your choice with full control over its presentation.
@@ -1625,4 +1643,13 @@ Display shopper-facing notifications generated by WooCommerce or extensions.
- **Supports:** align (full, wide), interactivity (clientNavigation), ~~multiple~~
- **Attributes:** align
+## Wishlist - woocommerce/wishlist
+
+Display the shopper's wishlist.
+
+- **Name:** woocommerce/wishlist
+- **Category:** woocommerce
+- **Supports:** align (full, wide), color (background, text), interactivity, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~, ~~reusable~~
+- **Attributes:** columnCount
+
{/* END Autogenerated - DO NOT EDIT */}