Skip to content

Commit

Permalink
Editor: update npm packages in trunk for 6.4.3.
Browse files Browse the repository at this point in the history
Package Update includes fixes for:
- Image Block: Enable image block to be selected correctly when clicked.
- Reduce specificity of default Cover text color styles.
- Image Block: Fix deprecation when width/height attribute is number.
- Text selection: show CSS hack to Safari only.
- SlotFill: Allow contextual SlotFillProviders.

See: WordPress/wordpress-develop#5696
See: WordPress/gutenberg@bd6767b
See: WordPress/gutenberg#56043
See: WordPress/gutenberg#56411
See: WordPress/gutenberg#57063
See: WordPress/gutenberg#57300
See: WordPress/gutenberg#56779

Props mikachan, wildworks, alexstine, poena, isabel_brison, andrewserong, czapla, andraganescu, joen, ellatrix, youknowriad, ntsekouras.
Fixes #59943, #59943.


Built from https://develop.svn.wordpress.org/trunk@57258


git-svn-id: http://core.svn.wordpress.org/trunk@56764 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
aaronjorbin authored and widoz committed Jan 26, 2024
1 parent 72c00f1 commit e92ee51
Show file tree
Hide file tree
Showing 21 changed files with 77 additions and 45 deletions.
2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/blocks/cover/style-rtl.css
Expand Up @@ -115,7 +115,7 @@
width:100%;
z-index:1;
}
.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color),.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color){
.wp-block-cover h1:where(:not(.has-text-color)),.wp-block-cover h2:where(:not(.has-text-color)),.wp-block-cover h3:where(:not(.has-text-color)),.wp-block-cover h4:where(:not(.has-text-color)),.wp-block-cover h5:where(:not(.has-text-color)),.wp-block-cover h6:where(:not(.has-text-color)),.wp-block-cover p:where(:not(.has-text-color)),.wp-block-cover-image h1:where(:not(.has-text-color)),.wp-block-cover-image h2:where(:not(.has-text-color)),.wp-block-cover-image h3:where(:not(.has-text-color)),.wp-block-cover-image h4:where(:not(.has-text-color)),.wp-block-cover-image h5:where(:not(.has-text-color)),.wp-block-cover-image h6:where(:not(.has-text-color)),.wp-block-cover-image p:where(:not(.has-text-color)){
color:inherit;
}
.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/blocks/cover/style-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/blocks/cover/style.css
Expand Up @@ -115,7 +115,7 @@
width:100%;
z-index:1;
}
.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color),.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color){
.wp-block-cover h1:where(:not(.has-text-color)),.wp-block-cover h2:where(:not(.has-text-color)),.wp-block-cover h3:where(:not(.has-text-color)),.wp-block-cover h4:where(:not(.has-text-color)),.wp-block-cover h5:where(:not(.has-text-color)),.wp-block-cover h6:where(:not(.has-text-color)),.wp-block-cover p:where(:not(.has-text-color)),.wp-block-cover-image h1:where(:not(.has-text-color)),.wp-block-cover-image h2:where(:not(.has-text-color)),.wp-block-cover-image h3:where(:not(.has-text-color)),.wp-block-cover-image h4:where(:not(.has-text-color)),.wp-block-cover-image h5:where(:not(.has-text-color)),.wp-block-cover-image h6:where(:not(.has-text-color)),.wp-block-cover-image p:where(:not(.has-text-color)){
color:inherit;
}
.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/blocks/cover/style.min.css

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions wp-includes/css/dist/block-editor/content-rtl.css
Expand Up @@ -48,15 +48,12 @@
opacity:.4;
}
}
:root .block-editor-block-list__layout::selection,:root .has-multi-selection .block-editor-block-list__layout::selection,_::-webkit-full-page-media,_:future{
background-color:transparent;
}
.block-editor-block-list__layout{
position:relative;
}
.block-editor-block-list__layout::selection{
background:transparent;
}
.has-multi-selection .block-editor-block-list__layout::selection{
background:transparent;
}
.block-editor-block-list__layout:where(.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)){
border-radius:2px;
}
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-editor/content-rtl.min.css

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions wp-includes/css/dist/block-editor/content.css
Expand Up @@ -48,15 +48,12 @@
opacity:.4;
}
}
:root .block-editor-block-list__layout::selection,:root .has-multi-selection .block-editor-block-list__layout::selection,_::-webkit-full-page-media,_:future{
background-color:transparent;
}
.block-editor-block-list__layout{
position:relative;
}
.block-editor-block-list__layout::selection{
background:transparent;
}
.has-multi-selection .block-editor-block-list__layout::selection{
background:transparent;
}
.block-editor-block-list__layout:where(.block-editor-block-list__block.is-multi-selected:not(.is-partially-selected)){
border-radius:2px;
}
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-editor/content.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style-rtl.css
Expand Up @@ -592,7 +592,7 @@
width:100%;
z-index:1;
}
.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color),.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color){
.wp-block-cover h1:where(:not(.has-text-color)),.wp-block-cover h2:where(:not(.has-text-color)),.wp-block-cover h3:where(:not(.has-text-color)),.wp-block-cover h4:where(:not(.has-text-color)),.wp-block-cover h5:where(:not(.has-text-color)),.wp-block-cover h6:where(:not(.has-text-color)),.wp-block-cover p:where(:not(.has-text-color)),.wp-block-cover-image h1:where(:not(.has-text-color)),.wp-block-cover-image h2:where(:not(.has-text-color)),.wp-block-cover-image h3:where(:not(.has-text-color)),.wp-block-cover-image h4:where(:not(.has-text-color)),.wp-block-cover-image h5:where(:not(.has-text-color)),.wp-block-cover-image h6:where(:not(.has-text-color)),.wp-block-cover-image p:where(:not(.has-text-color)){
color:inherit;
}
.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style-rtl.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style.css
Expand Up @@ -592,7 +592,7 @@
width:100%;
z-index:1;
}
.wp-block-cover h1:not(.has-text-color),.wp-block-cover h2:not(.has-text-color),.wp-block-cover h3:not(.has-text-color),.wp-block-cover h4:not(.has-text-color),.wp-block-cover h5:not(.has-text-color),.wp-block-cover h6:not(.has-text-color),.wp-block-cover p:not(.has-text-color),.wp-block-cover-image h1:not(.has-text-color),.wp-block-cover-image h2:not(.has-text-color),.wp-block-cover-image h3:not(.has-text-color),.wp-block-cover-image h4:not(.has-text-color),.wp-block-cover-image h5:not(.has-text-color),.wp-block-cover-image h6:not(.has-text-color),.wp-block-cover-image p:not(.has-text-color){
.wp-block-cover h1:where(:not(.has-text-color)),.wp-block-cover h2:where(:not(.has-text-color)),.wp-block-cover h3:where(:not(.has-text-color)),.wp-block-cover h4:where(:not(.has-text-color)),.wp-block-cover h5:where(:not(.has-text-color)),.wp-block-cover h6:where(:not(.has-text-color)),.wp-block-cover p:where(:not(.has-text-color)),.wp-block-cover-image h1:where(:not(.has-text-color)),.wp-block-cover-image h2:where(:not(.has-text-color)),.wp-block-cover-image h3:where(:not(.has-text-color)),.wp-block-cover-image h4:where(:not(.has-text-color)),.wp-block-cover-image h5:where(:not(.has-text-color)),.wp-block-cover-image h6:where(:not(.has-text-color)),.wp-block-cover-image p:where(:not(.has-text-color)){
color:inherit;
}
.wp-block-cover-image.is-position-top-left,.wp-block-cover.is-position-top-left{
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/css/dist/block-library/style.min.css

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions wp-includes/js/dist/block-editor.js
Expand Up @@ -8186,6 +8186,7 @@ function getUserPatterns(state) {
return {
name: `core/block/${userPattern.id}`,
id: userPattern.id,
type: 'user',
title: userPattern.title.raw,
categories: userPattern.wp_pattern_category.map(catId => categories && categories.get(catId) ? categories.get(catId).slug : catId),
content: userPattern.content.raw,
Expand Down Expand Up @@ -23553,7 +23554,9 @@ const ExperimentalBlockEditorProvider = with_registry_provider(props => {

// Syncs the entity provider with changes in the block-editor store.
useBlockSync(props);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SlotFillProvider, null, (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts.Register, null), (0,external_wp_element_namespaceObject.createElement)(BlockRefsProvider, null, children));
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SlotFillProvider, {
passthrough: true
}, (0,external_wp_element_namespaceObject.createElement)(keyboard_shortcuts.Register, null), (0,external_wp_element_namespaceObject.createElement)(BlockRefsProvider, null, children));
});
const BlockEditorProvider = props => {
return (0,external_wp_element_namespaceObject.createElement)(ExperimentalBlockEditorProvider, {
Expand Down Expand Up @@ -27690,14 +27693,14 @@ function BlockPattern({
}
}
}, (0,external_wp_element_namespaceObject.createElement)(WithToolTip, {
showTooltip: showTooltip && !pattern.id,
showTooltip: showTooltip && !pattern.type === 'user',
title: pattern.title
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableCompositeItem, {
role: "option",
as: "div",
...composite,
className: classnames_default()('block-editor-block-patterns-list__item', {
'block-editor-block-patterns-list__list-item-synced': pattern.id && !pattern.syncStatus
'block-editor-block-patterns-list__list-item-synced': pattern.type === 'user' && !pattern.syncStatus
}),
onClick: () => {
onClick(pattern, blocks);
Expand All @@ -27717,12 +27720,12 @@ function BlockPattern({
viewportWidth: viewportWidth
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
className: "block-editor-patterns__pattern-details"
}, pattern.id && !pattern.syncStatus && (0,external_wp_element_namespaceObject.createElement)("div", {
}, pattern.type === 'user' && !pattern.syncStatus && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-editor-patterns__pattern-icon-wrapper"
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
className: "block-editor-patterns__pattern-icon",
icon: library_symbol
})), (!showTooltip || pattern.id) && (0,external_wp_element_namespaceObject.createElement)("div", {
})), (!showTooltip || pattern.type === 'user') && (0,external_wp_element_namespaceObject.createElement)("div", {
className: "block-editor-block-patterns-list__item-title"
}, pattern.title)), !!pattern.description && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.VisuallyHidden, {
id: descriptionId
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/dist/block-editor.min.js

Large diffs are not rendered by default.

56 changes: 45 additions & 11 deletions wp-includes/js/dist/block-library.js
Expand Up @@ -23315,6 +23315,17 @@ const image_deprecated_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
}) {
Expand Down Expand Up @@ -23869,9 +23880,29 @@ const scaleOptions = [{
label: (0,external_wp_i18n_namespaceObject._x)('Contain', 'Scale option for dimensions control'),
help: (0,external_wp_i18n_namespaceObject.__)('Image is contained without distortion.')
}];
const disabledClickProps = {
onClick: event => event.preventDefault(),
'aria-disabled': true

// If the image has a href, wrap in an <a /> tag to trigger any inherited link element styles.
const ImageWrapper = ({
href,
children
}) => {
if (!href) {
return children;
}
return (0,external_wp_element_namespaceObject.createElement)("a", {
href: href,
onClick: event => event.preventDefault(),
"aria-disabled": true,
style: {
// When the Image block is linked,
// it's wrapped with a disabled <a /> tag.
// Restore cursor style so it doesn't appear 'clickable'
// and remove pointer events. Safari needs the display property.
pointerEvents: 'none',
cursor: 'default',
display: 'inline'
}
}, children);
};
function image_Image({
temporaryURL,
Expand Down Expand Up @@ -24323,7 +24354,9 @@ function image_Image({
// So we try using the imageRef width first and fallback to clientWidth.
const fallbackClientWidth = imageRef.current?.width || clientWidth;
if (canEditImage && isEditingImage) {
img = (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
img = (0,external_wp_element_namespaceObject.createElement)(ImageWrapper, {
href: href
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.__experimentalImageEditor, {
id: id,
url: url,
width: numericWidth,
Expand All @@ -24336,15 +24369,17 @@ function image_Image({
setIsEditingImage(false);
},
borderProps: isRounded ? undefined : borderProps
});
}));
} else if (!isResizable) {
img = (0,external_wp_element_namespaceObject.createElement)("div", {
style: {
width,
height,
aspectRatio
}
}, img);
}, (0,external_wp_element_namespaceObject.createElement)(ImageWrapper, {
href: href
}, img));
} else {
const numericRatio = aspectRatio && evalAspectRatio(aspectRatio);
const customRatio = numericWidth / numericHeight;
Expand Down Expand Up @@ -24429,15 +24464,14 @@ function image_Image({
});
},
resizeRatio: align === 'center' ? 2 : 1
}, img);
}, (0,external_wp_element_namespaceObject.createElement)(ImageWrapper, {
href: href
}, img));
}
if (!url && !temporaryURL) {
return sizeControls;
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !temporaryURL && controls, !!href ? (0,external_wp_element_namespaceObject.createElement)("a", {
href: href,
...disabledClickProps
}, img) : img, showCaption && (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !temporaryURL && controls, img, showCaption && (!external_wp_blockEditor_namespaceObject.RichText.isEmpty(caption) || isSelected) && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.RichText, {
identifier: "caption",
className: (0,external_wp_blockEditor_namespaceObject.__experimentalGetElementClassName)('caption'),
ref: captionRef,
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/dist/block-library.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion wp-includes/js/dist/components.js
Expand Up @@ -36658,10 +36658,11 @@ const slot_fill_Slot = (0,external_wp_element_namespaceObject.forwardRef)(({
});
function Provider({
children,
passthrough = false,
...props
}) {
const parent = (0,external_wp_element_namespaceObject.useContext)(slot_fill_context);
if (!parent.isDefault) {
if (!parent.isDefault && passthrough) {
return children;
}
return (0,external_wp_element_namespaceObject.createElement)(provider_SlotFillProvider, {
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/js/dist/components.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/version.php
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57257';
$wp_version = '6.5-alpha-57258';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit e92ee51

Please sign in to comment.