-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cover Block: Normalize the block toolbar
- Loading branch information
1 parent
8e43c3a
commit f93d888
Showing
19 changed files
with
196 additions
and
220 deletions.
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
packages/block-editor/src/components/block-alignment-matrix-control/README.md
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,63 @@ | ||
# Alignment Matrix Control | ||
|
||
The alignment matrix control allows users to quickly adjust inner block alignment; this is in contrast to the alignment toolbar that aligns the frame block. | ||
|
||
![Button components](https://i.imgur.com/PxYkgL5.png) | ||
|
||
## Table of contents | ||
|
||
- [Alignment Matrix Control](#alignment-matrix-control) | ||
- [Table of contents](#table-of-contents) | ||
- [Design guidelines](#design-guidelines) | ||
- [Usage](#usage) | ||
- [Development guidelines](#development-guidelines) | ||
- [Usage](#usage-1) | ||
- [Props](#props) | ||
|
||
## Design guidelines | ||
|
||
### Usage | ||
|
||
The alignment matrix is a specialized tool, and it's used in the cover block. | ||
|
||
![Cover](https://i.imgur.com/nJjqen8.png) | ||
|
||
As an example, here's the matrix alignment tool in action. | ||
|
||
![center](https://i.imgur.com/0Ce1fZm.png) | ||
|
||
![rop_right](https://i.imgur.com/yGGf6IP.png) | ||
|
||
## Development guidelines | ||
|
||
### Usage | ||
|
||
```jsx | ||
// This is a paraphrased example from the cover block | ||
import { | ||
BlockControls, | ||
__experimentalBlockAlignmentMatrixControl as BlockAlignmentMatrixControl | ||
} from "@wordpress/block-editor"; | ||
|
||
const controls = ( | ||
<> | ||
<BlockControls> | ||
<BlockAlignmentMatrixControl | ||
label={ __( 'Change content position' ) } | ||
value={ contentPosition } | ||
onChange={ ( nextPosition ) => | ||
setAttributes( { contentPosition: nextPosition } ) | ||
} | ||
/> | ||
</BlockControls> | ||
</> | ||
} | ||
``` | ||
### Props | ||
| Name | Type | Default | Description | | ||
| ---------- | ---------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `label` | `string` | `Change matrix alignment` | concise description of tool's functionality. | | ||
| `onChange` | `function` | `noop` | the function to execute upon a user's change of the matrix state | | ||
| `value` | `string` | `center` | describes the content alignment location and can be `top`, `right`, `bottom`, `left`, `topRight`, `bottomRight`, `bottomLeft`, `topLeft` | |
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
64 changes: 0 additions & 64 deletions
64
packages/block-editor/src/components/block-alignment-matrix-toolbar/README.md
This file was deleted.
Oops, something went wrong.
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
29 changes: 0 additions & 29 deletions
29
packages/block-editor/src/components/block-format-controls/README.md
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
packages/block-editor/src/components/block-format-controls/index.js
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...k-full-height-alignment-toolbar/README.md → ...k-full-height-alignment-control/README.md
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# Full Height Toolbar Toolbar | ||
# Full Height Toolbar Control | ||
|
||
Unlike the block alignment options, `Full Height Alignment` can be applied to a block in an independent way. But also, it works very well together with these block alignment options, where the combination empowers the design-layout capability. |
Oops, something went wrong.