Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
6ea1d57
Release script: Update react-native-editor version to 1.76.0
jhnstn May 11, 2022
bcddcbc
Release script: Update with changes from 'npm run core preios'
jhnstn May 11, 2022
678bd2f
Update Changelog
jhnstn May 11, 2022
21b838c
Release script: Update react-native-editor version to 1.76.1
May 20, 2022
7f79f52
Release script: Update with changes from 'npm run core preios'
May 20, 2022
981471e
[Mobile] - BlockList - Add internal onLayout from CellRendererCompone…
May 18, 2022
0087e3d
[Mobile] - Fix Drag & Drop Chip positioning issue with RTL languages …
May 18, 2022
5c6fe0d
[RNMobile] Add drag & drop help guide in Help & Support screen (#40961)
fluiddot May 19, 2022
09d4368
[RNMobile] Fix drag mode not being enabled when long-pressing over Sh…
fluiddot May 20, 2022
c951e59
Mobile - Update changelog
May 20, 2022
d0b2cea
Translate NEW badge in Move blocks help screen
fluiddot May 20, 2022
132bc3a
Release script: Update react-native-editor version to 1.77.0
SiobhyB May 24, 2022
cb4105f
Release script: Update with changes from 'npm run core preios'
SiobhyB May 24, 2022
639598f
[RNMobile] Improve text read by screen readers for BottomSheetSelectC…
SiobhyB May 13, 2022
3fe5683
[RNMobile] Add 'Insert from URL' option to Image block (#40334)
derekblank May 23, 2022
a6dd494
[RNMobile] - E2E Simplify heading and lists blocks functions (#40670)
jostnes May 16, 2022
1b3391e
Add ruby version file (#41013)
jhnstn May 12, 2022
148f835
[RNMobile] Improvements to Getting Started Guides (#40964)
SiobhyB May 23, 2022
a046a61
update expected html for file block (#41300)
jostnes May 25, 2022
ede6624
Add waitForVisible() to all blocks (#41126)
jostnes May 25, 2022
2daf775
Update CHANGELOG
SiobhyB May 26, 2022
d8fbfbd
Revert "update expected html for file block (#41300)"
SiobhyB May 26, 2022
efc0f2c
[RNMobile] Ensure post title gets focused when is notified from nativ…
fluiddot May 26, 2022
4c714af
Release script: Update react-native-editor version to 1.77.1
fluiddot Jun 2, 2022
9365c4e
Release script: Update with changes from 'npm run core preios'
fluiddot Jun 2, 2022
ad2c8e4
[RNMobile] Bump `react-native-reanimated` version to `2.4.1-wp-3` (#4…
fluiddot Jun 2, 2022
f10a378
Update react-native-editor changelog
fluiddot Jun 2, 2022
4cfbd82
Release script: Update react-native-editor version to 1.78.0
fluiddot Jun 10, 2022
5b447b4
Release script: Update with changes from 'npm run core preios'
fluiddot Jun 10, 2022
8bd8d90
[RNMobile] Bump `react-native-gesture-handler` to version `2.3.2` (#4…
fluiddot May 27, 2022
bdaaf6e
Update react-native-editor changelog
fluiddot Jun 10, 2022
6e13c9e
Release script: Update react-native-editor version to 1.78.1
SiobhyB Jun 16, 2022
32ab484
Release script: Update with changes from 'npm run core preios'
SiobhyB Jun 16, 2022
4ae461c
[RNMobile] Gallery block: Re-introduce `v1` (#41533)
fluiddot Jun 14, 2022
01adee1
[RNMobile] Fix missing translations for locales that include region (…
fluiddot Jun 14, 2022
b1352b7
Update CHANGELOG
SiobhyB Jun 16, 2022
eb2046e
Merge branch 'trunk' into rnmobile/release_1.78.1
fluiddot Jun 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge branch 'trunk' into rnmobile/release_1.78.1
# Conflicts:
#	packages/block-editor/src/components/media-upload/index.native.js
#	packages/block-editor/src/components/plain-text/index.native.js
#	packages/block-library/src/image/edit.native.js
#	packages/block-library/src/shortcode/edit.native.js
#	packages/block-library/src/shortcode/test/edit.native.js
#	packages/editor/src/components/editor-help/index.native.js
#	packages/react-native-aztec/package.json
#	packages/react-native-bridge/package.json
#	packages/react-native-editor/CHANGELOG.md
#	packages/react-native-editor/__device-tests__/[email protected]
#	packages/react-native-editor/__device-tests__/helpers/utils.js
#	packages/react-native-editor/__device-tests__/pages/editor-page.js
#	packages/react-native-editor/ios/Podfile.lock
#	packages/react-native-editor/package.json
  • Loading branch information
fluiddot committed Jun 17, 2022
commit eb2046e8ac5acfd2e136f5bf67ec6c612ffda97d
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export class MediaUpload extends Component {
id: URL_MEDIA_SOURCE,
value: URL_MEDIA_SOURCE,
label: __( 'Insert from URL' ),
types: [ MEDIA_TYPE_AUDIO, MEDIA_TYPE_IMAGE ],
types: [ MEDIA_TYPE_AUDIO, MEDIA_TYPE_IMAGE, MEDIA_TYPE_VIDEO ],
icon: globe,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,8 @@ export default class PlainText extends Component {
}

render() {
const {
style,
__experimentalVersion,
onFocus,
...otherProps
} = this.props;
const { style, __experimentalVersion, onFocus, ...otherProps } =
this.props;
const textStyles = [
style || styles[ 'block-editor-plain-text' ],
this.getFontSize(),
Expand Down
7 changes: 2 additions & 5 deletions packages/block-library/src/image/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,11 +461,8 @@ export class ImageEdit extends Component {
}

onSelectURL( newURL ) {
const {
createErrorNotice,
imageDefaultSize,
setAttributes,
} = this.props;
const { createErrorNotice, imageDefaultSize, setAttributes } =
this.props;

if ( isURL( newURL ) ) {
this.setState( {
Expand Down
7 changes: 4 additions & 3 deletions packages/block-library/src/shortcode/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ export function ShortcodeEdit( props ) {
shortcodeContainerStyle.paddingLeft +
shortcodeContainerStyle.paddingRight;

const onChange = useCallback( ( text ) => setAttributes( { text } ), [
setAttributes,
] );
const onChange = useCallback(
( text ) => setAttributes( { text } ),
[ setAttributes ]
);

return (
<View>
Expand Down
7 changes: 2 additions & 5 deletions packages/block-library/src/shortcode/test/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,8 @@ afterAll( () => {

describe( 'Shortcode block', () => {
it( 'inserts block', async () => {
const {
getByA11yLabel,
getByTestId,
getByText,
} = await initializeEditor();
const { getByA11yLabel, getByTestId, getByText } =
await initializeEditor();

fireEvent.press( getByA11yLabel( 'Add block' ) );

Expand Down
5 changes: 2 additions & 3 deletions packages/editor/src/components/editor-help/index.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,8 @@ function EditorHelpTopics( { close, isVisible, onClose } ) {
{ label, icon },
index
) => {
const labelSlug = kebabCase(
label
);
const labelSlug =
kebabCase( label );
const isLastItem =
index ===
HELP_TOPICS.length -
Expand Down
10 changes: 10 additions & 0 deletions packages/react-native-editor/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ For each user feature we should also add a importance categorization label to i

## Unreleased

- [*] Add 'Insert from URL' option to Video block [#41493]

## 1.78.1

- [**] Re-introduce support for v1 of the Gallery block to the native version of the editor [#41533]
Expand All @@ -29,6 +31,14 @@ For each user feature we should also add a importance categorization label to i
- [*] [a11y] Improve text read by screen readers for BottomSheetSelectControl [#41036]
- [*] Add 'Insert from URL' option to Image block [#40334]

## 1.76.3

- [***] Fix crash on iOS related to JSI and Reanimated [#41482]

## 1.76.2

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

## 1.76.1

- [*] BlockList - Add internal onLayout from CellRendererComponent to BlockListItemCell [#41105]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ import testData from './helpers/test-data';

describe( 'Gutenberg Editor Image Block tests', () => {
it( 'should be able to add an image block', async () => {
await editorPage.addNewBlock( blockNames.image );
await editorPage.closePicker();

const imageBlock = await editorPage.getBlockAtPosition(
blockNames.image
);

// Can only add image from media library on iOS
// iOS only test - Can only add image from media library on iOS
if ( ! isAndroid() ) {
await editorPage.addNewBlock( blockNames.image );
await editorPage.closePicker();
Expand Down
68 changes: 59 additions & 9 deletions packages/react-native-editor/__device-tests__/helpers/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,10 @@ const longPressMiddleOfElement = async ( driver, element ) => {

const x = location.x + size.width / 2;
const y = location.y + size.height / 2;
action.press( { x, y } );
// Setting to wait a bit longer because this is failing more frequently on the CI
action.wait( 5000 );
action.release();
const action = new wd.TouchAction( driver )
.longPress( { x, y } )
.wait( 5000 ) // Setting to wait a bit longer because this is failing more frequently on the CI
.release();
await action.perform();
};

Expand Down Expand Up @@ -516,13 +516,15 @@ const waitForMediaLibrary = async ( driver ) => {
* @param {string} driver
* @param {string} elementLocator
* @param {number} maxIteration - Default value is 25
* @param {string} elementToReturn - Options are allElements, lastElement, firstElement. Defaults to "firstElement"
* @param {number} iteration - Default value is 0
* @return {string} - Returns the first element found, empty string if not found
*/
const waitForVisible = async (
driver,
elementLocator,
maxIteration = 25,
elementToReturn = 'firstElement',
iteration = 0
) => {
const timeout = 1000;
Expand All @@ -539,35 +541,47 @@ const waitForVisible = async (
await driver.sleep( timeout );
}

const element = await driver.elementsByXPath( elementLocator );
if ( element.length === 0 ) {
const elements = await driver.elementsByXPath( elementLocator );
if ( elements.length === 0 ) {
// if locator is not visible, try again
return waitForVisible(
driver,
elementLocator,
maxIteration,
elementToReturn,
iteration + 1
);
}

return element[ 0 ];
switch ( elementToReturn ) {
case 'allElements':
return elements;
case 'lastElement':
return elements[ elements.length - 1 ];
default:
// Default is to return first element
return elements[ 0 ];
}
};

/**
* @param {string} driver
* @param {string} elementLocator
* @param {number} maxIteration - Default value is 25, can be adjusted to be less to wait for element to not be visible
* @param {string} elementToReturn - Options are allElements, lastElement, firstElement. Defaults to "firstElement"
* @return {boolean} - Returns true if element is found, false otherwise
*/
const isElementVisible = async (
driver,
elementLocator,
maxIteration = 25
maxIteration = 25,
elementToReturn = 'firstElement'
) => {
const element = await waitForVisible(
driver,
elementLocator,
maxIteration
maxIteration,
elementToReturn
);

// if there is no element, return false
Expand All @@ -582,12 +596,14 @@ const clickIfClickable = async (
driver,
elementLocator,
maxIteration = 25,
elementToReturn = 'firstElement',
iteration = 0
) => {
const element = await waitForVisible(
driver,
elementLocator,
maxIteration,
elementToReturn,
iteration
);

Expand All @@ -606,6 +622,7 @@ const clickIfClickable = async (
driver,
elementLocator,
maxIteration,
elementToReturn,
iteration + 1
);
}
Expand All @@ -618,17 +635,50 @@ const waitIfAndroid = async () => {
}
};

/**
* Content type definitions.
* Note: Android only supports plaintext.
*
* @typedef {"plaintext" | "image" | "url"} ClipboardContentType
*/

/**
* Helper to set content in the clipboard.
*
* @param {Object} driver Driver
* @param {string} content Content to set in the clipboard
* @param {ClipboardContentType} contentType Type of the content
*/
const setClipboard = async ( driver, content, contentType = 'plaintext' ) => {
const base64String = Buffer.from( content ).toString( 'base64' );
await driver.setClipboard( base64String, contentType );
};

/**
* Helper to clear the clipboard
*
* @param {Object} driver Driver
* @param {ClipboardContentType} contentType Type of the content
*/
const clearClipboard = async ( driver, contentType = 'plaintext' ) => {
await driver.setClipboard( '', contentType );
};

module.exports = {
backspace,
clearClipboard,
clickBeginningOfElement,
clickElementOutsideOfTextInput,
clickIfClickable,
clickMiddleOfElement,
doubleTap,
dragAndDropAfterElement,
isAndroid,
isEditorVisible,
isElementVisible,
isLocalEnvironment,
longPressMiddleOfElement,
setClipboard,
setupDriver,
stopDriver,
swipeDown,
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.