Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge master back into fork #3

Merged
merged 13 commits into from
Apr 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ about: Create a report to help us improve
**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
**To reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ For features included in the Gutenberg plugin, the deprecation policy is intende
- The PHP function `gutenberg_default_post_format_template` has been removed.
- The PHP function `gutenberg_get_available_image_sizes` has been removed.
- The PHP function `gutenberg_get_autosave_newer_than_post_save` has been removed.
- The PHP function `gutenberg_default_post_format_template` has been removed.
- The PHP function `gutenberg_editor_scripts_and_styles` has been removed.

## 5.4.0
Expand Down
46 changes: 0 additions & 46 deletions gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@

gutenberg_pre_init();

/**
* Project.
*
* The main entry point for the Gutenberg editor. Renders the editor on the
* wp-admin page for the plugin.
*
* @since 0.1.0
* @deprecated 5.3.0
*/
function the_gutenberg_project() {
_deprecated_function( __FUNCTION__, '5.3.0' );
}

/**
* Gutenberg's Menu.
*
Expand Down Expand Up @@ -81,22 +68,6 @@ function gutenberg_menu() {
}
add_action( 'admin_menu', 'gutenberg_menu' );

/**
* Checks whether we're currently loading a Gutenberg page
*
* @since 3.1.0
* @deprecated 5.3.0 WP_Screen::is_block_editor
*
* @return boolean Whether Gutenberg is being loaded.
*/
function is_gutenberg_page() {
_deprecated_function( __FUNCTION__, '5.3.0', 'WP_Screen::is_block_editor' );

require_once ABSPATH . 'wp-admin/includes/screen.php';
$screen = get_current_screen();
return ! is_null( $screen ) && get_current_screen()->is_block_editor();
}

/**
* Display a version notice and deactivate the Gutenberg plugin.
*
Expand Down Expand Up @@ -146,20 +117,3 @@ function gutenberg_pre_init() {

require_once dirname( __FILE__ ) . '/lib/load.php';
}

/**
* Initialize Gutenberg.
*
* Load API functions, register scripts and actions, etc.
*
* @deprecated 5.3.0
*
* @return bool Whether Gutenberg was initialized.
*/
function gutenberg_init() {
_deprecated_function( __FUNCTION__, '5.3.0' );

require_once ABSPATH . 'wp-admin/includes/screen.php';
$screen = get_current_screen();
return ! is_null( $screen ) && get_current_screen()->is_block_editor();
}
53 changes: 0 additions & 53 deletions lib/client-assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -500,59 +500,6 @@ function gutenberg_register_vendor_script( $handle, $src, $deps = array() ) {
);
}

/**
* Assigns a default editor template with a default block by post format, if
* not otherwise assigned for a new post of type "post".
*
* @deprecated 5.3.0
*
* @param array $settings Default editor settings.
*
* @return array Filtered block editor settings.
*/
function gutenberg_default_post_format_template( $settings ) {
_deprecated_function( __FUNCTION__, '5.3.0' );

return $settings;
}

/**
* Retrieve a stored autosave that is newer than the post save.
*
* Deletes autosaves that are older than the post save.
*
* @deprecated 5.3.0
*
* @return WP_Post|boolean The post autosave. False if none found.
*/
function gutenberg_get_autosave_newer_than_post_save() {
_deprecated_function( __FUNCTION__, '5.3.0' );

return false;
}

/**
* Loads Gutenberg Locale Data.
*
* @deprecated 5.2.0
*/
function gutenberg_load_locale_data() {
_deprecated_function( __FUNCTION__, '5.2.0' );
}

/**
* Retrieve The available image sizes for a post
*
* @deprecated 5.3.0
*
* @return array
*/
function gutenberg_get_available_image_sizes() {
_deprecated_function( __FUNCTION__, '5.3.0' );

return array();
}

/**
* Extends block editor settings to include Gutenberg's `editor-styles.css` as
* taking precedent those styles shipped with core.
Expand Down
53 changes: 0 additions & 53 deletions lib/i18n.php

This file was deleted.

1 change: 0 additions & 1 deletion lib/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

require dirname( __FILE__ ) . '/blocks.php';
require dirname( __FILE__ ) . '/client-assets.php';
require dirname( __FILE__ ) . '/i18n.php';
require dirname( __FILE__ ) . '/demo.php';
require dirname( __FILE__ ) . '/widgets.php';
require dirname( __FILE__ ) . '/widgets-page.php';
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.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ exports[`BlockControls should render a dynamic toolbar of controls 1`] = `
"focusedElement": null,
"isSelected": true,
"name": undefined,
"onFocus": undefined,
"setFocusedElement": [Function],
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/block-editor/src/components/block-edit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ class BlockEdit extends Component {
}

static getDerivedStateFromProps( props ) {
const { clientId, name, isSelected } = props;
const { clientId, name, isSelected, onFocus } = props;

return {
name,
isSelected,
clientId,
onFocus,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import tinycolor from 'tinycolor2';
/**
* WordPress dependencies
*/
import { speak } from '@wordpress/a11y';
import { __ } from '@wordpress/i18n';
import { Notice } from '@wordpress/components';
import { useEffect } from '@wordpress/element';

function ContrastChecker( {
backgroundColor,
Expand All @@ -34,6 +36,9 @@ function ContrastChecker( {
const msg = tinyBackgroundColor.getBrightness() < tinyTextColor.getBrightness() ?
__( 'This color combination may be hard for people to read. Try using a darker background color and/or a brighter text color.' ) :
__( 'This color combination may be hard for people to read. Try using a brighter background color and/or a darker text color.' );
useEffect( () => {
speak( __( 'This color combination may be hard for people to read.' ) );
}, [ backgroundColor, textColor ] );
return (
<div className="editor-contrast-checker block-editor-contrast-checker">
<Notice status="warning" isDismissible={ false }>
Expand Down
Loading