Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
506187b
Try avoiding the deprecated findDOMNode API from DropZone Provider (#…
youknowriad Nov 1, 2018
de7121c
Create file blocks when dropping multiple files at once (#11297)
ocean90 Nov 1, 2018
9c8923a
Remove deprecated componentWillReceiveProps from TinyMCE component (#…
ellatrix Nov 1, 2018
6919650
Remove findDOMNode usage from the inserter (#11363)
youknowriad Nov 1, 2018
5d3c7a1
Add removed periods to block descriptions. (#11367)
mayukojpn Nov 1, 2018
b8f2849
Docs: Remove duplicate word "page". (#11372)
Nov 1, 2018
29bdf31
api-fetch: Add Accept json header to l10n requests (#11336)
TimothyBJacobs Nov 1, 2018
0620892
Docs: add icon info to custom block category (#11213)
ajitbohra Nov 1, 2018
e30f36f
Advanced Panels: Add support for the 'Custom Fields' meta box (#11084)
noisysocks Nov 2, 2018
8a29b48
Handle metabox warning exceptions (#10999)
schlessera Nov 2, 2018
6b4076f
Update/shortcuts docs (#11321)
nosolosw Nov 2, 2018
a91a114
Remove a duplicate line in _breakpoints.scss (#11387)
niklasp Nov 2, 2018
7aeaff0
Fix design doc do's and don'ts links (#11391)
jasmussen Nov 2, 2018
22012ae
Capitalise 'page break' block title (#11384)
sarahmonster Nov 2, 2018
fbc093a
Try: Make gallery keyboardable (#11205)
jasmussen Nov 2, 2018
ccb199e
fix: Use aria-disabled instead of disabled for undo/redo (#11379)
tofumatt Nov 2, 2018
d3d6f93
Leverage forwardRef to remove findDOMNode from the block component (#…
youknowriad Nov 2, 2018
cbbf22e
Add: Stack on mobile option on Media & Text block (#10969)
jorgefilipecosta Nov 2, 2018
8322628
Use the image sizes names filter (#11356)
youknowriad Nov 2, 2018
47e66fb
Fix disabled undo button timeout (#11399)
ellatrix Nov 2, 2018
94d2b7f
Update tests so we can migrate SlotFill component to the stable conte…
nosolosw Nov 2, 2018
3caec34
Revert refactoring hierarchical term selector using the data module (…
youknowriad Nov 2, 2018
aad371d
Update SlotFillProvider to the stable context API (#11123)
nosolosw Nov 2, 2018
daa2ea9
Blocks: Upgrade hpq from 1.2.0 to 1.3.0 (#11344)
aduth Nov 2, 2018
122e569
Comment on TinyMCE component's use of shouldComponentUpdate
ellatrix Nov 2, 2018
2479293
Parser: Pass-through PHP errors in tests (#11429)
dmsnell Nov 2, 2018
fd23221
Fix typo and clarify wording of camelCaseString docblock (#11389)
kadamwhite Nov 2, 2018
f733526
wp.data: Split store implementation out from registry. (#10289)
coderkevin Nov 2, 2018
d40b926
API Fetch: Avoid unnecessary options shallow clone on unhandled metho…
aduth Nov 2, 2018
5d5c4ff
Editor: Debounce autosave on last edit (#10103)
aduth Nov 2, 2018
206d098
API Fetch: Fix non-JSON apiFetch body request (#11437)
aduth Nov 2, 2018
1f6dbf1
chore(release): update changelog files
pento Nov 3, 2018
c86e4d3
chore(release): publish
pento Nov 3, 2018
60e0b50
Update CONTRIBUTORS.md (#11328)
Nov 3, 2018
c36ea9c
Parser: Optimize JSON-attribute parsing (#11369)
dmsnell Nov 4, 2018
723be1d
Switch video block to embed if the URL should be handled by an embed …
notnownikki Nov 4, 2018
dd015c9
Post Preview Button: Use a <a> instead of a <button> when posible (#1…
noisysocks Nov 4, 2018
3a59842
Fixes #11474 (#11475)
timelsass Nov 5, 2018
273da09
Editor: Stop re-rendering all blocks when navigating with arrow keys …
gziolo Nov 5, 2018
e7ec3b3
PostPublishPanel: constraint tabbing within panel (#11403)
nosolosw Nov 5, 2018
c8b4679
Editor: Use store to always have up to date list of format types (#11…
gziolo Nov 5, 2018
1427890
Add aria label to images in Gallery block during edit mode. (#11466)
BE-Webdesign Nov 5, 2018
dfc2b5f
Fix applying formats on multiline values without wrapper tags (#11500)
ellatrix Nov 5, 2018
70c8068
Update/i18n pullquote and quote translator comments (#11496)
timelsass Nov 5, 2018
5c6f480
Hide custom fields option when the meta box is disabled (#11476)
noisysocks Nov 5, 2018
c961024
Update contributors.md (#11521)
amdrew Nov 6, 2018
57d01f6
Remove findDOMNode usage from the NavigableToolbar component (#11401)
youknowriad Nov 6, 2018
a1b647d
Remove moment from the public API of the date module (#11418)
youknowriad Nov 6, 2018
ead88a1
Don’t auto-select a pullquote text colour for regular style (#10792)
johngodley Nov 6, 2018
180ad30
feat: Add multi-block selection announcement (#11422)
tofumatt Nov 6, 2018
08e3154
Remove findDomNode from withHoverAreas by making a render prop compon…
youknowriad Nov 6, 2018
0829025
Disable fixed cover attachment on iOS (#11480)
jasmussen Nov 6, 2018
1f40e1e
Fix: Translator comments are not included in gutenberg-translations f…
jorgefilipecosta Nov 6, 2018
db8ef74
Fix: Show generic upload errors coming from the server in the image b…
jorgefilipecosta Nov 6, 2018
394be08
Request mocking helpers for e2e tests (#11250)
notnownikki Nov 6, 2018
8ab9fa6
Fix: Embeds: Clicking on a WordPress embed does not select the block.…
jorgefilipecosta Nov 6, 2018
e6fb93e
Post publish panel: focus the post link (#11489)
nosolosw Nov 6, 2018
7041e49
fix: Media on the right option in MediaText block (#11534)
SofiaSousa Nov 6, 2018
95f0640
Fetch all terms instead of just the first 100. Relies upon the fetch-…
dd32 Nov 6, 2018
9195550
Import Format API components instead of passing as props (#11545)
ellatrix Nov 6, 2018
3511dd8
RNmobile: Trigger media library picker (#11511)
hypest Nov 6, 2018
2d5dec7
Rich Text: Fix Format Type Assignment During Parsing (#11488)
ellatrix Nov 6, 2018
2dddcc9
Update plugin version to 4.2.0 (#11549)
youknowriad Nov 6, 2018
8cbfb3c
Editor: Factor initial edits to own state (#11267)
aduth Nov 6, 2018
1014389
Parser: Add new list of HTML fragments to parse output (#11334)
dmsnell Nov 7, 2018
7a20afe
[RNMobile] Remove delayed call to `onChange` method (#11537)
daniloercoli Nov 7, 2018
a61278d
Only show the image sizes with names (#11481)
youknowriad Nov 7, 2018
489eb79
Separate Paste Handler (#11539)
ellatrix Nov 7, 2018
d6ba8c2
Run the E2E tests as a user with the author role (#11359)
notnownikki Nov 7, 2018
57a7405
Expose @wordpress/editor to Gutenberg mobile (#11486)
Tug Nov 7, 2018
f23242b
Fix: "View as" link is not updated after the post is updated and the …
jorgefilipecosta Nov 7, 2018
7c63d10
Allow a block to disable being converted into a reusable block; Fix: …
jorgefilipecosta Nov 7, 2018
16a718a
Add mechanism to avoid forced child selection on blocks with template…
jorgefilipecosta Nov 7, 2018
26ccc15
Slot/Fill pattern with Toolbar #199 (#11115)
marecar3 Nov 7, 2018
1ac70e1
Fix the isBeingScheduled Selector. (#11572)
youknowriad Nov 7, 2018
78dd21f
Fix: Contrast checker: Consider fontSize large when size >= 24px ins…
jorgefilipecosta Nov 8, 2018
4e9d9b3
chore: Improve undo/redo no-op (#11428)
tofumatt Nov 8, 2018
a9b0742
Add missing tests for Format API code (#11562)
michaelsavchuk Nov 8, 2018
f966780
Rename wp-polyfill-ecmascript (#11216)
earnjam Nov 8, 2018
27b1529
Paste: Google Docs: fix nested formatting, sub, sup and del (#11207)
ellatrix Nov 8, 2018
e12f2b4
Fix regressions and improve the insert link search field and suggesti…
afercia Nov 8, 2018
69427ea
Gallery: Upload images one at a time (#11565)
noisysocks Nov 8, 2018
5728b36
Remove undefined className argument from save() methods. (#11605)
ocean90 Nov 8, 2018
996f0fe
[RNMobile] Make sure the native side is refreshed after blocks Mergin…
daniloercoli Nov 8, 2018
53209f4
Change aria-checked to only be used on matching ARIA roles for MenuIt…
BE-Webdesign Nov 8, 2018
f20c453
Fix: Cover image tooltips for alignment are duplicated (#11263)
jorgefilipecosta Nov 8, 2018
ddf8c07
fix: Improve empty block text (#11560)
tofumatt Nov 8, 2018
005c790
Editor: Reshape editor state for optimized and accurate dirtiness det…
aduth Nov 8, 2018
a0d0e1a
Components: Restore click-to-close behavior of Dropdown toggle (#11633)
aduth Nov 8, 2018
4369d93
Fix save lock control (length check on object) (#11636)
glingener Nov 8, 2018
90ec744
Update isSelectionEnabled selector documentation (#11538)
jorgefilipecosta Nov 8, 2018
c746581
Auto-refresh Popovers (#11257)
mmtr Nov 8, 2018
2484f4d
chore(release): update changelog files
ntwb Nov 9, 2018
d06fd6b
chore(release): publish
ntwb Nov 9, 2018
4741104
Support RichText tree preparation
ellatrix Nov 9, 2018
a3785cd
Block API: Normalize block type function argument (#11490)
gziolo Nov 9, 2018
b9c909f
Always show block icon on the block switcher when a single block is s…
jorgefilipecosta Nov 9, 2018
b814d88
Make the kitchensink button removable from plugins (#10964)
azaozz Nov 9, 2018
8e396e7
Try: Improve columns block (#11620)
jasmussen Nov 9, 2018
24e37f1
🐛 FIX: Grammatical Error (#11656)
MaedahBatool Nov 9, 2018
5531bd1
Update media url only if it exists in image block(gb-mobile) (#11635)
pinarol Nov 9, 2018
448d9f4
Update the block styles registration to avoid timing issues (#11532)
youknowriad Nov 9, 2018
ca67e13
Disabled conditions for publish buttons (#11584)
nosolosw Nov 9, 2018
a134d0c
Restore native backspace behaviour (#11627)
ellatrix Nov 9, 2018
471f749
Update the last occurence of home page with homepage (#11661)
gziolo Nov 9, 2018
bf45954
Add image and video transformations in Media & Text block (#11420)
jorgefilipecosta Nov 9, 2018
7a2f7ca
Enforce version increment for recently published npm packages (#11667)
gziolo Nov 9, 2018
6d6b849
Update Lerna to the latest version (#11666)
gziolo Nov 9, 2018
eba8b7f
fix: Change aria-label depending on content of paragraph block (#11653)
tofumatt Nov 9, 2018
665ac6d
chore(release): publish
gziolo Nov 9, 2018
66fc483
Test for rapid enter presses (#11665)
notnownikki Nov 9, 2018
f8fa752
Add validation to link format in RichText component (#11286)
talldan Nov 9, 2018
2fb5cec
Add changelog files back to the ingored changes by Lerna
gziolo Nov 9, 2018
e5dcd56
Update: Font Size Picker component documentation (#11404)
jorgefilipecosta Nov 9, 2018
5da5962
Further improve columns block. (#11659)
jasmussen Nov 9, 2018
4338dcf
Try: Refactor contextual toolbar to work better with floats (#11357)
jasmussen Nov 9, 2018
004d731
Remove 4.3 deprecated APIs (#11679)
youknowriad Nov 9, 2018
660e46e
Avoid unnecessary re-renders when navigating between blocks (#11495)
gziolo Nov 9, 2018
52a3375
Annotation API (#7718)
atimmer Nov 9, 2018
a2fee33
Fix: Blocks: Alt+F10 should navigate to block toolbar regardless of v…
jorgefilipecosta Nov 9, 2018
fc03492
PostPublishPanel: return focus to element that opened the panel (#11543)
nosolosw Nov 9, 2018
e0305d7
Editor: Capture focus on self in InsertionPoint inserter (#11684)
aduth Nov 9, 2018
4156bba
Editor: Correct insertion point opacity selector (#11685)
aduth Nov 9, 2018
4dcf338
Update the Gutenberg plugin to 4.3 RC1 (#11686)
youknowriad Nov 9, 2018
77bd99b
Framework: Move wp-polyfill-ecmascript override to scripts registrati…
aduth Nov 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Try avoiding the deprecated findDOMNode API from DropZone Provider (W…
…ordPress#11168)

* Try avoiding the deprecated findDOMNode API

* Components: Use event handler in place of `ref`
  • Loading branch information
youknowriad authored Nov 1, 2018
commit 506187b0151b00de45bb0580467d49df040814b6
19 changes: 7 additions & 12 deletions packages/components/src/drop-zone/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isEqual, find, some, filter, throttle, includes } from 'lodash';
/**
* WordPress dependencies
*/
import { Component, createContext, findDOMNode } from '@wordpress/element';
import { Component, createContext } from '@wordpress/element';
import isShallowEqual from '@wordpress/is-shallow-equal';

const { Provider, Consumer } = createContext( {
Expand Down Expand Up @@ -77,17 +77,11 @@ class DropZoneProvider extends Component {

componentDidMount() {
window.addEventListener( 'dragover', this.onDragOver );
window.addEventListener( 'drop', this.onDrop );
window.addEventListener( 'mouseup', this.resetDragState );

// Disable reason: Can't use a ref since this component just renders its children
// eslint-disable-next-line react/no-find-dom-node
this.container = findDOMNode( this );
}

componentWillUnmount() {
window.removeEventListener( 'dragover', this.onDragOver );
window.removeEventListener( 'drop', this.onDrop );
window.removeEventListener( 'mouseup', this.resetDragState );
}

Expand Down Expand Up @@ -212,10 +206,9 @@ class DropZoneProvider extends Component {
const { position, hoveredDropZone } = this.state;
const dragEventType = getDragEventType( event );
const dropZone = this.dropZones[ hoveredDropZone ];
const isValidDropzone = !! dropZone && this.container.contains( event.target );
this.resetDragState();

if ( isValidDropzone ) {
if ( dropZone ) {
switch ( dragEventType ) {
case 'file':
dropZone.onFilesDrop( [ ...event.dataTransfer.files ], position );
Expand All @@ -234,9 +227,11 @@ class DropZoneProvider extends Component {

render() {
return (
<Provider value={ this.dropZoneCallbacks }>
{ this.props.children }
</Provider>
<div onDrop={ this.onDrop } className="components-drop-zone__provider">
<Provider value={ this.dropZoneCallbacks }>
{ this.props.children }
</Provider>
</div>
);
}
}
Expand Down
4 changes: 4 additions & 0 deletions packages/components/src/drop-zone/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,7 @@
.components-drop-zone__content-text {
font-family: $default-font;
}

.components-drop-zone__provider {
height: 100%;
}
16 changes: 15 additions & 1 deletion test/e2e/specs/adding-blocks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@ describe( 'adding blocks', () => {
await newPost();
} );

/**
* Given a Puppeteer ElementHandle, clicks below its bounding box.
*
* @param {Puppeteer.ElementHandle} elementHandle Element handle.
*
* @return {Promise} Promise resolving when click occurs.
*/
async function clickBelow( elementHandle ) {
const box = await elementHandle.boundingBox();
const x = box.x + ( box.width / 2 );
const y = box.y + box.height + 100;
return page.mouse.click( x, y );
}

it( 'Should insert content using the placeholder and the regular inserter', async () => {
// Click below editor to focus last field (block appender)
await page.click( '.editor-writing-flow__click-redirect' );
await clickBelow( await page.$( '.editor-default-block-appender' ) );
expect( await page.$( '[data-type="core/paragraph"]' ) ).not.toBeNull();
await page.keyboard.type( 'Paragraph block' );

Expand Down