-
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.
Full Height Alignment Toolbar: Implementation + Cover integration. (#…
…26615) * full-height-alignment-toolbar: initial approach * block-editor: expose experimental full height * cover: add full height button to toolbar * cover: propagate full height to height input cpm * cover: dissabel unit control in full height mode * cover: store prev height to be able to return them * cover: set height via inline in full height mode * cover: add toggle control for full height * cover: set fulll height mode when saving block * full-height-alignment: change icon * cover: refactoring -> simplify full height * cover: handling not prev height values. * cover: clean fullHeightAlignment attr * full-height-align: change button label * full-height-alignment: pick icon from package * cover: improve setting prev values Props to @jorgefilipecosta
- Loading branch information
Showing
4 changed files
with
71 additions
and
3 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/block-editor/src/components/block-full-height-alignment-toolbar/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,3 @@ | ||
# Full Height Toolbar Toolbar | ||
|
||
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. |
25 changes: 25 additions & 0 deletions
25
packages/block-editor/src/components/block-full-height-alignment-toolbar/index.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,25 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { ToolbarGroup, ToolbarButton } from '@wordpress/components'; | ||
import { fullscreen } from '@wordpress/icons'; | ||
|
||
function BlockFullHeightAlignmentToolbar( { | ||
isActive, | ||
label = __( 'Toggle full height' ), | ||
onToggle, | ||
} ) { | ||
return ( | ||
<ToolbarGroup> | ||
<ToolbarButton | ||
isActive={ isActive } | ||
icon={ fullscreen } | ||
label={ label } | ||
onClick={ () => onToggle( ! isActive ) } | ||
/> | ||
</ToolbarGroup> | ||
); | ||
} | ||
|
||
export default BlockFullHeightAlignmentToolbar; |
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