-
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.
Introduce the layout prop to InnerBlocks
- Loading branch information
1 parent
55bf7ec
commit 9db2619
Showing
10 changed files
with
86 additions
and
76 deletions.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
packages/block-editor/src/components/inner-blocks/layout.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,20 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { createContext, useContext } from '@wordpress/element'; | ||
|
||
export const defaultLayout = { type: 'default' }; | ||
|
||
const Layout = createContext( defaultLayout ); | ||
|
||
/** | ||
* Allows to define the layout. | ||
*/ | ||
export const LayoutProvider = Layout.Provider; | ||
|
||
/** | ||
* React hook used to retrieve the layout config. | ||
*/ | ||
export function useLayout() { | ||
return useContext( Layout ); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { AlignmentHookSettingsProvider } from './align'; | ||
import './align'; | ||
import './anchor'; | ||
import './custom-class-name'; | ||
import './generated-class-name'; | ||
import './style'; | ||
import './color'; | ||
import './font-size'; | ||
|
||
export { AlignmentHookSettingsProvider }; |
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,12 +1,10 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { AlignmentHookSettingsProvider } from './align'; | ||
import './align'; | ||
import './anchor'; | ||
import './custom-class-name'; | ||
import './generated-class-name'; | ||
import './style'; | ||
import './color'; | ||
import './font-size'; | ||
|
||
export { AlignmentHookSettingsProvider }; |
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