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.114.1 #59711

Merged
merged 9 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from 8 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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/block-editor/src/private-apis.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import * as globalStyles from './components/global-styles';
import { ExperimentalBlockEditorProvider } from './components/provider';
import { getRichTextValues } from './components/rich-text/get-rich-text-values';
import { lock } from './lock-unlock';

/**
Expand All @@ -12,4 +13,5 @@ export const privateApis = {};
lock( privateApis, {
...globalStyles,
ExperimentalBlockEditorProvider,
getRichTextValues,
} );
67 changes: 67 additions & 0 deletions packages/block-library/src/block/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
initializeEditor,
fireEvent,
within,
setupApiFetch,
triggerBlockListLayout,
} from 'test/helpers';

/**
Expand Down Expand Up @@ -42,6 +44,7 @@ const getMockedReusableBlock = ( id ) => ( {
id,
title: { raw: `Reusable block - ${ id }` },
type: 'wp_block',
meta: { footnotes: '' },
} );

beforeAll( () => {
Expand Down Expand Up @@ -187,4 +190,68 @@ describe( 'Synced patterns', () => {
expect( reusableBlock ).toBeDefined();
expect( headingInnerBlock ).toBeDefined();
} );

it( 'renders block after content is updated due to a side effect', async () => {
// We have to use different ids because entities are cached in memory.
const id = 5;
const initialHtml = `<!-- wp:block {"ref":${ id }} /-->`;
const endpoint = `/wp/v2/blocks/${ id }`;
const fetchMedia = {
request: {
path: `/wp/v2/media/1?context=edit`,
},
response: {
source_url: 'https://cldup.com/cXyG__fTLN.jpg',
id: 1,
// We need to include the sizes to trigger the side effect.
media_details: {
sizes: {
large: {
source_url:
'https://cldup.com/cXyG__fTLN.jpg?w=500',
},
},
},
},
};

// Return mocked response for the block endpoint.
fetchRequest.mockImplementation( ( { path } ) => {
let response = {};
if ( path.startsWith( endpoint ) ) {
response = getMockedReusableBlock( id );
}
// Replace content with an Image block to trigger a side effect.
// The side effect will be produced when the `source` attribute is replaced
// with an URL that includes the width query parameter:
// https://cldup.com/cXyG__fTLN.jpg => https://cldup.com/cXyG__fTLN.jpg?w=500
response.content.raw = `<!-- wp:image {"id":1,"sizeSlug":"large","linkDestination":"none"} -->
<figure class="wp-block-image size-large"><img src="https://cldup.com/cXyG__fTLN.jpg" alt="" class="wp-image-1"/></figure>
<!-- /wp:image -->`;
return Promise.resolve( response );
} );

const screen = await initializeEditor( {
initialHtml,
} );

const reusableBlock = await screen.findByLabelText(
/Pattern Block\. Row 1/
);

// Mock media fetch requests
setupApiFetch( [ fetchMedia ] );

await triggerBlockListLayout(
within( reusableBlock ).getByTestId( 'block-list-wrapper' )
);

const imageBlock =
await within( reusableBlock ).getByLabelText(
'Image Block. Row 1'
);

expect( reusableBlock ).toBeDefined();
expect( imageBlock ).toBeDefined();
} );
} );
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.112.0",
"version": "1.114.1",
"description": "Aztec view for react-native.",
"private": true,
"author": "The WordPress Contributors",
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.112.0",
"version": "1.114.1",
"description": "Native bridge library used to integrate the block editor into a native App.",
"private": true,
"author": "The WordPress Contributors",
Expand Down
5 changes: 5 additions & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ For each user feature we should also add a importance categorization label to i
-->

## Unreleased

## 1.114.1
- [**] Fix a crash produced when the content of a synced pattern is updated [#59632]

## 1.114.0
- [*] Prevent crash when autoscrolling to blocks [#59110]
- [*] Remove opacity change when images are being uploaded [#59264]
- [*] Media & Text blocks correctly show an error message when the attached video upload fails [#59288]
Expand Down
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.71.15)
- fmt (6.2.1)
- glog (0.3.5)
- Gutenberg (1.112.0):
- Gutenberg (1.114.1):
- React-Core (= 0.71.15)
- React-CoreModules (= 0.71.15)
- React-RCTImage (= 0.71.15)
Expand Down Expand Up @@ -429,7 +429,7 @@ PODS:
- React-RCTImage
- RNSVG (13.9.0):
- React-Core
- RNTAztecView (1.112.0):
- RNTAztecView (1.114.1):
- React-Core
- WordPress-Aztec-iOS (= 1.19.9)
- SDWebImage (5.11.1):
Expand Down Expand Up @@ -617,7 +617,7 @@ SPEC CHECKSUMS:
FBReactNativeSpec: 8f5ee005451bf28f6a3ae995914b2f04b3584122
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b
Gutenberg: fad00864ab916e9f7778e5493c1a7f3bd9316eb4
Gutenberg: f46cb97123ab610bd3bb2a2ec9c2be017771f357
hermes-engine: 04437e4291ede4af0c76c25e7efd0eacb8fd25e5
libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913
libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c
Expand Down Expand Up @@ -662,7 +662,7 @@ SPEC CHECKSUMS:
RNReanimated: d4f363f4987ae0ade3e36ff81c94e68261bf4b8d
RNScreens: 68fd1060f57dd1023880bf4c05d74784b5392789
RNSVG: 53c661b76829783cdaf9b7a57258f3d3b4c28315
RNTAztecView: 74c676c87e4a9db79104fcdad9624c1e5c02fe15
RNTAztecView: 8e6e879ee72db06b4e651f8526fb0980f949a8ac
SDWebImage: a7f831e1a65eb5e285e3fb046a23fcfbf08e696d
SDWebImageWebPCoder: 908b83b6adda48effe7667cd2b7f78c897e5111d
WordPress-Aztec-iOS: fbebd569c61baa252b3f5058c0a2a9a6ada686bb
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.112.0",
"version": "1.114.1",
"description": "Mobile WordPress gutenberg editor.",
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down
Loading