-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Multi-selection]: Copy/cut partial selected blocks (#40098)
* [Multi-selection]: Copy/cut partial selected blocks * handle `copy` button in block actions * merge blocks on cut * partial copy from block actions only when is mergeable * update selector * revert partial selection copy in block actions menu item * add jsdoc for mapRichTextSettings util * update tests * add new e2e tests + pressKeyTimes playwright util
- Loading branch information
1 parent
7199ec2
commit 0e41033
Showing
28 changed files
with
417 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Helper function that maps attribute definition properties to the | ||
* ones used by RichText utils like `create, toHTMLString, etc..`. | ||
* | ||
* @param {Object} attributeDefinition A block's attribute definition object. | ||
* @return {Object} The mapped object. | ||
*/ | ||
export function mapRichTextSettings( attributeDefinition ) { | ||
const { | ||
multiline: multilineTag, | ||
__unstableMultilineWrapperTags: multilineWrapperTags, | ||
__unstablePreserveWhiteSpace: preserveWhiteSpace, | ||
} = attributeDefinition; | ||
return { | ||
multilineTag, | ||
multilineWrapperTags, | ||
preserveWhiteSpace, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
packages/e2e-test-utils-playwright/src/page/press-key-times.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Presses the given keyboard key a number of times in sequence. | ||
* | ||
* @param {string} key Key to press. | ||
* @param {number} count Number of times to press. | ||
*/ | ||
export async function pressKeyTimes( key, count ) { | ||
while ( count-- ) { | ||
await this.page.keyboard.press( key ); | ||
} | ||
} |
3 changes: 0 additions & 3 deletions
3
...hots/Copy-cut-paste-of-whole-blocks-should-cut-and-paste-individual-blocks-1-chromium.txt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.