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

Mobile Release v1.87.2 #47257

Merged
merged 16 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
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
4 changes: 3 additions & 1 deletion packages/block-editor/src/utils/parse-css-unit-to-px.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ function isMathExpression( cssUnit ) {
function evalMathExpression( cssUnit ) {
let errorFound = false;
// Convert every part of the expression to px values.
const cssUnitsBits = cssUnit.split( /[+-/*/]/g ).filter( Boolean );
const cssUnitsBits = cssUnit
.split( /(?!^-)[+*\/-](\s?-)?/g )
.filter( Boolean );
for ( const unit of cssUnitsBits ) {
// Standardize the unit to px and extract the value.
const parsedUnit = parseUnit( getPxFromCssUnit( unit ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ describe( 'getPxFromCssUnit', () => {
[ 'abc', null ],
[ 'console.log("howdy"); + 10px', null ],
[ 'calc(12vw * 10px', null ], // Missing closing bracket.
[ 'calc( 1em + 0.875rem )', '30px' ], // Decimals
];

test.each( testData )(
Expand Down
7 changes: 6 additions & 1 deletion packages/block-library/src/column/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ function ColumnEdit( {
);
}

const parentWidth =
contentStyle &&
contentStyle[ clientId ] &&
contentStyle[ clientId ].width;

return (
<>
{ isSelected && (
Expand Down Expand Up @@ -211,7 +216,7 @@ function ColumnEdit( {
>
<InnerBlocks
renderAppender={ renderAppender }
parentWidth={ contentStyle[ clientId ].width }
parentWidth={ parentWidth }
blockWidth={ blockWidth }
/>
</View>
Expand Down
6 changes: 6 additions & 0 deletions packages/block-library/src/gallery/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,11 +486,17 @@ function GalleryEdit( props ) {
className: classnames( className, 'has-nested-images' ),
} );

const nativeInnerBlockProps = Platform.isNative && {
marginHorizontal: 0,
marginVertical: 0,
};

const innerBlocksProps = useInnerBlocksProps( blockProps, {
allowedBlocks,
orientation: 'horizontal',
renderAppender: false,
__experimentalLayout: LAYOUT,
...nativeInnerBlockProps,
} );

if ( ! hasImages ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ exports[`core/more/edit/native should match snapshot when content is empty 1`] =
}
disableEditingMenu={false}
fontFamily="serif"
fontSize={16}
isMultiline={false}
maxImagesWidth={200}
onBlur={[Function]}
Expand Down Expand Up @@ -75,7 +74,6 @@ exports[`core/more/edit/native should match snapshot when content is not empty 1
}
disableEditingMenu={false}
fontFamily="serif"
fontSize={16}
isMultiline={false}
maxImagesWidth={200}
onBlur={[Function]}
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-aztec/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/react-native-aztec",
"version": "1.86.1",
"version": "1.87.2",
"description": "Aztec view for react-native.",
"private": true,
"author": "The WordPress Contributors",
Expand Down
9 changes: 9 additions & 0 deletions packages/react-native-aztec/src/AztecView.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ class AztecView extends Component {
// We now support this but passing line-height as a prop instead.
}

// Remove Font size rendering for pre elements until we fix an issue with AztecAndroid.
if (
Platform.OS === 'android' &&
this.props.text?.tag === 'pre' &&
style.hasOwnProperty( 'fontSize' )
) {
delete style.fontSize;
}

return (
<TouchableWithoutFeedback onPress={ this._onPress }>
<RCTAztecView
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-bridge/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/react-native-bridge",
"version": "1.86.1",
"version": "1.87.2",
"description": "Native bridge library used to integrate the block editor into a native App.",
"private": true,
"author": "The WordPress Contributors",
Expand Down
10 changes: 10 additions & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ For each user feature we should also add a importance categorization label to i
-->

## Unreleased

## 1.87.2
- [*] Add boolean contentStyle and clientId check to Column Edit InnerBlocks [#47234]
- [*] Line-height and font-size regression fixes [#47284]

## 1.87.1
- [**] Gallery block: Address styling regression, in which negative margin was added [#47086]
- [*] RichText - Parse CSS values and avoid setting undefined ones [#47080]

## 1.87.0
- [*] Add capabilities to force only Core blocks and control Support section [#46215]

## 1.86.1
Expand Down
4 changes: 1 addition & 3 deletions packages/react-native-editor/ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,10 @@ GEM

PLATFORMS
arm64-darwin-21
arm64-darwin-22

DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.2)

RUBY VERSION
ruby 2.7.5p203

BUNDLED WITH
2.3.18
8 changes: 4 additions & 4 deletions packages/react-native-editor/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ PODS:
- ReactCommon/turbomodule/core (= 0.69.4)
- fmt (6.2.1)
- glog (0.3.5)
- Gutenberg (1.86.1):
- Gutenberg (1.87.2):
- React-Core (= 0.69.4)
- React-CoreModules (= 0.69.4)
- React-RCTImage (= 0.69.4)
Expand Down Expand Up @@ -362,7 +362,7 @@ PODS:
- React-Core
- RNSVG (9.13.6):
- React-Core
- RNTAztecView (1.86.1):
- RNTAztecView (1.87.2):
- React-Core
- WordPress-Aztec-iOS (~> 1.19.8)
- SDWebImage (5.11.1):
Expand Down Expand Up @@ -545,7 +545,7 @@ SPEC CHECKSUMS:
FBReactNativeSpec: 2ff441cbe6e58c1778d8a5cf3311831a6a8c0809
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a
Gutenberg: d5a7f8a1047c0076a75a3e0a6400d22c324eef83
Gutenberg: 757eefbcd013a07e4816776bb65af1b1dc6098dc
libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c
RCT-Folly: b9d9fe1fc70114b751c076104e52f3b1b5e5a95a
RCTRequired: bd9d2ab0fda10171fcbcf9ba61a7df4dc15a28f4
Expand Down Expand Up @@ -588,7 +588,7 @@ SPEC CHECKSUMS:
RNReanimated: 8b189a09da0345d84b33b8cde57a57f8ed847352
RNScreens: 953633729a42e23ad0c93574d676b361e3335e8b
RNSVG: 36a7359c428dcb7c6bce1cc546fbfebe069809b0
RNTAztecView: 24db190c1b8b792a8b56f51835483547a8790d78
RNTAztecView: 37b773533f15466aac927b4c0f787edd933c2f87
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
WordPress-Aztec-iOS: 7d11d598f14c82c727c08b56bd35fbeb7dafb504
Expand Down
2 changes: 1 addition & 1 deletion packages/react-native-editor/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@wordpress/react-native-editor",
"version": "1.86.1",
"version": "1.87.2",
"description": "Mobile WordPress gutenberg editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
15 changes: 15 additions & 0 deletions packages/rich-text/src/component/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -932,6 +932,11 @@ export class RichText extends Component {

let newFontSize = DEFAULT_FONT_SIZE;

// Disables line-height rendering for pre elements until we fix some issues with AztecAndroid.
if ( tagName === 'pre' && ! this.isIOS ) {
return undefined;
}

// For block-based themes, get the default editor font size.
if ( baseGlobalStyles?.typography?.fontSize && tagName === 'p' ) {
newFontSize = baseGlobalStyles?.typography?.fontSize;
Expand Down Expand Up @@ -968,6 +973,11 @@ export class RichText extends Component {
baseGlobalStyles?.elements?.[ tagName ]?.typography?.lineHeight;
let newLineHeight;

// Disables line-height rendering for pre elements until we fix some issues with AztecAndroid.
if ( tagName === 'pre' && ! this.isIOS ) {
return undefined;
}

if ( ! this.getIsBlockBasedTheme() ) {
return;
}
Expand Down Expand Up @@ -1002,6 +1012,11 @@ export class RichText extends Component {
newLineHeight = MIN_LINE_HEIGHT;
}

// Until we parse CSS values correctly, avoid passing NaN values to Aztec
if ( isNaN( newLineHeight ) ) {
return undefined;
}

return newLineHeight;
}

Expand Down