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

Allow shrink mobile toolbar #2220

Merged
merged 7 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions RELEASE-NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
* Add enter/exit animation in FloatingToolbar
* [***] New block: Verse
* [*] Fix merging of text blocks when text had active formatting (bold, italic, strike, link)
* [***] Trash icon that is used to remove blocks is moved to the new menu reachable via ellipsis button in the block toolbar
* [**] Block toolbar can now collapse when the block width is smaller than the toolbar content

1.28.0
------
Expand Down
18 changes: 12 additions & 6 deletions __device-tests__/pages/editor-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,20 +243,26 @@ export default class EditorPage {
}

const buttonElementName = isAndroid() ? '//*' : '//XCUIElementTypeButton';
const removeButtonIdentifier = `Remove block at row ${ position }`;
const removeBlockLocator = `${ buttonElementName }[contains(@${ this.accessibilityIdXPathAttrib }, "${ removeButtonIdentifier }")]`;
const blockActionsMenuButtonIdentifier = `Open Block Actions Menu`;
const blockActionsMenuButtonLocator = `${ buttonElementName }[contains(@${ this.accessibilityIdXPathAttrib }, "${ blockActionsMenuButtonIdentifier }")]`;

if ( isAndroid() ) {
const block = await this.getBlockAtPosition( blockName, position );
let checkList = await this.driver.elementsByXPath( removeBlockLocator );
let checkList = await this.driver.elementsByXPath( blockActionsMenuButtonLocator );
while ( checkList.length === 0 ) {
await swipeUp( this.driver, block ); // Swipe up to show remove icon at the bottom
checkList = await this.driver.elementsByXPath( removeBlockLocator );
checkList = await this.driver.elementsByXPath( blockActionsMenuButtonLocator );
}
}

const removeButton = await this.driver.elementByXPath( removeBlockLocator );
await removeButton.click();
const blockActionsMenuButton = await this.driver.elementByXPath( blockActionsMenuButtonLocator );
await blockActionsMenuButton.click();

const removeActionButtonIdentifier = `Remove ${ blockName }`;
const removeActionButtonLocator = `${ buttonElementName }[contains(@${ this.accessibilityIdXPathAttrib }, "${ removeActionButtonIdentifier }")]`;
const removeActionButton = await this.driver.elementByXPath( removeActionButtonLocator );

await removeActionButton.click();
}

// =========================
Expand Down
2 changes: 1 addition & 1 deletion gutenberg
Submodule gutenberg updated 268 files
23 changes: 23 additions & 0 deletions patches/react-native+0.61.5.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
diff --git a/node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheetManager.m b/node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheetManager.m
index 65fa2bb..c5f265b 100644
--- a/node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheetManager.m
+++ b/node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheetManager.m
@@ -66,6 +66,7 @@ - (void)presentViewController:(UIViewController *)alertController
NSArray<NSString *> *buttons = [RCTConvert NSStringArray:options[@"options"]];
NSInteger cancelButtonIndex = options[@"cancelButtonIndex"] ? [RCTConvert NSInteger:options[@"cancelButtonIndex"]] : -1;
NSArray<NSNumber *> *destructiveButtonIndices;
+ NSArray<NSNumber *> *disabledButtonIndices = [RCTConvert NSArray:options[@"disabledButtonIndices"]];
if ([options[@"destructiveButtonIndex"] isKindOfClass:[NSArray class]]) {
destructiveButtonIndices = [RCTConvert NSArray:options[@"destructiveButtonIndex"]];
} else {
@@ -108,6 +109,10 @@ - (void)presentViewController:(UIViewController *)alertController
callback(@[@(localIndex)]);
}]];

+ if ([disabledButtonIndices containsObject:@(localIndex)]) {
+ [alertController.actions[localIndex] setEnabled:false];
+ }
+
index++;
}

diff --git a/node_modules/react-native/React/Views/RCTShadowView.m b/node_modules/react-native/React/Views/RCTShadowView.m
index 40c0cda..646f137 100644
--- a/node_modules/react-native/React/Views/RCTShadowView.m
Expand Down