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

[RNMobile] Add 'Insert from URL' option to Image block #40334

Conversation

derekblank
Copy link
Member

@derekblank derekblank commented Apr 14, 2022

What?

Fixes wordpress-mobile/gutenberg-mobile#3190 by adding "Insert from URL" option to the Image block.

Related: gutenberg-mobile#4779

Why?

"Insert from URL" is an option for the Audio, Video, and Image blocks on the web, and also for the Audio block on Gutenberg Mobile. This PR adds the same web behavior to the Image block.

How?

  • Adds an onSelectURL handler to the native image block based on the equivalent code on from the web Image block.
  • Adds error message handler for invalid URLs inspired by the same UI as the native File block.
  • Adds MEDIA_TYPE_IMAGE to the list of source options available when selecting an Image block, which is controlled by the Media Upload component.
  • Updates the Media Upload test cases to be more explicit about the media upload options for each block. (More info about test strategies and other considerations forthcoming below.)

Testing Instructions

  1. Open a Post or Page
  2. Insert an Image Block
  3. Tap on Insert from URL in the menu options
  4. Paste a valid (or invalid) URL into the text input tap Apply
  5. Image should display in UI (or show error message if the URL is invalid)
20220429_1255262.mov

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Apr 14, 2022
@github-actions
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @derekblank! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@derekblank
Copy link
Member Author

derekblank commented Apr 14, 2022

Other considerations regarding tests that can be discussed here, or broken out for future PRs:

  1. The tests have been refactored to be more clear about the media source options for each media block. With this PR change, each media option has been added to the list of expected options for each media block. The media capture options test case was moved into its own describe block so that the test output was more explicit about which block failed. Generally, I prefer to avoid nested describe blocks, but in this case it might make sense as the media blocks are a "suite" within a suite. I'd be interested in other opinions here.
    Media capture options for different media block types
      ✓ shows the correct media capture options for the Image block (116 ms)
      ✓ shows the correct media capture options for the Video block (16 ms)
      ✓ shows the correct media capture options for the Audio block (7 ms)
  1. I am still searching for an elegant way to test unhappy test paths, as in testing when a media source option should NOT be in the menu. I had experimented with passing the expected number of options that should be in each media block menu (e.g., something like expect(items.length).toBe(4)), but that didn't quite feel right.
  2. The media source options appear to be "dynamic" for different blocks, depending on what context they are loaded from. For example, the Audio block appears to have different menu options based on whether it is being used on a free or Pro site plan. When the site is free, only the Insert from URL option is present. When the site is "Pro", the options are WordPress Media Library, Insert from URL, and Choose from device. This requires a bit of further investigation on free and paid plans to note exactly which circumstances the correct media source options should appear, and if this dynamic free/pro behavior occurs on any other media blocks.
  3. Similar to the above, the Image block has two extra options when it is called from the native app that are not present in the Image block for the Gutenberg Mobile Demo app. (These two options are Choose from Free Photo Library and Choose from Tenor.) These come from getOtherMediaOptions within the native apps. Further investigation is required to understand how including these two options could (and/or should) be incorporated into the testing strategy.

@hypest
Copy link
Contributor

hypest commented Apr 14, 2022

Thanks for opening this draft PR @derekblank , and for putting good focus on the (automated) test strategy as well!

May I suggest splitting the effort to 2 different PRs, one to hold the main functionality plus some basic tests, and a second PR to host the extra tests? That way, the main feature moves through the review "pipeline" and becomes available sooner. WDYT?

@mchowning
Copy link
Contributor

mchowning commented Apr 14, 2022

Thanks for this @derekblank ! This is looking good.

In testing this though, when I select a URL to insert into an image or video block, I'm not seeing the block updated with the selected URL (i.e., the block placeholder remains and the block's HTML markup doesn't include the URL). Is this working for you?

Generally, I prefer to avoid nested describe blocks, but in this case it might make sense as the media blocks are a "suite" within a suite. I'd be interested in other opinions here.

I like the nesting here myself. 🙂

I am still searching for an elegant way to test unhappy test paths, as in testing when a media source option should NOT be in the menu. I had experimented with passing the expected number of options that should be in each media block menu (e.g., something like expect(items.length).toBe(4)), but that didn't quite feel right.

This seems ok to me. If we're verifying that each item we expect to be there is there, and then we also check that there are not more items than we expect, then that would catch if there were any unexpected values.

Obviously if we could find a way to more directly test that exactly the elements we expect and no others are present, then that would be better, but if there isn't a straightforward way to do that, then this doesn't feel like an unreasonable approach.

The media source options appear to be "dynamic" for different blocks, depending on what context they are loaded from.... . This requires a bit of further investigation on free and paid plans to note exactly which circumstances the correct media source options should appear, and if this dynamic free/pro behavior occurs on any other media blocks.

It looks like with the current implementation the capability to upload audio and __experimentalOnlyMediaLibrary are the only two dynamic influences on the media options for Gutenberg mobile. I think capturing that behavior is all you need to worry about. Making the options more dynamic than they are now is something I'm already working on in a separate PR, so I don't think you need to handle that.

hypest: May I suggest splitting the effort to 2 different PRs, one to hold the main functionality plus some basic tests, and a second PR to host the extra tests?

I think the modifications you have to the tests in this PR already are fine to keep in this PR. If/when you look to do some of the more extensive refactorings you mentioned (accounting for unhappy paths, dynamic block behavior, or media options sent from native), I agree with @hypest that a separate PR may be a better home for those changes. Based on our earlier conversations, I think that is what you were already planning to do, so I'm more just saying this "out loud". 🙂

@mchowning
Copy link
Contributor

It looks like there may be some issues with the getByText -> findByText change on CI. Here's the output in case you can't access it.

CI test failures
Summary of all failing tests
FAIL packages/format-library/src/link/test/index.native.js
  ● Android › improves apply animation performance by dismissing keyboard beforehand

    Unable to find node on an unmounted component.

      36 | 	} );
      37 |
    > 38 | 	describe( 'Media capture options for different media block types', () => {
         | 	             ^
      39 | 		const expectOptionForMediaType = ( mediaType, expectedOption ) => {
      40 | 			const wrapper = render(
      41 | 				<MediaUpload

      at Object.findFn [as findByText] (node_modules/@testing-library/react-native/build/helpers/makeQueries.js:95:35)
      at expectOptionForMediaType (packages/block-editor/src/components/media-upload/test/index.native.js:38:15)
      at Object.<anonymous> (packages/block-editor/src/components/media-upload/test/index.native.js:42:7)

  ● Android › improves apply animation performance by dismissing keyboard beforehand

    Unable to find node on an unmounted component.

      36 | 	} );
      37 |
    > 38 | 	describe( 'Media capture options for different media block types', () => {
         | 	             ^
      39 | 		const expectOptionForMediaType = ( mediaType, expectedOption ) => {
      40 | 			const wrapper = render(
      41 | 				<MediaUpload

      at Object.findFn [as findByText] (node_modules/@testing-library/react-native/build/helpers/makeQueries.js:95:35)
      at expectOptionForMediaType (packages/block-editor/src/components/media-upload/test/index.native.js:38:15)
      at Object.<anonymous> (packages/block-editor/src/components/media-upload/test/index.native.js:45:7)

  ● iOS › improves back animation performance by dismissing keyboard beforehand

    Unable to find node on an unmounted component.

      36 | 	} );
      37 |
    > 38 | 	describe( 'Media capture options for different media block types', () => {
         | 	             ^
      39 | 		const expectOptionForMediaType = ( mediaType, expectedOption ) => {
      40 | 			const wrapper = render(
      41 | 				<MediaUpload

      at Object.findFn [as findByText] (node_modules/@testing-library/react-native/build/helpers/makeQueries.js:95:35)
      at expectOptionForMediaType (packages/block-editor/src/components/media-upload/test/index.native.js:38:15)
      at Object.<anonymous> (packages/block-editor/src/components/media-upload/test/index.native.js:48:7)


Test Suites: 1 failed, 57 passed, 58 total
Tests:       2 failed, 3 skipped, 708 passed, 713 total
Snapshots:   84 passed, 84 total

@mchowning
Copy link
Contributor

Adding @fluiddot as a second reviewer here since I'll be AFK for most of next week. Also, Carlos will probably be very helpful with the test improvements you're considering.

@mchowning
Copy link
Contributor

What do you think about also getting up a gutenberg-mobile PR pointing at these changes so we can make sure the CI there is happy?

Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @derekblank, following this comment, I focused on checking the unit tests and found out some parts that might be related to the failures. Let me know if you need help addressing them, thanks 🙇 .

On a different note, I see that the PR is a draft (i.e. not ready to review), so I wanted to check with you if I should proceed reviewing it or wait for further updates.

@@ -52,11 +54,33 @@ describe( 'MediaUpload component', () => {
);
fireEvent.press( wrapper.getByText( 'Open Picker' ) );

wrapper.getByText( expectedOption );
wrapper.findByText( expectedOption );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think part of the failures in the unit tests is related to this line, findByText function returns a Promise so we should update expectOptionForMediaType function to be asynchronous, as well as the test cases where it's used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated expectOptionForMediaType to be asynchronous. Making the other test cases where it is used asynchronous triggered the linter warning rule for jest/expect-expect, which surprised me. The tests pass without using async on these other test cases where expectOptionForMediaType is being called, so I'm not certain if something unintended is happening here.

@@ -33,7 +35,7 @@ describe( 'MediaUpload component', () => {
expect( wrapper ).toBeTruthy();
} );

it( 'shows right media capture option for media type', () => {
describe( 'Media capture options for different media block types', () => {
const expectOptionForMediaType = ( mediaType, expectedOption ) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the function references the word expect, however, I don't see any expect statement within the function. I think we could check if the node returned by wrapper.findByText( expectedOption ) is visible doing something like:

const option = await wrapper.findByText( expectedOption );
expect( option ).toBeVisible();

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As an additional note, I noticed that the second argument's name expectedOption is singular but in the new test cases added (reference), we're passing an array. This might be also producing failures in the unit tests as the ByText query expects either a string or a regular expression, not an array.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think part of the failures in the unit tests is related to this line, findByText function returns a Promise so we should update expectOptionForMediaType function to be asynchronous, as well as the test cases where it's used.

Good callout on making expectOptionForMediaType asynchronous, and also adding an expect statement within the function too. I've added both of these changes.

As an additional note, I noticed that the second argument's name expectedOption is singular but in the new test cases added (reference), we're passing an array. This might be also producing failures in the unit tests as the ByText query expects either a string or a regular expression, not an array.

I think this is a good callout as well. To be honest, I wasn't sure if passing the text strings as an array to expectOptionForMediaType was really improving the tests' code readability, or if it was just making things more complicated. (This is also why the PR is still a draft as I wanted to get some feedback on this approach, so thank you. 🙇 ) After thinking about it a bit more, I think keeping getByText as the query is better, so I used forEach to iterate over each option in the array:

await expectedOptions.forEach( ( item ) => {
    const option = wrapper.getByText( item );
    expect( option ).toBeVisible();
} );

What do you think about this approach @fluiddot ?

Copy link
Contributor

@fluiddot fluiddot Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think this is a good callout as well. To be honest, I wasn't sure if passing the text strings as an array to expectOptionForMediaType was really improving the tests' code readability, or if it was just making things more complicated. (This is also why the PR is still a draft as I wanted to get some feedback on this approach, so thank you. 🙇 )

To be honest, I don't have a strong opinion on whether having that function accepts one option or multiple 🤔 .

Regarding this function, my gut feeling is that the logic could be eventually moved to a generic helper, as it's likely to be used on other test cases. So, in that case, I'd advocate having the one option only so we keep the helper simple, and then let the test cases handle the multiple options case. I think it might even help with the readability of the tests.

After thinking about it a bit more, I think keeping getByText as the query is better, so I used forEach to iterate over each option in the array:

await expectedOptions.forEach( ( item ) => {
    const option = wrapper.getByText( item );
    expect( option ).toBeVisible();
} );

What do you think about this approach @fluiddot ?

I think that's a good approach 👍. The only thing I'd like to mention is that if we use getByText, since it's a synchronous function, we wouldn't need to use await, and probably make expectOptionForMediaType asynchronous.

@fluiddot fluiddot added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Apr 19, 2022
@derekblank
Copy link
Member Author

Thanks for the feedback @mchowning !

In testing this though, when I select a URL to insert into an image or video block, I'm not seeing the block updated with the selected URL (i.e., the block placeholder remains and the block's HTML markup doesn't include the URL). Is this working for you?

No, it is not working for me either on the image and video blocks. I had attributed this to the differences between native and the Gutenberg Mobile demo app, and hadn't yet tested the Audio block (where Insert from URL it is working). Looking at the Audio block code, it looks the Image and Video blocks will need similar code to trigger the onSelect. I had a feeling that adding the Insert from URL option to the Media Upload options was a deceptively simple code change. 😅 So, that should be the next step for this task and PR. I also made a note to discuss HTML markup for blocks more in-depth during our next 1:1.

It looks like with the current implementation the capability to upload audio and __experimentalOnlyMediaLibrary are the only two dynamic influences on the media options for Gutenberg mobile. I think capturing that behavior is all you need to worry about. Making the options more dynamic than they are now is something I'm already working on in #39769, so I don't think you need to handle that.

Sounds good! I'll definitely check out those tests in your PR as well. 👍

@derekblank
Copy link
Member Author

derekblank commented Apr 27, 2022

@mchowning A couple of things to discuss:

  • I've updated the Image and Video files to receive the correct file from MediaUpload. Both blocks are now receiving the correct file back to the component. The Image block is working great for me to show the new image and update the block's HTML. The Video block is showing the correct file change in the Javascript, but the change is not reflected in the UI when using the Gutenberg Mobile Demo app. Simply, nothing happens. This behavior is the same for me for all of the other Media Select options for the Video block (Take a Video, Upload from Device, Wordpress Media Library). I had only tested with the Gutenberg Mobile Demo app, so perhaps this is expected and requires testing in one of the native apps. If so, we can discuss best practices for testing local Gutenberg changes in the native apps, which I have a few questions about anyways.
  • When an invalid URL is given to the Image and Video blocks, I was trying to match the error state precedent given by the Audio block, which uses createErrorNotice (and useDispatch) to send an error message: "Invalid URL. Audio file not found". However, the Audio block is a functional component and the Image and Video blocks are class components, so the useDispatch hook can't be used for Image and Video without refactoring them to be functional components. That's an option perhaps for a later PR, but I was searching for a convention that could send a similar error notice from a class component using withDispatch. (Reference for where this might occur in the Image component from this PR.) Is this UI pattern for sending error notices still used in class based components? Another alternative would be to consider that perhaps this is not a significant use case and just let the URL handling fail silently if it is not a valid URL. Open to other ideas I haven't considered yet as well. (@fluiddot may have encountered this before, too.) Here's a visual reference from the Audio block:
    Screenshot_20220427-164803


if ( payload !== attributes.src ) {
if ( isURL( payload ) ) {
setAttributes( { url: payload, id: undefined } );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be setting src instead of url here?

const { attributes, setAttributes } = this.props;

if ( payload !== attributes.src ) {
if ( isURL( payload ) ) {
Copy link
Contributor

@mchowning mchowning Apr 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The web implementation first checks if the url can be converted into an embed. I think we'll need to do something similar in order to handle things like Youtube links well?

@mchowning
Copy link
Contributor

mchowning commented Apr 27, 2022

👋 Derek! Nice progress on this. 😄

The Video block is showing the correct file change in the Javascript, but the change is not reflected in the UI when using the Gutenberg Mobile Demo app. Simply, nothing happens.

I think this is because the render method returns early with the placeholder if the id attribute is undefined, and we're not setting an id when inserting a URL (because we don't have one). Might be worth checking the web implementation to see how they handle this.

This behavior is the same for me for all of the other Media Select options for the Video block (Take a Video, Upload from Device, Wordpress Media Library). I had only tested with the Gutenberg Mobile Demo app, so perhaps this is expected and requires testing in one of the native apps.

You've got good instincts here. 🙂 Those other media options are pretty closely tied to native, and for anything that is closely tied to native it's a good idea to test it using the WordPress apps because the demo app doesn't support a lot of them (and I believe the Android demo app actually supports even fewer of them than the iOS demo app). FWIW though, I think we probably can get the "Insert from URL" functionality working in the demo app.

the useDispatch hook can't be used for Image and Video without refactoring them to be functional components. That's an option perhaps for a later PR...

👍 That would be a great improvement but I agree, let's not worry about it in this PR.

...so I was searching for a convention that could send a similar error notice from a class component using withDispatch.

It looks like the file block is still a class-based component and has some error handling. Do you think we can use anything from that here?

Another alternative would be to consider that perhaps this is not a significant use case and just let the URL handling fail silently if it is not a valid URL.

I think we need to do something to inform the user what has gone wrong, otherwise it would be pretty frustrating if you thought you had a valid URL.

The video block side of this is obviously turning out to be a fair bit more complicated. I don't feel strongly either way at this point, but if it continues being difficult, it might be worth pulling the Video block changes out and putting them into a separate PR.

@derekblank derekblank force-pushed the rnmobile/add-url-option-to-video-and-image-blocks branch from 067174f to 760b9cf Compare April 28, 2022 02:31
@derekblank derekblank changed the title Add 'Insert from URL' option to Video and Image blocks Add 'Insert from URL' option Image block Apr 28, 2022
Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@derekblank I tested the PR again and is working nice 🎊 . However, before approving it, it would be great if we could review the comment regarding setting the width and height of the image I added. Let me know if you'd like to expand information about it, thanks 🙇 .

packages/block-library/src/image/edit.native.js Outdated Show resolved Hide resolved
packages/block-library/src/image/edit.native.js Outdated Show resolved Hide resolved
@derekblank
Copy link
Member Author

Thanks for the review @fluiddot! I updated and responded to the final comment regarding the image dimensions for the web. With that change done, I've re-tested all of the flows for web and native using "Insert from URL" on the Image block, and did not note any other issues. If your testing experience is the same, I think we could say that any further issues should be handled via another PR. 🚀

I'll be creating a "retro" post of sorts to add to my onboarding P2 reflecting on what went well with this PR and what I can improve for next time. Feel free to consider anything you might have to add and include it here, or on the post when it is created. As always, your review and feedback is much appreciated! 🙇

Copy link
Contributor

@fluiddot fluiddot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @fluiddot! I updated and responded to the final comment regarding the image dimensions for the web. With that change done, I've re-tested all of the flows for web and native using "Insert from URL" on the Image block, and did not note any other issues. If your testing experience is the same, I think we could say that any further issues should be handled via another PR. 🚀

@derekblank thanks for addressing all the issues 🙇 , I re-tested the changes and confirm that I haven't found further issues, so the PR is ready to be merged 🎊 !

As an additional note, it might be interesting if in the future we also add the Insert from URL option to the Gallery block. I noticed that with these changes, it allows to insert an image from an URL for already added items but not for new ones.

ios-gallery-block-insert-url.mp4

@fluiddot
Copy link
Contributor

I've just realized that we didn't receive feedback from @iamthomasbishop regarding the loading indicator, Thomas, could you take a quick look when you're available? Thanks 🙇 !

Sharing here a couple of screenshots to showcase how the loading indicator looks with these changes:

Empty Image block Image block with an image

Note that this loading indicator is only shown after inserting the URL of an image, while the editor checks if the image exists (this behavior can also be checked in the video capture of this comment).

@iamthomasbishop
Copy link

@fluiddot @derekblank Thanks for the pings! The loading indicators look okay as-is, although I'd like to propose some refinements:

  • The iOS one in particular looks a bit weak in terms of contrast. Do we have control over the color/style of the loading indicators? If so, I'd suggest that we make the base color white on iOS. For Android, I would suggest that we change the base color from the standard green-ish to our primary accent blue (blue 50 in light, blue 30 in dark). Note: my suggestion assumes that the scrim/overlay is always dark — if we're inverting the overlay between appearance modes, we'd also invert the colors mentioned above)
  • The indicators look a bit small (especially on Android) so I think we might want to increase the size of both slightly (by either 1.5x or 2x), but let's try implementing the color details I mentioned above first to see if that is sufficient. I haven't tried this on a device yet so it might be less of a concern on-device.

@derekblank
Copy link
Member Author

As an additional note, it might be interesting if in the future we also add the Insert from URL option to the Gallery block. I noticed that with these changes, it allows to insert an image from an URL for already added items but not for new ones.

@fluiddot I agree - I've added issues to update blocks that use nested Image blocks, starting with the Gallery block, but also including the Cover/Media & Text blocks:

@derekblank
Copy link
Member Author

@fluiddot @derekblank Thanks for the pings! The loading indicators look okay as-is, although I'd like to propose some refinements

Thanks for the feedback @iamthomasbishop! I agree that your style suggestions would improve the visibility of the loading indicators. This loading indicator pattern could potentially be used (and standardized) across a handful of other blocks that fetch media using network requests, too. Rather than implement ad hoc style updates for the Image block alone here, I think it would be good to move the broader discussion to an issue that considers the loading indicators to be a shared style that can be reused across these other blocks, so I've created that issue here: Use shared loading indicator styles. I've added your comment from above to that issue to kick off the design discussion. Let me know if you have any further thoughts, of course.

@derekblank derekblank force-pushed the rnmobile/add-url-option-to-video-and-image-blocks branch from 334fa44 to ae02763 Compare May 23, 2022 11:01
@fluiddot
Copy link
Contributor

@derekblank Since you don't have permission to merge this PR and all PR checks are 🟢 , I'll go ahead and merge it 🎊 .

@fluiddot fluiddot merged commit 20f6ca5 into WordPress:trunk May 23, 2022
@github-actions github-actions bot added this to the Gutenberg 13.4 milestone May 23, 2022
@iamthomasbishop
Copy link

Rather than implement ad hoc style updates for the Image block alone here, I think it would be good to move the broader discussion to an issue that considers the loading indicators to be a shared style that can be reused across these other blocks, so I've created that issue here

@derekblank sounds good, and thank you!

westonruter added a commit that referenced this pull request May 23, 2022
…p-tests-config

* 'trunk' of github.com:WordPress/gutenberg: (88 commits)
  Components: refactor `AlignmentMatrixControl` to pass `exhaustive-deps` (#41167)
  [RNMobile] Add 'Insert from URL' option to Image block (#40334)
  [RNMobile] Improvements to Getting Started Guides (#40964)
  Post Author Name: Add to and from Post Author transformations (#41151)
  CheckboxControl: Add unit tests (#41165)
  Improve inline documentation (#41209)
  Mobile Release v1.76.1 (#41196)
  Use explicit type definitions for entity configuration (#40995)
  Scripts: Convert file extension to js in `block.json` during build (#41068)
  Reflects revert in 6446878 (#41221)
  get_style_nodes should be compatible with parent method. (#41217)
  Gallery: Opt-in to axial (column/row) block spacing controls (#41175)
  Table of Contents block: convert line breaks to spaces in headings. (#41206)
  Add support for button elements to theme.json (#40260)
  Global Styles: Load block CSS conditionally (#41160)
  Update URL (#41188)
  Improve autocompleter performance (#41197)
  Site Editor: Set min-width for styles preview (#41198)
  Remove Navigation Editor screen from experiments page (#40878)
  Fix broken Page title for pages created inline within in Nav block (#41063)
  ...
SiobhyB pushed a commit that referenced this pull request May 24, 2022
* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>
fluiddot added a commit that referenced this pull request Jun 3, 2022
* Release script: Update react-native-editor version to 1.76.0

* Release script: Update with changes from 'npm run core preios'

* Update Changelog

* Release script: Update react-native-editor version to 1.76.1

* Release script: Update with changes from 'npm run core preios'

* [Mobile] - BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell (#41105)

* Mobile - BlockList - Pass FlatList internal onLayout through CellRendererComponent

* Mobile - Update onLayout naming for BlockListItemCell

* [Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages (#41053)

* Mobile - Fix - Drag & drop chip issue with RTL languages

* Mobile - BlockDraggable - Rename maxWidth variable to contentWidth

* Mobile - BlockDraggable - Add custom exiting animation that uses the same functionality as ZoomOutEasyDown but customizing the translateX value taking into account RTL languages.

* [RNMobile] Add drag & drop help guide in Help & Support screen (#40961)

* Add drag & drop help guide

* Update content of help screen related to moving blocks

* Update drand-and-drop images

* Update styles of heading component of help screen

* Add HelpDetailBadge component

This component will be rendered in `HelpDetailSectionHeadingText` component via the `badge` prop.

* Add NEW badge to move blocks help section

* Optimize drag-and-drop images

* Add move-blocks icon to Help & Support screen

* Update react-native-editor changelog

* Add HelpSectionTitle component

* Prevent rendering separator on last help topic item

* [RNMobile] Fix drag mode not being enabled when long-pressing over Shortcode block (#41155)

* Add prop for disabling suggestions button

* Use allowed formats in format types calculation

* Add RichText version to PlainText component

* Use experimental version of PlainText in Shortcode block

* Add disableAutocorrection prop to RichText

* Disable autocorrection in Shortcode block

* Update PlainText props in Shortcode block

* Use pre as tagName in PlainText

* Rename replaceLineBreaks function

* Update shortcode block unit tests

* Prevent text input focus when selecting Shortcode block

* Force text color in Shortcode block

* Remove tagName prop from PlainText component

* Mobile - Update changelog

* Translate NEW badge in Move blocks help screen

* Release script: Update react-native-editor version to 1.77.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Improve text read by screen readers for BottomSheetSelectControl  (#41036)

Improves the text that's read by screen readers by the BottomSheetSelectControl component, adding extra context and making its purpose clearer.

* [RNMobile] Add 'Insert from URL' option to Image block (#40334)

* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>

* [RNMobile] - E2E Simplify heading and lists blocks functions (#40670)

* update tests using paragraph, heading and list blocks

* fix slash inserter tests to work in ci

* lint fixes

* wait for ordered list to appear

* lint fixes

* extra click only on local env

* wait to get backspace click reflected

* re-add extra click only for local env

* add wait to wait for backspace key to be reflected

* lint fixes

* break function, set position to get list block

* lint fixes

* use correct params, update function name

* lint fixes

* make maxIteration a parameter for isElementVisible

* update xpath for list block

* utilize waitForVisible for isElementVisible

* lint fixes

* add wait to getNumberOfParagraphBlocks and update xpath for android list block

* update edit text xpath to be read from any level

Co-authored-by: jos <[email protected]>

* Add ruby version file (#41013)

Use same version of ruby that is used on WP iOS

* [RNMobile] Improvements to Getting Started Guides (#40964)

* Update with copy from Gutenberg Mobile

Gutenberg Mobile's readme had some copy in the troubleshooting section that wasn't included in Gutenberg's how-to: https://github.com/wordpress-mobile/gutenberg-mobile/edit/trunk/README.md

This commit fixes that issue by updating Gutenberg's how-to with the latest from Gutenberg Mobile.

* Tweak wording, update inconsistent capitalisation

* Tweaks to copy and formatting

With this commit, I've tidied up some of the copy, attempting to make the instructions as concise and helpful as possible. I've also set the images to the same width to tidy up the overall look of the document (the images will appear small on mobile devices, but can be tapped on to get the full image).

* Set all images to fixed width, for consistency

* Rearrange sections to improve overall flow

- The "Unit Tests" is moved towards the bottom of the document, so that's it's closer to the instructions for integration tests. the document flows as follows:
- The steps for installing Xcode are moved under the "iOS" section.
- The overall flow of the document has been updated to the following: Clone Gutenberg > iOS > Android > Tests

* Add details about recommended JDK

* Add details about Cocoapods

* Refine instructions for installing Cocoapods

* Note `ffi` may already be installed

Some versions of Ruby may not require the `ffi` to be manually installed, which is noted with this commit.

* update expected html for file block (#41300)

Co-authored-by: jos <[email protected]>

* Add waitForVisible() to all blocks (#41126)

* add waits to all block - 1st try

* fix failing tests

* correct if else condition

* fix failing cover block test

* update spaces

* update to use new click helper

* wait for blocks to be visible first in getFirstBlock and getLastBlock

* remove length as a parameter

* update timing for long press since it's failing intermittently in ci

* remove deleted param, revert space changes

* remove redundant code

* exit function once condition is met

* increse wait time for long press

* remove unneccesary condition, update message, return click value

Co-authored-by: jos <[email protected]>

* Update CHANGELOG

* Revert "update expected html for file block (#41300)"

This reverts commit a046a61.

* [RNMobile] Ensure post title gets focused when is notified from native side (#41371)

* Release script: Update react-native-editor version to 1.77.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (#41482)

* Update react-native-editor changelog

Co-authored-by: jhnstn <[email protected]>
Co-authored-by: Gerardo <[email protected]>
Co-authored-by: Siobhan <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Jos <[email protected]>
Co-authored-by: jos <[email protected]>
Co-authored-by: Jason Johnston <[email protected]>
fluiddot added a commit that referenced this pull request Jun 13, 2022
* Release script: Update react-native-editor version to 1.76.0

* Release script: Update with changes from 'npm run core preios'

* Update Changelog

* Release script: Update react-native-editor version to 1.76.1

* Release script: Update with changes from 'npm run core preios'

* [Mobile] - BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell (#41105)

* Mobile - BlockList - Pass FlatList internal onLayout through CellRendererComponent

* Mobile - Update onLayout naming for BlockListItemCell

* [Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages (#41053)

* Mobile - Fix - Drag & drop chip issue with RTL languages

* Mobile - BlockDraggable - Rename maxWidth variable to contentWidth

* Mobile - BlockDraggable - Add custom exiting animation that uses the same functionality as ZoomOutEasyDown but customizing the translateX value taking into account RTL languages.

* [RNMobile] Add drag & drop help guide in Help & Support screen (#40961)

* Add drag & drop help guide

* Update content of help screen related to moving blocks

* Update drand-and-drop images

* Update styles of heading component of help screen

* Add HelpDetailBadge component

This component will be rendered in `HelpDetailSectionHeadingText` component via the `badge` prop.

* Add NEW badge to move blocks help section

* Optimize drag-and-drop images

* Add move-blocks icon to Help & Support screen

* Update react-native-editor changelog

* Add HelpSectionTitle component

* Prevent rendering separator on last help topic item

* [RNMobile] Fix drag mode not being enabled when long-pressing over Shortcode block (#41155)

* Add prop for disabling suggestions button

* Use allowed formats in format types calculation

* Add RichText version to PlainText component

* Use experimental version of PlainText in Shortcode block

* Add disableAutocorrection prop to RichText

* Disable autocorrection in Shortcode block

* Update PlainText props in Shortcode block

* Use pre as tagName in PlainText

* Rename replaceLineBreaks function

* Update shortcode block unit tests

* Prevent text input focus when selecting Shortcode block

* Force text color in Shortcode block

* Remove tagName prop from PlainText component

* Mobile - Update changelog

* Translate NEW badge in Move blocks help screen

* Release script: Update react-native-editor version to 1.77.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Improve text read by screen readers for BottomSheetSelectControl  (#41036)

Improves the text that's read by screen readers by the BottomSheetSelectControl component, adding extra context and making its purpose clearer.

* [RNMobile] Add 'Insert from URL' option to Image block (#40334)

* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>

* [RNMobile] - E2E Simplify heading and lists blocks functions (#40670)

* update tests using paragraph, heading and list blocks

* fix slash inserter tests to work in ci

* lint fixes

* wait for ordered list to appear

* lint fixes

* extra click only on local env

* wait to get backspace click reflected

* re-add extra click only for local env

* add wait to wait for backspace key to be reflected

* lint fixes

* break function, set position to get list block

* lint fixes

* use correct params, update function name

* lint fixes

* make maxIteration a parameter for isElementVisible

* update xpath for list block

* utilize waitForVisible for isElementVisible

* lint fixes

* add wait to getNumberOfParagraphBlocks and update xpath for android list block

* update edit text xpath to be read from any level

Co-authored-by: jos <[email protected]>

* Add ruby version file (#41013)

Use same version of ruby that is used on WP iOS

* [RNMobile] Improvements to Getting Started Guides (#40964)

* Update with copy from Gutenberg Mobile

Gutenberg Mobile's readme had some copy in the troubleshooting section that wasn't included in Gutenberg's how-to: https://github.com/wordpress-mobile/gutenberg-mobile/edit/trunk/README.md

This commit fixes that issue by updating Gutenberg's how-to with the latest from Gutenberg Mobile.

* Tweak wording, update inconsistent capitalisation

* Tweaks to copy and formatting

With this commit, I've tidied up some of the copy, attempting to make the instructions as concise and helpful as possible. I've also set the images to the same width to tidy up the overall look of the document (the images will appear small on mobile devices, but can be tapped on to get the full image).

* Set all images to fixed width, for consistency

* Rearrange sections to improve overall flow

- The "Unit Tests" is moved towards the bottom of the document, so that's it's closer to the instructions for integration tests. the document flows as follows:
- The steps for installing Xcode are moved under the "iOS" section.
- The overall flow of the document has been updated to the following: Clone Gutenberg > iOS > Android > Tests

* Add details about recommended JDK

* Add details about Cocoapods

* Refine instructions for installing Cocoapods

* Note `ffi` may already be installed

Some versions of Ruby may not require the `ffi` to be manually installed, which is noted with this commit.

* update expected html for file block (#41300)

Co-authored-by: jos <[email protected]>

* Add waitForVisible() to all blocks (#41126)

* add waits to all block - 1st try

* fix failing tests

* correct if else condition

* fix failing cover block test

* update spaces

* update to use new click helper

* wait for blocks to be visible first in getFirstBlock and getLastBlock

* remove length as a parameter

* update timing for long press since it's failing intermittently in ci

* remove deleted param, revert space changes

* remove redundant code

* exit function once condition is met

* increse wait time for long press

* remove unneccesary condition, update message, return click value

Co-authored-by: jos <[email protected]>

* Update CHANGELOG

* Revert "update expected html for file block (#41300)"

This reverts commit a046a61.

* [RNMobile] Ensure post title gets focused when is notified from native side (#41371)

* Release script: Update react-native-editor version to 1.77.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (#41482)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-gesture-handler` to version `2.3.2` (#41337)

* Update react-native-editor changelog

* Remove react-native-editor changelog duplicate entries

Co-authored-by: jhnstn <[email protected]>
Co-authored-by: Gerardo <[email protected]>
Co-authored-by: Siobhan <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Jos <[email protected]>
Co-authored-by: jos <[email protected]>
Co-authored-by: Jason Johnston <[email protected]>
jhnstn added a commit to jhnstn/gutenberg that referenced this pull request Jun 15, 2022
* Release script: Update react-native-editor version to 1.76.0

* Release script: Update with changes from 'npm run core preios'

* Update Changelog

* Release script: Update react-native-editor version to 1.76.1

* Release script: Update with changes from 'npm run core preios'

* [Mobile] - BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell (WordPress#41105)

* Mobile - BlockList - Pass FlatList internal onLayout through CellRendererComponent

* Mobile - Update onLayout naming for BlockListItemCell

* [Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages (WordPress#41053)

* Mobile - Fix - Drag & drop chip issue with RTL languages

* Mobile - BlockDraggable - Rename maxWidth variable to contentWidth

* Mobile - BlockDraggable - Add custom exiting animation that uses the same functionality as ZoomOutEasyDown but customizing the translateX value taking into account RTL languages.

* [RNMobile] Add drag & drop help guide in Help & Support screen (WordPress#40961)

* Add drag & drop help guide

* Update content of help screen related to moving blocks

* Update drand-and-drop images

* Update styles of heading component of help screen

* Add HelpDetailBadge component

This component will be rendered in `HelpDetailSectionHeadingText` component via the `badge` prop.

* Add NEW badge to move blocks help section

* Optimize drag-and-drop images

* Add move-blocks icon to Help & Support screen

* Update react-native-editor changelog

* Add HelpSectionTitle component

* Prevent rendering separator on last help topic item

* [RNMobile] Fix drag mode not being enabled when long-pressing over Shortcode block (WordPress#41155)

* Add prop for disabling suggestions button

* Use allowed formats in format types calculation

* Add RichText version to PlainText component

* Use experimental version of PlainText in Shortcode block

* Add disableAutocorrection prop to RichText

* Disable autocorrection in Shortcode block

* Update PlainText props in Shortcode block

* Use pre as tagName in PlainText

* Rename replaceLineBreaks function

* Update shortcode block unit tests

* Prevent text input focus when selecting Shortcode block

* Force text color in Shortcode block

* Remove tagName prop from PlainText component

* Mobile - Update changelog

* Translate NEW badge in Move blocks help screen

* Release script: Update react-native-editor version to 1.77.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Improve text read by screen readers for BottomSheetSelectControl  (WordPress#41036)

Improves the text that's read by screen readers by the BottomSheetSelectControl component, adding extra context and making its purpose clearer.

* [RNMobile] Add 'Insert from URL' option to Image block (WordPress#40334)

* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>

* [RNMobile] - E2E Simplify heading and lists blocks functions (WordPress#40670)

* update tests using paragraph, heading and list blocks

* fix slash inserter tests to work in ci

* lint fixes

* wait for ordered list to appear

* lint fixes

* extra click only on local env

* wait to get backspace click reflected

* re-add extra click only for local env

* add wait to wait for backspace key to be reflected

* lint fixes

* break function, set position to get list block

* lint fixes

* use correct params, update function name

* lint fixes

* make maxIteration a parameter for isElementVisible

* update xpath for list block

* utilize waitForVisible for isElementVisible

* lint fixes

* add wait to getNumberOfParagraphBlocks and update xpath for android list block

* update edit text xpath to be read from any level

Co-authored-by: jos <[email protected]>

* Add ruby version file (WordPress#41013)

Use same version of ruby that is used on WP iOS

* [RNMobile] Improvements to Getting Started Guides (WordPress#40964)

* Update with copy from Gutenberg Mobile

Gutenberg Mobile's readme had some copy in the troubleshooting section that wasn't included in Gutenberg's how-to: https://github.com/wordpress-mobile/gutenberg-mobile/edit/trunk/README.md

This commit fixes that issue by updating Gutenberg's how-to with the latest from Gutenberg Mobile.

* Tweak wording, update inconsistent capitalisation

* Tweaks to copy and formatting

With this commit, I've tidied up some of the copy, attempting to make the instructions as concise and helpful as possible. I've also set the images to the same width to tidy up the overall look of the document (the images will appear small on mobile devices, but can be tapped on to get the full image).

* Set all images to fixed width, for consistency

* Rearrange sections to improve overall flow

- The "Unit Tests" is moved towards the bottom of the document, so that's it's closer to the instructions for integration tests. the document flows as follows:
- The steps for installing Xcode are moved under the "iOS" section.
- The overall flow of the document has been updated to the following: Clone Gutenberg > iOS > Android > Tests

* Add details about recommended JDK

* Add details about Cocoapods

* Refine instructions for installing Cocoapods

* Note `ffi` may already be installed

Some versions of Ruby may not require the `ffi` to be manually installed, which is noted with this commit.

* update expected html for file block (WordPress#41300)

Co-authored-by: jos <[email protected]>

* Add waitForVisible() to all blocks (WordPress#41126)

* add waits to all block - 1st try

* fix failing tests

* correct if else condition

* fix failing cover block test

* update spaces

* update to use new click helper

* wait for blocks to be visible first in getFirstBlock and getLastBlock

* remove length as a parameter

* update timing for long press since it's failing intermittently in ci

* remove deleted param, revert space changes

* remove redundant code

* exit function once condition is met

* increse wait time for long press

* remove unneccesary condition, update message, return click value

Co-authored-by: jos <[email protected]>

* Update CHANGELOG

* Revert "update expected html for file block (WordPress#41300)"

This reverts commit a046a61.

* [RNMobile] Ensure post title gets focused when is notified from native side (WordPress#41371)

* Release script: Update react-native-editor version to 1.77.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (WordPress#41482)

* Update react-native-editor changelog

Co-authored-by: jhnstn <[email protected]>
Co-authored-by: Gerardo <[email protected]>
Co-authored-by: Siobhan <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Jos <[email protected]>
Co-authored-by: jos <[email protected]>
Co-authored-by: Jason Johnston <[email protected]>
jhnstn added a commit to jhnstn/gutenberg that referenced this pull request Jun 15, 2022
* Release script: Update react-native-editor version to 1.76.0

* Release script: Update with changes from 'npm run core preios'

* Update Changelog

* Release script: Update react-native-editor version to 1.76.1

* Release script: Update with changes from 'npm run core preios'

* [Mobile] - BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell (WordPress#41105)

* Mobile - BlockList - Pass FlatList internal onLayout through CellRendererComponent

* Mobile - Update onLayout naming for BlockListItemCell

* [Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages (WordPress#41053)

* Mobile - Fix - Drag & drop chip issue with RTL languages

* Mobile - BlockDraggable - Rename maxWidth variable to contentWidth

* Mobile - BlockDraggable - Add custom exiting animation that uses the same functionality as ZoomOutEasyDown but customizing the translateX value taking into account RTL languages.

* [RNMobile] Add drag & drop help guide in Help & Support screen (WordPress#40961)

* Add drag & drop help guide

* Update content of help screen related to moving blocks

* Update drand-and-drop images

* Update styles of heading component of help screen

* Add HelpDetailBadge component

This component will be rendered in `HelpDetailSectionHeadingText` component via the `badge` prop.

* Add NEW badge to move blocks help section

* Optimize drag-and-drop images

* Add move-blocks icon to Help & Support screen

* Update react-native-editor changelog

* Add HelpSectionTitle component

* Prevent rendering separator on last help topic item

* [RNMobile] Fix drag mode not being enabled when long-pressing over Shortcode block (WordPress#41155)

* Add prop for disabling suggestions button

* Use allowed formats in format types calculation

* Add RichText version to PlainText component

* Use experimental version of PlainText in Shortcode block

* Add disableAutocorrection prop to RichText

* Disable autocorrection in Shortcode block

* Update PlainText props in Shortcode block

* Use pre as tagName in PlainText

* Rename replaceLineBreaks function

* Update shortcode block unit tests

* Prevent text input focus when selecting Shortcode block

* Force text color in Shortcode block

* Remove tagName prop from PlainText component

* Mobile - Update changelog

* Translate NEW badge in Move blocks help screen

* Release script: Update react-native-editor version to 1.77.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Improve text read by screen readers for BottomSheetSelectControl  (WordPress#41036)

Improves the text that's read by screen readers by the BottomSheetSelectControl component, adding extra context and making its purpose clearer.

* [RNMobile] Add 'Insert from URL' option to Image block (WordPress#40334)

* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>

* [RNMobile] - E2E Simplify heading and lists blocks functions (WordPress#40670)

* update tests using paragraph, heading and list blocks

* fix slash inserter tests to work in ci

* lint fixes

* wait for ordered list to appear

* lint fixes

* extra click only on local env

* wait to get backspace click reflected

* re-add extra click only for local env

* add wait to wait for backspace key to be reflected

* lint fixes

* break function, set position to get list block

* lint fixes

* use correct params, update function name

* lint fixes

* make maxIteration a parameter for isElementVisible

* update xpath for list block

* utilize waitForVisible for isElementVisible

* lint fixes

* add wait to getNumberOfParagraphBlocks and update xpath for android list block

* update edit text xpath to be read from any level

Co-authored-by: jos <[email protected]>

* Add ruby version file (WordPress#41013)

Use same version of ruby that is used on WP iOS

* [RNMobile] Improvements to Getting Started Guides (WordPress#40964)

* Update with copy from Gutenberg Mobile

Gutenberg Mobile's readme had some copy in the troubleshooting section that wasn't included in Gutenberg's how-to: https://github.com/wordpress-mobile/gutenberg-mobile/edit/trunk/README.md

This commit fixes that issue by updating Gutenberg's how-to with the latest from Gutenberg Mobile.

* Tweak wording, update inconsistent capitalisation

* Tweaks to copy and formatting

With this commit, I've tidied up some of the copy, attempting to make the instructions as concise and helpful as possible. I've also set the images to the same width to tidy up the overall look of the document (the images will appear small on mobile devices, but can be tapped on to get the full image).

* Set all images to fixed width, for consistency

* Rearrange sections to improve overall flow

- The "Unit Tests" is moved towards the bottom of the document, so that's it's closer to the instructions for integration tests. the document flows as follows:
- The steps for installing Xcode are moved under the "iOS" section.
- The overall flow of the document has been updated to the following: Clone Gutenberg > iOS > Android > Tests

* Add details about recommended JDK

* Add details about Cocoapods

* Refine instructions for installing Cocoapods

* Note `ffi` may already be installed

Some versions of Ruby may not require the `ffi` to be manually installed, which is noted with this commit.

* update expected html for file block (WordPress#41300)

Co-authored-by: jos <[email protected]>

* Add waitForVisible() to all blocks (WordPress#41126)

* add waits to all block - 1st try

* fix failing tests

* correct if else condition

* fix failing cover block test

* update spaces

* update to use new click helper

* wait for blocks to be visible first in getFirstBlock and getLastBlock

* remove length as a parameter

* update timing for long press since it's failing intermittently in ci

* remove deleted param, revert space changes

* remove redundant code

* exit function once condition is met

* increse wait time for long press

* remove unneccesary condition, update message, return click value

Co-authored-by: jos <[email protected]>

* Update CHANGELOG

* Revert "update expected html for file block (WordPress#41300)"

This reverts commit a046a61.

* [RNMobile] Ensure post title gets focused when is notified from native side (WordPress#41371)

* Release script: Update react-native-editor version to 1.77.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (WordPress#41482)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-gesture-handler` to version `2.3.2` (WordPress#41337)

* Update react-native-editor changelog

* Remove react-native-editor changelog duplicate entries

Co-authored-by: jhnstn <[email protected]>
Co-authored-by: Gerardo <[email protected]>
Co-authored-by: Siobhan <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Jos <[email protected]>
Co-authored-by: jos <[email protected]>
Co-authored-by: Jason Johnston <[email protected]>
fluiddot added a commit that referenced this pull request Jun 17, 2022
* Release script: Update react-native-editor version to 1.76.0

* Release script: Update with changes from 'npm run core preios'

* Update Changelog

* Release script: Update react-native-editor version to 1.76.1

* Release script: Update with changes from 'npm run core preios'

* [Mobile] - BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell (#41105)

* Mobile - BlockList - Pass FlatList internal onLayout through CellRendererComponent

* Mobile - Update onLayout naming for BlockListItemCell

* [Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages (#41053)

* Mobile - Fix - Drag & drop chip issue with RTL languages

* Mobile - BlockDraggable - Rename maxWidth variable to contentWidth

* Mobile - BlockDraggable - Add custom exiting animation that uses the same functionality as ZoomOutEasyDown but customizing the translateX value taking into account RTL languages.

* [RNMobile] Add drag & drop help guide in Help & Support screen (#40961)

* Add drag & drop help guide

* Update content of help screen related to moving blocks

* Update drand-and-drop images

* Update styles of heading component of help screen

* Add HelpDetailBadge component

This component will be rendered in `HelpDetailSectionHeadingText` component via the `badge` prop.

* Add NEW badge to move blocks help section

* Optimize drag-and-drop images

* Add move-blocks icon to Help & Support screen

* Update react-native-editor changelog

* Add HelpSectionTitle component

* Prevent rendering separator on last help topic item

* [RNMobile] Fix drag mode not being enabled when long-pressing over Shortcode block (#41155)

* Add prop for disabling suggestions button

* Use allowed formats in format types calculation

* Add RichText version to PlainText component

* Use experimental version of PlainText in Shortcode block

* Add disableAutocorrection prop to RichText

* Disable autocorrection in Shortcode block

* Update PlainText props in Shortcode block

* Use pre as tagName in PlainText

* Rename replaceLineBreaks function

* Update shortcode block unit tests

* Prevent text input focus when selecting Shortcode block

* Force text color in Shortcode block

* Remove tagName prop from PlainText component

* Mobile - Update changelog

* Translate NEW badge in Move blocks help screen

* Release script: Update react-native-editor version to 1.77.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Improve text read by screen readers for BottomSheetSelectControl  (#41036)

Improves the text that's read by screen readers by the BottomSheetSelectControl component, adding extra context and making its purpose clearer.

* [RNMobile] Add 'Insert from URL' option to Image block (#40334)

* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>

* [RNMobile] - E2E Simplify heading and lists blocks functions (#40670)

* update tests using paragraph, heading and list blocks

* fix slash inserter tests to work in ci

* lint fixes

* wait for ordered list to appear

* lint fixes

* extra click only on local env

* wait to get backspace click reflected

* re-add extra click only for local env

* add wait to wait for backspace key to be reflected

* lint fixes

* break function, set position to get list block

* lint fixes

* use correct params, update function name

* lint fixes

* make maxIteration a parameter for isElementVisible

* update xpath for list block

* utilize waitForVisible for isElementVisible

* lint fixes

* add wait to getNumberOfParagraphBlocks and update xpath for android list block

* update edit text xpath to be read from any level

Co-authored-by: jos <[email protected]>

* Add ruby version file (#41013)

Use same version of ruby that is used on WP iOS

* [RNMobile] Improvements to Getting Started Guides (#40964)

* Update with copy from Gutenberg Mobile

Gutenberg Mobile's readme had some copy in the troubleshooting section that wasn't included in Gutenberg's how-to: https://github.com/wordpress-mobile/gutenberg-mobile/edit/trunk/README.md

This commit fixes that issue by updating Gutenberg's how-to with the latest from Gutenberg Mobile.

* Tweak wording, update inconsistent capitalisation

* Tweaks to copy and formatting

With this commit, I've tidied up some of the copy, attempting to make the instructions as concise and helpful as possible. I've also set the images to the same width to tidy up the overall look of the document (the images will appear small on mobile devices, but can be tapped on to get the full image).

* Set all images to fixed width, for consistency

* Rearrange sections to improve overall flow

- The "Unit Tests" is moved towards the bottom of the document, so that's it's closer to the instructions for integration tests. the document flows as follows:
- The steps for installing Xcode are moved under the "iOS" section.
- The overall flow of the document has been updated to the following: Clone Gutenberg > iOS > Android > Tests

* Add details about recommended JDK

* Add details about Cocoapods

* Refine instructions for installing Cocoapods

* Note `ffi` may already be installed

Some versions of Ruby may not require the `ffi` to be manually installed, which is noted with this commit.

* update expected html for file block (#41300)

Co-authored-by: jos <[email protected]>

* Add waitForVisible() to all blocks (#41126)

* add waits to all block - 1st try

* fix failing tests

* correct if else condition

* fix failing cover block test

* update spaces

* update to use new click helper

* wait for blocks to be visible first in getFirstBlock and getLastBlock

* remove length as a parameter

* update timing for long press since it's failing intermittently in ci

* remove deleted param, revert space changes

* remove redundant code

* exit function once condition is met

* increse wait time for long press

* remove unneccesary condition, update message, return click value

Co-authored-by: jos <[email protected]>

* Update CHANGELOG

* Revert "update expected html for file block (#41300)"

This reverts commit a046a61.

* [RNMobile] Ensure post title gets focused when is notified from native side (#41371)

* Release script: Update react-native-editor version to 1.77.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (#41482)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-gesture-handler` to version `2.3.2` (#41337)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Gallery block: Re-introduce `v1` (#41533)

* Fix isGalleryV2Enabled calculation for the native version

* Update comment in isGalleryV2Enabled function

Co-authored-by: David Calhoun <[email protected]>

Co-authored-by: David Calhoun <[email protected]>

* [RNMobile] Fix missing translations for locales that include region (only on Android) (#41685)

* Update CHANGELOG

Co-authored-by: jhnstn <[email protected]>
Co-authored-by: Gerardo <[email protected]>
Co-authored-by: Carlos Garcia <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Jos <[email protected]>
Co-authored-by: jos <[email protected]>
Co-authored-by: Jason Johnston <[email protected]>
Co-authored-by: David Calhoun <[email protected]>
dcalhoun added a commit that referenced this pull request Jul 8, 2022
* Release script: Update react-native-editor version to 1.76.0

* Release script: Update with changes from 'npm run core preios'

* Update Changelog

* Release script: Update react-native-editor version to 1.76.1

* Release script: Update with changes from 'npm run core preios'

* [Mobile] - BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell (#41105)

* Mobile - BlockList - Pass FlatList internal onLayout through CellRendererComponent

* Mobile - Update onLayout naming for BlockListItemCell

* [Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages (#41053)

* Mobile - Fix - Drag & drop chip issue with RTL languages

* Mobile - BlockDraggable - Rename maxWidth variable to contentWidth

* Mobile - BlockDraggable - Add custom exiting animation that uses the same functionality as ZoomOutEasyDown but customizing the translateX value taking into account RTL languages.

* [RNMobile] Add drag & drop help guide in Help & Support screen (#40961)

* Add drag & drop help guide

* Update content of help screen related to moving blocks

* Update drand-and-drop images

* Update styles of heading component of help screen

* Add HelpDetailBadge component

This component will be rendered in `HelpDetailSectionHeadingText` component via the `badge` prop.

* Add NEW badge to move blocks help section

* Optimize drag-and-drop images

* Add move-blocks icon to Help & Support screen

* Update react-native-editor changelog

* Add HelpSectionTitle component

* Prevent rendering separator on last help topic item

* [RNMobile] Fix drag mode not being enabled when long-pressing over Shortcode block (#41155)

* Add prop for disabling suggestions button

* Use allowed formats in format types calculation

* Add RichText version to PlainText component

* Use experimental version of PlainText in Shortcode block

* Add disableAutocorrection prop to RichText

* Disable autocorrection in Shortcode block

* Update PlainText props in Shortcode block

* Use pre as tagName in PlainText

* Rename replaceLineBreaks function

* Update shortcode block unit tests

* Prevent text input focus when selecting Shortcode block

* Force text color in Shortcode block

* Remove tagName prop from PlainText component

* Mobile - Update changelog

* Translate NEW badge in Move blocks help screen

* Release script: Update react-native-editor version to 1.77.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Improve text read by screen readers for BottomSheetSelectControl  (#41036)

Improves the text that's read by screen readers by the BottomSheetSelectControl component, adding extra context and making its purpose clearer.

* [RNMobile] Add 'Insert from URL' option to Image block (#40334)

* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>

* [RNMobile] - E2E Simplify heading and lists blocks functions (#40670)

* update tests using paragraph, heading and list blocks

* fix slash inserter tests to work in ci

* lint fixes

* wait for ordered list to appear

* lint fixes

* extra click only on local env

* wait to get backspace click reflected

* re-add extra click only for local env

* add wait to wait for backspace key to be reflected

* lint fixes

* break function, set position to get list block

* lint fixes

* use correct params, update function name

* lint fixes

* make maxIteration a parameter for isElementVisible

* update xpath for list block

* utilize waitForVisible for isElementVisible

* lint fixes

* add wait to getNumberOfParagraphBlocks and update xpath for android list block

* update edit text xpath to be read from any level

Co-authored-by: jos <[email protected]>

* Add ruby version file (#41013)

Use same version of ruby that is used on WP iOS

* [RNMobile] Improvements to Getting Started Guides (#40964)

* Update with copy from Gutenberg Mobile

Gutenberg Mobile's readme had some copy in the troubleshooting section that wasn't included in Gutenberg's how-to: https://github.com/wordpress-mobile/gutenberg-mobile/edit/trunk/README.md

This commit fixes that issue by updating Gutenberg's how-to with the latest from Gutenberg Mobile.

* Tweak wording, update inconsistent capitalisation

* Tweaks to copy and formatting

With this commit, I've tidied up some of the copy, attempting to make the instructions as concise and helpful as possible. I've also set the images to the same width to tidy up the overall look of the document (the images will appear small on mobile devices, but can be tapped on to get the full image).

* Set all images to fixed width, for consistency

* Rearrange sections to improve overall flow

- The "Unit Tests" is moved towards the bottom of the document, so that's it's closer to the instructions for integration tests. the document flows as follows:
- The steps for installing Xcode are moved under the "iOS" section.
- The overall flow of the document has been updated to the following: Clone Gutenberg > iOS > Android > Tests

* Add details about recommended JDK

* Add details about Cocoapods

* Refine instructions for installing Cocoapods

* Note `ffi` may already be installed

Some versions of Ruby may not require the `ffi` to be manually installed, which is noted with this commit.

* update expected html for file block (#41300)

Co-authored-by: jos <[email protected]>

* Add waitForVisible() to all blocks (#41126)

* add waits to all block - 1st try

* fix failing tests

* correct if else condition

* fix failing cover block test

* update spaces

* update to use new click helper

* wait for blocks to be visible first in getFirstBlock and getLastBlock

* remove length as a parameter

* update timing for long press since it's failing intermittently in ci

* remove deleted param, revert space changes

* remove redundant code

* exit function once condition is met

* increse wait time for long press

* remove unneccesary condition, update message, return click value

Co-authored-by: jos <[email protected]>

* Update CHANGELOG

* Revert "update expected html for file block (#41300)"

This reverts commit a046a61.

* [RNMobile] Ensure post title gets focused when is notified from native side (#41371)

* Release script: Update react-native-editor version to 1.77.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (#41482)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-gesture-handler` to version `2.3.2` (#41337)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Gallery block: Re-introduce `v1` (#41533)

* Fix isGalleryV2Enabled calculation for the native version

* Update comment in isGalleryV2Enabled function

Co-authored-by: David Calhoun <[email protected]>

Co-authored-by: David Calhoun <[email protected]>

* [RNMobile] Fix missing translations for locales that include region (only on Android) (#41685)

* Update CHANGELOG

* Release script: Update react-native-editor version to 1.79.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Add integration tests to cover Drag & Drop functionality (#41364)

* Add testID prop to Draggable components

* Add unit tests for Draggable component

* Set draggingId shared value before enable dragging

This change is required for testing, otherwise the dragging id is not passed when the dragging gesture begins.

* Mock generateHapticFeedback function

* Add testID to draggable chip component

* Add testID to BlockDraggable component

* Add test helpers for BlockDraggable component

Additionally, helpers related to fake timers have been added and updated in the global helpers file.

* Add drag and drop integration tests

* Update react-native-aztec mock to use AztecInputState

* [Mobile] - Add E2E tests for the Drag & Drop blocks feature (#41368)

* Mobile - Add E2E tests for the Drag & Drop blocks feature

* Update longPress action

* Use clickIfClickable

* Use longPress instead of press

* Fix clipboard typo

* Add setClipboard and clearClipboard helpers

* Mobile - Skip some of the Drag & Drop E2E on iOS (#41529)

* Mobile - Skip some of the Drag & Drop E2E on iOS

* Replace if condition to use onlyOnAndroid wrapper instead

* where it can change to use clickIfClickable(), add new param for waitForVisible() to control return value (#41367)

Co-authored-by: jos <[email protected]>

* [RNMobile] Add 'Insert from URL' option to Video block (#41493)

* Add onSelectURL function to mobile Video block edit

* Add notices store to mobile Video block

* Display Insert from URL in Video block media options menu

* Allow native video block to use Embed block for embeddable URLs

* Update native Video block src onSelectURL attribute

* Update CHANGELOG

* Upgrade Aztec to v1.5.9 (#41828)

* fix: Image block preserves alt text from media library (#41839)

* fix: Image block preserves alt text from media library

When the alt text for a media item is present in the media library, that
value should be copied into the Image block when inserted. This behavior
avoids the need to re-enter the alt text for each image inserted into
the post content.

* fix: Allow Media with and without alt text

Previous code required an alt text value, which broken existing code.
This overrides the method to support both contexts. It also updates
existing code to use the same method of generating media throughout the
source.

* test: Update alt text for demo editor test data

Consistently setting the alt text for all platforms will likely help
avoid confusion.

* test: Update outdated test fixture data

The demo editor now returns an alt text for the test image media.

* docs: Update changelog

* [RNMobile] Implement recovery option for invalid blocks (#41988)

If a block's validation fails within the mobile app, users are shown an error but not provided with any options for recovering the block. This PR introduces an option for users to attempt block recovery. They'll be prompted to tap on a block if they wish to attempt recovery.

* docs: Update change log

* [RNMobile] Upgrades Gradle to 7.4.2 & Android Gradle Plugin to 7.2.1 (#42136)

* Update Gradle to 7.4.1

* Update AGP to 7.2.1

* Update Aztec-Android version to v1.6.0 (#42243)

Co-authored-by: jhnstn <[email protected]>
Co-authored-by: Gerardo <[email protected]>
Co-authored-by: Carlos Garcia <[email protected]>
Co-authored-by: Siobhan <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Jos <[email protected]>
Co-authored-by: jos <[email protected]>
Co-authored-by: Jason Johnston <[email protected]>
Co-authored-by: Oguz Kocer <[email protected]>
dcalhoun added a commit that referenced this pull request Jul 20, 2022
* Release script: Update react-native-editor version to 1.76.0

* Release script: Update with changes from 'npm run core preios'

* Update Changelog

* Release script: Update react-native-editor version to 1.76.1

* Release script: Update with changes from 'npm run core preios'

* [Mobile] - BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell (#41105)

* Mobile - BlockList - Pass FlatList internal onLayout through CellRendererComponent

* Mobile - Update onLayout naming for BlockListItemCell

* [Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages (#41053)

* Mobile - Fix - Drag & drop chip issue with RTL languages

* Mobile - BlockDraggable - Rename maxWidth variable to contentWidth

* Mobile - BlockDraggable - Add custom exiting animation that uses the same functionality as ZoomOutEasyDown but customizing the translateX value taking into account RTL languages.

* [RNMobile] Add drag & drop help guide in Help & Support screen (#40961)

* Add drag & drop help guide

* Update content of help screen related to moving blocks

* Update drand-and-drop images

* Update styles of heading component of help screen

* Add HelpDetailBadge component

This component will be rendered in `HelpDetailSectionHeadingText` component via the `badge` prop.

* Add NEW badge to move blocks help section

* Optimize drag-and-drop images

* Add move-blocks icon to Help & Support screen

* Update react-native-editor changelog

* Add HelpSectionTitle component

* Prevent rendering separator on last help topic item

* [RNMobile] Fix drag mode not being enabled when long-pressing over Shortcode block (#41155)

* Add prop for disabling suggestions button

* Use allowed formats in format types calculation

* Add RichText version to PlainText component

* Use experimental version of PlainText in Shortcode block

* Add disableAutocorrection prop to RichText

* Disable autocorrection in Shortcode block

* Update PlainText props in Shortcode block

* Use pre as tagName in PlainText

* Rename replaceLineBreaks function

* Update shortcode block unit tests

* Prevent text input focus when selecting Shortcode block

* Force text color in Shortcode block

* Remove tagName prop from PlainText component

* Mobile - Update changelog

* Translate NEW badge in Move blocks help screen

* Release script: Update react-native-editor version to 1.77.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Improve text read by screen readers for BottomSheetSelectControl  (#41036)

Improves the text that's read by screen readers by the BottomSheetSelectControl component, adding extra context and making its purpose clearer.

* [RNMobile] Add 'Insert from URL' option to Image block (#40334)

* Add 'Insert from URL' option to Video and Image blocks

* Update code style from linting

* Improve test cases for Media Upload capture options

* Fix whitespace issue

* Update Media Upload option tests to be asynchronous

* Update native image block to use correct image URL

* Add error handling for invalid URLs to native Image block

* Clear invalid URL error on Image URL success

* Fix synchronicity of Media Upload option tests

* Add check for URL handler to native Image block picker options

* Update code style

* Remove Video block from urlSource options

Why: to be introduced in a later PR

* Remove URL option from Video block for Media Upload test

* Use Notice snackbar for native Image block error handling

* Update Image/Media Upload code style and helpers

* Use getImage to determine if URL is a valid image within Image block

* Add loading indicator and isURL check to native Image block URL behavior

* Add loading indicator to native Image block media placeholder

* Fix whitespace issue in native Image block code style

* Reuse native Image block loading indicator

* Use undefined dimension attributes for the native Image block URL behavior

Co-authored-by: Derek Blank <[email protected]>

* [RNMobile] - E2E Simplify heading and lists blocks functions (#40670)

* update tests using paragraph, heading and list blocks

* fix slash inserter tests to work in ci

* lint fixes

* wait for ordered list to appear

* lint fixes

* extra click only on local env

* wait to get backspace click reflected

* re-add extra click only for local env

* add wait to wait for backspace key to be reflected

* lint fixes

* break function, set position to get list block

* lint fixes

* use correct params, update function name

* lint fixes

* make maxIteration a parameter for isElementVisible

* update xpath for list block

* utilize waitForVisible for isElementVisible

* lint fixes

* add wait to getNumberOfParagraphBlocks and update xpath for android list block

* update edit text xpath to be read from any level

Co-authored-by: jos <[email protected]>

* Add ruby version file (#41013)

Use same version of ruby that is used on WP iOS

* [RNMobile] Improvements to Getting Started Guides (#40964)

* Update with copy from Gutenberg Mobile

Gutenberg Mobile's readme had some copy in the troubleshooting section that wasn't included in Gutenberg's how-to: https://github.com/wordpress-mobile/gutenberg-mobile/edit/trunk/README.md

This commit fixes that issue by updating Gutenberg's how-to with the latest from Gutenberg Mobile.

* Tweak wording, update inconsistent capitalisation

* Tweaks to copy and formatting

With this commit, I've tidied up some of the copy, attempting to make the instructions as concise and helpful as possible. I've also set the images to the same width to tidy up the overall look of the document (the images will appear small on mobile devices, but can be tapped on to get the full image).

* Set all images to fixed width, for consistency

* Rearrange sections to improve overall flow

- The "Unit Tests" is moved towards the bottom of the document, so that's it's closer to the instructions for integration tests. the document flows as follows:
- The steps for installing Xcode are moved under the "iOS" section.
- The overall flow of the document has been updated to the following: Clone Gutenberg > iOS > Android > Tests

* Add details about recommended JDK

* Add details about Cocoapods

* Refine instructions for installing Cocoapods

* Note `ffi` may already be installed

Some versions of Ruby may not require the `ffi` to be manually installed, which is noted with this commit.

* update expected html for file block (#41300)

Co-authored-by: jos <[email protected]>

* Add waitForVisible() to all blocks (#41126)

* add waits to all block - 1st try

* fix failing tests

* correct if else condition

* fix failing cover block test

* update spaces

* update to use new click helper

* wait for blocks to be visible first in getFirstBlock and getLastBlock

* remove length as a parameter

* update timing for long press since it's failing intermittently in ci

* remove deleted param, revert space changes

* remove redundant code

* exit function once condition is met

* increse wait time for long press

* remove unneccesary condition, update message, return click value

Co-authored-by: jos <[email protected]>

* Update CHANGELOG

* Revert "update expected html for file block (#41300)"

This reverts commit a046a61.

* [RNMobile] Ensure post title gets focused when is notified from native side (#41371)

* Release script: Update react-native-editor version to 1.77.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (#41482)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Bump `react-native-gesture-handler` to version `2.3.2` (#41337)

* Update react-native-editor changelog

* Release script: Update react-native-editor version to 1.78.1

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Gallery block: Re-introduce `v1` (#41533)

* Fix isGalleryV2Enabled calculation for the native version

* Update comment in isGalleryV2Enabled function

Co-authored-by: David Calhoun <[email protected]>

Co-authored-by: David Calhoun <[email protected]>

* [RNMobile] Fix missing translations for locales that include region (only on Android) (#41685)

* Update CHANGELOG

* Release script: Update react-native-editor version to 1.79.0

* Release script: Update with changes from 'npm run core preios'

* [RNMobile] Add integration tests to cover Drag & Drop functionality (#41364)

* Add testID prop to Draggable components

* Add unit tests for Draggable component

* Set draggingId shared value before enable dragging

This change is required for testing, otherwise the dragging id is not passed when the dragging gesture begins.

* Mock generateHapticFeedback function

* Add testID to draggable chip component

* Add testID to BlockDraggable component

* Add test helpers for BlockDraggable component

Additionally, helpers related to fake timers have been added and updated in the global helpers file.

* Add drag and drop integration tests

* Update react-native-aztec mock to use AztecInputState

* [Mobile] - Add E2E tests for the Drag & Drop blocks feature (#41368)

* Mobile - Add E2E tests for the Drag & Drop blocks feature

* Update longPress action

* Use clickIfClickable

* Use longPress instead of press

* Fix clipboard typo

* Add setClipboard and clearClipboard helpers

* Mobile - Skip some of the Drag & Drop E2E on iOS (#41529)

* Mobile - Skip some of the Drag & Drop E2E on iOS

* Replace if condition to use onlyOnAndroid wrapper instead

* where it can change to use clickIfClickable(), add new param for waitForVisible() to control return value (#41367)

Co-authored-by: jos <[email protected]>

* [RNMobile] Add 'Insert from URL' option to Video block (#41493)

* Add onSelectURL function to mobile Video block edit

* Add notices store to mobile Video block

* Display Insert from URL in Video block media options menu

* Allow native video block to use Embed block for embeddable URLs

* Update native Video block src onSelectURL attribute

* Update CHANGELOG

* Upgrade Aztec to v1.5.9 (#41828)

* fix: Image block preserves alt text from media library (#41839)

* fix: Image block preserves alt text from media library

When the alt text for a media item is present in the media library, that
value should be copied into the Image block when inserted. This behavior
avoids the need to re-enter the alt text for each image inserted into
the post content.

* fix: Allow Media with and without alt text

Previous code required an alt text value, which broken existing code.
This overrides the method to support both contexts. It also updates
existing code to use the same method of generating media throughout the
source.

* test: Update alt text for demo editor test data

Consistently setting the alt text for all platforms will likely help
avoid confusion.

* test: Update outdated test fixture data

The demo editor now returns an alt text for the test image media.

* docs: Update changelog

* [RNMobile] Implement recovery option for invalid blocks (#41988)

If a block's validation fails within the mobile app, users are shown an error but not provided with any options for recovering the block. This PR introduces an option for users to attempt block recovery. They'll be prompted to tap on a block if they wish to attempt recovery.

* docs: Update change log

* [RNMobile] Upgrades Gradle to 7.4.2 & Android Gradle Plugin to 7.2.1 (#42136)

* Update Gradle to 7.4.1

* Update AGP to 7.2.1

* Update Aztec-Android version to v1.6.0 (#42243)

* Release script: Update react-native-editor version to 1.79.1

* Release script: Update with changes from 'npm run core preios'

* fix: Workaround Android 12 webview crash (#42517)

* fix: Workaround Android 12 webview crash

A crash occurred due to combining webviews with Android 12's new scroll
overflow behavior. Applying `opacity: 0.99` prevents the crash from
occurring. This change should be viewed as a temporary fix while we
await a more appropriate solution for the `react-native-webview`
library.

react-native-webview/react-native-webview#1915 (comment)

* docs: Add change log entry

Co-authored-by: jhnstn <[email protected]>
Co-authored-by: Gerardo <[email protected]>
Co-authored-by: Carlos Garcia <[email protected]>
Co-authored-by: Siobhan <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Derek Blank <[email protected]>
Co-authored-by: Jos <[email protected]>
Co-authored-by: jos <[email protected]>
Co-authored-by: Jason Johnston <[email protected]>
Co-authored-by: Oguz Kocer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

App Review Feature Request: Add image through URL
5 participants