Skip to content

Commit

Permalink
Merge branch 'master' into add/create-new-page-within-nav-block
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj authored Feb 14, 2020
2 parents d54a682 + e6603a6 commit ef0c09c
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 19 deletions.
16 changes: 16 additions & 0 deletions packages/block-editor/src/components/editor-skeleton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,24 @@ import classnames from 'classnames';
/**
* WordPress dependencies
*/
import { useEffect } from '@wordpress/element';
import { navigateRegions } from '@wordpress/components';
import { __ } from '@wordpress/i18n';

function useHTMLClass( className ) {
useEffect( () => {
const element =
document && document.querySelector( `html:not(.${ className }` );
if ( ! element ) {
return;
}
element.classList.toggle( className );
return () => {
element.classList.toggle( className );
};
}, [ className ] );
}

function EditorSkeleton( {
footer,
header,
Expand All @@ -17,6 +32,7 @@ function EditorSkeleton( {
publish,
className,
} ) {
useHTMLClass( 'block-editor-editor-skeleton__html-container' );
return (
<div
className={ classnames(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// On Mobile devices, swiping the HTML element should not scroll.
// By making it fixed, we prevent that.
html {
html.block-editor-editor-skeleton__html-container {
position: fixed;
width: 100%;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,10 @@

.addBlockButton {
color: $blue-wordpress;
border: 2px;
border-radius: 10px;
border-color: $blue-wordpress;
}

.addBlockButtonDark {
color: $blue-30;
border-color: $blue-30;
}

.columnPadding {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const LinkControlSearchInput = ( {
className="block-editor-link-control__search-input"
value={ value }
onChange={ selectItemHandler }
onFocus={ selectItemHandler }
placeholder={ __( 'Search or type url' ) }
__experimentalRenderSuggestions={ renderSuggestions }
__experimentalFetchLinkSuggestions={ fetchSuggestions }
Expand Down
13 changes: 5 additions & 8 deletions packages/block-editor/src/components/url-input/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,23 +218,20 @@ class URLInput extends Component {
}
}

onFocus( event ) {
onFocus() {
const { suggestions } = this.state;
const { disableSuggestions, onFocus } = this.props;

const inputValue = event.target.value;

onFocus( inputValue );
const { disableSuggestions, value } = this.props;

// When opening the link editor, if there's a value present, we want to load the suggestions pane with the results for this input search value
// Don't re-run the suggestions on focus if there are already suggestions present (prevents searching again when tabbing between the input and buttons)
if (
inputValue &&
value &&
! disableSuggestions &&
! this.isUpdatingSuggestions &&
! ( suggestions && suggestions.length )
) {
// Ensure the suggestions are updated with the current input value
this.updateSuggestions( inputValue );
this.updateSuggestions( value );
}
}

Expand Down
11 changes: 8 additions & 3 deletions packages/block-library/src/embed/core-embeds.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const common = [
settings: {
title: 'Twitter',
icon: embedTwitterIcon,
keywords: [ 'tweet' ],
keywords: [ 'tweet', __( 'social' ) ],
description: __( 'Embed a tweet.' ),
},
patterns: [ /^https?:\/\/(www\.)?twitter\.com\/.+/i ],
Expand All @@ -54,6 +54,7 @@ export const common = [
settings: {
title: 'Facebook',
icon: embedFacebookIcon,
keywords: [ __( 'social' ) ],
description: __( 'Embed a Facebook post.' ),
},
patterns: [ /^https?:\/\/www\.facebook.com\/.+/i ],
Expand All @@ -63,7 +64,7 @@ export const common = [
settings: {
title: 'Instagram',
icon: embedInstagramIcon,
keywords: [ __( 'image' ) ],
keywords: [ __( 'image' ), __( 'social' ) ],
description: __( 'Embed an Instagram post.' ),
},
patterns: [ /^https?:\/\/(www\.)?instagr(\.am|am\.com)\/.+/i ],
Expand Down Expand Up @@ -160,7 +161,7 @@ export const others = [
settings: {
title: 'Crowdsignal',
icon: embedContentIcon,
keywords: [ 'polldaddy' ],
keywords: [ 'polldaddy', __( 'survey' ) ],
transform: [
{
type: 'block',
Expand All @@ -185,6 +186,7 @@ export const others = [
settings: {
title: 'Dailymotion',
icon: embedVideoIcon,
keywords: [ __( 'video' ) ],
description: __( 'Embed a Dailymotion video.' ),
},
patterns: [ /^https?:\/\/(www\.)?dailymotion\.com\/.+/i ],
Expand All @@ -194,6 +196,7 @@ export const others = [
settings: {
title: 'Hulu',
icon: embedVideoIcon,
keywords: [ __( 'video' ) ],
description: __( 'Embed Hulu content.' ),
},
patterns: [ /^https?:\/\/(www\.)?hulu\.com\/.+/i ],
Expand Down Expand Up @@ -351,6 +354,7 @@ export const others = [
settings: {
title: 'TikTok',
icon: embedVideoIcon,
keywords: [ __( 'video' ) ],
description: __( 'Embed a TikTok video.' ),
},
patterns: [ /^https?:\/\/(www\.)?tiktok\.com\/.+/i ],
Expand All @@ -369,6 +373,7 @@ export const others = [
settings: {
title: 'Tumblr',
icon: embedTumblrIcon,
keywords: [ __( 'social' ) ],
description: __( 'Embed a Tumblr post.' ),
},
patterns: [ /^https?:\/\/(www\.)?tumblr\.com\/.+/i ],
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ export class ImageEdit extends React.Component {
checked={ linkTarget === '_blank' }
onChange={ this.onSetNewTab }
/>
{ // eslint-disable-next-line no-undef
image && sizeOptionsValid && __DEV__ && (
{ image && sizeOptionsValid && (
<CycleSelectControl
icon={ 'editor-expand' }
label={ __( 'Size' ) }
Expand Down

0 comments on commit ef0c09c

Please sign in to comment.