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

Add landmark regions #2380

Merged
merged 3 commits into from
Sep 8, 2017
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
16 changes: 12 additions & 4 deletions editor/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ function Header( { multiSelectedBlockUids, onRemove, onDeselect } ) {

if ( count ) {
return (
<header className="editor-header editor-header-multi-select">
<div
role="region"
aria-label={ __( 'Editor toolbar' ) }
className="editor-header editor-header-multi-select"
>
<div className="editor-selected-count">
{ sprintf( _n( '%d block selected', '%d blocks selected', count ), count ) }
</div>
Expand All @@ -45,16 +49,20 @@ function Header( { multiSelectedBlockUids, onRemove, onDeselect } ) {
onClick={ () => onDeselect() }
/>
</div>
</header>
</div>
);
}

return (
<header className="editor-header">
<div
role="region"
aria-label={ __( 'Editor toolbar' ) }
className="editor-header"
>
<ModeSwitcher />
<SavedState />
<Tools />
</header>
</div>
);
}

Expand Down
11 changes: 8 additions & 3 deletions editor/modes/text-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Textarea from 'react-autosize-textarea';
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { parse } from '@wordpress/blocks';

Expand Down Expand Up @@ -49,8 +50,12 @@ class TextEditor extends Component {
const { value } = this.props;

return (
<div className="editor-text-editor">
<header className="editor-text-editor__formatting">
<div
role="region"
aria-label={ __( 'Editor content' ) }
className="editor-text-editor"
>
<div className="editor-text-editor__formatting">
<div className="editor-text-editor__formatting-group">
<button className="editor-text-editor__bold">b</button>
<button className="editor-text-editor__italic">i</button>
Expand All @@ -66,7 +71,7 @@ class TextEditor extends Component {
<button>more</button>
<button>close tags</button>
</div>
</header>
</div>
<div className="editor-text-editor__body">
<PostTitle />
<Textarea
Expand Down
2 changes: 1 addition & 1 deletion editor/modes/visual-editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class VisualEditor extends Component {
return (
<div
role="region"
aria-label={ __( 'Visual Editor' ) }
aria-label={ __( 'Editor content' ) }
className="editor-visual-editor"
onMouseDown={ this.onClick }
onTouchStart={ this.onClick }
Expand Down
3 changes: 2 additions & 1 deletion editor/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { connect } from 'react-redux';
/**
* WordPress Dependencies
*/
import { __ } from '@wordpress/i18n';
import { withFocusReturn } from '@wordpress/components';

/**
Expand All @@ -19,7 +20,7 @@ import { getActivePanel } from '../selectors';

const Sidebar = ( { panel } ) => {
return (
<div className="editor-sidebar">
<div className="editor-sidebar" role="region" aria-label={ __( 'Editor settings' ) }>
<Header />
{ panel === 'document' && <PostSettings /> }
{ panel === 'block' && <BlockInspector /> }
Expand Down
6 changes: 5 additions & 1 deletion lib/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
* The main entry point for the Gutenberg editor. Renders the editor on the
* wp-admin page for the plugin.
*
* @todo Remove the temporary fix for the NVDA screen reader and use meaningful
* content instead. See pull #2380 and issues #467 and #503.
*
* @since 0.1.0
*/
function the_gutenberg_project() {
?>
<div class="nvda-temp-fix screen-reader-text">&nbsp;</div>
<div class="gutenberg">
<section id="editor" class="gutenberg__editor"></section>
<div id="editor" class="gutenberg__editor"></div>
</div>
<?php
}
Expand Down