Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 98cc2b5

Browse files
aduthjorgefilipecosta
authored andcommittedJun 17, 2019
Edit Post: Remove DropZoneProvider as rendered by block editor
1 parent 5bd72f3 commit 98cc2b5

File tree

4 files changed

+46
-37
lines changed

4 files changed

+46
-37
lines changed
 

‎packages/block-editor/CHANGELOG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
## 2.2.0 (2019-06-12)
1+
## Master
22

33
### Breaking Changes
44

5-
- `BlockEditorProvider` no longer renders a wrapping `SlotFillProvider` (from `@wordpress/components`). For custom block editors, you should render your own as wrapping the `BlockEditorProvider`. A future release will include a new `BlockEditor` component for simple, standard usage. `BlockEditorProvider` will serve the simple purpose of establishing its own context for block editors.
5+
- `BlockEditorProvider` no longer renders a wrapping `SlotFillProvider` or `DropZoneProvider` (from `@wordpress/components`). For custom block editors, you should render your own as wrapping the `BlockEditorProvider`. A future release will include a new `BlockEditor` component for simple, standard usage. `BlockEditorProvider` will serve the simple purpose of establishing its own context for block editors.
6+
7+
## 2.2.0 (2019-06-12)
68

79
### Internal
810

‎packages/block-editor/src/components/provider/index.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* WordPress dependencies
33
*/
44
import { Component } from '@wordpress/element';
5-
import { DropZoneProvider } from '@wordpress/components';
65
import { withDispatch } from '@wordpress/data';
76
import { compose } from '@wordpress/compose';
87

@@ -120,11 +119,7 @@ class BlockEditorProvider extends Component {
120119
render() {
121120
const { children } = this.props;
122121

123-
return (
124-
<DropZoneProvider>
125-
{ children }
126-
</DropZoneProvider>
127-
);
122+
return children;
128123
}
129124
}
130125

‎packages/edit-post/src/editor.js

+20-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import { size, map, without } from 'lodash';
1010
import { withSelect } from '@wordpress/data';
1111
import { EditorProvider, ErrorBoundary, PostLockedModal } from '@wordpress/editor';
1212
import { StrictMode, Component } from '@wordpress/element';
13-
import { KeyboardShortcuts, SlotFillProvider } from '@wordpress/components';
13+
import {
14+
KeyboardShortcuts,
15+
SlotFillProvider,
16+
DropZoneProvider,
17+
} from '@wordpress/components';
1418

1519
/**
1620
* Internal dependencies
@@ -88,19 +92,21 @@ class Editor extends Component {
8892
return (
8993
<StrictMode>
9094
<SlotFillProvider>
91-
<EditorProvider
92-
settings={ editorSettings }
93-
post={ post }
94-
initialEdits={ initialEdits }
95-
useSubRegistry={ false }
96-
{ ...props }
97-
>
98-
<ErrorBoundary onError={ onError }>
99-
<Layout />
100-
<KeyboardShortcuts shortcuts={ preventEventDiscovery } />
101-
</ErrorBoundary>
102-
<PostLockedModal />
103-
</EditorProvider>
95+
<DropZoneProvider>
96+
<EditorProvider
97+
settings={ editorSettings }
98+
post={ post }
99+
initialEdits={ initialEdits }
100+
useSubRegistry={ false }
101+
{ ...props }
102+
>
103+
<ErrorBoundary onError={ onError }>
104+
<Layout />
105+
<KeyboardShortcuts shortcuts={ preventEventDiscovery } />
106+
</ErrorBoundary>
107+
<PostLockedModal />
108+
</EditorProvider>
109+
</DropZoneProvider>
104110
</SlotFillProvider>
105111
</StrictMode>
106112
);

‎playground/src/index.js

+21-15
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ import {
1010
WritingFlow,
1111
ObserveTyping,
1212
} from '@wordpress/block-editor';
13-
import { Popover, SlotFillProvider } from '@wordpress/components';
13+
import {
14+
Popover,
15+
SlotFillProvider,
16+
DropZoneProvider,
17+
} from '@wordpress/components';
1418
import { registerCoreBlocks } from '@wordpress/block-library';
1519
import '@wordpress/format-library';
1620

@@ -38,20 +42,22 @@ function App() {
3842
</div>
3943
<div className="playground__body">
4044
<SlotFillProvider>
41-
<BlockEditorProvider
42-
value={ blocks }
43-
onInput={ updateBlocks }
44-
onChange={ updateBlocks }
45-
>
46-
<div className="editor-styles-wrapper">
47-
<WritingFlow>
48-
<ObserveTyping>
49-
<BlockList />
50-
</ObserveTyping>
51-
</WritingFlow>
52-
</div>
53-
<Popover.Slot />
54-
</BlockEditorProvider>
45+
<DropZoneProvider>
46+
<BlockEditorProvider
47+
value={ blocks }
48+
onInput={ updateBlocks }
49+
onChange={ updateBlocks }
50+
>
51+
<div className="editor-styles-wrapper">
52+
<WritingFlow>
53+
<ObserveTyping>
54+
<BlockList />
55+
</ObserveTyping>
56+
</WritingFlow>
57+
</div>
58+
<Popover.Slot />
59+
</BlockEditorProvider>
60+
</DropZoneProvider>
5561
</SlotFillProvider>
5662
</div>
5763
</Fragment>

0 commit comments

Comments
 (0)
Please sign in to comment.