From 2d5d879b9b933f7056a546d9d52093de1d2c6155 Mon Sep 17 00:00:00 2001 From: Enej Bajgoric Date: Mon, 1 Mar 2021 10:16:01 -0800 Subject: [PATCH 1/6] Release script: Update react-native-editor version to 1.48.0 --- packages/react-native-aztec/package.json | 2 +- packages/react-native-bridge/package.json | 2 +- packages/react-native-editor/package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native-aztec/package.json b/packages/react-native-aztec/package.json index 2431d2fb69efa..b788b26aae22c 100644 --- a/packages/react-native-aztec/package.json +++ b/packages/react-native-aztec/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-native-aztec", - "version": "1.47.0", + "version": "1.48.0", "description": "Aztec view for react-native.", "private": true, "author": "The WordPress Contributors", diff --git a/packages/react-native-bridge/package.json b/packages/react-native-bridge/package.json index 21dcfb9b395a5..aa82a6a4c87b0 100644 --- a/packages/react-native-bridge/package.json +++ b/packages/react-native-bridge/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-native-bridge", - "version": "1.47.0", + "version": "1.48.0", "description": "Native bridge library used to integrate the block editor into a native App.", "private": true, "author": "The WordPress Contributors", diff --git a/packages/react-native-editor/package.json b/packages/react-native-editor/package.json index 21ddec8240c56..c6b2c8f4bd8af 100644 --- a/packages/react-native-editor/package.json +++ b/packages/react-native-editor/package.json @@ -1,6 +1,6 @@ { "name": "@wordpress/react-native-editor", - "version": "1.47.0", + "version": "1.48.0", "description": "Mobile WordPress gutenberg editor.", "author": "The WordPress Contributors", "license": "GPL-2.0-or-later", From c085da1635f77570d320a619e2a1567616800ce6 Mon Sep 17 00:00:00 2001 From: Enej Bajgoric Date: Mon, 1 Mar 2021 10:16:50 -0800 Subject: [PATCH 2/6] Release script: Update with changes from 'npm run core preios' --- packages/react-native-editor/ios/Podfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native-editor/ios/Podfile.lock b/packages/react-native-editor/ios/Podfile.lock index 4d42b17577909..1c9bb66ecfa60 100644 --- a/packages/react-native-editor/ios/Podfile.lock +++ b/packages/react-native-editor/ios/Podfile.lock @@ -21,7 +21,7 @@ PODS: - DoubleConversion - glog - glog (0.3.5) - - Gutenberg (1.47.0): + - Gutenberg (1.48.0): - React-Core (= 0.61.5) - React-CoreModules (= 0.61.5) - React-RCTImage (= 0.61.5) @@ -253,7 +253,7 @@ PODS: - React-Core - RNSVG (9.13.6-gb): - React-Core - - RNTAztecView (1.47.0): + - RNTAztecView (1.48.0): - React-Core - WordPress-Aztec-iOS (~> 1.19.4) - WordPress-Aztec-iOS (1.19.4) @@ -402,7 +402,7 @@ SPEC CHECKSUMS: FBReactNativeSpec: 118d0d177724c2d67f08a59136eb29ef5943ec75 Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 glog: 1f3da668190260b06b429bb211bfbee5cd790c28 - Gutenberg: 103a9ebea785a8e1dd4c8bd4378d4a8a70efa678 + Gutenberg: 670f7b82bc18bde86a516834b72b7eeded1011e8 RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1 RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320 React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78 @@ -435,7 +435,7 @@ SPEC CHECKSUMS: RNReanimated: f05baf4cd76b6eab2e4d7e2b244424960b968918 RNScreens: 953633729a42e23ad0c93574d676b361e3335e8b RNSVG: 46c4b680fe18237fa01eb7d7b311d77618fde31f - RNTAztecView: b1dfb9116d5947d9740145d3620cec703b529203 + RNTAztecView: 985f01fae9ea8ce9cb18a6f7af9b571084d7c9f9 WordPress-Aztec-iOS: 870c93297849072aadfc2223e284094e73023e82 Yoga: f2a7cd4280bfe2cca5a7aed98ba0eb3d1310f18b From a14915f0052ec03ff45a110a109006026b66beab Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Thu, 4 Mar 2021 14:34:07 +0100 Subject: [PATCH 3/6] [Mobile] - Fix splitting/merging of Paragraph and Heading (#29502) * Wip: Mobile RichText - Updating old value after splitting * Mobile - Fix splitting/merging issues and keyboard jumpiness on Android * Mobile - RichText - Add isIOS check for componentDidUpdate and use blockEditorStore * Mobile - RichText - Prevent onTextUpdate on Android --- .../rich-text/src/component/index.native.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/rich-text/src/component/index.native.js b/packages/rich-text/src/component/index.native.js index 6185f53b1bdf8..51b29854471de 100644 --- a/packages/rich-text/src/component/index.native.js +++ b/packages/rich-text/src/component/index.native.js @@ -7,7 +7,7 @@ * WordPress dependencies */ import RCTAztecView from '@wordpress/react-native-aztec'; -import { View, Platform } from 'react-native'; +import { View, Platform, InteractionManager } from 'react-native'; import { showUserSuggestions, showXpostSuggestions, @@ -18,7 +18,10 @@ import memize from 'memize'; /** * WordPress dependencies */ -import { BlockFormatControls } from '@wordpress/block-editor'; +import { + BlockFormatControls, + store as blockEditorStore, +} from '@wordpress/block-editor'; import { Component } from '@wordpress/element'; import { compose, withPreferredColorScheme } from '@wordpress/compose'; import { withSelect } from '@wordpress/data'; @@ -556,6 +559,7 @@ export class RichText extends Component { // Check if value is up to date with latest state of native AztecView if ( + this.isIOS && event.nativeEvent.text && event.nativeEvent.text !== this.props.value ) { @@ -615,7 +619,9 @@ export class RichText extends Component { // update text before updating selection // Make sure there are changes made to the content before upgrading it upward - this.onTextUpdate( event ); + if ( this.isIOS ) { + this.onTextUpdate( event ); + } // Aztec can send us selection change events after it has lost focus. // For instance the autocorrect feature will complete a partially written @@ -763,7 +769,9 @@ export class RichText extends Component { this.props.selectionEnd || 0 ); } else if ( ! isSelected && prevIsSelected ) { - this._editor.blur(); + InteractionManager.runAfterInteractions( () => { + this._editor?.blur(); + } ); } } @@ -998,7 +1006,7 @@ const withFormatTypes = ( WrappedComponent ) => ( props ) => { export default compose( [ withSelect( ( select, { clientId } ) => { const { getBlockParents, getBlock, getSettings } = select( - 'core/block-editor' + blockEditorStore ); const parents = getBlockParents( clientId, true ); const parentBlock = parents ? getBlock( parents[ 0 ] ) : undefined; From 14bd181aaf035cfdf088d509675269528aca8053 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Fri, 5 Mar 2021 10:12:09 +0100 Subject: [PATCH 4/6] Update changelog --- packages/react-native-editor/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index 374e8a799d2c9..700fc2b626684 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -11,6 +11,9 @@ For each user feature we should also add a importance categorization label to i ## Unreleased +## 1.48.0 +* [**] Buttons block: added with setting. [#28543] + ## 1.47.0 * [**] Add support for setting Cover block focal point. [#25810] From c348248fe6bf7c1f67c1ce82d61be6b5d2126723 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Fri, 5 Mar 2021 10:14:11 +0100 Subject: [PATCH 5/6] Changelog - fix typo --- packages/react-native-editor/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native-editor/CHANGELOG.md b/packages/react-native-editor/CHANGELOG.md index 700fc2b626684..6eb71f0388b99 100644 --- a/packages/react-native-editor/CHANGELOG.md +++ b/packages/react-native-editor/CHANGELOG.md @@ -12,7 +12,7 @@ For each user feature we should also add a importance categorization label to i ## Unreleased ## 1.48.0 -* [**] Buttons block: added with setting. [#28543] +* [**] Buttons block: added width setting. [#28543] ## 1.47.0 * [**] Add support for setting Cover block focal point. [#25810] From 285cb70ac7c3f56db9fa29021d1451d575a9f9a7 Mon Sep 17 00:00:00 2001 From: Gerardo Pacheco Date: Fri, 5 Mar 2021 13:59:28 +0100 Subject: [PATCH 6/6] Revert "[Mobile] - Fix splitting/merging of Paragraph and Heading (#29502)" This reverts commit a14915f0052ec03ff45a110a109006026b66beab. --- .../rich-text/src/component/index.native.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/rich-text/src/component/index.native.js b/packages/rich-text/src/component/index.native.js index 51b29854471de..6185f53b1bdf8 100644 --- a/packages/rich-text/src/component/index.native.js +++ b/packages/rich-text/src/component/index.native.js @@ -7,7 +7,7 @@ * WordPress dependencies */ import RCTAztecView from '@wordpress/react-native-aztec'; -import { View, Platform, InteractionManager } from 'react-native'; +import { View, Platform } from 'react-native'; import { showUserSuggestions, showXpostSuggestions, @@ -18,10 +18,7 @@ import memize from 'memize'; /** * WordPress dependencies */ -import { - BlockFormatControls, - store as blockEditorStore, -} from '@wordpress/block-editor'; +import { BlockFormatControls } from '@wordpress/block-editor'; import { Component } from '@wordpress/element'; import { compose, withPreferredColorScheme } from '@wordpress/compose'; import { withSelect } from '@wordpress/data'; @@ -559,7 +556,6 @@ export class RichText extends Component { // Check if value is up to date with latest state of native AztecView if ( - this.isIOS && event.nativeEvent.text && event.nativeEvent.text !== this.props.value ) { @@ -619,9 +615,7 @@ export class RichText extends Component { // update text before updating selection // Make sure there are changes made to the content before upgrading it upward - if ( this.isIOS ) { - this.onTextUpdate( event ); - } + this.onTextUpdate( event ); // Aztec can send us selection change events after it has lost focus. // For instance the autocorrect feature will complete a partially written @@ -769,9 +763,7 @@ export class RichText extends Component { this.props.selectionEnd || 0 ); } else if ( ! isSelected && prevIsSelected ) { - InteractionManager.runAfterInteractions( () => { - this._editor?.blur(); - } ); + this._editor.blur(); } } @@ -1006,7 +998,7 @@ const withFormatTypes = ( WrappedComponent ) => ( props ) => { export default compose( [ withSelect( ( select, { clientId } ) => { const { getBlockParents, getBlock, getSettings } = select( - blockEditorStore + 'core/block-editor' ); const parents = getBlockParents( clientId, true ); const parentBlock = parents ? getBlock( parents[ 0 ] ) : undefined;