woocommerce/docs/product-editor-development
Nathan Silveira 793e4a821d
Split product editor blocks into separate directory structures (#40571)
* Create 'generic' and 'product-fields' and separate blocks between the two

* Refactor 'BlockRegistry' to include new directory structure

* Increment README

* Add param documentation

* Add changelogs

* Lint markdown

* Add block directory doc

* Fix jest test

* Update handbook reference
2023-10-04 13:51:25 +00:00
..
README.md Split product editor blocks into separate directory structures (#40571) 2023-10-04 13:51:25 +00:00

README.md

Product Editor Development Handbook

⚠️ Notice: This documentation is currently a work in progress. Please be aware that some sections might be incomplete or subject to change. We appreciate your patience and welcome any contributions!

This handbook is a guide for extension developers looking to add support for the new product editor in their extensions. The product editor uses Gutenberg's Block Editor, which is going to help WooCommerce evolve alongside the WordPress ecosystem.

The product editor's UI consists of Groups (currently rendered as tabs), Sections, and Fields, which are all blocks.

Product editor structure

The form's structure is defined in PHP using a Template, which is a tree structure of blocks. The template can be modified by using the Template API to add new Groups, Sections, and Fields as well as remove existing ones.

Many extensibility implementations can be done using only the PHP-based Block Template API alongside our library of generic blocks. More complex interactivity can be implemented using JavaScript and React (the same library used to implement the core blocks used in the product editor). @woocommerce/create-product-editor-block can help scaffold a development environment with JavaScript and React.