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 mobile development branch into master (v2) #14503

Merged
merged 45 commits into from
Mar 21, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
f5852b9
Bump plugin version to 5.1.0-rc.1
noisysocks Feb 18, 2019
81e13d6
RichText: only ignore input types that insert HTML (#13914)
ellatrix Feb 20, 2019
bfe46d6
Bump plugin version to 5.1.0
noisysocks Feb 20, 2019
bb39e9a
Merge branch 'master' into rnmobile/release-v1.0
hypest Feb 20, 2019
2240dcf
Deprecate RichTextInputEvent on mobile too (#13975)
hypest Feb 20, 2019
ece3caf
The undelying RichText component implementation has changed the param…
daniloercoli Feb 20, 2019
d2e2a18
Fixes wrong state comparison (#13987)
marecar3 Feb 20, 2019
811fbe0
Re-add rootTagsToEliminate prop (#14006)
pinarol Feb 21, 2019
762f769
[Mobile]Update PostTitle to apply borders when it is focused (#13970)
pinarol Feb 21, 2019
7c32d3a
Mobile: Rename ref to innerRef on PostTitle (#14024)
etoledom Feb 21, 2019
258a10b
Fixes a red screen in mobile. (#14011)
diegoreymendez Feb 22, 2019
36b7447
Change background color on image placeholder block (#14033)
marecar3 Feb 22, 2019
1171ec5
Fix post title native syntax (#14041)
Tug Feb 22, 2019
d5de5f5
Mobile: Links UI using BottomSheet component (#13972)
etoledom Feb 22, 2019
85550bb
Fixes pasting links. (#14038)
diegoreymendez Feb 22, 2019
e485688
Update post title vertical paddings (#14040)
pinarol Feb 22, 2019
331b68d
Add try/catch fallback to plain text for pasteHandler (#14044)
mkevins Feb 22, 2019
0cbf01c
Fix link interface. (#14052)
SergioEstevao Feb 22, 2019
db68e6c
[Mobile]Fix title padding on Android (#14057)
pinarol Feb 22, 2019
0718f7e
Revert wrong format image color (#14058)
marecar3 Feb 22, 2019
987a5a4
Stop building the mobile release branch on Travis (#14060)
hypest Feb 22, 2019
926ed3f
[Native mobile] Bring release v1.0.1 back to "mobile develop" (#14075)
hypest Feb 24, 2019
4f166f4
Rnmobile/refactor rich text sizing code (#14164)
SergioEstevao Mar 4, 2019
3f702dd
Mobile: Fix pasting in header (#14118)
diegoreymendez Mar 5, 2019
2a41903
Mobile: Fix links ui on landscape iOS v2 (#14240)
etoledom Mar 5, 2019
eb59a11
Mobile: Avoid adding empty link to text. (#14270)
etoledom Mar 7, 2019
60fbafb
Avoid to reset html to empty string if block is heading and platform …
marecar3 Mar 8, 2019
8f82fd3
Set minHeight based on fontSize or style. (#14344)
SergioEstevao Mar 8, 2019
ea8d9d7
Remove unused styles classes. (#14338)
SergioEstevao Mar 12, 2019
38377fe
[Mobile]Fix placeholder position of block appender (#14386)
pinarol Mar 12, 2019
de77ad8
[Mobile]Update caret position on insert link (#14317)
pinarol Mar 13, 2019
a981491
Get the last master changes into the mobile develop branch (#14375)
Tug Mar 14, 2019
3f234fa
[RNmobile] Bring Placeholder text back working on Heading blocks (#14…
daniloercoli Mar 14, 2019
3581b0e
Add disableEditingMenu prop to manage showing editing menu on iOS (#1…
pinarol Mar 15, 2019
d38fc17
Merge remote-tracking branch 'origin/master' into rnmobile/develop
Tug Mar 18, 2019
aece780
Fix merge errors
Tug Mar 19, 2019
3b96fab
Update README.md
Tug Mar 19, 2019
475fa28
Fix tab linting error in scss
Tug Mar 19, 2019
87a8ca4
[React Native] request cancel image upload (#14391)
mzorz Mar 19, 2019
1fd1aef
Fix lint errors
Tug Mar 21, 2019
c64ef84
Investigate travis error
Tug Mar 21, 2019
0c528f7
Line modifications for packages/block-editor/src/index.js
Tug Mar 21, 2019
aa021f4
Fix circle dependency
Tug Mar 21, 2019
61c075e
Update README.md
Tug Mar 21, 2019
f7c1604
Revert travis logging
Tug Mar 21, 2019
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
Prev Previous commit
Next Next commit
[Mobile]Update PostTitle to apply borders when it is focused (#13970)
* Trigger onFocusStatusChange from PostTitle

* Fix lint issue

* Update post title shadow mechanism

Also open inner ref so that focus state can be updated when focus is made programmatically

* Update props

* Update onRef as ref

* Update title padding&margin
  • Loading branch information
pinarol authored Feb 21, 2019
commit 762f7696c312e3c2f2ebea47aa30d644e6fc041f
72 changes: 49 additions & 23 deletions packages/editor/src/components/post-title/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ import { withDispatch } from '@wordpress/data';
import { withFocusOutside } from '@wordpress/components';
import { withInstanceId, compose } from '@wordpress/compose';

import { View } from 'react-native';

import styles from './style.scss';

const minHeight = 30;

class PostTitle extends Component {
titleViewRef: Object;

constructor() {
super( ...arguments );

Expand All @@ -23,10 +29,23 @@ class PostTitle extends Component {
};
}

componentDidMount() {
if ( this.props.ref ) {
this.props.ref( this );
}
}

handleFocusOutside() {
this.onUnselect();
}

focus() {
if ( this.titleViewRef ) {
this.titleViewRef.focus();
this.setState( { isSelected: true } );
}
}

onSelect() {
this.setState( { isSelected: true } );
this.props.clearSelectedBlock();
Expand All @@ -41,34 +60,41 @@ class PostTitle extends Component {
placeholder,
style,
title,
focusedBorderColor,
borderStyle,
} = this.props;

const decodedPlaceholder = decodeEntities( placeholder );
const borderColor = this.state.isSelected ? focusedBorderColor : 'transparent';

return (
<RichText
tagName={ 'p' }
rootTagsToEliminate={ [ 'strong' ] }
onFocus={ this.onSelect }
onBlur={ this.props.onBlur } // always assign onBlur as a props
multiline={ false }
style={ [ style, {
minHeight: Math.max( minHeight, this.state.aztecHeight ),
} ] }
fontSize={ 24 }
fontWeight={ 'bold' }
onChange={ ( value ) => {
this.props.onUpdate( value );
} }
onContentSizeChange={ ( event ) => {
this.setState( { aztecHeight: event.aztecHeight } );
} }
placeholder={ decodedPlaceholder }
value={ title }
onSplit={ this.props.onEnterPress }
setRef={ this.props.setRef }
>
</RichText>
<View style={ [ styles.titleContainer, borderStyle, { borderColor } ] }>
<RichText
tagName={ 'p' }
rootTagsToEliminate={ [ 'strong' ] }
onFocus={ this.onSelect }
onBlur={ this.props.onBlur } // always assign onBlur as a props
multiline={ false }
style={ [ style, {
minHeight: Math.max( minHeight, this.state.aztecHeight ),
} ] }
fontSize={ 24 }
fontWeight={ 'bold' }
onChange={ ( value ) => {
this.props.onUpdate( value );
} }
onContentSizeChange={ ( event ) => {
this.setState( { aztecHeight: event.aztecHeight } );
} }
placeholder={ decodedPlaceholder }
value={ title }
onSplit={ this.props.onEnterPress }
setRef={ ( ref ) => {
this.titleViewRef = ref;
} }
>
</RichText>
</View>
);
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/editor/src/components/post-title/style.native.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

.titleContainer {
padding-left: 16;
padding-right: 16;
margin-top: 24;
}