-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
InnerBlocks: introduce prop to specify render callback for each block. (
#24232) * InnerBlocks: introduce prop to specify wrapper element for children. Initial web edit implementation. (No save or native implementations yet.) * Initial save implementation. * For testing purposes: wrap each child of Group in section tag. * Fix save implementation over-escaping. * Move wrapper logic from BlockList to BlockListBlock. Fixes block moving animations for inner blocks. * Fix drag-and-drop for inner blocks. * Initial native implementation. * Remove need for 'block-editor-block-list-block__wrapper'. This makes it possible to switch to a callback-based API, e.g. "itemWrapper={ ( item ) => <div>{ item }</div> }". * Switch to callback-based API. Edit implementation: <InnerBlocks __experimentalItemCallback={ ( item ) => <div>{ item }</div> } /> Save implementation: <InnerBlocks.Content __experimentalItemCallback={ ( item ) => <div>{ item }</div> } /> * Rename __experimentalCallback to __experimentalRenderCallback. * Apply render callback at a slightly higher level. Fixes non-light blocks having the render callback applied inside the Block component rather than outside. Also moves the "Edit as HTML" form of blocks inside the render callback. * Remove obsolete unit test. getNearestBlockIndex now assumes all elements passed to it are the root elements of blocks; we filter out the other elements before passing the array to the function. * Revert temporary Group block changes.
- Loading branch information
1 parent
759a98a
commit 48c4fb9
Showing
9 changed files
with
79 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters