Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storybook: Add Story for CopyHandler #68567

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/block-editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,9 +347,15 @@ _Related_

> **Deprecated**

'The CopyHandler component catches copy/cut and paste events coming from its props.children.

_Parameters_

- _props_ `Object`:
- _props_ `Object`: The props for the component.

_Returns_

- `Element`: The block type item element.

### createCustomColorsHOC

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ export const __unstableUseClipboardHandler = () => {
};

/**
* 'The CopyHandler component catches copy/cut and paste events coming from its props.children.
*
* @deprecated
* @param {Object} props
*
* @param {Object} props The props for the component.
* @return {Element} The block type item element.
*/
export default function CopyHandler( props ) {
deprecated( 'CopyHandler', {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import CopyHandler from '../';

export default {
title: 'BlockEditor/CopyHandler',
component: CopyHandler,
parameters: {
docs: {
canvas: { sourceState: 'shown' },
description: {
component:
'The `CopyHandler` component catches copy/cut and paste events coming from its props.children.',
},
},
},
argTypes: {
props: {
control: false,
description: 'The props for the component.',
table: {
type: { summary: 'object' },
},
},
},
};

export const Default = {
render: function Template( args ) {
return (
<CopyHandler { ...args }>
<button>{ __( 'Copy Handler' ) }</button>
</CopyHandler>
);
},
};
Loading