[Product Block Editor]: expose __experimentalSectionActions component (#46515)
* add basic Readme.md file * expose __experimentalSectionActions component * changelog * update readme example
This commit is contained in:
parent
28e78fd655
commit
5db25ea616
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Product Block Editor: expose __experimentalSectionActions component
|
|
@ -1,4 +1,4 @@
|
|||
export * from './block-fill';
|
||||
export * from './block-slot';
|
||||
export * from './section-actions/index';
|
||||
export * from './section-actions';
|
||||
export * from './types';
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
# SectionActions
|
||||
|
||||
`<SectionActions />` is a React component designed to be used within blocks in WooCommerce Product Editor,
|
||||
providing a slot for specific actions related to the section in which it is included.
|
||||
|
||||
## Example
|
||||
|
||||
```jsx
|
||||
import { __experimentalSectionActions as SectionActions } from '@woocommerce/product-editor'
|
||||
import { Button } from '@wordpress/components';
|
||||
import { __ } from '@wordpress/i18n';
|
||||
|
||||
function CustomProductBlockEdit() {
|
||||
return (
|
||||
<>
|
||||
<SectionActions>
|
||||
<Button
|
||||
onClick={ handleProductAction }
|
||||
variant="secondary"
|
||||
>
|
||||
{ __( 'Product action!', 'woocommerce' ) }
|
||||
</Button>
|
||||
</SectionActions>
|
||||
|
||||
<OtherBlockComponents { ...other} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
```
|
|
@ -63,6 +63,7 @@ export {
|
|||
export {
|
||||
BlockFill as __experimentalBlockFill,
|
||||
BlockSlot as __experimentalBlockSlot,
|
||||
SectionActions as __experimentalSectionActions,
|
||||
BlockFillProps,
|
||||
BlockSlotProps,
|
||||
} from './block-slot-fill';
|
||||
|
|
Loading…
Reference in New Issue