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

Layout: Add metabox placeholder shell #2800

Merged
merged 5 commits into from
Sep 26, 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
5 changes: 5 additions & 0 deletions components/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
border: none;
outline: none;
text-decoration: none;
margin: 0;

&:active {
color: currentColor;
}

&:disabled {
opacity: 0.6;
Expand Down
2 changes: 1 addition & 1 deletion components/panel/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
.components-panel .components-panel__body-title {
display: block;
padding: 0;
margin: -15px;
margin: -1 * $panel-padding;
font-size: inherit;
}
.components-panel__body.is-opened .components-panel__body-title {
Expand Down
14 changes: 14 additions & 0 deletions editor/assets/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,19 @@ body.gutenberg_page_gutenberg-demo {
padding-left: 0;
}

#wpbody-content {
padding-bottom: 0;
}

#wpfooter {
display: none;
}

.a11y-speak-region {
left: -1px;
top: -1px;
}

svg {
fill: currentColor;
}
Expand Down Expand Up @@ -46,6 +55,11 @@ body.gutenberg_page_gutenberg-demo {

.gutenberg__editor {
position: relative;
height: calc( 100vh - #{ $admin-bar-height-big } );

@include break-medium {
height: calc( 100vh - #{ $admin-bar-height } );
}

img {
max-width: 100%;
Expand Down
8 changes: 6 additions & 2 deletions editor/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Header from '../header';
import Sidebar from '../sidebar';
import TextEditor from '../modes/text-editor';
import VisualEditor from '../modes/visual-editor';
import MetaBoxes from '../meta-boxes';
import UnsavedChangesWarning from '../unsaved-changes-warning';
import DocumentTitle from '../document-title';
import AutosaveMonitor from '../autosave-monitor';
Expand All @@ -40,8 +41,11 @@ function Layout( { mode, isSidebarOpened, notices, ...props } ) {
<AutosaveMonitor />
<Header />
<div className="editor-layout__content">
{ mode === 'text' && <TextEditor /> }
{ mode === 'visual' && <VisualEditor /> }
<div className="editor-layout__editor">
{ mode === 'text' && <TextEditor /> }
{ mode === 'visual' && <VisualEditor /> }
</div>
<MetaBoxes />
</div>
{ isSidebarOpened && <Sidebar /> }
</div>
Expand Down
20 changes: 20 additions & 0 deletions editor/layout/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
.editor-layout,
.editor-layout__content {
height: 100%;
}

.editor-layout {
position: relative;
}

.editor-layout__content {
display: flex;
flex-direction: column;
margin-top: #{ -1 * $header-height };

@include break-medium {
margin-top: 0;
}
}

.editor-layout__editor {
flex-basis: 100%;
overflow-y: auto;
}

.editor-layout .components-notice-list {
position: fixed;
top: 100px;
Expand Down
50 changes: 50 additions & 0 deletions editor/meta-boxes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* WordPress dependencies
*/
import { __ } from '@wordpress/i18n';
import { Component } from '@wordpress/element';
import { Panel, PanelBody, Dashicon } from '@wordpress/components';

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

class MetaBoxes extends Component {
constructor() {
super( ...arguments );

this.toggle = this.toggle.bind( this );

this.state = {
isOpen: false,
};
}

toggle() {
this.setState( {
isOpen: ! this.state.isOpen,
} );
}

render() {
const { isOpen } = this.state;

return (
<Panel className="editor-meta-boxes">
<PanelBody
title={ __( 'Extended Settings' ) }
opened={ isOpen }
onToggle={ this.toggle }>
<div className="editor-meta-boxes__coming-soon">
<Dashicon icon="flag" />
<h3>{ __( 'Coming Soon' ) }</h3>
<p>{ __( 'Meta boxes are not yet supported, but are planned for a future release.' ) }</p>
</div>
</PanelBody>
</Panel>
);
}
}

export default MetaBoxes;
32 changes: 32 additions & 0 deletions editor/meta-boxes/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.editor-meta-boxes {
border-right-width: 0;
border-left-width: 0;

.components-panel__body-toggle {
background-color: $light-gray-300;
}

.components-panel__body.is-opened .components-panel__body-toggle {
border-bottom: 1px solid $light-gray-500;
}
}

.editor-meta-boxes__coming-soon {
width: 300px;
padding: #{ $panel-padding * 2 } 0 $panel-padding;
margin: 0 auto;
text-align: center;

&,
h3 {
color: $dark-gray-200;
}

h3 {
margin: 0.6em 0;
}

p {
margin-bottom: 0;
}
}