Update editor related npm packages for 6.4 RC1.

The npm packages needed a second part to the update for 6.4 RC1.

Props isabel_brison, andrewserong, jsnajdr, wildworks, joen, mciampini, tyxla, youknowriad, ramonopoly, spacedmonkey, dmsnell, mikachan, kishanjasani, czapla, siobhyb, darerodz, luisherranz

See #59411.

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


git-svn-id: http://core.svn.wordpress.org/trunk@56456 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Tammie Lister 2023-10-16 19:17:19 +00:00
parent aa29f65a28
commit 8325d334f6
16 changed files with 92 additions and 53 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -170,8 +170,8 @@ function block_core_image_render_lightbox( $block_content, $block ) {
if ( isset( $block['attrs']['id'] ) ) {
$img_uploaded_src = wp_get_attachment_url( $block['attrs']['id'] );
$img_metadata = wp_get_attachment_metadata( $block['attrs']['id'] );
$img_width = $img_metadata['width'];
$img_height = $img_metadata['height'];
$img_width = $img_metadata['width'] ?? 'none';
$img_height = $img_metadata['height'] ?? 'none';
} else {
$img_uploaded_src = $processor->get_attribute( 'src' );
$img_width = 'none';

View File

@ -38,6 +38,7 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
$link = 'next' === $navigation_type ? _x( 'Next', 'label for next post link' ) : _x( 'Previous', 'label for previous post link' );
$label = '';
// Only use hardcoded values here, otherwise we need to add escaping where these values are used.
$arrow_map = array(
'none' => '',
'arrow' => array(
@ -88,7 +89,7 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
}
// Display arrows.
if ( isset( $attributes['arrow'] ) && ! empty( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] ) {
if ( isset( $attributes['arrow'] ) && 'none' !== $attributes['arrow'] && isset( $arrow_map[ $attributes['arrow'] ] ) ) {
$arrow = $arrow_map[ $attributes['arrow'] ][ $navigation_type ];
if ( 'next' === $navigation_type ) {

View File

@ -48,14 +48,6 @@ class WP_Block_Parser {
*/
public $stack;
/**
* Empty associative array, here due to PHP quirks
*
* @since 4.4.0
* @var array empty associative array
*/
public $empty_attrs;
/**
* Parses a document and returns a list of block structures
*
@ -69,11 +61,10 @@ class WP_Block_Parser {
* @return array[]
*/
public function parse( $document ) {
$this->document = $document;
$this->offset = 0;
$this->output = array();
$this->stack = array();
$this->empty_attrs = array();
$this->document = $document;
$this->offset = 0;
$this->output = array();
$this->stack = array();
while ( $this->proceed() ) {
continue;
@ -287,7 +278,7 @@ class WP_Block_Parser {
*/
$attrs = $has_attrs
? json_decode( $matches['attrs'][0], /* as-associative */ true )
: $this->empty_attrs;
: array();
/*
* This state isn't allowed
@ -318,7 +309,7 @@ class WP_Block_Parser {
* @return WP_Block_Parser_Block freeform block object.
*/
public function freeform( $inner_html ) {
return new WP_Block_Parser_Block( null, $this->empty_attrs, array(), $inner_html, array( $inner_html ) );
return new WP_Block_Parser_Block( null, array(), array(), $inner_html, array( $inner_html ) );
}
/**

View File

@ -1056,21 +1056,28 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
}
.edit-site-global-styles-variations_item{
border-radius:2px;
box-sizing:border-box;
}
.edit-site-global-styles-variations_item .edit-site-global-styles-variations_item-preview{
border:1px solid #e0e0e0;
border-radius:2px;
box-shadow:0 0 0 1px #e0e0e0;
outline:1px solid transparent;
padding:2px;
}
.edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview{
border:1px solid #1e1e1e;
box-shadow:0 0 0 1px #1e1e1e;
outline-width:3px;
}
.edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview{
border:1px solid var(--wp-admin-theme-color);
box-shadow:0 0 0 1px var(--wp-admin-theme-color);
}
.edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview{
border:var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.edit-site-global-styles-variations_item:focus-visible{
outline:3px solid transparent;
outline-offset:0;
}
.edit-site-global-styles-icon-with-current-color{
@ -3088,16 +3095,16 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
}
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item-preview{
border:1px solid #1e1e1e;
box-shadow:0 0 0 1px #1e1e1e;
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview{
border:1px solid #f0f0f0;
box-shadow:0 0 0 1px #f0f0f0;
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview{
border:1px solid var(--wp-admin-theme-color);
box-shadow:0 0 0 1px var(--wp-admin-theme-color);
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview{
border:var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.edit-site-sidebar-navigation-screen__footer{

File diff suppressed because one or more lines are too long

View File

@ -1056,21 +1056,28 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
}
.edit-site-global-styles-variations_item{
border-radius:2px;
box-sizing:border-box;
}
.edit-site-global-styles-variations_item .edit-site-global-styles-variations_item-preview{
border:1px solid #e0e0e0;
border-radius:2px;
box-shadow:0 0 0 1px #e0e0e0;
outline:1px solid transparent;
padding:2px;
}
.edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview{
border:1px solid #1e1e1e;
box-shadow:0 0 0 1px #1e1e1e;
outline-width:3px;
}
.edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview{
border:1px solid var(--wp-admin-theme-color);
box-shadow:0 0 0 1px var(--wp-admin-theme-color);
}
.edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview{
border:var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.edit-site-global-styles-variations_item:focus-visible{
outline:3px solid transparent;
outline-offset:0;
}
.edit-site-global-styles-icon-with-current-color{
@ -3088,16 +3095,16 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
}
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item-preview{
border:1px solid #1e1e1e;
box-shadow:0 0 0 1px #1e1e1e;
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview{
border:1px solid #f0f0f0;
box-shadow:0 0 0 1px #f0f0f0;
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview{
border:1px solid var(--wp-admin-theme-color);
box-shadow:0 0 0 1px var(--wp-admin-theme-color);
}
.edit-site-sidebar-navigation-screen__content .edit-site-global-styles-style-variations-container .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview{
border:var(--wp-admin-theme-color) var(--wp-admin-border-width-focus) solid;
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
}
.edit-site-sidebar-navigation-screen__footer{

File diff suppressed because one or more lines are too long

View File

@ -26712,6 +26712,7 @@ function AutoBlockPreview(props) {
function BlockPreview({
blocks,
viewportWidth = 1200,
@ -26794,6 +26795,8 @@ function useBlockPreview({
const originalSettings = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings(), []);
const settings = (0,external_wp_element_namespaceObject.useMemo)(() => ({
...originalSettings,
styles: undefined,
// Clear styles included by the parent settings, as they are already output by the parent's EditorStyles.
__unstableIsPreviewMode: true
}), [originalSettings]);
const disabledRef = (0,external_wp_compose_namespaceObject.useDisabled)();
@ -26802,7 +26805,7 @@ function useBlockPreview({
const children = (0,external_wp_element_namespaceObject.createElement)(ExperimentalBlockEditorProvider, {
value: renderedBlocks,
settings: settings
}, (0,external_wp_element_namespaceObject.createElement)(BlockListItems, {
}, (0,external_wp_element_namespaceObject.createElement)(EditorStyles, null), (0,external_wp_element_namespaceObject.createElement)(BlockListItems, {
renderAppender: false,
layout: layout
}));
@ -41953,7 +41956,14 @@ function FiltersPanel({
const duotone_EMPTY_ARRAY = [];
// Safari does not always update the duotone filter when the duotone colors
// are changed. This browser check is later used to force a re-render of the block
// element to ensure the duotone filter is updated. The check is included at the
// root of this file as it only needs to be run once per page load.
const isSafari = window?.navigator.userAgent && window.navigator.userAgent.includes('Safari') && !window.navigator.userAgent.includes('Chrome') && !window.navigator.userAgent.includes('Chromium');
k([names]);
function useMultiOriginPresets({
presetSetting,
@ -42106,6 +42116,7 @@ const withDuotoneControls = (0,external_wp_compose_namespaceObject.createHigherO
}));
}, 'withDuotoneControls');
function DuotoneStyles({
clientId,
id: filterId,
selector: duotoneSelector,
attribute: duotoneAttr
@ -42155,6 +42166,7 @@ function DuotoneStyles({
setStyleOverride,
deleteStyleOverride
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
const blockElement = useBlockElement(clientId);
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!isValidFilter) return;
setStyleOverride(filterId, {
@ -42165,11 +42177,28 @@ function DuotoneStyles({
assets: colors !== 'unset' ? getDuotoneFilter(filterId, colors) : '',
__unstableType: 'svgs'
});
// Safari does not always update the duotone filter when the duotone colors
// are changed. When using Safari, force the block element to be repainted by
// the browser to ensure any changes are reflected visually. This logic matches
// that used on the site frontend in `block-supports/duotone.php`.
if (blockElement && isSafari) {
const display = blockElement.style.display;
// Switch to `inline-block` to force a repaint. In the editor, `inline-block`
// is used instead of `none` to ensure that scroll position is not affected,
// as `none` results in the editor scrolling to the top of the block.
blockElement.style.display = 'inline-block';
// Simply accessing el.offsetHeight flushes layout and style
// changes in WebKit without having to wait for setTimeout.
// eslint-disable-next-line no-unused-expressions
blockElement.offsetHeight;
blockElement.style.display = display;
}
return () => {
deleteStyleOverride(filterId);
deleteStyleOverride(`duotone-${filterId}`);
};
}, [isValidFilter, colors, selector, filterId, setStyleOverride, deleteStyleOverride]);
}, [isValidFilter, blockElement, colors, selector, filterId, setStyleOverride, deleteStyleOverride]);
return null;
}
@ -42219,6 +42248,7 @@ const withDuotoneStyles = (0,external_wp_compose_namespaceObject.createHigherOrd
// above this line should be carefully evaluated for its impact on
// performance.
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, shouldRender && (0,external_wp_element_namespaceObject.createElement)(DuotoneStyles, {
clientId: props.clientId,
id: filterClass,
selector: selector,
attribute: attribute
@ -43026,13 +43056,13 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!css) return;
setStyleOverride(id, {
setStyleOverride(selector, {
css
});
return () => {
deleteStyleOverride(id);
deleteStyleOverride(selector);
};
}, [id, css, setStyleOverride, deleteStyleOverride]);
}, [selector, css, setStyleOverride, deleteStyleOverride]);
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, {
...props,
__unstableLayoutClassNames: layoutClassNames
@ -43092,13 +43122,13 @@ const withChildLayoutStyles = (0,external_wp_compose_namespaceObject.createHighe
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store));
(0,external_wp_element_namespaceObject.useEffect)(() => {
if (!css) return;
setStyleOverride(id, {
setStyleOverride(selector, {
css
});
return () => {
deleteStyleOverride(id);
deleteStyleOverride(selector);
};
}, [id, css, setStyleOverride, deleteStyleOverride]);
}, [selector, css, setStyleOverride, deleteStyleOverride]);
return (0,external_wp_element_namespaceObject.createElement)(BlockListBlock, {
...props,
className: className

File diff suppressed because one or more lines are too long

View File

@ -76092,10 +76092,10 @@ const animateProgressBar = emotion_react_browser_esm_keyframes({
const INDETERMINATE_TRACK_WIDTH = 50;
const styles_Track = createStyled("div", true ? {
target: "e15u147w2"
} : 0)("position:relative;overflow:hidden;width:100%;max-width:160px;height:", config_values.borderWidthFocus, ";background-color:var(\n\t\t--wp-components-color-gray-300,\n\t\t", COLORS.gray[300], "\n\t);border-radius:", config_values.radiusBlockUi, ";" + ( true ? "" : 0));
} : 0)("position:relative;overflow:hidden;width:100%;max-width:160px;height:", config_values.borderWidthFocus, ";background-color:color-mix(\n\t\tin srgb,\n\t\tvar( --wp-components-color-foreground, ", COLORS.gray[900], " ),\n\t\ttransparent 90%\n\t);border-radius:", config_values.radiusBlockUi, ";outline:2px solid transparent;outline-offset:2px;" + ( true ? "" : 0));
const Indicator = createStyled("div", true ? {
target: "e15u147w1"
} : 0)("display:inline-block;position:absolute;top:0;height:100%;border-radius:", config_values.radiusBlockUi, ";background-color:", COLORS.theme.accent, ";", ({
} : 0)("display:inline-block;position:absolute;top:0;height:100%;border-radius:", config_values.radiusBlockUi, ";background-color:color-mix(\n\t\tin srgb,\n\t\tvar( --wp-components-color-foreground, ", COLORS.gray[900], " ),\n\t\ttransparent 10%\n\t);outline:2px solid transparent;outline-offset:-2px;", ({
isIndeterminate,
value
}) => isIndeterminate ? /*#__PURE__*/emotion_react_browser_esm_css({

File diff suppressed because one or more lines are too long

View File

@ -29660,6 +29660,9 @@ function PostLastRevisionCheck({
lastRevisionId,
revisionsCount
} = useRevisionData();
if (true) {
return null;
}
if (!lastRevisionId || revisionsCount < 2) {
return null;
}

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.4-beta4-56944';
$wp_version = '6.4-beta4-56945';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.