Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/WordPress/gutenberg into …
Browse files Browse the repository at this point in the history
…rnmobile/open-video-by-browser-for-android

* 'master' of https://github.com/WordPress/gutenberg: (34 commits)
  [RNMobile] Native mobile release v1.7.0 (#16156)
  Scripts: Document and simplify changing file entry and output of build scripts (#15982)
  Block library: Refactor Heading block to use class names for text align (#16035)
  Make calendar block resilient against editor module not being present (#16161)
  Bump plugin version to 5.9.1
  Editor: Fix the issue where statics for deprecated components were not hoisted (#16152)
  Build Tooling: Use "full" `npm install` for Build Artifacts Travis task (#16166)
  Scripts: Fix naming conventions for function containing CLI keyword (#16091)
  Add native support for Inserter (Ported from gutenberg-mobile) (#16114)
  docs(components/higher-order/with-spoken-messages): fix issue in example code (#16144)
  docs(components/with-focus-return): fix typo in README.md (#16143)
  docs(block-editor/components/inspector-controls): fix image path in README.md (#16145)
  Add mention of on Figma to CONTRIBUTING.md (#16140)
  Bring greater consistency to placeholder text for media blocks. (#16135)
  Add descriptive text and a link to embed documentation in embed blocks (#16101)
  Update toolbar-text.png (#16102)
  Updating changelogs for the Gutenberg 5.9 packages release
  chore(release): publish
  [RNMobile] Fix pasting text on Post Title (#16116)
  Bump plugin version to 5.9.0
  ...

# Conflicts:
#	packages/block-library/src/video/video-player.android.js
  • Loading branch information
daniloercoli committed Jun 14, 2019
2 parents 4a1e59e + 714d561 commit ef88999
Show file tree
Hide file tree
Showing 137 changed files with 813 additions and 263 deletions.
2 changes: 1 addition & 1 deletion .github/actions/milestone-it/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ minor=${parts[1]}

# 3. Determine next milestone.

if [ minor == '9' ]; then
if [[ $minor == 9* ]]; then
major=$((major+1))
minor="0"
else
Expand Down
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ jobs:

- name: Build artifacts
install:
- npm ci
# A "full" install is executed, since `npm ci` does not always exit
# with an error status code if the lock file is inaccurate.
#
# See: https://github.com/WordPress/gutenberg/issues/16157
- npm install
script:
- npm run check-local-changes

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Please see the [Developer Contributions section](/docs/contributors/develop.md)

## How Can Designers Contribute?

If you'd like to contribute to the design or front-end, feel free to contribute to tickets labelled [Needs Design](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A%22Needs+Design%22) or [Needs Design Feedback](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A"Needs+Design+Feedback%22). We could use your thoughtful replies, mockups, animatics, sketches, doodles. Proposed changes are best done as minimal and specific iterations on the work that precedes it so we can compare. If you use <a href="https://www.sketchapp.com/">Sketch</a>, you can grab <a href="https://cloudup.com/cMPXM8Va2cy">the source file for the mockups</a> (updated April 6th).
If you'd like to contribute to the design or front-end, feel free to contribute to tickets labelled [Needs Design](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A%22Needs+Design%22) or [Needs Design Feedback](https://github.com/WordPress/gutenberg/issues?q=is%3Aissue+is%3Aopen+label%3A"Needs+Design+Feedback%22). We could use your thoughtful replies, mockups, animatics, sketches, doodles. Proposed changes are best done as minimal and specific iterations on the work that precedes it so we can compare. The [WordPress Design team](http://make.wordpress.org/design/) uses [Figma](https://www.figma.com/) to collaborate and share work. If you'd like to contribute, join the [#design channel](http://wordpress.slack.com/messages/design/) in [Slack](https://make.wordpress.org/chat/) and ask the team to set you up with a free Figma account. This will give you access to a helpful [library of components](https://www.figma.com/file/ZtN5xslEVYgzU7Dd5CxgGZwq/WordPress-Components?node-id=0%3A1) used in WordPress.

## Contribute to the Documentation

Expand Down
Binary file modified docs/designers-developers/assets/toolbar-text.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Gutenberg
* Plugin URI: https://github.com/WordPress/gutenberg
* Description: Printing since 1440. This is the development plugin for the new block editor in core.
* Version: 5.9.0-rc.1
* Version: 5.9.1
* Author: Gutenberg Team
* Text Domain: gutenberg
*
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg",
"version": "5.9.0-rc.1",
"version": "5.9.1",
"private": true,
"description": "A new WordPress editor experience.",
"author": "The WordPress Contributors",
Expand Down
2 changes: 1 addition & 1 deletion packages/a11y/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/a11y",
"version": "2.3.0",
"version": "2.4.0",
"description": "Accessibility (a11y) utilities for WordPress.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/annotations/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/annotations",
"version": "1.3.0",
"version": "1.4.0",
"description": "Annotate content in the Gutenberg editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/api-fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/api-fetch",
"version": "3.2.0",
"version": "3.3.0",
"description": "Utility to make WordPress REST API requests.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-default/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/babel-preset-default",
"version": "4.2.0",
"version": "4.3.0",
"description": "Default Babel preset for WordPress development.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Master
## 2.2.0 (2019-06-12)

### Internal

Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/block-editor",
"version": "2.1.0",
"version": "2.2.0",
"description": "Generic block editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
1 change: 1 addition & 0 deletions packages/block-editor/src/components/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export { default as BlockInvalidWarning } from './block-list/block-invalid-warni

// Content Related Components
export { default as DefaultBlockAppender } from './default-block-appender';
export { default as Inserter } from './inserter';

// State Related Components
export { default as BlockEditorProvider } from './provider';
8 changes: 8 additions & 0 deletions packages/block-editor/src/components/inner-blocks/style.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Add clickable overlay to blocks with nesting.
// This makes it easy to select all layers of the block.
.block-editor-inner-blocks.has-overlay {
&::after {
content: "";
Expand All @@ -9,3 +11,9 @@
z-index: z-index(".block-editor-inner-blocks.has-overlay::after");
}
}

// On fullwide blocks, don't go beyond the canvas.
[data-align="full"] > .editor-block-list__block-edit > [data-block] .has-overlay::after {
right: 0;
left: 0;
}
96 changes: 96 additions & 0 deletions packages/block-editor/src/components/inserter/index.native.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* External dependencies
*/
import { FlatList, Text, TouchableHighlight, View } from 'react-native';

/**
* WordPress dependencies
*/
import { BottomSheet, Icon } from '@wordpress/components';
import { Component } from '@wordpress/element';
import { withSelect } from '@wordpress/data';
import { compose } from '@wordpress/compose';
import { getUnregisteredTypeHandlerName } from '@wordpress/blocks';

/**
* Internal dependencies
*/
import styles from './style.scss';

class Inserter extends Component {
calculateNumberOfColumns() {
const bottomSheetWidth = BottomSheet.getWidth();
const { paddingLeft: itemPaddingLeft, paddingRight: itemPaddingRight } = styles.modalItem;
const { paddingLeft: containerPaddingLeft, paddingRight: containerPaddingRight } = styles.content;
const { width: itemWidth } = styles.modalIconWrapper;
const itemTotalWidth = itemWidth + itemPaddingLeft + itemPaddingRight;
const containerTotalWidth = bottomSheetWidth - ( containerPaddingLeft + containerPaddingRight );
return Math.floor( containerTotalWidth / itemTotalWidth );
}

render() {
const numberOfColumns = this.calculateNumberOfColumns();
const bottomPadding = this.props.addExtraBottomPadding && styles.contentBottomPadding;

return (
<BottomSheet
isVisible={ true }
onClose={ this.props.onDismiss }
contentStyle={ [ styles.content, bottomPadding ] }
hideHeader
>
<FlatList
scrollEnabled={ false }
key={ `InserterUI-${ numberOfColumns }` } //re-render when numberOfColumns changes
keyboardShouldPersistTaps="always"
numColumns={ numberOfColumns }
data={ this.props.items }
ItemSeparatorComponent={ () =>
<View style={ styles.rowSeparator } />
}
keyExtractor={ ( item ) => item.name }
renderItem={ ( { item } ) =>
<TouchableHighlight
style={ styles.touchableArea }
underlayColor="transparent"
activeOpacity={ .5 }
accessibilityLabel={ item.title }
onPress={ () => this.props.onValueSelected( item.name ) }>
<View style={ styles.modalItem }>
<View style={ styles.modalIconWrapper }>
<View style={ styles.modalIcon }>
<Icon icon={ item.icon.src } fill={ styles.modalIcon.fill } size={ styles.modalIcon.width } />
</View>
</View>
<Text style={ styles.modalItemLabel }>{ item.title }</Text>
</View>
</TouchableHighlight>
}
/>
</BottomSheet>
);
}
}

export default compose( [
withSelect( ( select, { clientId, isAppender, rootClientId } ) => {
const {
getInserterItems,
getBlockRootClientId,
getBlockSelectionEnd,
} = select( 'core/block-editor' );

let destinationRootClientId = rootClientId;
if ( ! destinationRootClientId && ! clientId && ! isAppender ) {
const end = getBlockSelectionEnd();
if ( end ) {
destinationRootClientId = getBlockRootClientId( end ) || undefined;
}
}
const inserterItems = getInserterItems( destinationRootClientId );

return {
items: inserterItems.filter( ( { name } ) => name !== getUnregisteredTypeHandlerName() ),
};
} ),
] )( Inserter );
57 changes: 57 additions & 0 deletions packages/block-editor/src/components/inserter/style.native.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/** @format */

.touchableArea {
border-radius: 8px 8px 8px 8px;
}

.content {
padding: 0 0 0 0;
align-items: center;
justify-content: space-evenly;
}

.contentBottomPadding {
padding-bottom: 20px;
}

.rowSeparator {
height: 12px;
}

.modalItem {
flex-direction: column;
justify-content: center;
align-items: center;
padding-left: 8;
padding-right: 8;
padding-top: 0;
padding-bottom: 0;
}

.modalIconWrapper {
width: 104px;
height: 64px;
background-color: $gray-light; //#f3f6f8
border-radius: 8px 8px 8px 8px;
justify-content: center;
align-items: center;
}

.modalIcon {
width: 32px;
height: 32px;
justify-content: center;
align-items: center;
fill: $gray-dark;
}

.modalItemLabel {
background-color: transparent;
padding-left: 2;
padding-right: 2;
padding-top: 4;
padding-bottom: 0;
justify-content: center;
font-size: 12;
color: $gray-dark;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Inspector Controls

<img src="https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/blocks/inspector.png" with="281" height="527" alt="inspector">
<img src="https://raw.githubusercontent.com/WordPress/gutenberg/master/docs/designers-developers/assets/inspector.png" with="281" height="527" alt="inspector">

Inspector Controls appear in the post settings sidebar when a block is being edited. The controls appear in both HTML and visual editing modes, and thus should contain settings that affect the entire block.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,14 @@ export class MediaPlaceholder extends Component {
const isVideo = isOneType && 'video' === allowedTypes[ 0 ];

if ( instructions === undefined && mediaUpload ) {
instructions = __( 'Drag a media file, upload a new one or select a file from your library.' );
instructions = __( 'Upload a media file or pick one from your media library.' );

if ( isAudio ) {
instructions = __( 'Drag an audio, upload a new one or select a file from your library.' );
instructions = __( 'Upload an audio file, pick one from your media library, or add one with a URL.' );
} else if ( isImage ) {
instructions = __( 'Drag an image, upload a new one or select a file from your library.' );
instructions = __( 'Upload an image file, pick one from your media library, or add one with a URL.' );
} else if ( isVideo ) {
instructions = __( 'Drag a video, upload a new one or select a file from your library.' );
instructions = __( 'Upload a video file, pick one from your media library, or add one with a URL.' );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ describe( 'MediaUpload component', () => {
);
} } />
);
expect( wrapper.find( 'Picker' ).length ).toEqual( 1 );
expect( wrapper.find( 'Picker' ) ).toHaveLength( 1 );
} );

it( 'shows right media capture option for media type', () => {
Expand All @@ -68,7 +68,7 @@ describe( 'MediaUpload component', () => {
);
} } />
);
expect( wrapper.find( 'Picker' ).props().options.filter( ( item ) => item.label === expectedOption ).length ).toEqual( 1 );
expect( wrapper.find( 'Picker' ).props().options.filter( ( item ) => item.label === expectedOption ) ).toHaveLength( 1 );
};
expectOptionForMediaType( MEDIA_TYPE_IMAGE, OPTION_TAKE_PHOTO );
expectOptionForMediaType( MEDIA_TYPE_VIDEO, OPTION_TAKE_VIDEO );
Expand Down
23 changes: 20 additions & 3 deletions packages/block-editor/src/components/rich-text/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ import {
} from '@wordpress/rich-text';
import { decodeEntities } from '@wordpress/html-entities';
import { BACKSPACE } from '@wordpress/keycodes';
import { pasteHandler, children } from '@wordpress/blocks';
import {
children,
isUnmodifiedDefaultBlock,
pasteHandler,
} from '@wordpress/blocks';
import { isURL } from '@wordpress/url';

/**
Expand Down Expand Up @@ -358,6 +362,11 @@ export class RichText extends Component {

// eslint-disable-next-line no-unused-vars
onEnter( event ) {
if ( this.props.onEnter ) {
this.props.onEnter();
return;
}

this.lastEventCount = event.nativeEvent.eventCount;
this.comesFromAztec = true;
this.firedAfterTextChanged = event.nativeEvent.firedAfterTextChanged;
Expand Down Expand Up @@ -701,8 +710,8 @@ export class RichText extends Component {
}

componentWillUnmount() {
if ( this._editor.isFocused() ) {
// this._editor.blur();
if ( this._editor.isFocused() && this.props.shouldBlurOnUnmount ) {
this._editor.blur();
}
}

Expand Down Expand Up @@ -875,6 +884,7 @@ const RichTextContainer = compose( [
const {
getSelectionStart,
getSelectionEnd,
__unstableGetBlockWithoutInnerBlocks,
} = select( 'core/block-editor' );

const selectionStart = getSelectionStart();
Expand All @@ -887,12 +897,19 @@ const RichTextContainer = compose( [
);
}

// If the block of this RichText is unmodified then it's a candidate for replacing when adding a new block.
// In order to fix https://github.com/wordpress-mobile/gutenberg-mobile/issues/1126, let's blur on unmount in that case.
// This apparently assumes functionality the BlockHlder actually
const block = clientId && __unstableGetBlockWithoutInnerBlocks( clientId );
const shouldBlurOnUnmount = block && isSelected && isUnmodifiedDefaultBlock( block );

return {
formatTypes: getFormatTypes(),
selectionStart: isSelected ? selectionStart.offset : undefined,
selectionEnd: isSelected ? selectionEnd.offset : undefined,
isSelected,
blockIsSelected,
shouldBlurOnUnmount,
};
} ),
withDispatch( ( dispatch, {
Expand Down
Loading

0 comments on commit ef88999

Please sign in to comment.