-
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.
Merge branch 'trunk' of github.com:karthick-murugan/gutenberg into fe…
…ature/block-comments-scroll
- Loading branch information
Showing
43 changed files
with
2,603 additions
and
596 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
packages/block-editor/src/components/alignment-control/stories/aliginment-toolbar.story.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useState } from '@wordpress/element'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { AlignmentToolbar } from '..'; | ||
|
||
/** | ||
* The `AlignmentToolbar` component renders a dropdown menu that displays alignment options for the selected block in `Toolbar`. | ||
*/ | ||
const meta = { | ||
title: 'BlockEditor/AlignmentToolbar', | ||
component: AlignmentToolbar, | ||
argTypes: { | ||
value: { | ||
control: { type: null }, | ||
defaultValue: 'undefined', | ||
description: 'The current value of the alignment setting.', | ||
}, | ||
onChange: { | ||
action: 'onChange', | ||
control: { type: null }, | ||
description: | ||
"A callback function invoked when the toolbar's alignment value is changed via an interaction with any of the toolbar's buttons. Called with the new alignment value (ie: `left`, `center`, `right`, `undefined`) as the only argument.", | ||
}, | ||
}, | ||
}; | ||
export default meta; | ||
|
||
export const Default = { | ||
render: function Template( { onChange, ...args } ) { | ||
const [ value, setValue ] = useState(); | ||
return ( | ||
<AlignmentToolbar | ||
{ ...args } | ||
onChange={ ( ...changeArgs ) => { | ||
onChange( ...changeArgs ); | ||
setValue( ...changeArgs ); | ||
} } | ||
value={ value } | ||
/> | ||
); | ||
}, | ||
}; |
51 changes: 51 additions & 0 deletions
51
packages/block-editor/src/components/alignment-control/stories/index.story.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { useState } from '@wordpress/element'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { AlignmentControl } from '../'; | ||
|
||
/** | ||
* The `AlignmentControl` component renders a dropdown menu that displays alignment options for the selected block. | ||
* | ||
* This component is mostly used for blocks that display text, such as Heading, Paragraph, Post Author, Post Comments, Verse, Quote, Post Title, etc... And the available alignment options are `left`, `center` or `right` alignment. | ||
* | ||
* If you want to use the alignment control in a toolbar, you should use the `AlignmentToolbar` component instead. | ||
*/ | ||
const meta = { | ||
title: 'BlockEditor/AlignmentControl', | ||
component: AlignmentControl, | ||
argTypes: { | ||
value: { | ||
control: { type: null }, | ||
defaultValue: 'undefined', | ||
description: 'The current value of the alignment setting.', | ||
}, | ||
onChange: { | ||
action: 'onChange', | ||
control: { type: null }, | ||
description: | ||
"A callback function invoked when the toolbar's alignment value is changed via an interaction with any of the toolbar's buttons. Called with the new alignment value (ie: `left`, `center`, `right`, `undefined`) as the only argument.", | ||
}, | ||
}, | ||
}; | ||
export default meta; | ||
|
||
export const Default = { | ||
render: function Template( { onChange, ...args } ) { | ||
const [ value, setValue ] = useState(); | ||
return ( | ||
<AlignmentControl | ||
{ ...args } | ||
onChange={ ( ...changeArgs ) => { | ||
onChange( ...changeArgs ); | ||
setValue( ...changeArgs ); | ||
} } | ||
value={ value } | ||
/> | ||
); | ||
}, | ||
}; |
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
Oops, something went wrong.