-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Changes from all commits
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 81e13d6
RichText: only ignore input types that insert HTML (#13914)
ellatrix bfe46d6
Bump plugin version to 5.1.0
noisysocks bb39e9a
Merge branch 'master' into rnmobile/release-v1.0
hypest 2240dcf
Deprecate RichTextInputEvent on mobile too (#13975)
hypest ece3caf
The undelying RichText component implementation has changed the param…
daniloercoli d2e2a18
Fixes wrong state comparison (#13987)
marecar3 811fbe0
Re-add rootTagsToEliminate prop (#14006)
pinarol 762f769
[Mobile]Update PostTitle to apply borders when it is focused (#13970)
pinarol 7c32d3a
Mobile: Rename ref to innerRef on PostTitle (#14024)
etoledom 258a10b
Fixes a red screen in mobile. (#14011)
diegoreymendez 36b7447
Change background color on image placeholder block (#14033)
marecar3 1171ec5
Fix post title native syntax (#14041)
Tug d5de5f5
Mobile: Links UI using BottomSheet component (#13972)
etoledom 85550bb
Fixes pasting links. (#14038)
diegoreymendez e485688
Update post title vertical paddings (#14040)
pinarol 331b68d
Add try/catch fallback to plain text for pasteHandler (#14044)
mkevins 0cbf01c
Fix link interface. (#14052)
SergioEstevao db68e6c
[Mobile]Fix title padding on Android (#14057)
pinarol 0718f7e
Revert wrong format image color (#14058)
marecar3 987a5a4
Stop building the mobile release branch on Travis (#14060)
hypest 926ed3f
[Native mobile] Bring release v1.0.1 back to "mobile develop" (#14075)
hypest 4f166f4
Rnmobile/refactor rich text sizing code (#14164)
SergioEstevao 3f702dd
Mobile: Fix pasting in header (#14118)
diegoreymendez 2a41903
Mobile: Fix links ui on landscape iOS v2 (#14240)
etoledom eb59a11
Mobile: Avoid adding empty link to text. (#14270)
etoledom 60fbafb
Avoid to reset html to empty string if block is heading and platform …
marecar3 8f82fd3
Set minHeight based on fontSize or style. (#14344)
SergioEstevao ea8d9d7
Remove unused styles classes. (#14338)
SergioEstevao 38377fe
[Mobile]Fix placeholder position of block appender (#14386)
pinarol de77ad8
[Mobile]Update caret position on insert link (#14317)
pinarol a981491
Get the last master changes into the mobile develop branch (#14375)
Tug 3f234fa
[RNmobile] Bring Placeholder text back working on Heading blocks (#14…
daniloercoli 3581b0e
Add disableEditingMenu prop to manage showing editing menu on iOS (#1…
pinarol d38fc17
Merge remote-tracking branch 'origin/master' into rnmobile/develop
Tug aece780
Fix merge errors
Tug 3b96fab
Update README.md
Tug 475fa28
Fix tab linting error in scss
Tug 87a8ca4
[React Native] request cancel image upload (#14391)
mzorz 1fd1aef
Fix lint errors
Tug c64ef84
Investigate travis error
Tug 0c528f7
Line modifications for packages/block-editor/src/index.js
Tug aa021f4
Fix circle dependency
Tug 61c075e
Update README.md
Tug f7c1604
Revert travis logging
Tug 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
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
3 changes: 0 additions & 3 deletions
3
packages/block-editor/src/components/default-block-appender/style.native.scss
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 |
---|---|---|
@@ -1,8 +1,5 @@ | ||
// @format | ||
|
||
@import "variables.scss"; | ||
@import "colors.scss"; | ||
|
||
.blockHolder { | ||
flex: 1 1 auto; | ||
} | ||
|
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,22 @@ | ||
// Block Creation Components | ||
export { default as BlockControls } from './block-controls'; | ||
export { default as BlockEdit } from './block-edit'; | ||
export { default as BlockFormatControls } from './block-format-controls'; | ||
export * from './colors'; | ||
export * from './font-sizes'; | ||
export { default as InspectorControls } from './inspector-controls'; | ||
export { default as PlainText } from './plain-text'; | ||
export { | ||
default as RichText, | ||
RichTextShortcut, | ||
RichTextToolbarButton, | ||
UnstableRichTextInputEvent, | ||
} from './rich-text'; | ||
export { default as MediaPlaceholder } from './media-placeholder'; | ||
export { default as URLInput } from './url-input'; | ||
|
||
// Content Related Components | ||
export { default as DefaultBlockAppender } from './default-block-appender'; | ||
|
||
// State Related Components | ||
export { default as BlockEditorProvider } from './provider'; |
1 change: 0 additions & 1 deletion
1
packages/block-editor/src/components/plain-text/style.native.scss
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@import "variables.scss"; | ||
|
||
.block-editor-plain-text { | ||
font-family: $default-regular-font; | ||
|
150 changes: 150 additions & 0 deletions
150
packages/block-editor/src/components/provider/index.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,150 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { Component } from '@wordpress/element'; | ||
import { SlotFillProvider } from '@wordpress/components'; | ||
import { withDispatch, RegistryConsumer } from '@wordpress/data'; | ||
import { createHigherOrderComponent, compose } from '@wordpress/compose'; | ||
|
||
/** | ||
* Higher-order component which renders the original component with the current | ||
* registry context passed as its `registry` prop. | ||
* | ||
* @param {WPComponent} OriginalComponent Original component. | ||
* | ||
* @return {WPComponent} Enhanced component. | ||
*/ | ||
const withRegistry = createHigherOrderComponent( | ||
( OriginalComponent ) => ( props ) => ( | ||
<RegistryConsumer> | ||
{ ( registry ) => ( | ||
<OriginalComponent | ||
{ ...props } | ||
registry={ registry } | ||
/> | ||
) } | ||
</RegistryConsumer> | ||
), | ||
'withRegistry' | ||
); | ||
|
||
class BlockEditorProvider extends Component { | ||
componentDidMount() { | ||
this.props.updateSettings( this.props.settings ); | ||
this.props.resetBlocks( this.props.value ); | ||
this.attachChangeObserver( this.props.registry ); | ||
} | ||
|
||
componentDidUpdate( prevProps ) { | ||
const { | ||
settings, | ||
updateSettings, | ||
value, | ||
resetBlocks, | ||
registry, | ||
} = this.props; | ||
|
||
if ( settings !== prevProps.settings ) { | ||
updateSettings( settings ); | ||
} | ||
|
||
if ( registry !== prevProps.registry ) { | ||
this.attachChangeObserver( registry ); | ||
} | ||
|
||
if ( this.isSyncingOutcomingValue ) { | ||
this.isSyncingOutcomingValue = false; | ||
} else if ( value !== prevProps.value ) { | ||
this.isSyncingIncomingValue = true; | ||
resetBlocks( value ); | ||
} | ||
} | ||
|
||
componentWillUnmount() { | ||
if ( this.unsubscribe ) { | ||
this.unsubscribe(); | ||
} | ||
} | ||
|
||
/** | ||
* Given a registry object, overrides the default dispatch behavior for the | ||
* `core/block-editor` store to interpret a state change and decide whether | ||
* we should call `onChange` or `onInput` depending on whether the change | ||
* is persistent or not. | ||
* | ||
* This needs to be done synchronously after state changes (instead of using | ||
* `componentDidUpdate`) in order to avoid batching these changes. | ||
* | ||
* @param {WPDataRegistry} registry Registry from which block editor | ||
* dispatch is to be overriden. | ||
*/ | ||
attachChangeObserver( registry ) { | ||
if ( this.unsubscribe ) { | ||
this.unsubscribe(); | ||
} | ||
|
||
const { | ||
getBlocks, | ||
isLastBlockChangePersistent, | ||
} = registry.select( 'core/block-editor' ); | ||
|
||
let blocks = getBlocks(); | ||
let isPersistent = isLastBlockChangePersistent(); | ||
|
||
this.unsubscribe = registry.subscribe( () => { | ||
const { | ||
onChange, | ||
onInput, | ||
} = this.props; | ||
const newBlocks = getBlocks(); | ||
const newIsPersistent = isLastBlockChangePersistent(); | ||
if ( newBlocks !== blocks && this.isSyncingIncomingValue ) { | ||
this.isSyncingIncomingValue = false; | ||
blocks = newBlocks; | ||
isPersistent = newIsPersistent; | ||
return; | ||
} | ||
|
||
if ( | ||
newBlocks !== blocks || | ||
// This happens when a previous input is explicitely marked as persistent. | ||
( newIsPersistent && ! isPersistent ) | ||
) { | ||
blocks = newBlocks; | ||
isPersistent = newIsPersistent; | ||
|
||
this.isSyncingOutcomingValue = true; | ||
if ( isPersistent ) { | ||
onChange( blocks ); | ||
} else { | ||
onInput( blocks ); | ||
} | ||
} | ||
} ); | ||
} | ||
|
||
render() { | ||
const { children } = this.props; | ||
|
||
return ( | ||
<SlotFillProvider> | ||
{ children } | ||
</SlotFillProvider> | ||
); | ||
} | ||
} | ||
|
||
export default compose( [ | ||
withDispatch( ( dispatch ) => { | ||
const { | ||
updateSettings, | ||
resetBlocks, | ||
} = dispatch( 'core/block-editor' ); | ||
|
||
return { | ||
updateSettings, | ||
resetBlocks, | ||
}; | ||
} ), | ||
withRegistry, | ||
] )( BlockEditorProvider ); |
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
3 changes: 1 addition & 2 deletions
3
packages/block-editor/src/components/rich-text/style.native.scss
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 |
---|---|---|
@@ -1,7 +1,6 @@ | ||
@import "variables.scss"; | ||
@import "colors.scss"; | ||
|
||
.block-editor-rich-text { | ||
font-family: $default-regular-font; | ||
text-decoration-color: $gray; | ||
min-height: $min-height-paragraph; | ||
} |
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,4 @@ | ||
|
||
.wp-block-heading { | ||
min-height: $min-height-heading; | ||
} |
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
// @format | ||
|
||
@import "variables.scss"; | ||
|
||
.imageContainer { | ||
flex: 1; | ||
justify-content: center; | ||
|
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
Oops, something went wrong.
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.
Can you help me understand why this file exists separate from
index.js
? Is it necessary that it does? Or did it just help simplify the migration? I'm concerned about the maintenance overhead in how new exported components need to be added to two files. And typically it's only made apparent after the fact (I'm encountering this in #21467).Could we have a file of "common" imports? I mean, ideally all the components are made available in either environment, but I suppose it may unavoidable we'd need to exclude / include some as specific to one or the other.