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

Editor: updating layout and design #11536

Merged
merged 46 commits into from
Mar 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
70828a8
Editor: design iteration.
mtias Feb 22, 2017
52a3381
Accordion: get rid of noticon and add animation.
mtias Feb 22, 2017
90fe410
Editor: Implement distraction free mode.
mtias Feb 22, 2017
1a3fa0b
Editor: Add "status" accordion.
mtias Feb 22, 2017
2fceba7
Editor: document bar and navigation.
mtias Feb 22, 2017
1f5040f
Sharing: polish design and typography, adjust notice.
mtias Feb 22, 2017
118c4b7
Editor: post-type and metadata overhaul.
mtias Feb 22, 2017
228a78c
Search: add "compact" version to be used in tight spaces.
mtias Feb 23, 2017
069b9a1
AuthorSelector: update to use compact search and clean up CSS.
mtias Feb 23, 2017
1f73db1
Sharing: adjust publicize disabled message.
mtias Feb 23, 2017
eebe964
TermTreeSelector: distinguish between small and compact.
mtias Feb 23, 2017
63b7d5f
Editor: Move visibility block to status accordion.
mtias Feb 23, 2017
759d93b
Editor: Normalizing the editor bar and layout design.
jasmussen Feb 24, 2017
910ba62
Adjust close and accordion arrow positions.
jasmussen Feb 24, 2017
b136ab5
Site: add "compact" variation that hides domain.
mtias Feb 24, 2017
53e020c
Fix issues with editor being mispositioned between saves.
jasmussen Feb 27, 2017
8e063b1
Close sidebar via (x) and fix for empty localStore on revisions
timmyc Feb 27, 2017
ce3c8e8
Move trash post to status accordion.
timmyc Feb 27, 2017
af0da9d
Focus sidebar on initial load
timmyc Feb 27, 2017
9569f74
Better align accordions, and polish font sizes.
jasmussen Feb 28, 2017
c549800
Place trash action on sidebar footer and redesign the block.
mtias Feb 28, 2017
f985114
Editor: remember sidebar state.
mtias Feb 28, 2017
e6330e4
Polish the Save button.
jasmussen Feb 28, 2017
1ce26e3
Fix date picker in status accordion.
timmyc Feb 28, 2017
7489c2c
Skip categories tags accordion tests for now.
timmyc Feb 28, 2017
907f9af
Add open as default, don't animate on loading
timmyc Mar 1, 2017
00a2e3d
Add tab active state.
jasmussen Mar 1, 2017
96565e4
Use "Post Settings" as label for sidebar toggle.
mtias Mar 1, 2017
039d1f3
Improve Save button position and look.
jasmussen Mar 1, 2017
8b4dc13
Fix icon alignment in toolbar.
jasmussen Mar 1, 2017
14589cf
Mobile: rework.
mtias Mar 1, 2017
dc5215f
Remove all drafts-button remnants and unused redux bits.
timmyc Mar 1, 2017
f70bfb8
Editor: Misc. fixes on UI elements.
timmyc Mar 1, 2017
933dc11
Try adding saved status to own block
timmyc Mar 2, 2017
958a78d
Make publish notice dismissable.
jasmussen Mar 3, 2017
c413a32
Editor: Make sidebar animation performant.
jasmussen Mar 3, 2017
328c173
Fix stray space that would show up in Post Settings.
jasmussen Mar 3, 2017
c1e29b5
Fix and re-enable tests.
timmyc Mar 3, 2017
d224e72
Fix toolbars with sidebar/happychat open
timmyc Mar 3, 2017
19b963f
Editor: update Save status logic
timmyc Mar 8, 2017
11ea3f6
Only render sticky when it's toggled on.
mtias Mar 8, 2017
c1e1927
Replace a few color variables with SCSS.
jasmussen Mar 8, 2017
0c43b0e
Fix issue with horizontal scrollbar on smaller screens.
jasmussen Mar 8, 2017
190b90c
Editor: Fix publishing of private posts.
mtias Mar 9, 2017
638a4ad
PostStatus: use phrase for page/post and type: settings for CPT.
mtias Mar 9, 2017
cffc2fb
Editor: improve sidebar widths at responsive breakpoints.
jasmussen Mar 9, 2017
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: 0 additions & 2 deletions assets/stylesheets/_components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@
@import 'my-sites/upgrades/domain-management/style';
@import 'my-sites/upgrades/domain-management/components/icann-verification/style';
@import 'post-editor/style';
@import 'post-editor/drafts-button/style';
@import 'post-editor/edit-post-status/style';
@import 'post-editor/editor-action-bar/style';
@import 'post-editor/editor-author/style';
Expand All @@ -400,7 +399,6 @@
@import 'post-editor/editor-ground-control/style';
@import 'post-editor/editor-html-toolbar/style';
@import 'post-editor/editor-location/style';
@import 'post-editor/editor-mobile-navigation/style';
@import 'post-editor/editor-notice/style';
@import 'post-editor/editor-more-options/style';
@import 'post-editor/editor-notice/style';
Expand Down
1 change: 1 addition & 0 deletions assets/stylesheets/shared/functions/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ $z-layers: (
'.main': 20, //TODO: this doesn't always have a stacking context
//'tinymce-toolbar': 20, client/components/tinymce/index.jsx
'.search': 22,
'.editor-ground-control': 22,
'.reader-mobile-sidebar': 23,
'.community-translator': 99,
'.author-selector__popover.popover': 100,
Expand Down
1 change: 1 addition & 0 deletions assets/stylesheets/shared/mixins/_clear-fix.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
content: ".";
display: block;
height: 0;
width: 0;
clear: both;
visibility: hidden;
}
Expand Down
1 change: 1 addition & 0 deletions client/blocks/author-selector/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ const SwitcherShell = React.createClass( {
ignoreContext={ this.props.ignoreContext } >
{ ( this.props.fetchOptions.search || users.length > 10 ) &&
<Search
compact
onSearch={ this._onSearch }
placeholder={ this.translate( 'Find Author…', { context: 'search label' } ) }
delaySearch={ true }
Expand Down
14 changes: 6 additions & 8 deletions client/blocks/author-selector/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
overflow: hidden;
text-overflow: ellipsis;
}

.user__name {
font-size: 13px;
}
}

.author-selector__popover.popover {
Expand All @@ -51,16 +55,10 @@
border-top: 0px;
border-bottom: 1px solid lighten( $gray, 30 );
border-radius: 5px;
// .search should be cleaned up to not force height
height: 43px;
margin-bottom: 0;

&.is-open {
width: 200px;
}

.search__input[type="search"] {
font-size: 14px;
&.is-open {
width: 200px;
}

& + .author-selector__infinite-list {
Expand Down
12 changes: 8 additions & 4 deletions client/blocks/site/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ export default React.createClass( {
isSelected: false,

homeLink: false,
showHomeIcon: true // if homeLink is enabled
// if homeLink is enabled
showHomeIcon: true,
compact: false
};
},

Expand All @@ -48,7 +50,8 @@ export default React.createClass( {
isHighlighted: React.PropTypes.bool,
site: React.PropTypes.object,
homeLink: React.PropTypes.bool,
showHomeIcon: React.PropTypes.bool
showHomeIcon: React.PropTypes.bool,
compact: React.PropTypes.bool
},

onSelect( event ) {
Expand Down Expand Up @@ -78,7 +81,8 @@ export default React.createClass( {
'is-private': site.is_private,
'is-redirect': site.options && site.options.is_redirect,
'is-selected': this.props.isSelected,
'is-highlighted': this.props.isHighlighted
'is-highlighted': this.props.isHighlighted,
'is-compact': this.props.compact,
} );

return (
Expand All @@ -103,7 +107,7 @@ export default React.createClass( {
} )
}
>
<SiteIcon site={ site } />
<SiteIcon site={ site } size={ this.props.compact ? 24 : null } />
<div className="site__info">
<div className="site__title">
{ /* eslint-disable wpcalypso/jsx-gridicon-size */ }
Expand Down
29 changes: 29 additions & 0 deletions client/blocks/site/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,30 @@
}

}

&.is-compact {
.site__content {
padding: 0 16px;
}

.site__domain {
display: none;
}

.site__title {
line-height: 46px;
}

.site__home {
top: 11px;
line-height: 18px;
}

.site__home .gridicon {
margin-top: 0;
}

}
}

// Wraps the anchor element
Expand Down Expand Up @@ -114,6 +138,11 @@
vertical-align: middle;
}

.site.is-compact & {
width: 24px;
height: 24px;
}

&:hover {
color: $white;
}
Expand Down
4 changes: 3 additions & 1 deletion client/blocks/term-tree-selector/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default React.createClass( {
analyticsPrefix: PropTypes.string,
taxonomy: PropTypes.string,
height: PropTypes.number,
compact: PropTypes.bool,
},

getDefaultProps() {
Expand Down Expand Up @@ -54,7 +55,7 @@ export default React.createClass( {
},

render() {
const { className, taxonomy, onChange, selected, createLink, multiple, height } = this.props;
const { className, taxonomy, onChange, selected, createLink, multiple, height, compact } = this.props;

const classes = classNames( className );
const { search } = this.state;
Expand All @@ -74,6 +75,7 @@ export default React.createClass( {
createLink={ createLink }
multiple={ multiple }
height={ height }
compact={ compact }
/>
</div>
);
Expand Down
12 changes: 8 additions & 4 deletions client/blocks/term-tree-selector/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
background-color: $white;
border: 1px solid lighten( $gray, 20% );

&.is-compact {
&.is-small {
background-color: transparent;
border: none;
}
Expand Down Expand Up @@ -52,14 +52,18 @@ input[type=checkbox].term-tree-selector__input {
}

.term-tree-selector__nested-list {
margin-left: 1em;
margin-left: 24px;
}

.term-tree-selector__list-item {
position: relative;
padding: 2px 8px;
padding: 4px 8px;
font-size: 13px;

.term-tree-selector.is-compact.is-small & {
padding-left: 0;
}

&.is-empty {
padding-top: 4px;
}
Expand All @@ -77,7 +81,7 @@ input[type=checkbox].term-tree-selector__input {
margin-top: 2px;

.term-tree-selector.is-compact & {
font-size: 14px;
font-size: 12px;
margin-top: 0;
}

Expand Down
17 changes: 9 additions & 8 deletions client/blocks/term-tree-selector/terms.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ const TermTreeSelectorList = React.createClass( {

this.list.recomputeRowHeights();

// Compact mode passes the height of the scrollable region as a derived
// Small mode passes the height of the scrollable region as a derived
// number, and will not be updated unless our component re-renders
if ( this.isCompact() ) {
if ( this.isSmall() ) {
this.forceUpdate();
}
},
Expand Down Expand Up @@ -202,7 +202,7 @@ const TermTreeSelectorList = React.createClass( {
}
},

isCompact() {
isSmall() {
if ( ! this.props.terms || this.state.searchTerm ) {
return false;
}
Expand Down Expand Up @@ -400,15 +400,16 @@ const TermTreeSelectorList = React.createClass( {

render() {
const rowCount = this.getRowCount();
const isCompact = this.isCompact();
const isSmall = this.isSmall();
const searchLength = this.state.searchTerm.length;
const showSearch = ( searchLength > 0 || ! isCompact ) &&
const showSearch = ( searchLength > 0 || ! isSmall ) &&
( this.props.terms || ( ! this.props.terms && searchLength > 0 ) );
const { className, isError, loading, siteId, taxonomy, query, height } = this.props;
const classes = classNames( 'term-tree-selector', className, {
'is-loading': loading,
'is-compact': isCompact,
'is-error': isError
'is-small': isSmall,
'is-error': isError,
'is-compact': this.props.compact,
} );

return (
Expand All @@ -428,7 +429,7 @@ const TermTreeSelectorList = React.createClass( {
<List
ref={ this.setListRef }
width={ this.getResultsWidth() }
height={ isCompact ? this.getCompactContainerHeight() : height }
height={ isSmall ? this.getCompactContainerHeight() : height }
onRowsRendered={ this.setRequestedPages }
rowCount={ rowCount }
estimatedRowSize={ ITEM_HEIGHT }
Expand Down
2 changes: 2 additions & 0 deletions client/components/accordion/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import React, { Component, PropTypes } from 'react';
import { noop } from 'lodash';
import classNames from 'classnames';
import Gridicon from 'gridicons';

/**
* Internal dependencies
Expand Down Expand Up @@ -55,6 +56,7 @@ export default class Accordion extends Component {
{ icon && <span className="accordion__icon">{ icon }</span> }
<span className="accordion__title">{ title }</span>
{ subtitle && <span className="accordion__subtitle">{ subtitle }</span> }
<span className="accordion__arrow"><Gridicon icon="dropdown" /></span>
</button>
{ status && <AccordionStatus { ...status } /> }
</header>
Expand Down
34 changes: 20 additions & 14 deletions client/components/accordion/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$accordion-padding: 16px;
$accordion-subtitle-height: 16px;
$accordion-background-collapsed: $gray-light; // same as body
$accordion-background-hover: lighten( $gray, 30% );
$accordion-background-collapsed: $white; // same as body
$accordion-background-hover: $white;
$accordion-background-expanded: $white;

.accordion {
Expand Down Expand Up @@ -30,13 +30,16 @@ $accordion-background-expanded: $white;
background-color: $accordion-background-hover;
}

&::after {
@include noticon( '\f431', 22px );
.accordion__arrow {
position: absolute;
top: 50%;
right: $accordion-padding;
right: ( $accordion-padding - 4px );
transform: translateY( -50% );
color: lighten( $gray, 10% );
color: darken( $gray, 10% );
height: 24px;
.gridicon {
transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease-in;
}
}

.accordion.has-subtitle & {
Expand All @@ -46,14 +49,14 @@ $accordion-background-expanded: $white;
}

.accordion.is-expanded {
box-shadow: 0 0 0 1px lighten( $gray, 20% );

.accordion__toggle {
background-color: $accordion-background-expanded;
box-shadow: 0 0 0 1px lighten( $gray, 20% );

&::after {
content: '\f432';
.accordion__arrow {
.gridicon {
transform: rotate( 180deg );
}
}
}

Expand All @@ -78,6 +81,9 @@ $accordion-background-expanded: $white;
.accordion__title,
.accordion__subtitle {
display: block;
font-size: 13px;
font-weight: 500;
line-height: $accordion-subtitle-height;

.accordion.has-icon & {
padding-left: 28px;
Expand All @@ -89,9 +95,9 @@ $accordion-background-expanded: $white;
}

.accordion__subtitle {
font-size: 0.8em;
font-style: italic;
color: $gray-dark;
font-size: 11px;
color: $gray-text-min;
font-weight: 400;
white-space: nowrap;
overflow: hidden;
position: relative;
Expand Down Expand Up @@ -127,7 +133,7 @@ $accordion-background-expanded: $white;
}

.accordion__content-wrap {
padding: $accordion-padding;
padding: 0 $accordion-padding $accordion-padding $accordion-padding;
}

.accordion__section {
Expand Down
Loading