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

Latest cherry-picks for 6.4.x #57360

Merged
merged 18 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
24 changes: 14 additions & 10 deletions packages/block-editor/src/components/block-list/content.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,27 @@
}
}


// Hide selections on this element, otherwise Safari will include it stacked
// under your actual selection.
// This uses a CSS hack to show the rules to Safari only. Failing here is okay,
// it just makes the selection indication slightly less precise. That makes this
// hack a progressive enhancement. Stylelint is disabled to allow the hack to work.
/* stylelint-disable */
_::-webkit-full-page-media, _:future, :root .block-editor-block-list__layout::selection,
_::-webkit-full-page-media, _:future, :root .has-multi-selection .block-editor-block-list__layout::selection {
background-color: transparent;
}
/* stylelint-enable */


// Note to developers refactoring this, please test navigation mode, and
// multi selection and hovering the block switcher to highlight the block.
// Also be sure to test partial selections in Safari, as it draws the
// selection marker with an entirely different model than Blink.
.block-editor-block-list__layout {
position: relative;

// Hide selections on this element, otherwise Safari will include it stacked
// under your actual selection.
&::selection {
background: transparent;
}

.has-multi-selection &::selection {
background: transparent;
}

// Block multi selection
// Apply a rounded radius to the entire block when multi selected, but with low specificity
// so explicit radii set by tools are preserved.
Expand Down
2 changes: 1 addition & 1 deletion packages/block-editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const ExperimentalBlockEditorProvider = withRegistryProvider(
useBlockSync( props );

return (
<SlotFillProvider>
<SlotFillProvider passthrough>
<KeyboardShortcuts.Register />
<BlockRefsProvider>{ children }</BlockRefsProvider>
</SlotFillProvider>
Expand Down
8 changes: 8 additions & 0 deletions packages/block-library/src/image/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,14 @@ const v6 = {
},
},
},
migrate( attributes ) {
const { height, width } = attributes;
return {
...attributes,
width: typeof width === 'number' ? `${ width }px` : width,
height: typeof height === 'number' ? `${ height }px` : height,
};
},
save( { attributes } ) {
const {
url,
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/slot-fill/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export const Slot = forwardRef( ( { bubblesVirtually, ...props }, ref ) => {
return <BaseSlot { ...props } />;
} );

export function Provider( { children, ...props } ) {
export function Provider( { children, passthrough = false, ...props } ) {
const parent = useContext( SlotFillContext );
if ( ! parent.isDefault ) {
if ( ! parent.isDefault && passthrough ) {
return children;
}
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* HTML for testing the router navigate function.
*
* @package gutenberg-test-interactive-blocks
*
* @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* HTML for testing the hydration of router regions.
*
* @package gutenberg-test-interactive-blocks
*
* @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* HTML for testing the hydration of the serialized store.
*
* @package gutenberg-test-interactive-blocks
*
* @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",
"alt": "",
"caption": "",
"width": 100,
"height": 100
"width": "100px",
"height": "100px"
},
"innerBlocks": []
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- wp:image {"align":"left","width":100,"height":100} -->
<!-- wp:image {"width":"100px","height":"100px","align":"left"} -->
<figure class="wp-block-image alignleft is-resized"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==" alt="" style="width:100px;height:100px"/></figure>
<!-- /wp:image -->
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==",
"alt": "",
"caption": "",
"width": 164,
"height": 164,
"width": "164px",
"height": "164px",
"sizeSlug": "large",
"className": "is-style-rounded",
"style": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<!-- wp:image {"align":"left","width":164,"height":164,"sizeSlug":"large","className":"is-style-rounded","style":{"border":{"radius":"100%"}}} -->
<!-- wp:image {"width":"164px","height":"164px","sizeSlug":"large","align":"left","className":"is-style-rounded","style":{"border":{"radius":"100%"}}} -->
<figure class="wp-block-image alignleft size-large is-resized has-custom-border is-style-rounded"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==" alt="" style="border-radius:100%;width:164px;height:164px"/></figure>
<!-- /wp:image -->
Loading