diff --git a/editor/assets/stylesheets/_z-index.scss b/editor/assets/stylesheets/_z-index.scss index 06224f7b6c9448..3ff782acf2fa80 100644 --- a/editor/assets/stylesheets/_z-index.scss +++ b/editor/assets/stylesheets/_z-index.scss @@ -7,6 +7,7 @@ $z-layers: ( '.editor-visual-editor__block {core/image aligned left or right}': 10, '.editor-visual-editor__block-controls': 1, '.editor-header': 20, + '.editor-post-visibility__dialog': 30, ); @function z-index( $key ) { diff --git a/editor/selectors.js b/editor/selectors.js index 886314c4082b56..5a31a7791c2abd 100644 --- a/editor/selectors.js +++ b/editor/selectors.js @@ -1,7 +1,7 @@ /** * External dependencies */ -import { first, last } from 'lodash'; +import { first, last, get } from 'lodash'; /** * Internal dependencies @@ -60,10 +60,16 @@ export function getEditedPostVisibility( state ) { export function getEditedPostTitle( state ) { return state.editor.edits.title === undefined - ? state.currentPost.title.raw + ? get( state.currentPost, 'title.raw' ) : state.editor.edits.title; } +export function getEditedPostExcerpt( state ) { + return state.editor.edits.excerpt === undefined + ? get( state.currentPost, 'excerpt.raw' ) + : state.editor.edits.excerpt; +} + export function getEditedPostPreviewLink( state ) { const link = state.currentPost.link; if ( ! link ) { diff --git a/editor/sidebar/post-excerpt/index.js b/editor/sidebar/post-excerpt/index.js new file mode 100644 index 00000000000000..db6d3362f2f5f6 --- /dev/null +++ b/editor/sidebar/post-excerpt/index.js @@ -0,0 +1,52 @@ +/** + * External dependencies + */ +import { connect } from 'react-redux'; + +/** + * WordPress dependencies + */ +import { __ } from 'i18n'; +import PanelBody from 'components/panel/body'; + +/** + * Internal Dependencies + */ +import './style.scss'; +import { getEditedPostExcerpt } from '../../selectors'; +import { editPost } from '../../actions'; + +function PostExcerpt( { excerpt, onUpdateExcerpt } ) { + const onChange = ( event ) => onUpdateExcerpt( event.target.value ); + + return ( + +