-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Enables Block Grouping/UnGrouping using core/group #14908
Commits on Jun 3, 2019
-
Experiment with rudity mentory mechanic to allow Block Grouping
Tried a few approaches via `insertBlock/removeBlocks` and even `replaceBlocks` but nothing preserved the undo history apart from this rather brute force method.
Configuration menu - View commit details
-
Copy full SHA for ec83e29 - Browse repository at this point
Copy the full SHA ec83e29View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84cedd1 - Browse repository at this point
Copy the full SHA 84cedd1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4499172 - Browse repository at this point
Copy the full SHA 4499172View commit details -
Adds transform and updates Group button implementation to mirror
Adds a `from` transform to the `core/group` Block. Currently this only works for `core/paragraph` but will need to work for all Block types. Updates the convert button to utilise `switchToBlockType` which invokes the same functionality as used in Block transform thereby unifiying the two methods of grouping.
Configuration menu - View commit details
-
Copy full SHA for ec38f09 - Browse repository at this point
Copy the full SHA ec38f09View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6a340cc - Browse repository at this point
Copy the full SHA 6a340ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9250dfe - Browse repository at this point
Copy the full SHA 9250dfeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 81bbde6 - Browse repository at this point
Copy the full SHA 81bbde6View commit details -
Adds wildcard Block transforms
A major update to the transforms logic to enable wildcard Block transforms. * Pass Block names into transform callback function - enables dynamic Block creation in wildcard transforms (see `core/group`) * Add edge cases to Block transformation logic to account for specifying `*` (all) Block types as valid for a transformation * Remove unwanted test that checks all Blocks are of the same type before allowing a transform on a Multi Block selection
Configuration menu - View commit details
-
Copy full SHA for 5417118 - Browse repository at this point
Copy the full SHA 5417118View commit details -
Configuration menu - View commit details
-
Copy full SHA for 10cc373 - Browse repository at this point
Copy the full SHA 10cc373View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d0d259 - Browse repository at this point
Copy the full SHA 0d0d259View commit details -
Configuration menu - View commit details
-
Copy full SHA for febf5b0 - Browse repository at this point
Copy the full SHA febf5b0View commit details -
Extracts key transform test logic into dedicated methods
Previously hard coded values and difficult to follow logic were making the `switchToBlockType` overly complex. Extracted to well name methods to improve readability and allow to further refactoring.
Configuration menu - View commit details
-
Copy full SHA for 6bcfe33 - Browse repository at this point
Copy the full SHA 6bcfe33View commit details -
Extract method to test for wildcard block transforms
DRYs up code by extracting a function to test for the presence of a wildcard block transform
Configuration menu - View commit details
-
Copy full SHA for b7691dc - Browse repository at this point
Copy the full SHA b7691dcView commit details -
Moves logic to allow for wildcard transform into central transform ch…
…ecking method Previously test to allow wildcard transform to be valid were manually added as edge cases in conditions in predicate functions. This update centralises all logic to test whether a given transform is possible but including the logic that allows wildcard transforms within the main method `isPossibleTransformForSource` which determines whether a given transform is possible.
Configuration menu - View commit details
-
Copy full SHA for be26e72 - Browse repository at this point
Copy the full SHA be26e72View commit details -
Configuration menu - View commit details
-
Copy full SHA for f05f7bb - Browse repository at this point
Copy the full SHA f05f7bbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 322ec73 - Browse repository at this point
Copy the full SHA 322ec73View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68a16f2 - Browse repository at this point
Copy the full SHA 68a16f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 824a168 - Browse repository at this point
Copy the full SHA 824a168View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1effcde - Browse repository at this point
Copy the full SHA 1effcdeView commit details -
Includes testing grouping via transforms, options menu and keyboard shortcuts
Configuration menu - View commit details
-
Copy full SHA for 45b7b80 - Browse repository at this point
Copy the full SHA 45b7b80View commit details -
Adds check for group block availability before displaying grouping UI
Also adds e2e tests to cover this.
Configuration menu - View commit details
-
Copy full SHA for 1666e97 - Browse repository at this point
Copy the full SHA 1666e97View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0e4a2d3 - Browse repository at this point
Copy the full SHA 0e4a2d3View commit details -
Updates to preserve widest width alignment of child block on group co…
…ntainer Previously if one of the child blocks being grouped had a width alignment (eg: wide or full) then the group block did not respect this. This meant that layouts weren’t preserved when grouping. Adds functionality and tests to ensure that when a group is created the widest alignment setting of the child blocks is set on the group block.
Configuration menu - View commit details
-
Copy full SHA for d6cb0cc - Browse repository at this point
Copy the full SHA d6cb0ccView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3e76175 - Browse repository at this point
Copy the full SHA 3e76175View commit details -
Updates to simplify test setup
Previously API calls were cleaning up blocks. This can be removed because all posts are auto removed before each test is run. Addresses #14908 (comment)
Configuration menu - View commit details
-
Copy full SHA for 2627694 - Browse repository at this point
Copy the full SHA 2627694View commit details -
Configuration menu - View commit details
-
Copy full SHA for 29b5ed4 - Browse repository at this point
Copy the full SHA 29b5ed4View commit details -
Configuration menu - View commit details
-
Copy full SHA for fd257ff - Browse repository at this point
Copy the full SHA fd257ffView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4bdce11 - Browse repository at this point
Copy the full SHA 4bdce11View commit details -
Configuration menu - View commit details
-
Copy full SHA for 27143f9 - Browse repository at this point
Copy the full SHA 27143f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 77a4268 - Browse repository at this point
Copy the full SHA 77a4268View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ef8e03 - Browse repository at this point
Copy the full SHA 2ef8e03View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2c8adfd - Browse repository at this point
Copy the full SHA 2c8adfdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 96c11ba - Browse repository at this point
Copy the full SHA 96c11baView commit details -
Configuration menu - View commit details
-
Copy full SHA for 607404e - Browse repository at this point
Copy the full SHA 607404eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2328b54 - Browse repository at this point
Copy the full SHA 2328b54View commit details -
Fix Block deletion test failure via keyboard workaround
Due to the addition of the “Group” item into the Block Options toolbar the “Remove Block” item had been removed outside the viewable portion of the Popover (not the popover has a restricted height and allows scrolling to see the additional items if there is insufficient space to display them all). Pupeteer isn’t able to click on items that are not visible. The simplest work around is to us the keyboard to select the “Remove Block” menu item rather. Trying to scroll a div within Pupeteer is fraught with problems and inconsistencies.
Configuration menu - View commit details
-
Copy full SHA for a99d98f - Browse repository at this point
Copy the full SHA a99d98fView commit details -
Fixes Remove Block button helper to be more resilient to change
Previously we relied on the number of tab stops to locate the correct button in the menu. This change uses the actual text of the button to identify it and uses an assertion to ensure that the correct button is explicitly required.
Configuration menu - View commit details
-
Copy full SHA for 0f51ec5 - Browse repository at this point
Copy the full SHA 0f51ec5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b95fab - Browse repository at this point
Copy the full SHA 7b95fabView commit details -
Fixes to catch transforms which are invalid for blocks of different t…
…ypes A check was accidentally removed in `b2af0f2611e2a2bc66c62959dbf483abcbe103a9` which allowed multiple blocks of different types to be considered valid even if they were not. Adds conditional to ensure that unless the transform is a wildcard then we test that all the blocks are of the same type as the first block’s type before considering the transform to be valid.
Configuration menu - View commit details
-
Copy full SHA for 1ba77c0 - Browse repository at this point
Copy the full SHA 1ba77c0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d2d3d7 - Browse repository at this point
Copy the full SHA 6d2d3d7View commit details -
Fixes Transforms test to not over-test Group transforms
Previously we tested every block transforming into the Group Block. This was unwanted overhead. Fixed to only test 1 single Block transforming into Group. Removed redundant snapshots as a result of removing it.
Configuration menu - View commit details
-
Copy full SHA for 7328bbf - Browse repository at this point
Copy the full SHA 7328bbfView commit details -
Configuration menu - View commit details
-
Copy full SHA for c950c2e - Browse repository at this point
Copy the full SHA c950c2eView commit details -
Fix to make Group transform snapshot tests more resilient to change
Now explicity selects paragraph and image blocks to test the Group transform rather than simply testing the first block that transform into a Group. This ensures that if the order of transforms changes in the fixtures the test won’t be accidentally invalidated. Resolves: #14908
Configuration menu - View commit details
-
Copy full SHA for 16c20c6 - Browse repository at this point
Copy the full SHA 16c20c6View commit details -
Updates to DRY out test and reduce test redundancy and performance
Through use of smarter filtering we can get away with a single `it.each()` block which improves perf and removes redundant tests. Addresses #14908 (comment)
Configuration menu - View commit details
-
Copy full SHA for 587ec4b - Browse repository at this point
Copy the full SHA 587ec4bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8074131 - Browse repository at this point
Copy the full SHA 8074131View commit details -
Configuration menu - View commit details
-
Copy full SHA for 024cdae - Browse repository at this point
Copy the full SHA 024cdaeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7453ef2 - Browse repository at this point
Copy the full SHA 7453ef2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1b3f357 - Browse repository at this point
Copy the full SHA 1b3f357View commit details -
Configuration menu - View commit details
-
Copy full SHA for dbac411 - Browse repository at this point
Copy the full SHA dbac411View commit details -
Configuration menu - View commit details
-
Copy full SHA for 36fda5a - Browse repository at this point
Copy the full SHA 36fda5aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 358bc1c - Browse repository at this point
Copy the full SHA 358bc1cView commit details -
Updates to remove unwanted level of context on the translation
Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>
Configuration menu - View commit details
-
Copy full SHA for 2b229fc - Browse repository at this point
Copy the full SHA 2b229fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for c3bdf0f - Browse repository at this point
Copy the full SHA c3bdf0fView commit details -
Adds tests for isContainerGroupBlock function
Note these test will need updating when we land #15774
Configuration menu - View commit details
-
Copy full SHA for b2519fa - Browse repository at this point
Copy the full SHA b2519faView commit details -
Fixes logic around multi blocks of same type and adds tests
Prevously we had 1 function attempting to test for multiple block selection and checking that the selection was all of the same block type. This caused bugs within `switchToBlockType` because the logic was confusing. For example, if a selection isn’t a multi block then we don’t need to test that all the blocks are the same. Separated the two functions and updated conditions in switchToBlockType to reflect this. Added unit tests to cover two new functions.
Configuration menu - View commit details
-
Copy full SHA for b474df5 - Browse repository at this point
Copy the full SHA b474df5View commit details -
Adds new generator based API signature to Block transforms
Previously the transforms function was pased two arguments 1. attributes 2. innerblocks This wasn’t extensible and more advanced transformations require more information about the block (eg: name). To avoid bloating the signature, a progressive enhancement approach is applied whereby if a generator function is passed as the transform then we pass the entire block object to the generator. This is opt-in only and is backwards compatible with all existing transform functions.
Configuration menu - View commit details
-
Copy full SHA for 8c6ccd3 - Browse repository at this point
Copy the full SHA 8c6ccd3View commit details -
Adds new apply option method to transform API
Previously we were modifying the existing transform function to conform to the requirements of a new API (ie: receiving the entire block object rather than the individual arguments). It was decided that introducing a new `apply` option and soft deprecating the old transform option would be preferable. The apply option if provided now takes precedence over the transform option. This is fully backwards compatible. See https://wordpress.slack.com/archives/C02QB2JS7/p1559567845087000
Configuration menu - View commit details
-
Copy full SHA for a30367d - Browse repository at this point
Copy the full SHA a30367dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dc6c6d - Browse repository at this point
Copy the full SHA 1dc6c6dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1981661 - Browse repository at this point
Copy the full SHA 1981661View commit details -
Configuration menu - View commit details
-
Copy full SHA for e8f7506 - Browse repository at this point
Copy the full SHA e8f7506View commit details
Commits on Jun 4, 2019
-
Fixes test util to avoid infinite loops
Previously if the button wasn’t found then the loop would continue forever looking for the button. This would have caused timeouts. Limits the loop to the number of buttons in the document. Also bails out immediately having found the button. Resolves #14908 (comment)
Configuration menu - View commit details
-
Copy full SHA for 5570049 - Browse repository at this point
Copy the full SHA 5570049View commit details -
Renames apply to convert to avoid confusion with Func.apply
To avoid potential confusion and overlap with Function.apply, rename to `convert`. Slack discussion: https://wordpress.slack.com/archives/C02QB2JS7/p1559593099150300?thread_ts=1559571243.134500&cid=C02QB2JS7 MDN Function apply docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/apply Resolves: #14908 (comment)
Configuration menu - View commit details
-
Copy full SHA for 8cb7c2f - Browse repository at this point
Copy the full SHA 8cb7c2fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4254769 - Browse repository at this point
Copy the full SHA 4254769View commit details -
Fix convert API to match established patterns for consistency
Previously `convert` always passed an array of block objects even if there was only a single block. This is inconsistent with the implementation of the existing `transform` method which passes only a block’s attributes/innerBlocks pair when it is not a multi block. To retain consistency with the existing `isMultiBlock` paradiagm this updates the API of `convert` to pass a single block object when not in multiblock mode.
Configuration menu - View commit details
-
Copy full SHA for 60bb8a7 - Browse repository at this point
Copy the full SHA 60bb8a7View commit details -
Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>
Configuration menu - View commit details
-
Copy full SHA for 91f1868 - Browse repository at this point
Copy the full SHA 91f1868View commit details -
Configuration menu - View commit details
-
Copy full SHA for a579c5f - Browse repository at this point
Copy the full SHA a579c5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for b6f7f55 - Browse repository at this point
Copy the full SHA b6f7f55View commit details -
Updates to remove keyboard shortcuts
Following a discussion it was not possible to achieve a consensus on which shortcuts was most suitable (or indeed whether keyboard shortcuts for this were even a good idea). As a result this has been descoped from this PR and will be addressed elsewhere. Once merged I will push a new placeholder PR with the foundation for shortcuts in place and others can then amend it.
Configuration menu - View commit details
-
Copy full SHA for 4707009 - Browse repository at this point
Copy the full SHA 4707009View commit details -
Configuration menu - View commit details
-
Copy full SHA for afec594 - Browse repository at this point
Copy the full SHA afec594View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5dd3452 - Browse repository at this point
Copy the full SHA 5dd3452View commit details
Commits on Jun 5, 2019
-
Fixes unwanted check introduced during debugging
Test for existence of transform is not required and was introduced during debugging. Can be removed.
Configuration menu - View commit details
-
Copy full SHA for abbcd4e - Browse repository at this point
Copy the full SHA abbcd4eView commit details -
Updates to collapse spaces in doc blocks
Co-Authored-By: Andrew Duthie <andrew@andrewduthie.com>
Configuration menu - View commit details
-
Copy full SHA for b9350e2 - Browse repository at this point
Copy the full SHA b9350e2View commit details -
Configuration menu - View commit details
-
Copy full SHA for efa7ac6 - Browse repository at this point
Copy the full SHA efa7ac6View commit details -
Configuration menu - View commit details
-
Copy full SHA for c6ee214 - Browse repository at this point
Copy the full SHA c6ee214View commit details -
Configuration menu - View commit details
-
Copy full SHA for f9fd251 - Browse repository at this point
Copy the full SHA f9fd251View commit details -
Reinstate missing Ungroup icon
Accidentally got lost during renaming of “UnGroup” to “Ungroup”!
Configuration menu - View commit details
-
Copy full SHA for 1a938ad - Browse repository at this point
Copy the full SHA 1a938adView commit details