[Product Block Editor]: expose __experimentalSectionActions component (#46515)

* add basic Readme.md file

* expose __experimentalSectionActions component

* changelog

* update readme example
This commit is contained in:
Damián Suárez 2024-04-12 05:48:40 -04:00 committed by GitHub
parent 28e78fd655
commit 5db25ea616
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: update
Product Block Editor: expose __experimentalSectionActions component

View File

@ -1,4 +1,4 @@
export * from './block-fill';
export * from './block-slot';
export * from './section-actions/index';
export * from './section-actions';
export * from './types';

View File

@ -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} />
</>
);
}
```

View File

@ -63,6 +63,7 @@ export {
export {
BlockFill as __experimentalBlockFill,
BlockSlot as __experimentalBlockSlot,
SectionActions as __experimentalSectionActions,
BlockFillProps,
BlockSlotProps,
} from './block-slot-fill';