-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
[RNMobile] Pullquote block #20952
Merged
Merged
[RNMobile] Pullquote block #20952
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c67e14f
Create native Pullquote block
ceyhun fd1ff66
Enable native Pullquote block in dev
ceyhun 9c09805
Merge branch 'master' into rnmobile/pullquote-block
ceyhun f5a340c
Remove native pullquote implementation
ceyhun 1ba878d
Create a BlockQuote component to use for native Pullquote
ceyhun 5a20f96
Create a Figure component to use for native Pullquote
ceyhun df0c1e0
Implement native behaviour in web Pullquote's edit.js
ceyhun c4aa274
Merge branch 'master' into rnmobile/pullquote-block
ceyhun 64b938d
Bring withColors HOC back to mobile
ceyhun fdabf7c
Address design feedback
ceyhun 06e1b1c
Implement native PanelColorSettings with an unsupported message display
ceyhun 5ee8ef2
Revert using Platform.OS check to not render PanelColorSettings
ceyhun 7a3cc2b
Merge branch 'master' into rnmobile/pullquote-block
ceyhun e9307bc
Merge branch 'master' into rnmobile/pullquote-block
ceyhun 5c216a1
Merge branch 'master' into rnmobile/pullquote-block
ceyhun 153f189
Move native unsupported message display to PanelColorGradientSettings
ceyhun 440d528
Merge branch 'master' into rnmobile/pullquote-block
ceyhun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
...ages/block-editor/src/components/colors-gradients/panel-color-gradient-settings.native.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { PanelBody, UnsupportedFooterControl } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
const PanelColorGradientSettings = () => { | ||
return ( | ||
<PanelBody> | ||
<UnsupportedFooterControl | ||
label={ __( 'Color settings are coming soon.' ) } | ||
separatorType="none" | ||
/> | ||
</PanelBody> | ||
); | ||
}; | ||
export default PanelColorGradientSettings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const BlockQuote = 'blockquote'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { View } from 'react-native'; | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { Children, cloneElement } from '@wordpress/element'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import styles from './blockquote.scss'; | ||
|
||
export const BlockQuote = ( props ) => { | ||
const newChildren = Children.map( props.children, ( child ) => { | ||
if ( child && child.props.identifier === 'value' ) { | ||
return cloneElement( child, { | ||
style: styles.quote, | ||
} ); | ||
} | ||
if ( child && child.props.identifier === 'citation' ) { | ||
return cloneElement( child, { | ||
style: styles.citation, | ||
} ); | ||
} | ||
return child; | ||
} ); | ||
return <View>{ newChildren }</View>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.quote { | ||
font-size: 18px; | ||
} | ||
|
||
.citation { | ||
font-size: 14px; | ||
margin-top: 12px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const Figure = 'figure'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { View } from 'react-native'; | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { withPreferredColorScheme } from '@wordpress/compose'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import styles from './figure.scss'; | ||
|
||
export const Figure = withPreferredColorScheme( ( props ) => { | ||
const { children, getStylesFromColorScheme } = props; | ||
|
||
const wpPullquoteFigure = getStylesFromColorScheme( | ||
styles.light, | ||
styles.dark | ||
); | ||
|
||
return <View style={ wpPullquoteFigure }>{ children }</View>; | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
%shared { | ||
border-width: 3px 0; | ||
padding: 21px 16px; | ||
} | ||
|
||
.light { | ||
@extend %shared; | ||
border-top-color: $gray-lighten-20; | ||
border-bottom-color: $gray-lighten-20; | ||
} | ||
|
||
.dark { | ||
@extend %shared; | ||
border-top-color: $gray-50; | ||
border-bottom-color: $gray-50; | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identifier and textAlign are only used by native code right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True for
textAlign
. Butidentifier
also exists in web: https://github.com/WordPress/gutenberg/blob/master/packages/block-editor/src/components/rich-text/index.js#L118