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

Plugin: Backport bug fixes from Gutenberg 5.5.0 to wp/trunk (WordPress 5.2 RC) #14987

Merged
merged 22 commits into from
Apr 16, 2019

Commits on Apr 16, 2019

  1. Configuration menu
    Copy the full SHA
    3d3abd6 View commit details
    Browse the repository at this point in the history
  2. Fix/post title borders in code editor (#14771)

    * Remove thick left border for the title in the code editor.
    
    * Remove thick left border from the permalink field in the code editor.
    
    * Move styles into the `edit-post` module.
    
    * Remove no-longer-necessary style change.
    
    * Remove unnecessary styles.
    kjellr authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    8913322 View commit details
    Browse the repository at this point in the history
  3. Fix: Restrict block insert, move, and replace attending to allowedBlo…

    …cks, locking, and child blocks (#14003)
    
    Supersedes: https://github.com/WordPress/gutenberg/pull/7301/files
    Uses the select control implemented in #13924.
    This PR changes the action creators to be a generator and have all the required validations before yielding the action.
    
    Fixes: #14568;
    Fixes: #10186;
    Fixes: #13099;
    
    Missing the update to the unit tests.
    
    ## How has this been tested?
    Test block: [gist.github.com/jorgefilipecosta/b7194daac3ce26827522694fb4252c1c#file-testallowedblocksmiddleware-js](https://gist.github.com/jorgefilipecosta/b7194daac3ce26827522694fb4252c1c#file-testallowedblocksmiddleware-js)
    
    I pasted the test block referred in the browser console.
    I added the Product block.
    I verified I cannot move using drag & drop the Buy button out of the Product block. (child block restriction.
    I verified I cannot move using drag & drop a paragraph created outside of the Product block inside the product block. (allowed blocks restriction).
    I verified that if I press enter in the buy button or image inside the product block, a paragraph is not created (allowed blocks restriction).
    I added two galleries outside the product block, multi-selected them, and copied them ( ctrl + c ), I pasted them inside the list block inside the Product block and I verified they were not added (allowed blocks restriction).
    
    I verified that when we have a template lock and we press enter on the title we now do not insert unallowed blocks.
    Template lock code:
    
    ```
    add_filter( 'allowed_block_types', function( $allowed_block_types, $post ) {
    	if ( $post->post_type === 'post' ) {
    	    return $allowed_block_types;
    	}
    	return [ 'core/image', 'core/button' ];
    }, 10, 2 );
    ```
    I verified that if we disable the paragraph, e.g., with a filter or inside the test block, pressing enter on the title or in placeholders does not add paragraph blocks. Pressing the sibling inserter also does not insert the paragraph (PR #7226).
    Code to disable paragraph:
    
    ```
    function myplugin_register_book_lock_post_type() {
        $args = array(
            'public' => true,
    	  	'template_lock' => 'all',
            'label'  => 'Books Lock',
            'show_in_rest' => true,
            'template' => array(
                array( 'core/image', array(
                ) ),
                array( 'core/heading', array(
                    'placeholder' => 'Add Author...',
                ) ),
                array( 'core/paragraph', array(
                    'placeholder' => 'Add Description...',
                ) ),
            ),
        );
        register_post_type( 'book_lock', $args );
    }
    add_action( 'init', 'myplugin_register_book_lock_post_type' );
    ```
    I added two image blocks, multi-selected them, copied them and tried to paste them on the list inside the test block. I checked the image blocks were not added inside the test block.
    
    All these actions are possible in master.
    
    Todo: If we accept this approach, end 2 end tests will be created before the merge that replicate this manual tests.
    jorgefilipecosta authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    e234570 View commit details
    Browse the repository at this point in the history
  4. Make image selected onFocus (#14813)

    nosolosw authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    56bfeb7 View commit details
    Browse the repository at this point in the history
  5. Fix Blocker Picker autocompleter icon spacing (#14772)

    * Fixes classname to match package and CSS rule
    
    During the creation of block-editor the className on the autocompleter wasn’t updated. This change updates the class to use the `block-editor-` prefix. This causes the CSS to apply again thereby correcting the margin that was missing.
    
    * Revert "Fixes classname to match package and CSS rule"
    
    This reverts commit 28eb706.
    
    * Editor: Revert autocompleters classnames to editor prefix
    
    Co-Authored-By: Daniel Richards <[email protected]>
    2 people authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    cb39c74 View commit details
    Browse the repository at this point in the history
  6. Avoid saving metaboxes before a preview (#14877)

    * Remove logic that causes a metabox save before a preview
    
    * Add e2e test for preview with custom fields active.
    
    * Improve test robustness
    talldan authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    3e0f9e9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    ca583e1 View commit details
    Browse the repository at this point in the history
  8. Fix selecting separator block (#14854)

    * fix selecting separator block
    
    * center align the inserter toggle
    ashwin-pc authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    0015eb1 View commit details
    Browse the repository at this point in the history
  9. Color palette hover tooltip fix. (#14693)

    Vadim Nicolai authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    8dd2043 View commit details
    Browse the repository at this point in the history
  10. Refactor the Settings button CSS. (#14475)

    * Refactor the Settings button CSS.
    
    * Remove box-shadow use padding and margin.
    afercia authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    e2777f1 View commit details
    Browse the repository at this point in the history
  11. Input Interaction: take into account container padding (#14804)

    * Input Interaction: take into account container padding
    
    * Add e2e test
    ellatrix authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    887d8a4 View commit details
    Browse the repository at this point in the history
  12. Fix regression with column block being selected. (#14876)

    * Fix regression with column block being selected.
    
    The columns block is currently slightly fiddly, due to the nesting nature of Columns > Column > Blocks structure. All three levels are "Blocks" in the block editor sense, and all can be selected. This is pending enhancements in #9628.
    
    However in the mean time, we have a hack in place, this uses `pointer-events` to prevent the _mouse_ selection of the individual column blocks. This makes it drastically simpler to select the Columns block, which is where you can adjust the number of columns in the block. The individual column blocks, on the other hand, is currently largely inactionable. You can set alignments on them, which is why #9628 is urgent, but until we have a better system for selecting parent blocks, this pointer-events hack is arguably the better stopgap solution.
    
    That hack regressed in master. This PR restores it, and makes it slightly better.
    
    Things to test:
    
    - Insert a columns block with content, and verify you can select both child and parent block.
    - Insert an "Archives" block inside a column, and verify that the block itself is clickable, but the links inside are not (it's using component-disabled to make archive links unfollowable)
    
    * Fix mess ¯\_(ツ)_/¯
    jasmussen authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    ad7095b View commit details
    Browse the repository at this point in the history
  13. Block Editor: Consider received blocks state change as ignored (#14916)

    * Block Editor: Avoid creating new state reference on unchanging isPersistentChange
    
    * Block Editor: Consider received blocks state change as ignored
    
    * fixup a35fa82
    
    * Block Editor: Regenerate documentation
    aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    949bef3 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    026734f View commit details
    Browse the repository at this point in the history
  15. Fix button isDefault isBusy hover (#14469)

    sbardian authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    9be8b69 View commit details
    Browse the repository at this point in the history
  16. Fix regression with color swatch focus style (#14944)

    When you focus a color swatch, the circle around the check is offset.
    
    Removing the border that this PR removes, fixes that, and appears to not have any side-effects.
    
    I'm not sure how it regressed.
    jasmussen authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    bb5f4c7 View commit details
    Browse the repository at this point in the history
  17. Remove box shadow from the (#14936)

    Fixes #14853.
    
    This removes the box shadow on the inserter button that appears to the left of the default block appender (or to the right on mobile).
    
    This brings the hover state in line with the hover state for the sibling inserter.
    kjellr authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    83fc56f View commit details
    Browse the repository at this point in the history
  18. Adjust clashing shortcuts used for character input (#14681)

    * Adjust clashing shortcuts used for character input
    
    * Update modal
    
    * adds docs correction to correspond, adds inlined script to remove production dead code
    ellatrix authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    709d68c View commit details
    Browse the repository at this point in the history
  19. Button Block: fix space insertion (#14925)

    * Button Block: fix space insertion
    
    * Typo
    
    * Allow rule for preview
    ellatrix authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    b8b3d2a View commit details
    Browse the repository at this point in the history
  20. Format Library: Assign Popover anchorRect to update selection position (

    #14938)
    
    * Block Editor: Pass spread props from URLPopover to Popover
    
    Avoids need to explicitly support onClickOutside as deprecated pass-through prop, instead leveraging pass-through nature of spread props.
    
    * Format Library: Assign Popover getAnchorRect to update selection position
    
    * Format Library: Compute memoized anchor from caret point or active element
    
    * Components: Add anchorRect prop to Popover component
    
    * Format Library: Provide direct reference to Popover anchorRect
    
    * Format Library: Consider next element sibling for initial caret placement
    
    Co-Authored-By: Ella van Durpe <[email protected]>
    
    * Components: Mark PositionedAtSelection as unstable
    
    * Components: Remove getAnchorRect mention from Popover README
    aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    9a29787 View commit details
    Browse the repository at this point in the history
  21. Fix spacer NaN warning (#14785)

    * Fix spacer NaN warning
    
    * Set the min height of spacer block
    
    * Reset the customHeight if it is invalid
    
    * Add local state in spacer
    
    * Update input field's value when using drag handle
    Jackie6 authored and aduth committed Apr 16, 2019
    Configuration menu
    Copy the full SHA
    4c91030 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    660fbaa View commit details
    Browse the repository at this point in the history