wp-includes/blocks.php - register_block_from_metadata
wp-includes/script-loader- wp_enqueue_registered_block_scripts_and_styles
Entites.js hold static and dynamic selectors. Dynamic are created with prefixes and rootEntitiesConfig
const [ link, setLink ] = useEntityProp( 'postType', postType, 'link', postId );
- Entity type
- Entity type name
- Entity field
- post ID (current if omitted)
There is a secret group attribute on BlockControls
- default group='default'
Predefined groups: https://github.com/WordPress/gutenberg/blob/trunk/packages/block-editor/src/components/block-controls/groups.js
select core/editor getCurrentPostType()
// useEntityProp
/**
* Hook that returns the value and a setter for the
* specified property of the nearest provided
* entity of the specified type.
*
* @param {string} kind The entity kind.
* @param {string} name The entity name.
* @param {string} prop The property name.
* @param {string} [_id] An entity ID to use instead of the context-provided one.
*
* @return {[*, Function, *]} An array where the first item is the
* property value, the second is the
* setter and the third is the full value
* object from REST API containing more
* information like `raw`, `rendered` and
* `protected` props.
*/