Update @wordpress packages
Update packages to include these bug fixes from Gutenberg: - Force remount LinkControl when moving between links within same richtext block - Site Editor: Change ToolsMoreMenuGroup slot-fill name - Respect fields param for global styles REST API requests. - Try ensuring the item after post content clears floats - Fix submenus not opening on click - Apply i18n functions to Nav block menu drops when selecting existing Menu - Gallery: Make sure the mobile warning notice only runs when images are added to a new block - Prepare navigation php code for core patch - Address deprecation issues from Buttons flex layout PR. - Block Library: Fix incorrect attributes definitions - Fix Navigation accessibility issues See #54337. Built from https://develop.svn.wordpress.org/trunk@52103 git-svn-id: http://core.svn.wordpress.org/trunk@51695 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
80f38671d0
commit
3e094c27d0
File diff suppressed because one or more lines are too long
|
@ -111,14 +111,26 @@ function wp_get_layout_style( $selector, $layout, $has_block_gap_support = false
|
|||
*/
|
||||
if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) {
|
||||
$style .= "justify-content: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
// --justification-setting allows children to inherit the value regardless or row or column direction.
|
||||
$style .= "--justification-setting: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
if ( ! empty( $layout['setCascadingProperties'] ) && $layout['setCascadingProperties'] ) {
|
||||
// --layout-justification-setting allows children to inherit the value regardless or row or column direction.
|
||||
$style .= "--layout-justification-setting: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
$style .= '--layout-direction: row;';
|
||||
$style .= "--layout-wrap: $flex_wrap;";
|
||||
$style .= "--layout-justify: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
$style .= '--layout-align: center;';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$style .= 'flex-direction: column;';
|
||||
if ( ! empty( $layout['justifyContent'] ) && array_key_exists( $layout['justifyContent'], $justify_content_options ) ) {
|
||||
$style .= "align-items: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
$style .= "--justification-setting: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
if ( ! empty( $layout['setCascadingProperties'] ) && $layout['setCascadingProperties'] ) {
|
||||
// --layout-justification-setting allows children to inherit the value regardless or row or column direction.
|
||||
$style .= "--layout-justification-setting: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
$style .= '--layout-direction: column;';
|
||||
$style .= '--layout-justify: initial;';
|
||||
$style .= "--layout-align: {$justify_content_options[ $layout['justifyContent'] ]};";
|
||||
}
|
||||
}
|
||||
}
|
||||
$style .= '}';
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"type": "array"
|
||||
},
|
||||
"templateLock": {
|
||||
"type": "string",
|
||||
"type": [ "string", "boolean" ],
|
||||
"enum": [ "all", "insert", false ]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -67,7 +67,7 @@
|
|||
"type": "array"
|
||||
},
|
||||
"templateLock": {
|
||||
"type": "string",
|
||||
"type": [ "string", "boolean" ],
|
||||
"enum": [ "all", "insert", false ]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"default": "div"
|
||||
},
|
||||
"templateLock": {
|
||||
"type": "string",
|
||||
"type": [ "string", "boolean" ],
|
||||
"enum": [ "all", "insert", false ]
|
||||
}
|
||||
},
|
||||
|
|
|
@ -88,6 +88,7 @@ button.wp-block-navigation-item__content {
|
|||
color: currentColor;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.wp-block-navigation-submenu__toggle {
|
||||
|
|
|
@ -1 +1 @@
|
|||
.wp-block-navigation-submenu{position:relative;display:flex}.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg{stroke:currentColor}button.wp-block-navigation-item__content{background-color:initial;border:none;color:currentColor;font-size:inherit;font-family:inherit}.wp-block-navigation-submenu__toggle{cursor:pointer}
|
||||
.wp-block-navigation-submenu{position:relative;display:flex}.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg{stroke:currentColor}button.wp-block-navigation-item__content{background-color:initial;border:none;color:currentColor;font-size:inherit;font-family:inherit;text-align:right}.wp-block-navigation-submenu__toggle{cursor:pointer}
|
|
@ -88,6 +88,7 @@ button.wp-block-navigation-item__content {
|
|||
color: currentColor;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.wp-block-navigation-submenu__toggle {
|
||||
|
|
|
@ -1 +1 @@
|
|||
.wp-block-navigation-submenu{position:relative;display:flex}.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg{stroke:currentColor}button.wp-block-navigation-item__content{background-color:initial;border:none;color:currentColor;font-size:inherit;font-family:inherit}.wp-block-navigation-submenu__toggle{cursor:pointer}
|
||||
.wp-block-navigation-submenu{position:relative;display:flex}.wp-block-navigation-submenu .wp-block-navigation__submenu-icon svg{stroke:currentColor}button.wp-block-navigation-item__content{background-color:initial;border:none;color:currentColor;font-size:inherit;font-family:inherit;text-align:left}.wp-block-navigation-submenu__toggle{cursor:pointer}
|
|
@ -85,117 +85,6 @@ function block_core_navigation_build_css_font_sizes( $attributes ) {
|
|||
return $font_sizes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the menu items for a WordPress menu location.
|
||||
*
|
||||
* @param string $location The menu location.
|
||||
* @return array Menu items for the location.
|
||||
*/
|
||||
function gutenberg_get_menu_items_at_location( $location ) {
|
||||
if ( empty( $location ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Build menu data. The following approximates the code in
|
||||
// `wp_nav_menu()` and `gutenberg_output_block_nav_menu`.
|
||||
|
||||
// Find the location in the list of locations, returning early if the
|
||||
// location can't be found.
|
||||
$locations = get_nav_menu_locations();
|
||||
if ( ! isset( $locations[ $location ] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the menu from the location, returning early if there is no
|
||||
// menu or there was an error.
|
||||
$menu = wp_get_nav_menu_object( $locations[ $location ] );
|
||||
if ( ! $menu || is_wp_error( $menu ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) );
|
||||
_wp_menu_item_classes_by_context( $menu_items );
|
||||
|
||||
return $menu_items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts a standard array of menu items into a nested structure keyed by the
|
||||
* id of the parent menu.
|
||||
*
|
||||
* @param array $menu_items Menu items to sort.
|
||||
* @return array An array keyed by the id of the parent menu where each element
|
||||
* is an array of menu items that belong to that parent.
|
||||
*/
|
||||
function gutenberg_sort_menu_items_by_parent_id( $menu_items ) {
|
||||
$sorted_menu_items = array();
|
||||
foreach ( (array) $menu_items as $menu_item ) {
|
||||
$sorted_menu_items[ $menu_item->menu_order ] = $menu_item;
|
||||
}
|
||||
unset( $menu_items, $menu_item );
|
||||
|
||||
$menu_items_by_parent_id = array();
|
||||
foreach ( $sorted_menu_items as $menu_item ) {
|
||||
$menu_items_by_parent_id[ $menu_item->menu_item_parent ][] = $menu_item;
|
||||
}
|
||||
|
||||
return $menu_items_by_parent_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns menu item data into a nested array of parsed blocks
|
||||
*
|
||||
* @param array $menu_items An array of menu items that represent
|
||||
* an individual level of a menu.
|
||||
* @param array $menu_items_by_parent_id An array keyed by the id of the
|
||||
* parent menu where each element is an
|
||||
* array of menu items that belong to
|
||||
* that parent.
|
||||
* @return array An array of parsed block data.
|
||||
*/
|
||||
function gutenberg_parse_blocks_from_menu_items( $menu_items, $menu_items_by_parent_id ) {
|
||||
if ( empty( $menu_items ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$blocks = array();
|
||||
|
||||
foreach ( $menu_items as $menu_item ) {
|
||||
$class_name = ! empty( $menu_item->classes ) ? implode( ' ', (array) $menu_item->classes ) : null;
|
||||
$id = ( null !== $menu_item->object_id && 'custom' !== $menu_item->object ) ? $menu_item->object_id : null;
|
||||
$opens_in_new_tab = null !== $menu_item->target && '_blank' === $menu_item->target;
|
||||
$rel = ( null !== $menu_item->xfn && '' !== $menu_item->xfn ) ? $menu_item->xfn : null;
|
||||
$kind = null !== $menu_item->type ? str_replace( '_', '-', $menu_item->type ) : 'custom';
|
||||
|
||||
$block = array(
|
||||
'blockName' => 'core/navigation-link',
|
||||
'attrs' => array(
|
||||
'className' => $class_name,
|
||||
'description' => $menu_item->description,
|
||||
'id' => $id,
|
||||
'kind' => $kind,
|
||||
'label' => $menu_item->title,
|
||||
'opensInNewTab' => $opens_in_new_tab,
|
||||
'rel' => $rel,
|
||||
'title' => $menu_item->attr_title,
|
||||
'type' => $menu_item->object,
|
||||
'url' => $menu_item->url,
|
||||
),
|
||||
);
|
||||
|
||||
$block['innerBlocks'] = gutenberg_parse_blocks_from_menu_items(
|
||||
isset( $menu_items_by_parent_id[ $menu_item->ID ] )
|
||||
? $menu_items_by_parent_id[ $menu_item->ID ]
|
||||
: array(),
|
||||
$menu_items_by_parent_id
|
||||
);
|
||||
|
||||
$blocks[] = $block;
|
||||
}
|
||||
|
||||
return $blocks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the top-level submenu SVG chevron icon.
|
||||
*
|
||||
|
@ -354,7 +243,7 @@ function render_block_core_navigation( $attributes, $content, $block ) {
|
|||
|
||||
$responsive_container_markup = sprintf(
|
||||
'<button aria-expanded="false" aria-haspopup="true" aria-label="%3$s" class="%6$s" data-micromodal-trigger="modal-%1$s"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" role="img" aria-hidden="true" focusable="false"><rect x="4" y="7.5" width="16" height="1.5" /><rect x="4" y="15" width="16" height="1.5" /></svg></button>
|
||||
<div class="%5$s" id="modal-%1$s" aria-hidden="true">
|
||||
<div class="%5$s" id="modal-%1$s">
|
||||
<div class="wp-block-navigation__responsive-close" tabindex="-1" data-micromodal-close>
|
||||
<div class="wp-block-navigation__responsive-dialog" role="dialog" aria-modal="true" aria-labelledby="modal-%1$s-title" >
|
||||
<button aria-label="%4$s" data-micromodal-close class="wp-block-navigation__responsive-container-close"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" role="img" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg></button>
|
||||
|
|
|
@ -114,7 +114,8 @@
|
|||
"allowSwitching": false,
|
||||
"allowInheriting": false,
|
||||
"default": {
|
||||
"type": "flex"
|
||||
"type": "flex",
|
||||
"setCascadingProperties": true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -264,6 +264,11 @@
|
|||
}
|
||||
|
||||
.wp-block-navigation__container {
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-right: 0;
|
||||
|
@ -284,7 +289,11 @@
|
|||
bottom: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content {
|
||||
display: contents;
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open {
|
||||
display: flex;
|
||||
|
@ -293,12 +302,12 @@
|
|||
z-index: 100000;
|
||||
padding: 72px 24px 24px 24px;
|
||||
background-color: inherit;
|
||||
align-items: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, inherit);
|
||||
justify-content: flex-start;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
@ -336,7 +345,7 @@
|
|||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
|
||||
|
@ -349,7 +358,7 @@
|
|||
}
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
|
||||
display: contents;
|
||||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
@ -416,15 +425,4 @@
|
|||
|
||||
html.has-modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wp-block-navigation__responsive-close,
|
||||
.wp-block-navigation__responsive-dialog,
|
||||
.wp-block-navigation__container {
|
||||
display: contents;
|
||||
}
|
||||
.is-menu-open .wp-block-navigation__responsive-close,
|
||||
.is-menu-open .wp-block-navigation__responsive-dialog,
|
||||
.is-menu-open .wp-block-navigation__container {
|
||||
align-items: inherit;
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -264,6 +264,11 @@
|
|||
}
|
||||
|
||||
.wp-block-navigation__container {
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
|
@ -284,7 +289,11 @@
|
|||
bottom: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content {
|
||||
display: contents;
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open {
|
||||
display: flex;
|
||||
|
@ -293,12 +302,12 @@
|
|||
z-index: 100000;
|
||||
padding: 72px 24px 24px 24px;
|
||||
background-color: inherit;
|
||||
align-items: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, inherit);
|
||||
justify-content: flex-start;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
@ -336,7 +345,7 @@
|
|||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
|
||||
|
@ -349,7 +358,7 @@
|
|||
}
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
|
||||
display: contents;
|
||||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
@ -416,15 +425,4 @@
|
|||
|
||||
html.has-modal-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wp-block-navigation__responsive-close,
|
||||
.wp-block-navigation__responsive-dialog,
|
||||
.wp-block-navigation__container {
|
||||
display: contents;
|
||||
}
|
||||
.is-menu-open .wp-block-navigation__responsive-close,
|
||||
.is-menu-open .wp-block-navigation__responsive-dialog,
|
||||
.is-menu-open .wp-block-navigation__container {
|
||||
align-items: inherit;
|
||||
}
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array(), 'version' => 'f63141a5a5be0a629c2580a2c4b8e4f8');
|
||||
<?php return array('dependencies' => array(), 'version' => '554dac353fae87a844b8e51706ae55ba');
|
|
@ -581,37 +581,39 @@ function toggleSubmenuOnClick(event) {
|
|||
|
||||
buttonToggle.setAttribute('aria-expanded', 'true');
|
||||
}
|
||||
}
|
||||
|
||||
const submenuButtons = document.querySelectorAll('.wp-block-navigation-submenu__toggle');
|
||||
submenuButtons.forEach(function (button) {
|
||||
button.addEventListener('click', toggleSubmenuOnClick);
|
||||
}); // Close on click outside.
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
const navigationBlocks = document.querySelectorAll('.wp-block-navigation');
|
||||
navigationBlocks.forEach(function (block) {
|
||||
if (!block.contains(event.target)) {
|
||||
closeSubmenus(block);
|
||||
}
|
||||
});
|
||||
}); // Close on focus outside.
|
||||
|
||||
document.addEventListener('keyup', function (event) {
|
||||
const submenuBlocks = document.querySelectorAll('.wp-block-navigation-item.has-child');
|
||||
submenuBlocks.forEach(function (block) {
|
||||
if (!block.contains(event.target)) {
|
||||
closeSubmenus(block);
|
||||
}
|
||||
});
|
||||
}); // Necessary for some themes such as TT1 Blocks, where
|
||||
} // Necessary for some themes such as TT1 Blocks, where
|
||||
// scripts could be loaded before the body.
|
||||
|
||||
window.onload = () => micromodal_es.init({
|
||||
onShow: navigationToggleModal,
|
||||
onClose: navigationToggleModal,
|
||||
openClass: 'is-menu-open'
|
||||
});
|
||||
|
||||
window.onload = () => {
|
||||
micromodal_es.init({
|
||||
onShow: navigationToggleModal,
|
||||
onClose: navigationToggleModal,
|
||||
openClass: 'is-menu-open'
|
||||
});
|
||||
const submenuButtons = document.querySelectorAll('.wp-block-navigation-submenu__toggle');
|
||||
submenuButtons.forEach(function (button) {
|
||||
button.addEventListener('click', toggleSubmenuOnClick);
|
||||
}); // Close on click outside.
|
||||
|
||||
document.addEventListener('click', function (event) {
|
||||
const navigationBlocks = document.querySelectorAll('.wp-block-navigation');
|
||||
navigationBlocks.forEach(function (block) {
|
||||
if (!block.contains(event.target)) {
|
||||
closeSubmenus(block);
|
||||
}
|
||||
});
|
||||
}); // Close on focus outside.
|
||||
|
||||
document.addEventListener('keyup', function (event) {
|
||||
const submenuBlocks = document.querySelectorAll('.wp-block-navigation-item.has-child');
|
||||
submenuBlocks.forEach(function (block) {
|
||||
if (!block.contains(event.target)) {
|
||||
closeSubmenus(block);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/***/ })
|
||||
|
|
|
@ -1 +1 @@
|
|||
<?php return array('dependencies' => array(), 'version' => '7b2c5174a07c417dc3db6f1d9a9c3f78');
|
||||
<?php return array('dependencies' => array(), 'version' => '4942262e50480536aae4cd504a13f19c');
|
File diff suppressed because one or more lines are too long
|
@ -75,8 +75,11 @@
|
|||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-navigation .wp-block-page-list {
|
||||
display: contents;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation .wp-block-navigation-item {
|
||||
|
|
|
@ -1 +1 @@
|
|||
.wp-block-navigation .wp-block-page-list{display:contents;flex-wrap:wrap;background-color:inherit}.wp-block-navigation .wp-block-navigation-item{background-color:inherit}
|
||||
.wp-block-navigation .wp-block-page-list{display:flex;flex-direction:var(--layout-direction,initial);justify-content:var(--layout-justify,initial);align-items:var(--layout-align,initial);flex-wrap:var(--layout-wrap,wrap);background-color:inherit}.wp-block-navigation .wp-block-navigation-item{background-color:inherit}
|
|
@ -75,8 +75,11 @@
|
|||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-navigation .wp-block-page-list {
|
||||
display: contents;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation .wp-block-navigation-item {
|
||||
|
|
|
@ -1 +1 @@
|
|||
.wp-block-navigation .wp-block-page-list{display:contents;flex-wrap:wrap;background-color:inherit}.wp-block-navigation .wp-block-navigation-item{background-color:inherit}
|
||||
.wp-block-navigation .wp-block-page-list{display:flex;flex-direction:var(--layout-direction,initial);justify-content:var(--layout-justify,initial);align-items:var(--layout-align,initial);flex-wrap:var(--layout-wrap,wrap);background-color:inherit}.wp-block-navigation .wp-block-navigation-item{background-color:inherit}
|
|
@ -1,79 +0,0 @@
|
|||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Converts a hex value into the rgb equivalent.
|
||||
*
|
||||
* @param {string} hex - the hexadecimal value to convert
|
||||
* @return {string} comma separated rgb values
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-content + * {
|
||||
clear: both;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
.wp-block-post-content+*{clear:both}
|
|
@ -1,79 +0,0 @@
|
|||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Breakpoints & Media Queries
|
||||
*/
|
||||
/**
|
||||
* SCSS Variables.
|
||||
*
|
||||
* Please use variables from this sheet to ensure consistency across the UI.
|
||||
* Don't add to this sheet unless you're pretty sure the value will be reused in many places.
|
||||
* For example, don't add rules to this sheet that affect block visuals. It's purely for UI.
|
||||
*/
|
||||
/**
|
||||
* Colors
|
||||
*/
|
||||
/**
|
||||
* Fonts & basic variables.
|
||||
*/
|
||||
/**
|
||||
* Grid System.
|
||||
* https://make.wordpress.org/design/2019/10/31/proposal-a-consistent-spacing-system-for-wordpress/
|
||||
*/
|
||||
/**
|
||||
* Dimensions.
|
||||
*/
|
||||
/**
|
||||
* Shadows.
|
||||
*/
|
||||
/**
|
||||
* Editor widths.
|
||||
*/
|
||||
/**
|
||||
* Block & Editor UI.
|
||||
*/
|
||||
/**
|
||||
* Block paddings.
|
||||
*/
|
||||
/**
|
||||
* React Native specific.
|
||||
* These variables do not appear to be used anywhere else.
|
||||
*/
|
||||
/**
|
||||
* Converts a hex value into the rgb equivalent.
|
||||
*
|
||||
* @param {string} hex - the hexadecimal value to convert
|
||||
* @return {string} comma separated rgb values
|
||||
*/
|
||||
/**
|
||||
* Breakpoint mixins
|
||||
*/
|
||||
/**
|
||||
* Long content fade mixin
|
||||
*
|
||||
* Creates a fading overlay to signify that the content is longer
|
||||
* than the space allows.
|
||||
*/
|
||||
/**
|
||||
* Focus styles.
|
||||
*/
|
||||
/**
|
||||
* Applies editor left position to the selector passed as argument
|
||||
*/
|
||||
/**
|
||||
* Styles that are reused verbatim in a few places
|
||||
*/
|
||||
/**
|
||||
* Allows users to opt-out of animations via OS-level preferences.
|
||||
*/
|
||||
/**
|
||||
* Reset default styles for JavaScript UI based pages.
|
||||
* This is a WP-admin agnostic reset
|
||||
*/
|
||||
/**
|
||||
* Reset the WP Admin page styles for Gutenberg-like pages.
|
||||
*/
|
||||
.wp-block-post-content + * {
|
||||
clear: both;
|
||||
}
|
|
@ -1 +0,0 @@
|
|||
.wp-block-post-content+*{clear:both}
|
|
@ -1669,6 +1669,11 @@ ul.has-background {
|
|||
}
|
||||
|
||||
.wp-block-navigation__container {
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-right: 0;
|
||||
|
@ -1689,7 +1694,11 @@ ul.has-background {
|
|||
bottom: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content {
|
||||
display: contents;
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open {
|
||||
display: flex;
|
||||
|
@ -1698,12 +1707,12 @@ ul.has-background {
|
|||
z-index: 100000;
|
||||
padding: 72px 24px 24px 24px;
|
||||
background-color: inherit;
|
||||
align-items: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, inherit);
|
||||
justify-content: flex-start;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
@ -1741,7 +1750,7 @@ ul.has-background {
|
|||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
|
||||
|
@ -1754,7 +1763,7 @@ ul.has-background {
|
|||
}
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
|
||||
display: contents;
|
||||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
@ -1823,17 +1832,6 @@ html.has-modal-open {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wp-block-navigation__responsive-close,
|
||||
.wp-block-navigation__responsive-dialog,
|
||||
.wp-block-navigation__container {
|
||||
display: contents;
|
||||
}
|
||||
.is-menu-open .wp-block-navigation__responsive-close,
|
||||
.is-menu-open .wp-block-navigation__responsive-dialog,
|
||||
.is-menu-open .wp-block-navigation__container {
|
||||
align-items: inherit;
|
||||
}
|
||||
|
||||
.wp-block-navigation .wp-block-navigation-item__label {
|
||||
word-break: normal;
|
||||
overflow-wrap: break-word;
|
||||
|
@ -1853,6 +1851,7 @@ button.wp-block-navigation-item__content {
|
|||
color: currentColor;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.wp-block-navigation-submenu__toggle {
|
||||
|
@ -1889,8 +1888,11 @@ button.wp-block-navigation-item__content {
|
|||
}
|
||||
|
||||
.wp-block-navigation .wp-block-page-list {
|
||||
display: contents;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation .wp-block-navigation-item {
|
||||
|
@ -2165,10 +2167,6 @@ p.has-background {
|
|||
color: inherit;
|
||||
}
|
||||
|
||||
.wp-block-post-content + * {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wp-block-post-template,
|
||||
.wp-block-query-loop {
|
||||
margin-top: 0;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1691,6 +1691,11 @@ ul.has-background {
|
|||
}
|
||||
|
||||
.wp-block-navigation__container {
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding-left: 0;
|
||||
|
@ -1711,7 +1716,11 @@ ul.has-background {
|
|||
bottom: 0;
|
||||
}
|
||||
.wp-block-navigation__responsive-container .wp-block-navigation__responsive-container-content {
|
||||
display: contents;
|
||||
display: flex;
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open {
|
||||
display: flex;
|
||||
|
@ -1720,12 +1729,12 @@ ul.has-background {
|
|||
z-index: 100000;
|
||||
padding: 72px 24px 24px 24px;
|
||||
background-color: inherit;
|
||||
align-items: inherit;
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, inherit);
|
||||
justify-content: flex-start;
|
||||
overflow: auto;
|
||||
padding: 0;
|
||||
}
|
||||
|
@ -1763,7 +1772,7 @@ ul.has-background {
|
|||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: var(--justification-setting, inherit);
|
||||
align-items: var(--layout-justification-setting, initial);
|
||||
}
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item .wp-block-navigation__submenu-container,
|
||||
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
|
||||
|
@ -1776,7 +1785,7 @@ ul.has-background {
|
|||
}
|
||||
@media (min-width: 600px) {
|
||||
.wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
|
||||
display: contents;
|
||||
display: block;
|
||||
width: 100%;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
|
@ -1845,17 +1854,6 @@ html.has-modal-open {
|
|||
overflow: hidden;
|
||||
}
|
||||
|
||||
.wp-block-navigation__responsive-close,
|
||||
.wp-block-navigation__responsive-dialog,
|
||||
.wp-block-navigation__container {
|
||||
display: contents;
|
||||
}
|
||||
.is-menu-open .wp-block-navigation__responsive-close,
|
||||
.is-menu-open .wp-block-navigation__responsive-dialog,
|
||||
.is-menu-open .wp-block-navigation__container {
|
||||
align-items: inherit;
|
||||
}
|
||||
|
||||
.wp-block-navigation .wp-block-navigation-item__label {
|
||||
word-break: normal;
|
||||
overflow-wrap: break-word;
|
||||
|
@ -1875,6 +1873,7 @@ button.wp-block-navigation-item__content {
|
|||
color: currentColor;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.wp-block-navigation-submenu__toggle {
|
||||
|
@ -1911,8 +1910,11 @@ button.wp-block-navigation-item__content {
|
|||
}
|
||||
|
||||
.wp-block-navigation .wp-block-page-list {
|
||||
display: contents;
|
||||
flex-wrap: wrap;
|
||||
display: flex;
|
||||
flex-direction: var(--layout-direction, initial);
|
||||
justify-content: var(--layout-justify, initial);
|
||||
align-items: var(--layout-align, initial);
|
||||
flex-wrap: var(--layout-wrap, wrap);
|
||||
background-color: inherit;
|
||||
}
|
||||
.wp-block-navigation .wp-block-navigation-item {
|
||||
|
@ -2187,10 +2189,6 @@ p.has-background {
|
|||
color: inherit;
|
||||
}
|
||||
|
||||
.wp-block-post-content + * {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wp-block-post-template,
|
||||
.wp-block-query-loop {
|
||||
margin-top: 0;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -25433,26 +25433,46 @@ const flexWrapOptions = ['wrap', 'nowrap'];
|
|||
layout
|
||||
}) {
|
||||
const {
|
||||
orientation = 'horizontal'
|
||||
orientation = 'horizontal',
|
||||
setCascadingProperties = false
|
||||
} = layout;
|
||||
const blockGapSupport = Object(use_setting["a" /* default */])('spacing.blockGap');
|
||||
const hasBlockGapStylesSupport = blockGapSupport !== null;
|
||||
const justifyContent = justifyContentMap[layout.justifyContent] || justifyContentMap.left;
|
||||
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap'; // --justification-setting allows children to inherit the value
|
||||
// regardless or row or column direction.
|
||||
|
||||
const rowOrientation = `
|
||||
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
||||
let rowOrientation = `
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: ${justifyContent};
|
||||
--justification-setting: ${justifyContent};
|
||||
`;
|
||||
|
||||
if (setCascadingProperties) {
|
||||
// --layout-justification-setting allows children to inherit the value
|
||||
// regardless or row or column direction.
|
||||
rowOrientation += `
|
||||
--layout-justification-setting: ${justifyContent};
|
||||
--layout-direction: row;
|
||||
--layout-wrap: ${flexWrap};
|
||||
--layout-justify: ${justifyContent};
|
||||
--layout-align: center;
|
||||
`;
|
||||
}
|
||||
|
||||
const alignItems = alignItemsMap[layout.justifyContent] || alignItemsMap.left;
|
||||
const columnOrientation = `
|
||||
let columnOrientation = `
|
||||
flex-direction: column;
|
||||
align-items: ${alignItems};
|
||||
--justification-setting: ${alignItems};
|
||||
`;
|
||||
|
||||
if (setCascadingProperties) {
|
||||
columnOrientation += `
|
||||
--layout-justification-setting: ${alignItems};
|
||||
--layout-direction: column;
|
||||
--layout-justify: initial;
|
||||
--layout-align: ${alignItems};
|
||||
`;
|
||||
}
|
||||
|
||||
return Object(external_wp_element_["createElement"])("style", null, `
|
||||
${appendSelectors(selector)} {
|
||||
display: flex;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4039,17 +4039,20 @@ const migrateWithLayout = attributes => {
|
|||
|
||||
const {
|
||||
contentJustification,
|
||||
orientation
|
||||
orientation,
|
||||
...updatedAttributes
|
||||
} = attributes;
|
||||
const updatedAttributes = { ...attributes
|
||||
};
|
||||
|
||||
if (contentJustification || orientation) {
|
||||
Object.assign(updatedAttributes, {
|
||||
layout: {
|
||||
type: 'flex',
|
||||
justifyContent: contentJustification || 'left',
|
||||
orientation: orientation || 'horizontal'
|
||||
...(contentJustification && {
|
||||
justifyContent: contentJustification
|
||||
}),
|
||||
...(orientation && {
|
||||
orientation
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -4080,8 +4083,9 @@ const buttons_deprecated_deprecated = [{
|
|||
}
|
||||
},
|
||||
isEligible: ({
|
||||
layout
|
||||
}) => !layout,
|
||||
contentJustification,
|
||||
orientation
|
||||
}) => !!contentJustification || !!orientation,
|
||||
migrate: migrateWithLayout,
|
||||
|
||||
save({
|
||||
|
@ -4251,10 +4255,7 @@ function ButtonsEdit({
|
|||
__experimentalLayout: layout,
|
||||
templateInsertUpdatesSelection: true
|
||||
});
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["BlockControls"], {
|
||||
group: "block",
|
||||
__experimentalShareWithChildBlocks: true
|
||||
}), Object(external_wp_element_["createElement"])("div", innerBlocksProps));
|
||||
return Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])("div", innerBlocksProps));
|
||||
}
|
||||
|
||||
/* harmony default export */ var buttons_edit = (ButtonsEdit);
|
||||
|
@ -5545,7 +5546,7 @@ const column_metadata = {
|
|||
type: "array"
|
||||
},
|
||||
templateLock: {
|
||||
type: "string",
|
||||
type: ["string", "boolean"],
|
||||
"enum": ["all", "insert", false]
|
||||
}
|
||||
},
|
||||
|
@ -8298,7 +8299,7 @@ const cover_metadata = {
|
|||
type: "array"
|
||||
},
|
||||
templateLock: {
|
||||
type: "string",
|
||||
type: ["string", "boolean"],
|
||||
"enum": ["all", "insert", false]
|
||||
}
|
||||
},
|
||||
|
@ -11765,7 +11766,7 @@ var build_module = __webpack_require__("U60i");
|
|||
|
||||
|
||||
|
||||
function useMobileWarning() {
|
||||
function useMobileWarning(newImages) {
|
||||
const {
|
||||
createWarningNotice
|
||||
} = Object(external_wp_data_["useDispatch"])(external_wp_notices_["store"]);
|
||||
|
@ -11779,7 +11780,7 @@ function useMobileWarning() {
|
|||
return isFeatureActive('core/edit-post', 'mobileGalleryWarning');
|
||||
}, []);
|
||||
|
||||
if (!isMobileWarningActive) {
|
||||
if (!isMobileWarningActive || !newImages) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -11869,7 +11870,6 @@ function GalleryEdit(props) {
|
|||
shortCodeTransforms,
|
||||
sizeSlug
|
||||
} = attributes;
|
||||
useMobileWarning();
|
||||
const {
|
||||
__unstableMarkNextChangeAsNotPersistent,
|
||||
replaceInnerBlocks,
|
||||
|
@ -11907,6 +11907,7 @@ function GalleryEdit(props) {
|
|||
})), [innerBlockImages]);
|
||||
const imageData = useGetMedia(innerBlockImages);
|
||||
const newImages = useGetNewImages(images, imageData);
|
||||
useMobileWarning(newImages);
|
||||
Object(external_wp_element_["useEffect"])(() => {
|
||||
newImages === null || newImages === void 0 ? void 0 : newImages.forEach(newImage => {
|
||||
updateBlockAttributes(newImage.clientId, { ...buildImageAttributes(false, newImage.attributes),
|
||||
|
@ -14208,7 +14209,7 @@ const group_metadata = {
|
|||
"default": "div"
|
||||
},
|
||||
templateLock: {
|
||||
type: "string",
|
||||
type: ["string", "boolean"],
|
||||
"enum": ["all", "insert", false]
|
||||
}
|
||||
},
|
||||
|
@ -20643,7 +20644,7 @@ const ExistingMenusDropdown = ({
|
|||
}, ({
|
||||
onClose
|
||||
}) => Object(external_wp_element_["createElement"])(external_wp_element_["Fragment"], null, Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
|
||||
label: "Menus"
|
||||
label: Object(external_wp_i18n_["__"])('Menus')
|
||||
}, canSwitchNavigationMenu && navigationMenus.map(menu => {
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
|
||||
onClick: () => {
|
||||
|
@ -20654,7 +20655,7 @@ const ExistingMenusDropdown = ({
|
|||
key: menu.id
|
||||
}, menu.title.rendered);
|
||||
})), Object(external_wp_element_["createElement"])(external_wp_components_["MenuGroup"], {
|
||||
label: "Classic Menus"
|
||||
label: Object(external_wp_i18n_["__"])('Classic Menus')
|
||||
}, menus.map(menu => {
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["MenuItem"], {
|
||||
onClick: () => {
|
||||
|
@ -20852,8 +20853,7 @@ function ResponsiveWrapper({
|
|||
height: "1.5"
|
||||
}))), Object(external_wp_element_["createElement"])("div", {
|
||||
className: responsiveContainerClasses,
|
||||
id: modalId,
|
||||
"aria-hidden": !isOpen
|
||||
id: modalId
|
||||
}, Object(external_wp_element_["createElement"])("div", {
|
||||
className: "wp-block-navigation__responsive-close",
|
||||
tabIndex: "-1"
|
||||
|
@ -22275,7 +22275,8 @@ const navigation_metadata = {
|
|||
allowSwitching: false,
|
||||
allowInheriting: false,
|
||||
"default": {
|
||||
type: "flex"
|
||||
type: "flex",
|
||||
setCascadingProperties: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -390,7 +390,7 @@ var external_lodash_ = __webpack_require__("YLtl");
|
|||
const {
|
||||
Fill: ToolsMoreMenuGroup,
|
||||
Slot
|
||||
} = Object(external_wp_components_["createSlotFill"])('ToolsMoreMenuGroup');
|
||||
} = Object(external_wp_components_["createSlotFill"])('EditSiteToolsMoreMenuGroup');
|
||||
|
||||
ToolsMoreMenuGroup.Slot = ({
|
||||
fillProps
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -991,6 +991,36 @@ function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, dir
|
|||
const walkToStart = Object(external_lodash_["partialRight"])(walkToBoundary, 'backwards');
|
||||
const walkToEnd = Object(external_lodash_["partialRight"])(walkToBoundary, 'forwards');
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/use-link-instance-key.js
|
||||
// Weakly referenced map allows unused ids to be garbage collected.
|
||||
const weakMap = new WeakMap(); // Incrementing zero-based ID value
|
||||
|
||||
let use_link_instance_key_id = -1;
|
||||
const prefix = 'link-control-instance';
|
||||
|
||||
function getKey(_id) {
|
||||
return `${prefix}-${_id}`;
|
||||
}
|
||||
/**
|
||||
* Builds a unique link control key for the given object reference.
|
||||
*
|
||||
* @param {Object} instance an unique object reference specific to this link control instance.
|
||||
* @return {string} the unique key to use for this link control.
|
||||
*/
|
||||
|
||||
|
||||
function useLinkInstanceKey(instance) {
|
||||
if (weakMap.has(instance)) {
|
||||
return getKey(weakMap.get(instance));
|
||||
}
|
||||
|
||||
use_link_instance_key_id += 1;
|
||||
weakMap.set(instance, use_link_instance_key_id);
|
||||
return getKey(use_link_instance_key_id);
|
||||
}
|
||||
|
||||
/* harmony default export */ var use_link_instance_key = (useLinkInstanceKey);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/format-library/build-module/link/inline.js
|
||||
|
||||
|
||||
|
@ -1011,6 +1041,7 @@ const walkToEnd = Object(external_lodash_["partialRight"])(walkToBoundary, 'forw
|
|||
|
||||
|
||||
|
||||
|
||||
function InlineLinkUI({
|
||||
isActive,
|
||||
activeAttributes,
|
||||
|
@ -1150,7 +1181,12 @@ function InlineLinkUI({
|
|||
ref: contentRef,
|
||||
value,
|
||||
settings: link_link
|
||||
}); // The focusOnMount prop shouldn't evolve during render of a Popover
|
||||
}); // Generate a string based key that is unique to this anchor reference.
|
||||
// This is used to force re-mount the LinkControl component to avoid
|
||||
// potential stale state bugs caused by the component not being remounted
|
||||
// See https://github.com/WordPress/gutenberg/pull/34742.
|
||||
|
||||
const forceRemountKey = use_link_instance_key(anchorRef); // The focusOnMount prop shouldn't evolve during render of a Popover
|
||||
// otherwise it causes a render of the content.
|
||||
|
||||
const focusOnMount = Object(external_wp_element_["useRef"])(addingLink ? 'firstElement' : false);
|
||||
|
@ -1183,6 +1219,7 @@ function InlineLinkUI({
|
|||
onClose: stopAddingLink,
|
||||
position: "bottom center"
|
||||
}, Object(external_wp_element_["createElement"])(external_wp_blockEditor_["__experimentalLinkControl"], {
|
||||
key: forceRemountKey,
|
||||
value: linkValue,
|
||||
onChange: onChangeLink,
|
||||
onRemove: removeLink,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -234,18 +234,45 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller {
|
|||
public function prepare_item_for_response( $post, $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
|
||||
$config = json_decode( $post->post_content, true );
|
||||
$is_global_styles_user_theme_json = isset( $config['isGlobalStylesUserThemeJSON'] ) && true === $config['isGlobalStylesUserThemeJSON'];
|
||||
$result = array(
|
||||
'id' => $post->ID,
|
||||
'settings' => ! empty( $config['settings'] ) && $is_global_styles_user_theme_json ? $config['settings'] : new stdClass(),
|
||||
'styles' => ! empty( $config['styles'] ) && $is_global_styles_user_theme_json ? $config['styles'] : new stdClass(),
|
||||
'title' => array(
|
||||
'raw' => $post->post_title,
|
||||
'rendered' => get_the_title( $post ),
|
||||
),
|
||||
);
|
||||
$result = $this->add_additional_fields_to_object( $result, $request );
|
||||
$response = rest_ensure_response( $result );
|
||||
$links = $this->prepare_links( $post->id );
|
||||
$fields = $this->get_fields_for_response( $request );
|
||||
|
||||
// Base fields for every post.
|
||||
$data = array();
|
||||
|
||||
if ( rest_is_field_included( 'id', $fields ) ) {
|
||||
$data['id'] = $post->ID;
|
||||
}
|
||||
|
||||
if ( rest_is_field_included( 'title', $fields ) ) {
|
||||
$data['title'] = array();
|
||||
}
|
||||
if ( rest_is_field_included( 'title.raw', $fields ) ) {
|
||||
$data['title']['raw'] = $post->post_title;
|
||||
}
|
||||
if ( rest_is_field_included( 'title.rendered', $fields ) ) {
|
||||
add_filter( 'protected_title_format', array( $this, 'protected_title_format' ) );
|
||||
|
||||
$data['title']['rendered'] = get_the_title( $post->ID );
|
||||
|
||||
remove_filter( 'protected_title_format', array( $this, 'protected_title_format' ) );
|
||||
}
|
||||
|
||||
if ( rest_is_field_included( 'settings', $fields ) ) {
|
||||
$data['settings'] = ! empty( $config['settings'] ) && $is_global_styles_user_theme_json ? $config['settings'] : new stdClass();
|
||||
}
|
||||
|
||||
if ( rest_is_field_included( 'styles', $fields ) ) {
|
||||
$data['styles'] = ! empty( $config['styles'] ) && $is_global_styles_user_theme_json ? $config['styles'] : new stdClass();
|
||||
}
|
||||
|
||||
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
|
||||
$data = $this->add_additional_fields_to_object( $data, $request );
|
||||
$data = $this->filter_response_by_context( $data, $context );
|
||||
|
||||
// Wrap the data in a response object.
|
||||
$response = rest_ensure_response( $data );
|
||||
|
||||
$links = $this->prepare_links( $post->ID );
|
||||
$response->add_links( $links );
|
||||
if ( ! empty( $links['self']['href'] ) ) {
|
||||
$actions = $this->get_available_actions();
|
||||
|
@ -300,6 +327,21 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller {
|
|||
return $rels;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overwrites the default protected title format.
|
||||
*
|
||||
* By default, WordPress will show password protected posts with a title of
|
||||
* "Protected: %s", as the REST API communicates the protected status of a post
|
||||
* in a machine readable format, we remove the "Protected: " prefix.
|
||||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @return string Protected title format.
|
||||
*/
|
||||
public function protected_title_format() {
|
||||
return '%s';
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the query params for the global styles collection.
|
||||
*
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.9-alpha-52096';
|
||||
$wp_version = '5.9-alpha-52103';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue