@wordpress/block-editor: Add some settings to BlockEditorProvider (#40462)

* Include EditorBlockSettings in provider settings

* Add tests
This commit is contained in:
Jon Surrell
2019-11-18 12:54:25 -08:00
committed by Sheetal Nandi
parent cd211d24c5
commit 6eeacad386
2 changed files with 9 additions and 2 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
import { BlockInstance } from '@wordpress/blocks';
import { ComponentType, ReactNode } from '@wordpress/element';
import { EditorSettings } from '../';
import { EditorSettings, EditorBlockListSettings } from '../';
declare namespace BlockEditorProvider {
interface Props {
@@ -35,7 +35,7 @@ declare namespace BlockEditorProvider {
* except for the first.
*/
onInput?(blocks: BlockInstance[]): void;
settings?: Partial<EditorSettings>;
settings?: Partial<EditorSettings & EditorBlockListSettings>;
useSubRegistry?: boolean;
/**
* The current array of blocks.
@@ -64,6 +64,13 @@ const STYLES = [{ css: '.foo { color: red; }' }, { css: '.bar { color: blue; }',
</be.BlockControls>;
<be.BlockControls.Slot />;
//
// BlockEditorProvider
//
<be.BlockEditorProvider value={[]} settings={{ templateLock: 'all' }}>
<div />
</be.BlockEditorProvider>;
//
// block-format-controls
//