mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Editor: Update @wordpress packages for 6.2 Beta 5.
Updates the `@wordpress` packages to include the following changes: - Add border radius to off canvas navigation menu items - Remove border from quick inserter child elements - Show variant patterns even if there are no patterns for the Query Loop block - Order initial block items in Navigation with PrivateInserter - Update: Add descriptions to all panels in the Site Editor's dark side - Fix typo in template parts description - Fix: Browse mode descriptions margin - Fix: Show creation popover on empty page links in the navigation sidebar - Make sure the directly inserted block in the Nav block is a Page link - Fix browser history when synchronising state with urls - Navigation Sidebar: Change the logic about which navigation gets selected for the sidebar - Fixes extra UI in navigation block inspector - Renames parent selection boolean param and improves docs - Widget Importer: Fix Widget Group block imports - Don't add Post Content layout styles to title in the post editor - Site editor: Add hover animation to site editor canvas - Prevent the saving button from showing when renaming templates - Navigation Block: Fix big spinner - Navigation: Don't save the level of the link in an attribute - Focus 1st parent block on block remove, if no previous block is available - Navigation: Performance: improve params in `block_core_navigation_get_most_recently_published_navigation()` - Navigation Block inspector: fix link UI popover opening on links that have a url - Fix for `WP_Theme_JSON_Resolver::get_merged_data()` - Site Editor: Add page details when viewing a specific page. - Fix site editor sidebar scrollbars - Fix: Custom link UI does appears outside canvas on the sidebar navigation - Fix: Make navigation page list load its items on navigation sidebar References: * [d14fea64bd
Gutenberg's commit for publishing the packages] * [dbe47a5e8f
Gutenberg's commit for `blocks/navigation-link.php` and `blocks/navigation-submenu.php`] * [ea74a306e5
Gutenberg's commit for `blocks/navigation.php`] Follow-up to [55441], [55440]. Props ntsekouras, mamaduka, gziolo, costdev, hellofromTonya. See #57471. Built from https://develop.svn.wordpress.org/trunk@55475 git-svn-id: http://core.svn.wordpress.org/trunk@55008 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c41d5e69d3
commit
67abdca2cc
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -9,18 +9,17 @@
|
||||
* Build an array with CSS classes and inline styles defining the colors
|
||||
* which will be applied to the navigation markup in the front-end.
|
||||
*
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param bool $is_sub_menu Whether the link is part of a sub-menu.
|
||||
* @return array Colors CSS classes and inline styles.
|
||||
*/
|
||||
function block_core_navigation_link_build_css_colors( $context, $attributes ) {
|
||||
function block_core_navigation_link_build_css_colors( $context, $attributes, $is_sub_menu = false ) {
|
||||
$colors = array(
|
||||
'css_classes' => array(),
|
||||
'inline_styles' => '',
|
||||
);
|
||||
|
||||
$is_sub_menu = isset( $attributes['isTopLevelLink'] ) ? ( ! $attributes['isTopLevelLink'] ) : false;
|
||||
|
||||
// Text color.
|
||||
$named_text_color = null;
|
||||
$custom_text_color = null;
|
||||
|
@ -9,18 +9,17 @@
|
||||
* Build an array with CSS classes and inline styles defining the colors
|
||||
* which will be applied to the navigation markup in the front-end.
|
||||
*
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param array $context Navigation block context.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param bool $is_sub_menu Whether the block is a sub-menu.
|
||||
* @return array Colors CSS classes and inline styles.
|
||||
*/
|
||||
function block_core_navigation_submenu_build_css_colors( $context, $attributes ) {
|
||||
function block_core_navigation_submenu_build_css_colors( $context, $attributes, $is_sub_menu = false ) {
|
||||
$colors = array(
|
||||
'css_classes' => array(),
|
||||
'inline_styles' => '',
|
||||
);
|
||||
|
||||
$is_sub_menu = isset( $attributes['isTopLevelItem'] ) ? ( ! $attributes['isTopLevelItem'] ) : false;
|
||||
|
||||
// Text color.
|
||||
$named_text_color = null;
|
||||
$custom_text_color = null;
|
||||
@ -250,6 +249,15 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
||||
}
|
||||
|
||||
if ( $has_submenu ) {
|
||||
$colors = block_core_navigation_submenu_build_css_colors( $block->context, $attributes, $has_submenu );
|
||||
$classes = array_merge(
|
||||
array( 'wp-block-navigation__submenu-container' ),
|
||||
$colors['css_classes']
|
||||
);
|
||||
$css_classes = trim( implode( ' ', $classes ) );
|
||||
|
||||
$style_attribute = $colors['inline_styles'];
|
||||
|
||||
$inner_blocks_html = '';
|
||||
foreach ( $block->inner_blocks as $inner_block ) {
|
||||
$inner_blocks_html .= $inner_block->render();
|
||||
@ -263,10 +271,19 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
||||
$html = $tag_processor->get_updated_html();
|
||||
}
|
||||
|
||||
$wrapper_attributes = get_block_wrapper_attributes(
|
||||
array(
|
||||
'class' => $css_classes,
|
||||
'style' => $style_attribute,
|
||||
)
|
||||
);
|
||||
|
||||
$html .= sprintf(
|
||||
'<ul class="wp-block-navigation__submenu-container">%s</ul>',
|
||||
'<ul %s>%s</ul>',
|
||||
$wrapper_attributes,
|
||||
$inner_blocks_html
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
$html .= '</li>';
|
||||
|
@ -373,12 +373,14 @@ function block_core_navigation_get_most_recently_published_navigation() {
|
||||
|
||||
// Default to the most recently created menu.
|
||||
$parsed_args = array(
|
||||
'post_type' => 'wp_navigation',
|
||||
'no_found_rows' => true,
|
||||
'order' => 'DESC',
|
||||
'orderby' => 'date',
|
||||
'post_status' => 'publish',
|
||||
'posts_per_page' => 1, // get only the most recent.
|
||||
'post_type' => 'wp_navigation',
|
||||
'no_found_rows' => true,
|
||||
'update_post_meta_cache' => false,
|
||||
'update_post_term_cache' => false,
|
||||
'order' => 'DESC',
|
||||
'orderby' => 'date',
|
||||
'post_status' => 'publish',
|
||||
'posts_per_page' => 1, // get only the most recent.
|
||||
);
|
||||
|
||||
$navigation_post = new WP_Query( $parsed_args );
|
||||
|
@ -374,7 +374,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.wp-block-navigation .components-spinner{
|
||||
.wp-block-navigation__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -374,7 +374,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.wp-block-navigation .components-spinner{
|
||||
.wp-block-navigation__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
||||
|
||||
|
2
wp-includes/blocks/navigation/editor.min.css
vendored
2
wp-includes/blocks/navigation/editor.min.css
vendored
File diff suppressed because one or more lines are too long
@ -39,4 +39,8 @@
|
||||
|
||||
.wp-block-page-list .components-notice{
|
||||
margin-right:0;
|
||||
}
|
||||
|
||||
.wp-block-page-list__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
@ -1 +1 @@
|
||||
.wp-block-navigation .wp-block-page-list,.wp-block-navigation .wp-block-page-list>div{background-color:inherit}.wp-block-navigation.items-justified-space-between .wp-block-page-list,.wp-block-navigation.items-justified-space-between .wp-block-page-list>div{display:contents;flex:1}.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list>div,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list>div{flex:inherit}.wp-block-navigation .wp-block-navigation__submenu-container>.wp-block-page-list{display:block}.wp-block-pages-list__item__link{pointer-events:none}@media (min-width:600px){.wp-block-page-list-modal{max-width:480px}}.wp-block-page-list-modal-buttons{display:flex;gap:12px;justify-content:flex-end}.wp-block-page-list .open-on-click:focus-within>.wp-block-navigation__submenu-container{height:auto;min-width:200px;opacity:1;visibility:visible;width:auto}.wp-block-page-list .components-notice{margin-right:0}
|
||||
.wp-block-navigation .wp-block-page-list,.wp-block-navigation .wp-block-page-list>div{background-color:inherit}.wp-block-navigation.items-justified-space-between .wp-block-page-list,.wp-block-navigation.items-justified-space-between .wp-block-page-list>div{display:contents;flex:1}.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list>div,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list>div{flex:inherit}.wp-block-navigation .wp-block-navigation__submenu-container>.wp-block-page-list{display:block}.wp-block-pages-list__item__link{pointer-events:none}@media (min-width:600px){.wp-block-page-list-modal{max-width:480px}}.wp-block-page-list-modal-buttons{display:flex;gap:12px;justify-content:flex-end}.wp-block-page-list .open-on-click:focus-within>.wp-block-navigation__submenu-container{height:auto;min-width:200px;opacity:1;visibility:visible;width:auto}.wp-block-page-list .components-notice{margin-right:0}.wp-block-page-list__loading-indicator-container{padding:8px 12px}
|
@ -39,4 +39,8 @@
|
||||
|
||||
.wp-block-page-list .components-notice{
|
||||
margin-left:0;
|
||||
}
|
||||
|
||||
.wp-block-page-list__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
2
wp-includes/blocks/page-list/editor.min.css
vendored
2
wp-includes/blocks/page-list/editor.min.css
vendored
@ -1 +1 @@
|
||||
.wp-block-navigation .wp-block-page-list,.wp-block-navigation .wp-block-page-list>div{background-color:inherit}.wp-block-navigation.items-justified-space-between .wp-block-page-list,.wp-block-navigation.items-justified-space-between .wp-block-page-list>div{display:contents;flex:1}.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list>div,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list>div{flex:inherit}.wp-block-navigation .wp-block-navigation__submenu-container>.wp-block-page-list{display:block}.wp-block-pages-list__item__link{pointer-events:none}@media (min-width:600px){.wp-block-page-list-modal{max-width:480px}}.wp-block-page-list-modal-buttons{display:flex;gap:12px;justify-content:flex-end}.wp-block-page-list .open-on-click:focus-within>.wp-block-navigation__submenu-container{height:auto;min-width:200px;opacity:1;visibility:visible;width:auto}.wp-block-page-list .components-notice{margin-left:0}
|
||||
.wp-block-navigation .wp-block-page-list,.wp-block-navigation .wp-block-page-list>div{background-color:inherit}.wp-block-navigation.items-justified-space-between .wp-block-page-list,.wp-block-navigation.items-justified-space-between .wp-block-page-list>div{display:contents;flex:1}.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.has-child-selected .wp-block-page-list>div,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list,.wp-block-navigation.items-justified-space-between.is-selected .wp-block-page-list>div{flex:inherit}.wp-block-navigation .wp-block-navigation__submenu-container>.wp-block-page-list{display:block}.wp-block-pages-list__item__link{pointer-events:none}@media (min-width:600px){.wp-block-page-list-modal{max-width:480px}}.wp-block-page-list-modal-buttons{display:flex;gap:12px;justify-content:flex-end}.wp-block-page-list .open-on-click:focus-within>.wp-block-navigation__submenu-container{height:auto;min-width:200px;opacity:1;visibility:visible;width:auto}.wp-block-page-list .components-notice{margin-left:0}.wp-block-page-list__loading-indicator-container{padding:8px 12px}
|
@ -3005,6 +3005,7 @@
|
||||
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content{
|
||||
border:none;
|
||||
box-shadow:0 .7px 1px rgba(0,0,0,.1),0 1.2px 1.7px -.2px rgba(0,0,0,.1),0 2.3px 3.3px -.5px rgba(0,0,0,.1);
|
||||
outline:none;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>*{
|
||||
@ -3012,10 +3013,12 @@
|
||||
border-right:1px solid #ccc;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>:first-child{
|
||||
border-radius:2px 2px 0 0;
|
||||
border-top:1px solid #ccc;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>:last-child{
|
||||
border-bottom:1px solid #ccc;
|
||||
border-radius:0 0 2px 2px;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>.components-button{
|
||||
border:1px solid #1e1e1e;
|
||||
|
File diff suppressed because one or more lines are too long
3
wp-includes/css/dist/block-editor/style.css
vendored
3
wp-includes/css/dist/block-editor/style.css
vendored
@ -3005,6 +3005,7 @@
|
||||
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content{
|
||||
border:none;
|
||||
box-shadow:0 .7px 1px rgba(0,0,0,.1),0 1.2px 1.7px -.2px rgba(0,0,0,.1),0 2.3px 3.3px -.5px rgba(0,0,0,.1);
|
||||
outline:none;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>*{
|
||||
@ -3012,10 +3013,12 @@
|
||||
border-right:1px solid #ccc;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>:first-child{
|
||||
border-radius:2px 2px 0 0;
|
||||
border-top:1px solid #ccc;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>:last-child{
|
||||
border-bottom:1px solid #ccc;
|
||||
border-radius:0 0 2px 2px;
|
||||
}
|
||||
.block-editor-inserter__popover.is-quick .components-popover__content .block-editor-inserter__quick-inserter>.components-button{
|
||||
border:1px solid #1e1e1e;
|
||||
|
File diff suppressed because one or more lines are too long
@ -1645,7 +1645,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.wp-block-navigation .components-spinner{
|
||||
.wp-block-navigation__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
||||
|
||||
@ -1916,6 +1916,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
margin-right:0;
|
||||
}
|
||||
|
||||
.wp-block-page-list__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
||||
|
||||
.block-editor-block-list__block[data-type="core/paragraph"].has-drop-cap:focus{
|
||||
min-height:auto !important;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -1643,7 +1643,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.wp-block-navigation .components-spinner{
|
||||
.wp-block-navigation__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
||||
|
||||
@ -1914,6 +1914,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
|
||||
margin-left:0;
|
||||
}
|
||||
|
||||
.wp-block-page-list__loading-indicator-container{
|
||||
padding:8px 12px;
|
||||
}
|
||||
|
||||
.block-editor-block-list__block[data-type="core/paragraph"].has-drop-cap:focus{
|
||||
min-height:auto !important;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
146
wp-includes/css/dist/edit-site/style-rtl.css
vendored
146
wp-includes/css/dist/edit-site/style-rtl.css
vendored
@ -1419,46 +1419,6 @@ body.is-fullscreen-mode .edit-site-list-header{
|
||||
display:block;
|
||||
}
|
||||
|
||||
@keyframes loadingpulse{
|
||||
0%{
|
||||
opacity:1;
|
||||
}
|
||||
50%{
|
||||
opacity:.5;
|
||||
}
|
||||
to{
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.edit-site-navigation-inspector .block-editor-list-view-leaf .block-editor-list-view-block-contents{
|
||||
white-space:normal;
|
||||
}
|
||||
.edit-site-navigation-inspector .block-editor-list-view-block__title{
|
||||
margin-top:3px;
|
||||
}
|
||||
.edit-site-navigation-inspector .block-editor-list-view-block__menu-cell{
|
||||
padding-left:0;
|
||||
}
|
||||
.edit-site-navigation-inspector .edit-site-navigation-inspector__select-menu{
|
||||
margin-bottom:8px;
|
||||
}
|
||||
|
||||
.edit-site-navigation-inspector__placeholder{
|
||||
animation:loadingpulse 1s linear infinite;
|
||||
animation-delay:.5s;
|
||||
background-color:#f0f0f0;
|
||||
margin:8px;
|
||||
padding:8px;
|
||||
}
|
||||
.edit-site-navigation-inspector__placeholder.is-child{
|
||||
margin-right:24px;
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.edit-site-navigation-inspector__empty-msg{
|
||||
padding:0 8px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-edit-mode{
|
||||
width:280px;
|
||||
}
|
||||
@ -2017,7 +1977,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
.edit-site-layout__content{
|
||||
display:flex;
|
||||
flex-grow:1;
|
||||
overflow:hidden;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.edit-site-layout__sidebar{
|
||||
@ -2162,6 +2122,20 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
}
|
||||
}
|
||||
|
||||
.edit-site-save-hub{
|
||||
color:#949494;
|
||||
}
|
||||
|
||||
.edit-site-save-hub__button{
|
||||
color:inherit;
|
||||
}
|
||||
.edit-site-save-hub__button[aria-disabled=true]{
|
||||
opacity:1;
|
||||
}
|
||||
.edit-site-save-hub__button[aria-disabled=true]:hover{
|
||||
color:inherit;
|
||||
}
|
||||
|
||||
@media (min-width:600px){
|
||||
.edit-site-save-panel__modal{
|
||||
width:600px;
|
||||
@ -2171,33 +2145,33 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
.edit-site-sidebar__content{
|
||||
flex-grow:1;
|
||||
overflow-y:auto;
|
||||
}
|
||||
.edit-site-sidebar__content .components-navigator-screen{
|
||||
scrollbar-color:#757575 #1e1e1e;
|
||||
scrollbar-gutter:stable;
|
||||
scrollbar-width:thin;
|
||||
visibility:hidden;
|
||||
}
|
||||
.edit-site-sidebar__content::-webkit-scrollbar{
|
||||
.edit-site-sidebar__content .components-navigator-screen::-webkit-scrollbar{
|
||||
height:12px;
|
||||
width:12px;
|
||||
}
|
||||
.edit-site-sidebar__content::-webkit-scrollbar-track{
|
||||
.edit-site-sidebar__content .components-navigator-screen::-webkit-scrollbar-track{
|
||||
background-color:#1e1e1e;
|
||||
}
|
||||
.edit-site-sidebar__content::-webkit-scrollbar-thumb{
|
||||
.edit-site-sidebar__content .components-navigator-screen::-webkit-scrollbar-thumb{
|
||||
background-clip:padding-box;
|
||||
background-color:#757575;
|
||||
border:3px solid transparent;
|
||||
border-radius:8px;
|
||||
}
|
||||
.edit-site-sidebar__content:focus,.edit-site-sidebar__content:hover,.edit-site-sidebar__content>*{
|
||||
.edit-site-sidebar__content .components-navigator-screen:focus,.edit-site-sidebar__content .components-navigator-screen:hover,.edit-site-sidebar__content .components-navigator-screen>*{
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
.edit-site-sidebar__footer{
|
||||
border-top:1px solid #2f2f2f;
|
||||
display:flex;
|
||||
flex-shrink:0;
|
||||
justify-content:flex-end;
|
||||
margin:0 24px;
|
||||
padding:24px 0;
|
||||
}
|
||||
@ -2222,7 +2196,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
||||
outline:3px solid transparent;
|
||||
}
|
||||
.edit-site-sidebar-button:focus,.edit-site-sidebar-button:focus-visible,.edit-site-sidebar-button:hover,.edit-site-sidebar-button:not([aria-disabled=true]):active{
|
||||
.edit-site-sidebar-button:focus,.edit-site-sidebar-button:focus-visible,.edit-site-sidebar-button:hover,.edit-site-sidebar-button:not([aria-disabled=true]):active,.edit-site-sidebar-button[aria-expanded=true]{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
@ -2239,20 +2213,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
background:var(--wp-admin-theme-color);
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button{
|
||||
color:#949494;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button:focus,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button:hover,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button[aria-current]{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf:focus,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf:hover,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf[aria-current]{
|
||||
background:#2f2f2f;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf .block-editor-list-view-block__menu{
|
||||
margin-right:-8px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content .block-editor-list-view-block-select-button{
|
||||
cursor:grab;
|
||||
padding:8px;
|
||||
@ -2271,6 +2231,18 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
margin:0 36px 16px 16px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__page-link{
|
||||
color:#949494;
|
||||
display:inline-block;
|
||||
margin-right:16px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__page-link:focus,.edit-site-sidebar-navigation-screen__page-link:hover{
|
||||
color:#fff;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__page-link .components-external-link__icon{
|
||||
margin-right:4px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__title-icon{
|
||||
background:#1e1e1e;
|
||||
box-shadow:0 8px 16px #1e1e1e;
|
||||
@ -2323,15 +2295,57 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus .block-editor-list-view-block__menu-edit,.edit-site-sidebar-navigation-screen-navigation-menus .edit-site-navigation-inspector__select-menu{
|
||||
display:none;
|
||||
.edit-site-sidebar-navigation-screen__description{
|
||||
margin:0 16px 32px 0;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus .offcanvas-editor-list-view-leaf{
|
||||
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__placeholder{
|
||||
animation:loadingpulse 1s linear infinite;
|
||||
animation-delay:.5s;
|
||||
background-color:#f0f0f0;
|
||||
margin:8px;
|
||||
padding:8px;
|
||||
}
|
||||
|
||||
@keyframes loadingpulse{
|
||||
0%{
|
||||
opacity:1;
|
||||
}
|
||||
50%{
|
||||
opacity:.5;
|
||||
}
|
||||
to{
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf{
|
||||
border-radius:2px;
|
||||
max-width:calc(100% - 4px);
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus .block-editor-list-view-leaf .block-editor-list-view-block__contents-cell{
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf:focus,.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf:hover,.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf[aria-current]{
|
||||
background:#2f2f2f;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf .block-editor-list-view-block__menu{
|
||||
margin-right:-8px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-leaf .block-editor-list-view-block__contents-cell{
|
||||
width:100%;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-leaf .block-editor-list-view-block-contents{
|
||||
white-space:normal;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-block__title{
|
||||
margin-top:3px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-block__menu-cell{
|
||||
padding-left:0;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button{
|
||||
color:#949494;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button:focus,.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button:hover,.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button[aria-current]{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.edit-site-site-icon__icon{
|
||||
fill:currentColor;
|
||||
|
File diff suppressed because one or more lines are too long
146
wp-includes/css/dist/edit-site/style.css
vendored
146
wp-includes/css/dist/edit-site/style.css
vendored
@ -1419,46 +1419,6 @@ body.is-fullscreen-mode .edit-site-list-header{
|
||||
display:block;
|
||||
}
|
||||
|
||||
@keyframes loadingpulse{
|
||||
0%{
|
||||
opacity:1;
|
||||
}
|
||||
50%{
|
||||
opacity:.5;
|
||||
}
|
||||
to{
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.edit-site-navigation-inspector .block-editor-list-view-leaf .block-editor-list-view-block-contents{
|
||||
white-space:normal;
|
||||
}
|
||||
.edit-site-navigation-inspector .block-editor-list-view-block__title{
|
||||
margin-top:3px;
|
||||
}
|
||||
.edit-site-navigation-inspector .block-editor-list-view-block__menu-cell{
|
||||
padding-right:0;
|
||||
}
|
||||
.edit-site-navigation-inspector .edit-site-navigation-inspector__select-menu{
|
||||
margin-bottom:8px;
|
||||
}
|
||||
|
||||
.edit-site-navigation-inspector__placeholder{
|
||||
animation:loadingpulse 1s linear infinite;
|
||||
animation-delay:.5s;
|
||||
background-color:#f0f0f0;
|
||||
margin:8px;
|
||||
padding:8px;
|
||||
}
|
||||
.edit-site-navigation-inspector__placeholder.is-child{
|
||||
margin-left:24px;
|
||||
width:50%;
|
||||
}
|
||||
|
||||
.edit-site-navigation-inspector__empty-msg{
|
||||
padding:0 8px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-edit-mode{
|
||||
width:280px;
|
||||
}
|
||||
@ -2017,7 +1977,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
.edit-site-layout__content{
|
||||
display:flex;
|
||||
flex-grow:1;
|
||||
overflow:hidden;
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.edit-site-layout__sidebar{
|
||||
@ -2162,6 +2122,20 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
}
|
||||
}
|
||||
|
||||
.edit-site-save-hub{
|
||||
color:#949494;
|
||||
}
|
||||
|
||||
.edit-site-save-hub__button{
|
||||
color:inherit;
|
||||
}
|
||||
.edit-site-save-hub__button[aria-disabled=true]{
|
||||
opacity:1;
|
||||
}
|
||||
.edit-site-save-hub__button[aria-disabled=true]:hover{
|
||||
color:inherit;
|
||||
}
|
||||
|
||||
@media (min-width:600px){
|
||||
.edit-site-save-panel__modal{
|
||||
width:600px;
|
||||
@ -2171,33 +2145,33 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
.edit-site-sidebar__content{
|
||||
flex-grow:1;
|
||||
overflow-y:auto;
|
||||
}
|
||||
.edit-site-sidebar__content .components-navigator-screen{
|
||||
scrollbar-color:#757575 #1e1e1e;
|
||||
scrollbar-gutter:stable;
|
||||
scrollbar-width:thin;
|
||||
visibility:hidden;
|
||||
}
|
||||
.edit-site-sidebar__content::-webkit-scrollbar{
|
||||
.edit-site-sidebar__content .components-navigator-screen::-webkit-scrollbar{
|
||||
height:12px;
|
||||
width:12px;
|
||||
}
|
||||
.edit-site-sidebar__content::-webkit-scrollbar-track{
|
||||
.edit-site-sidebar__content .components-navigator-screen::-webkit-scrollbar-track{
|
||||
background-color:#1e1e1e;
|
||||
}
|
||||
.edit-site-sidebar__content::-webkit-scrollbar-thumb{
|
||||
.edit-site-sidebar__content .components-navigator-screen::-webkit-scrollbar-thumb{
|
||||
background-clip:padding-box;
|
||||
background-color:#757575;
|
||||
border:3px solid transparent;
|
||||
border-radius:8px;
|
||||
}
|
||||
.edit-site-sidebar__content:focus,.edit-site-sidebar__content:hover,.edit-site-sidebar__content>*{
|
||||
.edit-site-sidebar__content .components-navigator-screen:focus,.edit-site-sidebar__content .components-navigator-screen:hover,.edit-site-sidebar__content .components-navigator-screen>*{
|
||||
visibility:visible;
|
||||
}
|
||||
|
||||
.edit-site-sidebar__footer{
|
||||
border-top:1px solid #2f2f2f;
|
||||
display:flex;
|
||||
flex-shrink:0;
|
||||
justify-content:flex-end;
|
||||
margin:0 24px;
|
||||
padding:24px 0;
|
||||
}
|
||||
@ -2222,7 +2196,7 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-components-color-accent, var(--wp-admin-theme-color, #007cba));
|
||||
outline:3px solid transparent;
|
||||
}
|
||||
.edit-site-sidebar-button:focus,.edit-site-sidebar-button:focus-visible,.edit-site-sidebar-button:hover,.edit-site-sidebar-button:not([aria-disabled=true]):active{
|
||||
.edit-site-sidebar-button:focus,.edit-site-sidebar-button:focus-visible,.edit-site-sidebar-button:hover,.edit-site-sidebar-button:not([aria-disabled=true]):active,.edit-site-sidebar-button[aria-expanded=true]{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
@ -2239,20 +2213,6 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
background:var(--wp-admin-theme-color);
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button{
|
||||
color:#949494;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button:focus,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button:hover,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .components-button[aria-current]{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf:focus,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf:hover,.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf[aria-current]{
|
||||
background:#2f2f2f;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__content .edit-site-navigation-inspector .offcanvas-editor-list-view-leaf .block-editor-list-view-block__menu{
|
||||
margin-left:-8px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content .block-editor-list-view-block-select-button{
|
||||
cursor:grab;
|
||||
padding:8px;
|
||||
@ -2271,6 +2231,18 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
margin:0 16px 16px 36px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__page-link{
|
||||
color:#949494;
|
||||
display:inline-block;
|
||||
margin-left:16px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__page-link:focus,.edit-site-sidebar-navigation-screen__page-link:hover{
|
||||
color:#fff;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__page-link .components-external-link__icon{
|
||||
margin-left:4px;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__title-icon{
|
||||
background:#1e1e1e;
|
||||
box-shadow:0 8px 16px #1e1e1e;
|
||||
@ -2323,15 +2295,57 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus .block-editor-list-view-block__menu-edit,.edit-site-sidebar-navigation-screen-navigation-menus .edit-site-navigation-inspector__select-menu{
|
||||
display:none;
|
||||
.edit-site-sidebar-navigation-screen__description{
|
||||
margin:0 0 32px 16px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus .offcanvas-editor-list-view-leaf{
|
||||
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__placeholder{
|
||||
animation:loadingpulse 1s linear infinite;
|
||||
animation-delay:.5s;
|
||||
background-color:#f0f0f0;
|
||||
margin:8px;
|
||||
padding:8px;
|
||||
}
|
||||
|
||||
@keyframes loadingpulse{
|
||||
0%{
|
||||
opacity:1;
|
||||
}
|
||||
50%{
|
||||
opacity:.5;
|
||||
}
|
||||
to{
|
||||
opacity:1;
|
||||
}
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf{
|
||||
border-radius:2px;
|
||||
max-width:calc(100% - 4px);
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus .block-editor-list-view-leaf .block-editor-list-view-block__contents-cell{
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf:focus,.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf:hover,.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf[aria-current]{
|
||||
background:#2f2f2f;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .offcanvas-editor-list-view-leaf .block-editor-list-view-block__menu{
|
||||
margin-left:-8px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-leaf .block-editor-list-view-block__contents-cell{
|
||||
width:100%;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-leaf .block-editor-list-view-block-contents{
|
||||
white-space:normal;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-block__title{
|
||||
margin-top:3px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .block-editor-list-view-block__menu-cell{
|
||||
padding-right:0;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button{
|
||||
color:#949494;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button:focus,.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button:hover,.edit-site-sidebar-navigation-screen-navigation-menus__content .components-button[aria-current]{
|
||||
color:#fff;
|
||||
}
|
||||
|
||||
.edit-site-site-icon__icon{
|
||||
fill:currentColor;
|
||||
|
2
wp-includes/css/dist/edit-site/style.min.css
vendored
2
wp-includes/css/dist/edit-site/style.min.css
vendored
File diff suppressed because one or more lines are too long
160
wp-includes/js/dist/block-editor.js
vendored
160
wp-includes/js/dist/block-editor.js
vendored
@ -9208,21 +9208,32 @@ function selectBlock(clientId) {
|
||||
}
|
||||
/**
|
||||
* Yields action objects used in signalling that the block preceding the given
|
||||
* clientId should be selected.
|
||||
* clientId (or optionally, its first parent from bottom to top)
|
||||
* should be selected.
|
||||
*
|
||||
* @param {string} clientId Block client ID.
|
||||
* @param {string} clientId Block client ID.
|
||||
* @param {boolean} fallbackToParent If true, select the first parent if there is no previous block.
|
||||
*/
|
||||
|
||||
const selectPreviousBlock = clientId => _ref4 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
} = _ref4;
|
||||
const previousBlockClientId = select.getPreviousBlockClientId(clientId);
|
||||
const selectPreviousBlock = function (clientId) {
|
||||
let fallbackToParent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
||||
return _ref4 => {
|
||||
let {
|
||||
select,
|
||||
dispatch
|
||||
} = _ref4;
|
||||
const previousBlockClientId = select.getPreviousBlockClientId(clientId);
|
||||
|
||||
if (previousBlockClientId) {
|
||||
dispatch.selectBlock(previousBlockClientId, -1);
|
||||
}
|
||||
if (previousBlockClientId) {
|
||||
dispatch.selectBlock(previousBlockClientId, -1);
|
||||
} else if (fallbackToParent) {
|
||||
const firstParentClientId = select.getBlockRootClientId(clientId);
|
||||
|
||||
if (firstParentClientId) {
|
||||
dispatch.selectBlock(firstParentClientId, -1);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
/**
|
||||
* Yields action objects used in signalling that the block following the given
|
||||
@ -10019,8 +10030,11 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref16 => {
|
||||
* the set of specified client IDs are to be removed.
|
||||
*
|
||||
* @param {string|string[]} clientIds Client IDs of blocks to remove.
|
||||
* @param {boolean} selectPrevious True if the previous block should be
|
||||
* selected when a block is removed.
|
||||
* @param {boolean} selectPrevious True if the previous block
|
||||
* or the immediate parent
|
||||
* (if no previous block exists)
|
||||
* should be selected
|
||||
* when a block is removed.
|
||||
*/
|
||||
|
||||
const removeBlocks = function (clientIds) {
|
||||
@ -10044,7 +10058,7 @@ const removeBlocks = function (clientIds) {
|
||||
}
|
||||
|
||||
if (selectPrevious) {
|
||||
dispatch.selectPreviousBlock(clientIds[0]);
|
||||
dispatch.selectPreviousBlock(clientIds[0], selectPrevious);
|
||||
}
|
||||
|
||||
dispatch({
|
||||
@ -25017,7 +25031,8 @@ function InserterSearchResults(_ref) {
|
||||
isDraggable = true,
|
||||
shouldFocusBlock = true,
|
||||
prioritizePatterns,
|
||||
selectBlockOnInsert
|
||||
selectBlockOnInsert,
|
||||
orderInitialBlockItems
|
||||
} = _ref;
|
||||
const debouncedSpeak = (0,external_wp_compose_namespaceObject.useDebounce)(external_wp_a11y_namespaceObject.speak, 500);
|
||||
const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
|
||||
@ -25050,9 +25065,15 @@ function InserterSearchResults(_ref) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const results = searchBlockItems(orderBy(blockTypes, 'frecency', 'desc'), blockTypeCategories, blockTypeCollections, filterValue);
|
||||
let orderedItems = orderBy(blockTypes, 'frecency', 'desc');
|
||||
|
||||
if (!filterValue && orderInitialBlockItems) {
|
||||
orderedItems = orderInitialBlockItems(orderedItems);
|
||||
}
|
||||
|
||||
const results = searchBlockItems(orderedItems, blockTypeCategories, blockTypeCollections, filterValue);
|
||||
return maxBlockTypesToShow !== undefined ? results.slice(0, maxBlockTypesToShow) : results;
|
||||
}, [filterValue, blockTypes, blockTypeCategories, blockTypeCollections, maxBlockTypes]); // Announce search results on change.
|
||||
}, [filterValue, blockTypes, blockTypeCategories, blockTypeCollections, maxBlockTypes, orderInitialBlockItems]); // Announce search results on change.
|
||||
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
if (!filterValue) {
|
||||
@ -25429,7 +25450,8 @@ function QuickInserter(_ref) {
|
||||
clientId,
|
||||
isAppender,
|
||||
prioritizePatterns,
|
||||
selectBlockOnInsert
|
||||
selectBlockOnInsert,
|
||||
orderInitialBlockItems
|
||||
} = _ref;
|
||||
const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
|
||||
const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
|
||||
@ -25507,7 +25529,8 @@ function QuickInserter(_ref) {
|
||||
maxBlockTypes: SHOWN_BLOCK_TYPES,
|
||||
isDraggable: false,
|
||||
prioritizePatterns: prioritizePatterns,
|
||||
selectBlockOnInsert: selectBlockOnInsert
|
||||
selectBlockOnInsert: selectBlockOnInsert,
|
||||
orderInitialBlockItems: orderInitialBlockItems
|
||||
})), setInserterIsOpened && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
className: "block-editor-inserter__quick-inserter-expand",
|
||||
onClick: onBrowseAll,
|
||||
@ -25553,21 +25576,23 @@ const defaultRenderToggle = _ref => {
|
||||
toggleProps = {},
|
||||
prioritizePatterns
|
||||
} = _ref;
|
||||
let label;
|
||||
|
||||
if (hasSingleBlockType) {
|
||||
label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one
|
||||
(0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle);
|
||||
} else if (prioritizePatterns) {
|
||||
label = (0,external_wp_i18n_namespaceObject.__)('Add pattern');
|
||||
} else {
|
||||
label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button');
|
||||
}
|
||||
|
||||
const {
|
||||
as: Wrapper = external_wp_components_namespaceObject.Button,
|
||||
label: labelProp,
|
||||
onClick,
|
||||
...rest
|
||||
} = toggleProps; // Handle both onClick functions from the toggle and the parent component.
|
||||
} = toggleProps;
|
||||
let label = labelProp;
|
||||
|
||||
if (!label && hasSingleBlockType) {
|
||||
label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one
|
||||
(0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle);
|
||||
} else if (!label && prioritizePatterns) {
|
||||
label = (0,external_wp_i18n_namespaceObject.__)('Add pattern');
|
||||
} else if (!label) {
|
||||
label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button');
|
||||
} // Handle both onClick functions from the toggle and the parent component.
|
||||
|
||||
|
||||
function handleClick(event) {
|
||||
if (onToggle) {
|
||||
@ -25579,7 +25604,7 @@ const defaultRenderToggle = _ref => {
|
||||
}
|
||||
}
|
||||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, _extends({
|
||||
return (0,external_wp_element_namespaceObject.createElement)(Wrapper, _extends({
|
||||
icon: library_plus,
|
||||
label: label,
|
||||
tooltipPosition: "bottom",
|
||||
@ -25591,7 +25616,7 @@ const defaultRenderToggle = _ref => {
|
||||
}, rest));
|
||||
};
|
||||
|
||||
class Inserter extends external_wp_element_namespaceObject.Component {
|
||||
class PrivateInserter extends external_wp_element_namespaceObject.Component {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.onToggle = this.onToggle.bind(this);
|
||||
@ -25671,7 +25696,8 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
||||
__experimentalIsQuick: isQuick,
|
||||
prioritizePatterns,
|
||||
onSelectOrClose,
|
||||
selectBlockOnInsert
|
||||
selectBlockOnInsert,
|
||||
orderInitialBlockItems
|
||||
} = this.props;
|
||||
|
||||
if (isQuick) {
|
||||
@ -25689,7 +25715,8 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
||||
clientId: clientId,
|
||||
isAppender: isAppender,
|
||||
prioritizePatterns: prioritizePatterns,
|
||||
selectBlockOnInsert: selectBlockOnInsert
|
||||
selectBlockOnInsert: selectBlockOnInsert,
|
||||
orderInitialBlockItems: orderInitialBlockItems
|
||||
});
|
||||
}
|
||||
|
||||
@ -25740,7 +25767,7 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
||||
|
||||
}
|
||||
|
||||
/* harmony default export */ var inserter = ((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, _ref4) => {
|
||||
const ComposedPrivateInserter = (0,external_wp_compose_namespaceObject.compose)([(0,external_wp_data_namespaceObject.withSelect)((select, _ref4) => {
|
||||
var _getBlockVariations;
|
||||
|
||||
let {
|
||||
@ -25912,7 +25939,15 @@ class Inserter extends external_wp_element_namespaceObject.Component {
|
||||
clientId
|
||||
} = _ref6;
|
||||
return hasItems || !isAppender && !rootClientId && !clientId;
|
||||
})])(Inserter));
|
||||
})])(PrivateInserter);
|
||||
const Inserter = (0,external_wp_element_namespaceObject.forwardRef)((props, ref) => {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(ComposedPrivateInserter, _extends({
|
||||
ref: ref
|
||||
}, props, {
|
||||
orderInitialBlockItems: undefined
|
||||
}));
|
||||
});
|
||||
/* harmony default export */ var inserter = (Inserter);
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/default-block-appender/index.js
|
||||
|
||||
@ -31256,7 +31291,7 @@ function BlockSettingsDropdown(_ref2) {
|
||||
maximumLength: 25
|
||||
});
|
||||
const updateSelectionAfterRemove = (0,external_wp_element_namespaceObject.useCallback)(__experimentalSelectBlock ? () => {
|
||||
const blockToSelect = previousBlockClientId || nextBlockClientId;
|
||||
const blockToSelect = previousBlockClientId || nextBlockClientId || firstParentClientId;
|
||||
|
||||
if (blockToSelect && // From the block options dropdown, it's possible to remove a block that is not selected,
|
||||
// in this case, it's not necessary to update the selection since the selected block wasn't removed.
|
||||
@ -31265,7 +31300,7 @@ function BlockSettingsDropdown(_ref2) {
|
||||
!selectedBlockClientIds.includes(blockToSelect)) {
|
||||
__experimentalSelectBlock(blockToSelect);
|
||||
}
|
||||
} : block_settings_dropdown_noop, [__experimentalSelectBlock, previousBlockClientId, nextBlockClientId, selectedBlockClientIds]);
|
||||
} : block_settings_dropdown_noop, [__experimentalSelectBlock, previousBlockClientId, nextBlockClientId, firstParentClientId, selectedBlockClientIds]);
|
||||
const label = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
/* translators: %s: block name */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Remove %s'), blockTitle);
|
||||
@ -55403,6 +55438,8 @@ function useGlobalStylesOutput() {
|
||||
|
||||
|
||||
|
||||
|
||||
const prioritizedInserterBlocks = ['core/navigation-link/page', 'core/navigation-link'];
|
||||
const Appender = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref) => {
|
||||
let {
|
||||
nestingLevel,
|
||||
@ -55444,18 +55481,39 @@ const Appender = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref)
|
||||
(0,external_wp_a11y_namespaceObject.speak)((0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: name of block being inserted (i.e. Paragraph, Image, Group etc)
|
||||
(0,external_wp_i18n_namespaceObject.__)('%s block inserted'), insertedBlockTitle), 'assertive');
|
||||
}, [insertedBlockTitle]);
|
||||
const orderInitialBlockItems = (0,external_wp_element_namespaceObject.useCallback)(items => {
|
||||
items.sort((_ref2, _ref3) => {
|
||||
let {
|
||||
id: aName
|
||||
} = _ref2;
|
||||
let {
|
||||
id: bName
|
||||
} = _ref3;
|
||||
// Sort block items according to `prioritizedInserterBlocks`.
|
||||
let aIndex = prioritizedInserterBlocks.indexOf(aName);
|
||||
let bIndex = prioritizedInserterBlocks.indexOf(bName); // All other block items should come after that.
|
||||
|
||||
if (aIndex < 0) aIndex = prioritizedInserterBlocks.length;
|
||||
if (bIndex < 0) bIndex = prioritizedInserterBlocks.length;
|
||||
return aIndex - bIndex;
|
||||
});
|
||||
return items;
|
||||
}, []);
|
||||
|
||||
if (hideInserter) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const {
|
||||
PrivateInserter
|
||||
} = unlock(privateApis);
|
||||
const descriptionId = `off-canvas-editor-appender__${instanceId}`;
|
||||
const description = (0,external_wp_i18n_namespaceObject.sprintf)(
|
||||
/* translators: 1: The name of the block. 2: The numerical position of the block. 3: The level of nesting for the block. */
|
||||
(0,external_wp_i18n_namespaceObject.__)('Append to %1$s block at position %2$d, Level %3$d'), blockTitle, blockCount + 1, nestingLevel);
|
||||
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "offcanvas-editor-appender"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(inserter, _extends({
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(PrivateInserter, _extends({
|
||||
ref: ref,
|
||||
rootClientId: clientId,
|
||||
position: "bottom right",
|
||||
@ -55471,7 +55529,8 @@ const Appender = (0,external_wp_element_namespaceObject.forwardRef)((_ref, ref)
|
||||
if (maybeInsertedBlock !== null && maybeInsertedBlock !== void 0 && maybeInsertedBlock.clientId) {
|
||||
setInsertedBlock(maybeInsertedBlock);
|
||||
}
|
||||
}
|
||||
},
|
||||
orderInitialBlockItems: orderInitialBlockItems
|
||||
})), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "offcanvas-editor-appender__description",
|
||||
id: descriptionId
|
||||
@ -56044,7 +56103,7 @@ const block_contents_ListViewBlockContents = (0,external_wp_element_namespaceObj
|
||||
insertedBlockName,
|
||||
setInsertedBlockAttributes
|
||||
} = useInsertedBlock(lastInsertedBlockClientId);
|
||||
const hasExistingLinkValue = insertedBlockAttributes === null || insertedBlockAttributes === void 0 ? void 0 : insertedBlockAttributes.id;
|
||||
const hasExistingLinkValue = insertedBlockAttributes === null || insertedBlockAttributes === void 0 ? void 0 : insertedBlockAttributes.url;
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
if (clientId === lastInsertedBlockClientId && BLOCKS_WITH_LINK_UI_SUPPORT !== null && BLOCKS_WITH_LINK_UI_SUPPORT !== void 0 && BLOCKS_WITH_LINK_UI_SUPPORT.includes(insertedBlockName) && !hasExistingLinkValue // don't re-show the Link UI if the block already has a link value.
|
||||
) {
|
||||
@ -56507,7 +56566,8 @@ function branch_ListViewBranch(props) {
|
||||
fixedListWindow,
|
||||
isExpanded,
|
||||
parentId,
|
||||
shouldShowInnerBlocks = true
|
||||
shouldShowInnerBlocks = true,
|
||||
showAppender: showAppenderProp = true
|
||||
} = props;
|
||||
const isContentLocked = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
return !!(parentId && select(store).getTemplateLock(parentId) === 'contentOnly');
|
||||
@ -56522,7 +56582,7 @@ function branch_ListViewBranch(props) {
|
||||
} // Only show the appender at the first level.
|
||||
|
||||
|
||||
const showAppender = level === 1;
|
||||
const showAppender = showAppenderProp && level === 1;
|
||||
const filteredBlocks = blocks.filter(Boolean);
|
||||
const blockCount = filteredBlocks.length; // The appender means an extra row in List View, so add 1 to the row count.
|
||||
|
||||
@ -56585,7 +56645,8 @@ function branch_ListViewBranch(props) {
|
||||
fixedListWindow: fixedListWindow,
|
||||
isBranchSelected: isSelectedBranch,
|
||||
selectedClientIds: selectedClientIds,
|
||||
isExpanded: isExpanded
|
||||
isExpanded: isExpanded,
|
||||
showAppender: showAppenderProp
|
||||
}));
|
||||
}), showAppender && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridRow, {
|
||||
level: level,
|
||||
@ -57182,6 +57243,7 @@ const off_canvas_editor_BLOCK_LIST_ITEM_HEIGHT = 36;
|
||||
* @param {Object} props.LeafMoreMenu Optional more menu substitution.
|
||||
* @param {string} props.description Optional accessible description for the tree grid component.
|
||||
* @param {string} props.onSelect Optional callback to be invoked when a block is selected.
|
||||
* @param {string} props.showAppender Flag to show or hide the block appender.
|
||||
* @param {Object} ref Forwarded ref
|
||||
*/
|
||||
|
||||
@ -57191,6 +57253,7 @@ function OffCanvasEditor(_ref, ref) {
|
||||
blocks,
|
||||
showBlockMovers = false,
|
||||
isExpanded = false,
|
||||
showAppender = true,
|
||||
LeafMoreMenu,
|
||||
description = (0,external_wp_i18n_namespaceObject.__)('Block navigation structure'),
|
||||
onSelect
|
||||
@ -57324,7 +57387,8 @@ function OffCanvasEditor(_ref, ref) {
|
||||
fixedListWindow: fixedListWindow,
|
||||
selectedClientIds: selectedClientIds,
|
||||
isExpanded: isExpanded,
|
||||
shouldShowInnerBlocks: shouldShowInnerBlocks
|
||||
shouldShowInnerBlocks: shouldShowInnerBlocks,
|
||||
showAppender: showAppender
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTreeGridRow, {
|
||||
level: 1,
|
||||
setSize: 1,
|
||||
@ -57472,6 +57536,7 @@ function LeafMoreMenu(props) {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Private @wordpress/block-editor APIs.
|
||||
*/
|
||||
@ -57480,7 +57545,8 @@ const privateApis = {};
|
||||
lock(privateApis, { ...global_styles_namespaceObject,
|
||||
ExperimentalBlockEditorProvider: ExperimentalBlockEditorProvider,
|
||||
LeafMoreMenu: LeafMoreMenu,
|
||||
OffCanvasEditor: off_canvas_editor
|
||||
OffCanvasEditor: off_canvas_editor,
|
||||
PrivateInserter: ComposedPrivateInserter
|
||||
});
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/index.js
|
||||
|
4
wp-includes/js/dist/block-editor.min.js
vendored
4
wp-includes/js/dist/block-editor.min.js
vendored
File diff suppressed because one or more lines are too long
164
wp-includes/js/dist/block-library.js
vendored
164
wp-includes/js/dist/block-library.js
vendored
@ -27019,7 +27019,8 @@ function useOutdentListItem(clientId) {
|
||||
moveBlocksToPosition(clientIds, parentListId, getBlockRootClientId(parentListItemId), getBlockIndex(parentListItemId) + 1);
|
||||
|
||||
if (!getBlockOrder(parentListId).length) {
|
||||
removeBlock(parentListId);
|
||||
const shouldSelectParent = false;
|
||||
removeBlock(parentListId, shouldSelectParent);
|
||||
}
|
||||
});
|
||||
}, [])];
|
||||
@ -30623,7 +30624,10 @@ function ResponsiveWrapper(_ref) {
|
||||
|
||||
const inner_blocks_ALLOWED_BLOCKS = ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'];
|
||||
const inner_blocks_DEFAULT_BLOCK = {
|
||||
name: 'core/navigation-link'
|
||||
name: 'core/navigation-link',
|
||||
attributes: {
|
||||
type: 'page'
|
||||
}
|
||||
};
|
||||
function NavigationInnerBlocks(_ref) {
|
||||
let {
|
||||
@ -31869,7 +31873,7 @@ const MenuInspectorControls = props => {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.InspectorControls, {
|
||||
group: "list"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
|
||||
title: false ? 0 : (0,external_wp_i18n_namespaceObject.__)('Menu')
|
||||
title: null
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
||||
className: "wp-block-navigation-off-canvas-editor__header"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
|
||||
@ -32474,9 +32478,11 @@ function Navigation(_ref) {
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(manage_menus_button, {
|
||||
disabled: isManageMenusButtonDisabled,
|
||||
className: "wp-block-navigation-manage-menus-button"
|
||||
})), isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
|
||||
})), isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "wp-block-navigation__loading-indicator-container"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
|
||||
className: "wp-block-navigation__loading-indicator"
|
||||
})), !isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
|
||||
}))), !isLoading && (0,external_wp_element_namespaceObject.createElement)(TagName, blockProps, (0,external_wp_element_namespaceObject.createElement)(ResponsiveWrapper, {
|
||||
id: clientId,
|
||||
onToggle: setResponsiveMenuVisibility,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Menu'),
|
||||
@ -33921,17 +33927,6 @@ function NavigationLinkEdit(_ref) {
|
||||
hasChildren: !!getBlockCount(clientId)
|
||||
};
|
||||
}, [clientId]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
// This side-effect should not create an undo level as those should
|
||||
// only be created via user interactions. Mark this change as
|
||||
// not persistent to avoid undo level creation.
|
||||
// See https://github.com/WordPress/gutenberg/issues/34564.
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
setAttributes({
|
||||
isTopLevelLink
|
||||
});
|
||||
}, [isTopLevelLink]);
|
||||
/**
|
||||
* Transform to submenu block.
|
||||
*/
|
||||
@ -34880,19 +34875,7 @@ function NavigationSubmenuEdit(_ref) {
|
||||
if (!openSubmenusOnClick && !url) {
|
||||
setIsLinkOpen(true);
|
||||
}
|
||||
}, []); // Store the colors from context as attributes for rendering.
|
||||
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
// This side-effect should not create an undo level as those should
|
||||
// only be created via user interactions. Mark this change as
|
||||
// not persistent to avoid undo level creation.
|
||||
// See https://github.com/WordPress/gutenberg/issues/34564.
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
setAttributes({
|
||||
isTopLevelItem
|
||||
});
|
||||
}, [isTopLevelItem]);
|
||||
}, []);
|
||||
/**
|
||||
* The hook shouldn't be necessary but due to a focus loss happening
|
||||
* when selecting a suggestion in the link popover, we force close on block unselection.
|
||||
@ -35639,7 +35622,11 @@ function BlockContent(_ref) {
|
||||
} = _ref;
|
||||
|
||||
if (!hasResolvedPages) {
|
||||
return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, null));
|
||||
return (0,external_wp_element_namespaceObject.createElement)("div", blockProps, (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "wp-block-page-list__loading-indicator-container"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Spinner, {
|
||||
className: "wp-block-page-list__loading-indicator"
|
||||
})));
|
||||
}
|
||||
|
||||
if (pages === null) {
|
||||
@ -43368,6 +43355,7 @@ function QueryPlaceholder(_ref) {
|
||||
} = _ref;
|
||||
const [isStartingBlank, setIsStartingBlank] = (0,external_wp_element_namespaceObject.useState)(false);
|
||||
const blockProps = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
|
||||
const blockNameForPatterns = useBlockNameForPatterns(clientId, attributes);
|
||||
const {
|
||||
blockType,
|
||||
allVariations,
|
||||
@ -43385,9 +43373,9 @@ function QueryPlaceholder(_ref) {
|
||||
return {
|
||||
blockType: getBlockType(name),
|
||||
allVariations: getBlockVariations(name),
|
||||
hasPatterns: !!getPatternsByBlockTypes(name, rootClientId).length
|
||||
hasPatterns: !!getPatternsByBlockTypes(blockNameForPatterns, rootClientId).length
|
||||
};
|
||||
}, [name, clientId]);
|
||||
}, [name, blockNameForPatterns, clientId]);
|
||||
const matchingVariation = (0,external_wp_blockEditor_namespaceObject.__experimentalGetMatchingVariation)(attributes, allVariations);
|
||||
const icon = (matchingVariation === null || matchingVariation === void 0 ? void 0 : (_matchingVariation$ic = matchingVariation.icon) === null || _matchingVariation$ic === void 0 ? void 0 : _matchingVariation$ic.src) || (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.icon) || (blockType === null || blockType === void 0 ? void 0 : (_blockType$icon = blockType.icon) === null || _blockType$icon === void 0 ? void 0 : _blockType$icon.src);
|
||||
const label = (matchingVariation === null || matchingVariation === void 0 ? void 0 : matchingVariation.title) || (blockType === null || blockType === void 0 ? void 0 : blockType.title);
|
||||
@ -54597,32 +54585,81 @@ function TemplatePartSelectionModal(_ref) {
|
||||
*/
|
||||
|
||||
function transformWidgetToBlock(widget) {
|
||||
if (widget.id_base === 'block') {
|
||||
const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, {
|
||||
__unstableSkipAutop: true
|
||||
});
|
||||
if (widget.id_base !== 'block') {
|
||||
let attributes;
|
||||
|
||||
if (!parsedBlocks.length) {
|
||||
return (0,external_wp_blocks_namespaceObject.createBlock)('core/paragraph', {}, []);
|
||||
if (widget._embedded.about[0].is_multi) {
|
||||
attributes = {
|
||||
idBase: widget.id_base,
|
||||
instance: widget.instance
|
||||
};
|
||||
} else {
|
||||
attributes = {
|
||||
id: widget.id
|
||||
};
|
||||
}
|
||||
|
||||
return parsedBlocks[0];
|
||||
return switchLegacyWidgetType((0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes));
|
||||
}
|
||||
|
||||
let attributes;
|
||||
const parsedBlocks = (0,external_wp_blocks_namespaceObject.parse)(widget.instance.raw.content, {
|
||||
__unstableSkipAutop: true
|
||||
});
|
||||
|
||||
if (widget._embedded.about[0].is_multi) {
|
||||
attributes = {
|
||||
idBase: widget.id_base,
|
||||
instance: widget.instance
|
||||
};
|
||||
} else {
|
||||
attributes = {
|
||||
id: widget.id
|
||||
};
|
||||
if (!parsedBlocks.length) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return (0,external_wp_blocks_namespaceObject.createBlock)('core/legacy-widget', attributes, []);
|
||||
const block = parsedBlocks[0];
|
||||
|
||||
if (block.name === 'core/widget-group') {
|
||||
return (0,external_wp_blocks_namespaceObject.createBlock)((0,external_wp_blocks_namespaceObject.getGroupingBlockName)(), undefined, transformInnerBlocks(block.innerBlocks));
|
||||
}
|
||||
|
||||
if (block.innerBlocks.length > 0) {
|
||||
return (0,external_wp_blocks_namespaceObject.cloneBlock)(block, undefined, transformInnerBlocks(block.innerBlocks));
|
||||
}
|
||||
|
||||
return block;
|
||||
}
|
||||
/**
|
||||
* Switch Legacy Widget to the first matching transformation block.
|
||||
*
|
||||
* @param {Object} block Legacy Widget block object
|
||||
* @return {Object|undefined} a block
|
||||
*/
|
||||
|
||||
function switchLegacyWidgetType(block) {
|
||||
const transforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)([block]).filter(item => {
|
||||
var _item$transforms, _item$transforms$from, _item$transforms2, _item$transforms2$to;
|
||||
|
||||
// The block without any transformations can't be a wildcard.
|
||||
if (!item.transforms) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const hasWildCardFrom = (_item$transforms = item.transforms) === null || _item$transforms === void 0 ? void 0 : (_item$transforms$from = _item$transforms.from) === null || _item$transforms$from === void 0 ? void 0 : _item$transforms$from.find(from => from.blocks && from.blocks.includes('*'));
|
||||
const hasWildCardTo = (_item$transforms2 = item.transforms) === null || _item$transforms2 === void 0 ? void 0 : (_item$transforms2$to = _item$transforms2.to) === null || _item$transforms2$to === void 0 ? void 0 : _item$transforms2$to.find(to => to.blocks && to.blocks.includes('*')); // Skip wildcard transformations.
|
||||
|
||||
return !hasWildCardFrom && !hasWildCardTo;
|
||||
});
|
||||
|
||||
if (!transforms.length) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, transforms[0].name);
|
||||
}
|
||||
|
||||
function transformInnerBlocks() {
|
||||
let innerBlocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
||||
return innerBlocks.flatMap(block => {
|
||||
if (block.name === 'core/legacy-widget') {
|
||||
return switchLegacyWidgetType(block);
|
||||
}
|
||||
|
||||
return (0,external_wp_blocks_namespaceObject.createBlock)(block.name, block.attributes, transformInnerBlocks(block.innerBlocks));
|
||||
}).filter(block => !!block);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/template-part/edit/import-controls.js
|
||||
@ -54637,7 +54674,6 @@ function transformWidgetToBlock(widget) {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
@ -54726,32 +54762,14 @@ function TemplatePartImportControls(_ref) {
|
||||
});
|
||||
const skippedWidgets = new Set();
|
||||
const blocks = widgets.flatMap(widget => {
|
||||
const block = transformWidgetToBlock(widget);
|
||||
const block = transformWidgetToBlock(widget); // Skip the block if we have no matching transformations.
|
||||
|
||||
if (block.name !== 'core/legacy-widget') {
|
||||
return block;
|
||||
}
|
||||
|
||||
const transforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)([block]).filter(item => {
|
||||
var _item$transforms, _item$transforms$from, _item$transforms2, _item$transforms2$to;
|
||||
|
||||
// The block without any transformations can't be a wildcard.
|
||||
if (!item.transforms) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const hasWildCardFrom = (_item$transforms = item.transforms) === null || _item$transforms === void 0 ? void 0 : (_item$transforms$from = _item$transforms.from) === null || _item$transforms$from === void 0 ? void 0 : _item$transforms$from.find(from => from.blocks && from.blocks.includes('*'));
|
||||
const hasWildCardTo = (_item$transforms2 = item.transforms) === null || _item$transforms2 === void 0 ? void 0 : (_item$transforms2$to = _item$transforms2.to) === null || _item$transforms2$to === void 0 ? void 0 : _item$transforms2$to.find(to => to.blocks && to.blocks.includes('*'));
|
||||
return !hasWildCardFrom && !hasWildCardTo;
|
||||
}); // Skip the block if we have no matching transformations.
|
||||
|
||||
if (!transforms.length) {
|
||||
if (!block) {
|
||||
skippedWidgets.add(widget.id_base);
|
||||
return [];
|
||||
} // Try transforming the Legacy Widget into a first matching block.
|
||||
}
|
||||
|
||||
|
||||
return (0,external_wp_blocks_namespaceObject.switchToBlockType)(block, transforms[0].name);
|
||||
return block;
|
||||
});
|
||||
await createFromBlocks(blocks,
|
||||
/* translators: %s: name of the widget area */
|
||||
|
4
wp-includes/js/dist/block-library.min.js
vendored
4
wp-includes/js/dist/block-library.min.js
vendored
File diff suppressed because one or more lines are too long
9
wp-includes/js/dist/edit-post.js
vendored
9
wp-includes/js/dist/edit-post.js
vendored
@ -3989,11 +3989,9 @@ function VisualEditor(_ref2) {
|
||||
css: postContentLayoutStyles,
|
||||
layoutDefinitions: globalLayoutSettings === null || globalLayoutSettings === void 0 ? void 0 : globalLayoutSettings.definitions
|
||||
})), !isTemplateMode && (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: classnames_default()( // This wrapper div should have the same
|
||||
// classes as the block list beneath.
|
||||
'is-root-container', 'block-editor-block-list__layout', 'edit-post-visual-editor__post-title-wrapper', {
|
||||
className: classnames_default()('edit-post-visual-editor__post-title-wrapper', {
|
||||
'is-focus-mode': isFocusMode
|
||||
}, blockListLayoutClass),
|
||||
}, 'is-layout-flow'),
|
||||
contentEditable: false
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.PostTitle, {
|
||||
ref: titleRef
|
||||
@ -10042,6 +10040,9 @@ function initializeEditor(id, postType, postId, settings, initialEdits) {
|
||||
(0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({
|
||||
inserter: false
|
||||
});
|
||||
(0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({
|
||||
inserter: false
|
||||
});
|
||||
|
||||
if (false) {}
|
||||
/*
|
||||
|
2
wp-includes/js/dist/edit-post.min.js
vendored
2
wp-includes/js/dist/edit-post.min.js
vendored
File diff suppressed because one or more lines are too long
667
wp-includes/js/dist/edit-site.js
vendored
667
wp-includes/js/dist/edit-site.js
vendored
@ -3926,11 +3926,17 @@ const originalHistoryPush = history_history.push;
|
||||
const originalHistoryReplace = history_history.replace;
|
||||
|
||||
function push(params, state) {
|
||||
return originalHistoryPush.call(history_history, (0,external_wp_url_namespaceObject.addQueryArgs)(window.location.href, params), state);
|
||||
const currentArgs = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href);
|
||||
const currentUrlWithoutArgs = (0,external_wp_url_namespaceObject.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
|
||||
const newUrl = (0,external_wp_url_namespaceObject.addQueryArgs)(currentUrlWithoutArgs, params);
|
||||
return originalHistoryPush.call(history_history, newUrl, state);
|
||||
}
|
||||
|
||||
function replace(params, state) {
|
||||
return originalHistoryReplace.call(history_history, (0,external_wp_url_namespaceObject.addQueryArgs)(window.location.href, params), state);
|
||||
const currentArgs = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href);
|
||||
const currentUrlWithoutArgs = (0,external_wp_url_namespaceObject.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
|
||||
const newUrl = (0,external_wp_url_namespaceObject.addQueryArgs)(currentUrlWithoutArgs, params);
|
||||
return originalHistoryReplace.call(history_history, newUrl, state);
|
||||
}
|
||||
|
||||
history_history.push = push;
|
||||
@ -4014,8 +4020,11 @@ function useLink() {
|
||||
}
|
||||
}
|
||||
|
||||
const currentArgs = (0,external_wp_url_namespaceObject.getQueryArgs)(window.location.href);
|
||||
const currentUrlWithoutArgs = (0,external_wp_url_namespaceObject.removeQueryArgs)(window.location.href, ...Object.keys(currentArgs));
|
||||
const newUrl = (0,external_wp_url_namespaceObject.addQueryArgs)(currentUrlWithoutArgs, params);
|
||||
return {
|
||||
href: (0,external_wp_url_namespaceObject.addQueryArgs)(window.location.href, params),
|
||||
href: newUrl,
|
||||
onClick
|
||||
};
|
||||
}
|
||||
@ -5637,7 +5646,8 @@ function SidebarNavigationScreen(_ref) {
|
||||
isRoot,
|
||||
title,
|
||||
actions,
|
||||
content
|
||||
content,
|
||||
description
|
||||
} = _ref;
|
||||
const {
|
||||
dashboardLink
|
||||
@ -5668,7 +5678,9 @@ function SidebarNavigationScreen(_ref) {
|
||||
className: "edit-site-sidebar-navigation-screen__title"
|
||||
}, title), actions), (0,external_wp_element_namespaceObject.createElement)("nav", {
|
||||
className: "edit-site-sidebar-navigation-screen__content"
|
||||
}, content));
|
||||
}, description && (0,external_wp_element_namespaceObject.createElement)("p", {
|
||||
className: "edit-site-sidebar-navigation-screen__description"
|
||||
}, description), content));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-item/index.js
|
||||
@ -5746,6 +5758,7 @@ function SidebarNavigationScreenMain() {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
isRoot: true,
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Design'),
|
||||
description: (0,external_wp_i18n_namespaceObject.__)('Customize the appearance of your website using the block editor.'),
|
||||
content: (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, !!navigationMenus && navigationMenus.length > 0 && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalNavigatorButton, {
|
||||
as: SidebarNavigationItem,
|
||||
path: "/navigation",
|
||||
@ -7471,7 +7484,8 @@ const config = {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Templates'),
|
||||
loading: (0,external_wp_i18n_namespaceObject.__)('Loading templates'),
|
||||
notFound: (0,external_wp_i18n_namespaceObject.__)('No templates found'),
|
||||
manage: (0,external_wp_i18n_namespaceObject.__)('Manage all templates')
|
||||
manage: (0,external_wp_i18n_namespaceObject.__)('Manage all templates'),
|
||||
description: (0,external_wp_i18n_namespaceObject.__)('Express the layout of your site with templates.')
|
||||
}
|
||||
},
|
||||
wp_template_part: {
|
||||
@ -7479,7 +7493,8 @@ const config = {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Template parts'),
|
||||
loading: (0,external_wp_i18n_namespaceObject.__)('Loading template parts'),
|
||||
notFound: (0,external_wp_i18n_namespaceObject.__)('No template parts found'),
|
||||
manage: (0,external_wp_i18n_namespaceObject.__)('Manage all template parts')
|
||||
manage: (0,external_wp_i18n_namespaceObject.__)('Manage all template parts'),
|
||||
description: (0,external_wp_i18n_namespaceObject.__)('Template Parts are small pieces of a layout that can be reused across multiple templates and always appear the same way. Common template parts include the site header, footer, or sidebar.')
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -7523,6 +7538,7 @@ function SidebarNavigationScreenTemplates() {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
isRoot: isTemplatePartsMode,
|
||||
title: config[postType].labels.title,
|
||||
description: config[postType].labels.description,
|
||||
actions: canCreate && (0,external_wp_element_namespaceObject.createElement)(AddNewTemplate, {
|
||||
templateType: postType,
|
||||
toggleProps: {
|
||||
@ -7573,7 +7589,7 @@ const pencil = (0,external_wp_element_namespaceObject.createElement)(external_wp
|
||||
*/
|
||||
|
||||
|
||||
function useEditedEntityRecord() {
|
||||
function useEditedEntityRecord(postType, postId) {
|
||||
const {
|
||||
record,
|
||||
title,
|
||||
@ -7590,12 +7606,12 @@ function useEditedEntityRecord() {
|
||||
const {
|
||||
__experimentalGetTemplateInfo: getTemplateInfo
|
||||
} = select(external_wp_editor_namespaceObject.store);
|
||||
const postType = getEditedPostType();
|
||||
const postId = getEditedPostId();
|
||||
const usedPostType = postType !== null && postType !== void 0 ? postType : getEditedPostType();
|
||||
const usedPostId = postId !== null && postId !== void 0 ? postId : getEditedPostId();
|
||||
|
||||
const _record = getEditedEntityRecord('postType', postType, postId);
|
||||
const _record = getEditedEntityRecord('postType', usedPostType, usedPostId);
|
||||
|
||||
const _isLoaded = !!postId;
|
||||
const _isLoaded = !!usedPostId;
|
||||
|
||||
const templateInfo = getTemplateInfo(_record);
|
||||
return {
|
||||
@ -7604,7 +7620,7 @@ function useEditedEntityRecord() {
|
||||
description: templateInfo.description,
|
||||
isLoaded: _isLoaded
|
||||
};
|
||||
}, []);
|
||||
}, [postType, postId]);
|
||||
return {
|
||||
isLoaded,
|
||||
record,
|
||||
@ -7622,6 +7638,7 @@ function useEditedEntityRecord() {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
@ -7632,6 +7649,13 @@ function useEditedEntityRecord() {
|
||||
|
||||
|
||||
function SidebarNavigationScreenTemplate() {
|
||||
const {
|
||||
params
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
const {
|
||||
postType,
|
||||
postId
|
||||
} = params;
|
||||
const {
|
||||
setCanvasMode
|
||||
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
|
||||
@ -7639,11 +7663,16 @@ function SidebarNavigationScreenTemplate() {
|
||||
getDescription,
|
||||
getTitle,
|
||||
record
|
||||
} = useEditedEntityRecord();
|
||||
} = useEditedEntityRecord(postType, postId);
|
||||
let description = getDescription();
|
||||
|
||||
if (!description && record.is_custom) {
|
||||
description = (0,external_wp_i18n_namespaceObject.__)('This is a custom template that can be applied manually to any Post or Page.');
|
||||
if (!description) {
|
||||
if (record.type === 'wp_template' && record.is_custom) {
|
||||
description = (0,external_wp_i18n_namespaceObject.__)('This is a custom template that can be applied manually to any Post or Page.');
|
||||
} else if (record.type === 'wp_template_part') {
|
||||
description = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: template part title e.g: "Header".
|
||||
(0,external_wp_i18n_namespaceObject.__)('This is your %s template part.'), getTitle());
|
||||
}
|
||||
}
|
||||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
@ -7653,7 +7682,7 @@ function SidebarNavigationScreenTemplate() {
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Edit'),
|
||||
icon: library_pencil
|
||||
}),
|
||||
content: description ? (0,external_wp_element_namespaceObject.createElement)("p", null, description) : undefined
|
||||
description: description
|
||||
});
|
||||
}
|
||||
|
||||
@ -7699,7 +7728,15 @@ function useSyncPathWithURL() {
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
const currentUrlParams = (0,external_wp_element_namespaceObject.useRef)(urlParams);
|
||||
const currentPath = (0,external_wp_element_namespaceObject.useRef)(navigatorLocation.path);
|
||||
const isMounting = (0,external_wp_element_namespaceObject.useRef)(true);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
// The navigatorParams are only initially filled properly when the
|
||||
// navigator screens mount. so we ignore the first synchronisation.
|
||||
if (isMounting.current) {
|
||||
isMounting.current = false;
|
||||
return;
|
||||
}
|
||||
|
||||
function updateUrlParams(newUrlParams) {
|
||||
if (Object.entries(newUrlParams).every(_ref => {
|
||||
let [key, value] = _ref;
|
||||
@ -7721,17 +7758,11 @@ function useSyncPathWithURL() {
|
||||
postId: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postId,
|
||||
path: undefined
|
||||
});
|
||||
} else if (navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postType && !(navigatorParams !== null && navigatorParams !== void 0 && navigatorParams.postId)) {
|
||||
updateUrlParams({
|
||||
postType: navigatorParams === null || navigatorParams === void 0 ? void 0 : navigatorParams.postType,
|
||||
path: navigatorLocation.path,
|
||||
postId: undefined
|
||||
});
|
||||
} else {
|
||||
updateUrlParams({
|
||||
postType: undefined,
|
||||
postId: undefined,
|
||||
path: navigatorLocation.path
|
||||
path: navigatorLocation.path === '/' ? undefined : navigatorLocation.path
|
||||
});
|
||||
}
|
||||
}, [navigatorLocation === null || navigatorLocation === void 0 ? void 0 : navigatorLocation.path, navigatorParams, history]);
|
||||
@ -7746,7 +7777,19 @@ function useSyncPathWithURL() {
|
||||
}, [urlParams, goTo]);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-inspector/navigation-menu.js
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js
|
||||
|
||||
function NavigationMenuLoader() {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar-navigation-screen-navigation-menus__placeholder"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar-navigation-screen-navigation-menus__placeholder"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar-navigation-screen-navigation-menus__placeholder"
|
||||
}));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js
|
||||
|
||||
|
||||
/**
|
||||
@ -7755,222 +7798,62 @@ function useSyncPathWithURL() {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
const ALLOWED_BLOCKS = {
|
||||
'core/navigation': ['core/navigation-link', 'core/search', 'core/social-links', 'core/page-list', 'core/spacer', 'core/home-link', 'core/site-title', 'core/site-logo', 'core/navigation-submenu'],
|
||||
'core/social-links': ['core/social-link'],
|
||||
'core/navigation-submenu': ['core/navigation-link', 'core/navigation-submenu'],
|
||||
'core/navigation-link': ['core/navigation-link', 'core/navigation-submenu']
|
||||
};
|
||||
function NavigationMenu(_ref) {
|
||||
|
||||
function NavigationMenuContent(_ref) {
|
||||
let {
|
||||
innerBlocks,
|
||||
rootClientId,
|
||||
onSelect
|
||||
} = _ref;
|
||||
const {
|
||||
updateBlockListSettings
|
||||
clientIdsTree,
|
||||
isLoading
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
__unstableGetClientIdsTree,
|
||||
areInnerBlocksControlled
|
||||
} = select(external_wp_blockEditor_namespaceObject.store);
|
||||
return {
|
||||
clientIdsTree: __unstableGetClientIdsTree(rootClientId),
|
||||
// This is a small hack to wait for the navigation block
|
||||
// to actually load its inner blocks.
|
||||
isLoading: !areInnerBlocksControlled(rootClientId)
|
||||
};
|
||||
}, [rootClientId]);
|
||||
const {
|
||||
replaceBlock,
|
||||
__unstableMarkNextChangeAsNotPersistent
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
|
||||
const {
|
||||
OffCanvasEditor,
|
||||
LeafMoreMenu
|
||||
} = unlock(external_wp_blockEditor_namespaceObject.privateApis); //TODO: Block settings are normally updated as a side effect of rendering InnerBlocks in BlockList
|
||||
//Think through a better way of doing this, possible with adding allowed blocks to block library metadata
|
||||
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
|
||||
const offCanvasOnselect = (0,external_wp_element_namespaceObject.useCallback)(block => {
|
||||
if (block.name === 'core/navigation-link' && !block.attributes.url) {
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
updateBlockListSettings('', {
|
||||
allowedBlocks: ALLOWED_BLOCKS['core/navigation']
|
||||
});
|
||||
innerBlocks.forEach(block => {
|
||||
if (ALLOWED_BLOCKS[block.name]) {
|
||||
updateBlockListSettings(block.clientId, {
|
||||
allowedBlocks: ALLOWED_BLOCKS[block.name]
|
||||
});
|
||||
}
|
||||
});
|
||||
}, [updateBlockListSettings, innerBlocks]);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(OffCanvasEditor, {
|
||||
blocks: innerBlocks,
|
||||
onSelect: onSelect,
|
||||
LeafMoreMenu: LeafMoreMenu
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/navigation-inspector/index.js
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
const NAVIGATION_MENUS_QUERY = [{
|
||||
per_page: -1,
|
||||
status: 'publish'
|
||||
}];
|
||||
function NavigationInspector(_ref) {
|
||||
var _navigationMenus$;
|
||||
|
||||
let {
|
||||
onSelect
|
||||
} = _ref;
|
||||
const {
|
||||
selectedNavigationBlockId,
|
||||
clientIdToRef,
|
||||
navigationMenus,
|
||||
isResolvingNavigationMenus,
|
||||
hasResolvedNavigationMenus,
|
||||
firstNavigationBlockId
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
__experimentalGetActiveBlockIdByBlockNames,
|
||||
__experimentalGetGlobalBlocksByName,
|
||||
getBlock
|
||||
} = select(external_wp_blockEditor_namespaceObject.store);
|
||||
const {
|
||||
getEntityRecords,
|
||||
hasFinishedResolution,
|
||||
isResolving
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
const navigationMenusQuery = ['postType', 'wp_navigation', NAVIGATION_MENUS_QUERY[0]]; // Get the active Navigation block (if present).
|
||||
|
||||
const selectedNavId = __experimentalGetActiveBlockIdByBlockNames('core/navigation'); // Get all Navigation blocks currently within the editor canvas.
|
||||
|
||||
|
||||
const navBlockIds = __experimentalGetGlobalBlocksByName('core/navigation');
|
||||
|
||||
const idToRef = {};
|
||||
navBlockIds.forEach(id => {
|
||||
var _getBlock, _getBlock$attributes;
|
||||
|
||||
idToRef[id] = (_getBlock = getBlock(id)) === null || _getBlock === void 0 ? void 0 : (_getBlock$attributes = _getBlock.attributes) === null || _getBlock$attributes === void 0 ? void 0 : _getBlock$attributes.ref;
|
||||
});
|
||||
return {
|
||||
selectedNavigationBlockId: selectedNavId,
|
||||
firstNavigationBlockId: navBlockIds === null || navBlockIds === void 0 ? void 0 : navBlockIds[0],
|
||||
clientIdToRef: idToRef,
|
||||
navigationMenus: getEntityRecords(...navigationMenusQuery),
|
||||
isResolvingNavigationMenus: isResolving('getEntityRecords', navigationMenusQuery),
|
||||
hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', navigationMenusQuery)
|
||||
};
|
||||
}, []);
|
||||
const navMenuListId = (0,external_wp_compose_namespaceObject.useInstanceId)(NavigationMenu, 'edit-site-navigation-inspector-menu');
|
||||
const firstNavRefInTemplate = clientIdToRef[firstNavigationBlockId];
|
||||
const firstNavigationMenuRef = navigationMenus === null || navigationMenus === void 0 ? void 0 : (_navigationMenus$ = navigationMenus[0]) === null || _navigationMenus$ === void 0 ? void 0 : _navigationMenus$.id; // Default Navigation Menu is either:
|
||||
// - the Navigation Menu referenced by the first Nav block within the template.
|
||||
// - the first of the available Navigation Menus (`wp_navigation`) posts.
|
||||
|
||||
const defaultNavigationMenuId = firstNavRefInTemplate || firstNavigationMenuRef; // The Navigation Menu manually selected by the user within the Nav inspector.
|
||||
|
||||
const [currentMenuId, setCurrentMenuId] = (0,external_wp_element_namespaceObject.useState)(firstNavRefInTemplate); // If a Nav block is selected within the canvas then set the
|
||||
// Navigation Menu referenced by it's `ref` attribute to be
|
||||
// active within the Navigation sidebar.
|
||||
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
if (selectedNavigationBlockId) {
|
||||
setCurrentMenuId(clientIdToRef[selectedNavigationBlockId]);
|
||||
replaceBlock(block.clientId, (0,external_wp_blocks_namespaceObject.createBlock)('core/navigation-link', block.attributes));
|
||||
} else {
|
||||
onSelect(block);
|
||||
}
|
||||
}, [selectedNavigationBlockId]);
|
||||
let options = [];
|
||||
}, [onSelect, __unstableMarkNextChangeAsNotPersistent, replaceBlock]); // The hidden block is needed because it makes block edit side effects trigger.
|
||||
// For example a navigation page list load its items has an effect on edit to load its items.
|
||||
|
||||
if (navigationMenus) {
|
||||
options = navigationMenus.map(_ref2 => {
|
||||
let {
|
||||
id,
|
||||
title
|
||||
} = _ref2;
|
||||
return {
|
||||
value: id,
|
||||
label: title.rendered
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
const [innerBlocks, onInput, onChange] = (0,external_wp_coreData_namespaceObject.useEntityBlockEditor)('postType', 'wp_navigation', {
|
||||
id: currentMenuId || defaultNavigationMenuId
|
||||
});
|
||||
const {
|
||||
isLoadingInnerBlocks,
|
||||
hasLoadedInnerBlocks
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
isResolving,
|
||||
hasFinishedResolution
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
return {
|
||||
isLoadingInnerBlocks: isResolving('getEntityRecord', ['postType', 'wp_navigation', currentMenuId || defaultNavigationMenuId]),
|
||||
hasLoadedInnerBlocks: hasFinishedResolution('getEntityRecord', ['postType', 'wp_navigation', currentMenuId || defaultNavigationMenuId])
|
||||
};
|
||||
}, [currentMenuId, defaultNavigationMenuId]);
|
||||
const isLoading = !(hasResolvedNavigationMenus && hasLoadedInnerBlocks);
|
||||
const hasMoreThanOneNavigationMenu = (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) > 1;
|
||||
const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length); // Entity block editor will return entities that are not currently published.
|
||||
// Guard by only allowing their usage if there are published Nav Menus.
|
||||
|
||||
const publishedInnerBlocks = hasNavigationMenus ? innerBlocks : [];
|
||||
const hasInnerBlocks = !!(publishedInnerBlocks !== null && publishedInnerBlocks !== void 0 && publishedInnerBlocks.length);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
if (isResolvingNavigationMenus) {
|
||||
(0,external_wp_a11y_namespaceObject.speak)('Loading Navigation sidebar menus.');
|
||||
}
|
||||
|
||||
if (hasResolvedNavigationMenus) {
|
||||
(0,external_wp_a11y_namespaceObject.speak)('Navigation sidebar menus have loaded.');
|
||||
}
|
||||
}, [isResolvingNavigationMenus, hasResolvedNavigationMenus]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
if (isLoadingInnerBlocks) {
|
||||
(0,external_wp_a11y_namespaceObject.speak)('Loading Navigation sidebar selected menu items.');
|
||||
}
|
||||
|
||||
if (hasLoadedInnerBlocks) {
|
||||
(0,external_wp_a11y_namespaceObject.speak)('Navigation sidebar selected menu items have loaded.');
|
||||
}
|
||||
}, [isLoadingInnerBlocks, hasLoadedInnerBlocks]);
|
||||
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-navigation-inspector"
|
||||
}, hasResolvedNavigationMenus && !hasNavigationMenus && (0,external_wp_element_namespaceObject.createElement)("p", {
|
||||
className: "edit-site-navigation-inspector__empty-msg"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('There are no Navigation Menus.')), !hasResolvedNavigationMenus && (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-navigation-inspector__placeholder"
|
||||
}), hasResolvedNavigationMenus && hasMoreThanOneNavigationMenu && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, {
|
||||
__nextHasNoMarginBottom: true,
|
||||
className: "edit-site-navigation-inspector__select-menu",
|
||||
"aria-controls": // aria-controls should only apply when referenced element is in DOM
|
||||
hasLoadedInnerBlocks ? navMenuListId : undefined,
|
||||
value: currentMenuId || defaultNavigationMenuId,
|
||||
options: options,
|
||||
onChange: newMenuId => setCurrentMenuId(Number(newMenuId))
|
||||
}), isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-navigation-inspector__placeholder is-child"
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isLoading && (0,external_wp_element_namespaceObject.createElement)(NavigationMenuLoader, null), !isLoading && (0,external_wp_element_namespaceObject.createElement)(OffCanvasEditor, {
|
||||
blocks: clientIdsTree,
|
||||
onSelect: offCanvasOnselect,
|
||||
LeafMoreMenu: LeafMoreMenu,
|
||||
showAppender: false
|
||||
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-navigation-inspector__placeholder is-child"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-navigation-inspector__placeholder is-child"
|
||||
})), hasInnerBlocks && !isLoading && (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, {
|
||||
value: publishedInnerBlocks,
|
||||
onChange: onChange,
|
||||
onInput: onInput
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(NavigationMenu, {
|
||||
innerBlocks: publishedInnerBlocks,
|
||||
onSelect: onSelect
|
||||
})), !hasInnerBlocks && !isLoading && (0,external_wp_element_namespaceObject.createElement)("p", {
|
||||
className: "edit-site-navigation-inspector__empty-msg"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Navigation Menu is empty.')));
|
||||
style: {
|
||||
visibility: 'hidden'
|
||||
}
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTools, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, null))));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menus/index.js
|
||||
@ -7981,6 +7864,10 @@ function NavigationInspector(_ref) {
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
@ -7988,11 +7875,73 @@ function NavigationInspector(_ref) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
const sidebar_navigation_screen_navigation_menus_noop = () => {};
|
||||
|
||||
const NAVIGATION_MENUS_QUERY = {
|
||||
per_page: -1,
|
||||
status: 'publish'
|
||||
};
|
||||
|
||||
function SidebarNavigationScreenWrapper(_ref) {
|
||||
let {
|
||||
children,
|
||||
actions
|
||||
} = _ref;
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
|
||||
actions: actions,
|
||||
description: (0,external_wp_i18n_namespaceObject.__)('Browse your site, edit pages, and manage your primary navigation menu.'),
|
||||
content: children
|
||||
});
|
||||
}
|
||||
|
||||
const prioritizedInserterBlocks = ['core/navigation-link/page', 'core/navigation-link'];
|
||||
function SidebarNavigationScreenNavigationMenus() {
|
||||
var _orderedNavigationMen;
|
||||
|
||||
const history = useHistory();
|
||||
const {
|
||||
navigationMenus,
|
||||
hasResolvedNavigationMenus,
|
||||
storedSettings
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
getSettings
|
||||
} = unlock(select(store_store));
|
||||
const {
|
||||
getEntityRecords,
|
||||
hasFinishedResolution
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
const navigationMenusQuery = ['postType', 'wp_navigation', NAVIGATION_MENUS_QUERY];
|
||||
return {
|
||||
storedSettings: getSettings(false),
|
||||
navigationMenus: getEntityRecords(...navigationMenusQuery),
|
||||
hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', navigationMenusQuery)
|
||||
};
|
||||
}, []); // Sort navigation menus by date.
|
||||
|
||||
const orderedNavigationMenus = (0,external_wp_element_namespaceObject.useMemo)(() => navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.sort((menuA, menuB) => {
|
||||
const menuADate = new Date(menuA.date);
|
||||
const menuBDate = new Date(menuB.date);
|
||||
return menuADate.getTime() > menuBDate.getTime();
|
||||
}), [navigationMenus]);
|
||||
const firstNavigationMenu = orderedNavigationMenus === null || orderedNavigationMenus === void 0 ? void 0 : (_orderedNavigationMen = orderedNavigationMenus[0]) === null || _orderedNavigationMen === void 0 ? void 0 : _orderedNavigationMen.id;
|
||||
const blocks = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
||||
return [(0,external_wp_blocks_namespaceObject.createBlock)('core/navigation', {
|
||||
ref: firstNavigationMenu
|
||||
})];
|
||||
}, [firstNavigationMenu]);
|
||||
const isLoading = !hasResolvedNavigationMenus;
|
||||
const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
|
||||
const onSelect = (0,external_wp_element_namespaceObject.useCallback)(selectedBlock => {
|
||||
const {
|
||||
attributes
|
||||
attributes,
|
||||
name
|
||||
} = selectedBlock;
|
||||
|
||||
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
||||
@ -8001,15 +7950,69 @@ function SidebarNavigationScreenNavigationMenus() {
|
||||
postId: attributes.id
|
||||
});
|
||||
}
|
||||
|
||||
if (name === 'core/page-list-item' && attributes.id && history) {
|
||||
history.push({
|
||||
postType: 'page',
|
||||
postId: attributes.id
|
||||
});
|
||||
}
|
||||
}, [history]);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
|
||||
content: (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar-navigation-screen-navigation-menus"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(NavigationInspector, {
|
||||
onSelect: onSelect
|
||||
}))
|
||||
});
|
||||
const orderInitialBlockItems = (0,external_wp_element_namespaceObject.useCallback)(items => {
|
||||
items.sort((_ref2, _ref3) => {
|
||||
let {
|
||||
id: aName
|
||||
} = _ref2;
|
||||
let {
|
||||
id: bName
|
||||
} = _ref3;
|
||||
// Sort block items according to `prioritizedInserterBlocks`.
|
||||
let aIndex = prioritizedInserterBlocks.indexOf(aName);
|
||||
let bIndex = prioritizedInserterBlocks.indexOf(bName); // All other block items should come after that.
|
||||
|
||||
if (aIndex < 0) aIndex = prioritizedInserterBlocks.length;
|
||||
if (bIndex < 0) bIndex = prioritizedInserterBlocks.length;
|
||||
return aIndex - bIndex;
|
||||
});
|
||||
return items;
|
||||
}, []);
|
||||
|
||||
if (hasResolvedNavigationMenus && !hasNavigationMenus) {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, null, (0,external_wp_i18n_namespaceObject.__)('There are no Navigation Menus.'));
|
||||
}
|
||||
|
||||
if (!hasResolvedNavigationMenus || isLoading) {
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, null, (0,external_wp_element_namespaceObject.createElement)(NavigationMenuLoader, null));
|
||||
}
|
||||
|
||||
const {
|
||||
PrivateInserter
|
||||
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockEditorProvider, {
|
||||
settings: storedSettings,
|
||||
value: blocks,
|
||||
onChange: sidebar_navigation_screen_navigation_menus_noop,
|
||||
onInput: sidebar_navigation_screen_navigation_menus_noop
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenWrapper, {
|
||||
actions: (0,external_wp_element_namespaceObject.createElement)(PrivateInserter, {
|
||||
rootClientId: blocks[0].clientId,
|
||||
position: "bottom right",
|
||||
isAppender: true,
|
||||
selectBlockOnInsert: false,
|
||||
shouldDirectInsert: false,
|
||||
__experimentalIsQuick: true,
|
||||
toggleProps: {
|
||||
as: SidebarButton,
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Add menu item')
|
||||
},
|
||||
orderInitialBlockItems: orderInitialBlockItems
|
||||
})
|
||||
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar-navigation-screen-navigation-menus__content"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(NavigationMenuContent, {
|
||||
rootClientId: blocks[0].clientId,
|
||||
onSelect: onSelect
|
||||
}))));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-templates-browse/index.js
|
||||
@ -8027,10 +8030,12 @@ function SidebarNavigationScreenNavigationMenus() {
|
||||
|
||||
const sidebar_navigation_screen_templates_browse_config = {
|
||||
wp_template: {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('All templates')
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('All templates'),
|
||||
description: (0,external_wp_i18n_namespaceObject.__)('Create new templates, or reset any customizations made to the templates supplied by your theme.')
|
||||
},
|
||||
wp_template_part: {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('All template parts')
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('All template parts'),
|
||||
description: (0,external_wp_i18n_namespaceObject.__)('Create new template parts, or reset any customisations made to the template parts supplied by your theme.')
|
||||
}
|
||||
};
|
||||
function SidebarNavigationScreenTemplatesBrowse() {
|
||||
@ -8040,13 +8045,14 @@ function SidebarNavigationScreenTemplatesBrowse() {
|
||||
}
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
title: sidebar_navigation_screen_templates_browse_config[postType].title
|
||||
title: sidebar_navigation_screen_templates_browse_config[postType].title,
|
||||
description: sidebar_navigation_screen_templates_browse_config[postType].description
|
||||
});
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: external ["wp","keycodes"]
|
||||
var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-hub/index.js
|
||||
|
||||
|
||||
/**
|
||||
@ -8057,16 +8063,15 @@ var external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function SaveButton(_ref) {
|
||||
let {
|
||||
showTooltip = true
|
||||
} = _ref;
|
||||
function SaveButton() {
|
||||
const {
|
||||
countUnsavedChanges,
|
||||
isDirty,
|
||||
isSaving,
|
||||
isSaveViewOpen
|
||||
@ -8084,19 +8089,23 @@ function SaveButton(_ref) {
|
||||
return {
|
||||
isDirty: dirtyEntityRecords.length > 0,
|
||||
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
|
||||
isSaveViewOpen: isSaveViewOpened()
|
||||
isSaveViewOpen: isSaveViewOpened(),
|
||||
countUnsavedChanges: dirtyEntityRecords.length
|
||||
};
|
||||
}, []);
|
||||
const {
|
||||
setIsSaveViewOpened
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
|
||||
const disabled = !isDirty || isSaving;
|
||||
|
||||
const label = (0,external_wp_i18n_namespaceObject.__)('Save');
|
||||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "primary",
|
||||
className: "edit-site-save-button__button",
|
||||
const label = disabled ? (0,external_wp_i18n_namespaceObject.__)('Saved') : (0,external_wp_i18n_namespaceObject.__)('Save');
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
||||
className: "edit-site-save-hub",
|
||||
alignment: "right",
|
||||
spacing: 4
|
||||
}, isDirty && (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %d: number of unsaved changes (number).
|
||||
(0,external_wp_i18n_namespaceObject._n)('%d unsaved change', '%d unsaved changes', countUnsavedChanges), countUnsavedChanges)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
className: "edit-site-save-hub__button",
|
||||
variant: disabled ? undefined : 'primary',
|
||||
"aria-disabled": disabled,
|
||||
"aria-expanded": isSaveViewOpen,
|
||||
isBusy: isSaving,
|
||||
@ -8107,16 +8116,9 @@ function SaveButton(_ref) {
|
||||
* button does something, i.e. when it's not disabled.
|
||||
*/
|
||||
,
|
||||
shortcut: disabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s')
|
||||
/*
|
||||
* Displaying the keyboard shortcut conditionally makes the tooltip
|
||||
* itself show conditionally. This would trigger a full-rerendering
|
||||
* of the button that we want to avoid. By setting `showTooltip`,
|
||||
& the tooltip is always rendered even when there's no keyboard shortcut.
|
||||
*/
|
||||
,
|
||||
showTooltip: showTooltip
|
||||
}, label);
|
||||
shortcut: disabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s'),
|
||||
icon: disabled ? library_check : undefined
|
||||
}, label));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-item/index.js
|
||||
@ -8140,7 +8142,7 @@ function SaveButton(_ref) {
|
||||
|
||||
|
||||
function SidebarNavigationScreenNavigationItem() {
|
||||
var _post$title, _post$description;
|
||||
var _record$title, _record$description;
|
||||
|
||||
const {
|
||||
setCanvasMode
|
||||
@ -8152,25 +8154,20 @@ function SidebarNavigationScreenNavigationItem() {
|
||||
}
|
||||
} = (0,external_wp_components_namespaceObject.__experimentalUseNavigator)();
|
||||
const {
|
||||
post
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
getEntityRecord
|
||||
} = select(external_wp_coreData_namespaceObject.store); // The currently selected entity to display.
|
||||
// Typically template or template part in the site editor.
|
||||
|
||||
return {
|
||||
post: postId && postType ? getEntityRecord('postType', postType, postId) : null
|
||||
};
|
||||
}, [postType, postId]);
|
||||
record
|
||||
} = (0,external_wp_coreData_namespaceObject.useEntityRecord)('postType', postType, postId);
|
||||
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
title: post ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post === null || post === void 0 ? void 0 : (_post$title = post.title) === null || _post$title === void 0 ? void 0 : _post$title.rendered) : null,
|
||||
title: record ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(record === null || record === void 0 ? void 0 : (_record$title = record.title) === null || _record$title === void 0 ? void 0 : _record$title.rendered) : null,
|
||||
actions: (0,external_wp_element_namespaceObject.createElement)(SidebarButton, {
|
||||
onClick: () => setCanvasMode('edit'),
|
||||
label: (0,external_wp_i18n_namespaceObject.__)('Edit'),
|
||||
icon: library_pencil
|
||||
}),
|
||||
content: post ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(post === null || post === void 0 ? void 0 : (_post$description = post.description) === null || _post$description === void 0 ? void 0 : _post$description.rendered) : null
|
||||
description: postType === 'page' ? (0,external_wp_i18n_namespaceObject.__)('Pages are static and are not listed by date. Pages do not use tags or categories.') : (0,external_wp_i18n_namespaceObject.__)('Posts are entries listed in reverse chronological order on the site homepage or on the posts page.'),
|
||||
content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, record !== null && record !== void 0 && record.link ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ExternalLink, {
|
||||
className: "edit-site-sidebar-navigation-screen__page-link",
|
||||
href: record.link
|
||||
}, record.link) : null, record ? (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(record === null || record === void 0 ? void 0 : (_record$description = record.description) === null || _record$description === void 0 ? void 0 : _record$description.rendered) : null)
|
||||
});
|
||||
}
|
||||
|
||||
@ -8223,9 +8220,7 @@ function Sidebar() {
|
||||
initialPath: initialPath.current
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarScreens, null)), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar__footer"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SaveButton, {
|
||||
showTooltip: false
|
||||
})));
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SaveButton, null)));
|
||||
}
|
||||
|
||||
/* harmony default export */ var sidebar = ((0,external_wp_element_namespaceObject.memo)(Sidebar));
|
||||
@ -13888,7 +13883,8 @@ function EditorCanvas(_ref) {
|
||||
}), (0,external_wp_element_namespaceObject.createElement)("style", null, // Forming a "block formatting context" to prevent margin collapsing.
|
||||
// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context
|
||||
`.is-root-container { display: flow-root; }
|
||||
body { position: relative; }`), enableResizing && (0,external_wp_element_namespaceObject.createElement)("style", null, // Some themes will have `min-height: 100vh` for the root container,
|
||||
body { position: relative;
|
||||
${canvasMode === 'view' ? 'cursor: pointer;' : ''}}}`), enableResizing && (0,external_wp_element_namespaceObject.createElement)("style", null, // Some themes will have `min-height: 100vh` for the root container,
|
||||
// which isn't a requirement in auto resize mode.
|
||||
`.is-root-container { min-height: 0 !important; }`)),
|
||||
ref: mouseMoveTypingRef,
|
||||
@ -15503,9 +15499,10 @@ function List() {
|
||||
|
||||
const {
|
||||
params: {
|
||||
postType: templateType
|
||||
path
|
||||
}
|
||||
} = useLocation();
|
||||
const templateType = path === '/wp_template/all' ? 'wp_template' : 'wp_template_part';
|
||||
useRegisterShortcuts();
|
||||
const {
|
||||
previousShortcut,
|
||||
@ -16392,6 +16389,76 @@ function MoreMenu(_ref) {
|
||||
}));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-button/index.js
|
||||
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
function save_button_SaveButton() {
|
||||
const {
|
||||
isDirty,
|
||||
isSaving,
|
||||
isSaveViewOpen
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
__experimentalGetDirtyEntityRecords,
|
||||
isSavingEntityRecord
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
|
||||
const dirtyEntityRecords = __experimentalGetDirtyEntityRecords();
|
||||
|
||||
const {
|
||||
isSaveViewOpened
|
||||
} = select(store_store);
|
||||
return {
|
||||
isDirty: dirtyEntityRecords.length > 0,
|
||||
isSaving: dirtyEntityRecords.some(record => isSavingEntityRecord(record.kind, record.name, record.key)),
|
||||
isSaveViewOpen: isSaveViewOpened()
|
||||
};
|
||||
}, []);
|
||||
const {
|
||||
setIsSaveViewOpened
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store);
|
||||
const disabled = !isDirty || isSaving;
|
||||
|
||||
const label = (0,external_wp_i18n_namespaceObject.__)('Save');
|
||||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
||||
variant: "primary",
|
||||
className: "edit-site-save-button__button",
|
||||
"aria-disabled": disabled,
|
||||
"aria-expanded": isSaveViewOpen,
|
||||
isBusy: isSaving,
|
||||
onClick: disabled ? undefined : () => setIsSaveViewOpened(true),
|
||||
label: label
|
||||
/*
|
||||
* We want the tooltip to show the keyboard shortcut only when the
|
||||
* button does something, i.e. when it's not disabled.
|
||||
*/
|
||||
,
|
||||
shortcut: disabled ? undefined : external_wp_keycodes_namespaceObject.displayShortcut.primary('s')
|
||||
/*
|
||||
* Displaying the keyboard shortcut conditionally makes the tooltip
|
||||
* itself show conditionally. This would trigger a full-rerendering
|
||||
* of the button that we want to avoid. By setting `showTooltip`,
|
||||
& the tooltip is always rendered even when there's no keyboard shortcut.
|
||||
*/
|
||||
,
|
||||
showTooltip: true
|
||||
}, label);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/icons/build-module/library/undo.js
|
||||
|
||||
|
||||
@ -16614,9 +16681,6 @@ function TemplateDetails(_ref) {
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(store_store); // TODO: We should update this to filter by template part's areas as well.
|
||||
|
||||
const browseAllLinkProps = useLink({
|
||||
canvas: 'view',
|
||||
postType: template.type,
|
||||
postId: undefined,
|
||||
path: '/' + template.type + '/all'
|
||||
});
|
||||
const isTemplatePart = template.type === 'wp_template_part'; // Only user-created and non-default templates can change the name.
|
||||
@ -17006,7 +17070,7 @@ function HeaderEditMode() {
|
||||
as: "span"
|
||||
},
|
||||
/* translators: accessibility text */
|
||||
(0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')))))), (0,external_wp_element_namespaceObject.createElement)(SaveButton, null), (0,external_wp_element_namespaceObject.createElement)(pinned_items.Slot, {
|
||||
(0,external_wp_i18n_namespaceObject.__)('(opens in a new tab)')))))), (0,external_wp_element_namespaceObject.createElement)(save_button_SaveButton, null), (0,external_wp_element_namespaceObject.createElement)(pinned_items.Slot, {
|
||||
scope: "core/edit-site"
|
||||
}), (0,external_wp_element_namespaceObject.createElement)(MoreMenu, {
|
||||
showIconLabels: showIconLabels
|
||||
@ -17283,25 +17347,41 @@ function useSyncCanvasModeWithURL() {
|
||||
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
|
||||
const currentCanvasMode = (0,external_wp_element_namespaceObject.useRef)(canvasMode);
|
||||
const {
|
||||
canvas: canvasInUrl = 'view'
|
||||
canvas: canvasInUrl
|
||||
} = params;
|
||||
const currentCanvasInUrl = (0,external_wp_element_namespaceObject.useRef)(canvasInUrl);
|
||||
const currentUrlParams = (0,external_wp_element_namespaceObject.useRef)(params);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
currentUrlParams.current = params;
|
||||
}, [params]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
currentCanvasMode.current = canvasMode;
|
||||
|
||||
if (currentCanvasMode !== currentCanvasInUrl) {
|
||||
history.push({ ...params,
|
||||
canvas: canvasMode
|
||||
if (canvasMode === 'init') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (canvasMode === 'edit' && currentCanvasInUrl.current !== canvasMode) {
|
||||
history.push({ ...currentUrlParams.current,
|
||||
canvas: 'edit'
|
||||
});
|
||||
}
|
||||
}, [canvasMode]);
|
||||
|
||||
if (canvasMode === 'view' && currentCanvasInUrl.current !== undefined) {
|
||||
history.push({ ...currentUrlParams.current,
|
||||
canvas: undefined
|
||||
});
|
||||
}
|
||||
}, [canvasMode, history]);
|
||||
(0,external_wp_element_namespaceObject.useEffect)(() => {
|
||||
currentCanvasInUrl.current = canvasInUrl;
|
||||
|
||||
if (canvasInUrl !== currentCanvasMode.current) {
|
||||
setCanvasMode(canvasInUrl);
|
||||
if (canvasInUrl === undefined && currentCanvasMode.current !== 'view') {
|
||||
setCanvasMode('view');
|
||||
} else if (canvasInUrl === 'edit' && currentCanvasMode.current !== 'edit') {
|
||||
setCanvasMode('edit');
|
||||
}
|
||||
}, [canvasInUrl]);
|
||||
}, [canvasInUrl, setCanvasMode]);
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/save-panel/index.js
|
||||
@ -17763,6 +17843,12 @@ function Layout() {
|
||||
paddingBottom: showFrame ? canvasPadding : 0
|
||||
}
|
||||
}, canvasResizer, !!canvasSize.width && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
||||
whileHover: isEditorPage && canvasMode === 'view' ? {
|
||||
scale: 1.01,
|
||||
transition: {
|
||||
duration: disableMotion || isResizing ? 0 : 0.2
|
||||
}
|
||||
} : {},
|
||||
initial: false,
|
||||
layout: "position",
|
||||
className: "edit-site-layout__canvas",
|
||||
@ -18115,6 +18201,9 @@ function initializeEditor(id, settings) {
|
||||
(0,external_wp_widgets_namespaceObject.registerLegacyWidgetBlock)({
|
||||
inserter: false
|
||||
});
|
||||
(0,external_wp_widgets_namespaceObject.registerWidgetGroupBlock)({
|
||||
inserter: false
|
||||
});
|
||||
|
||||
if (false) {} // We dispatch actions and update the store synchronously before rendering
|
||||
// so that we won't trigger unnecessary re-renders with useEffect.
|
||||
|
2
wp-includes/js/dist/edit-site.min.js
vendored
2
wp-includes/js/dist/edit-site.min.js
vendored
File diff suppressed because one or more lines are too long
9
wp-includes/js/dist/widgets.js
vendored
9
wp-includes/js/dist/widgets.js
vendored
@ -1830,9 +1830,12 @@ function registerLegacyWidgetBlock() {
|
||||
}
|
||||
/**
|
||||
* Registers the Widget Group block.
|
||||
*
|
||||
* @param {Object} supports Block support settings.
|
||||
*/
|
||||
|
||||
function registerWidgetGroupBlock() {
|
||||
let supports = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
const {
|
||||
metadata,
|
||||
settings,
|
||||
@ -1841,7 +1844,11 @@ function registerWidgetGroupBlock() {
|
||||
(0,external_wp_blocks_namespaceObject.registerBlockType)({
|
||||
name,
|
||||
...metadata
|
||||
}, settings);
|
||||
}, { ...settings,
|
||||
supports: { ...settings.supports,
|
||||
...supports
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
2
wp-includes/js/dist/widgets.min.js
vendored
2
wp-includes/js/dist/widgets.min.js
vendored
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.2-beta4-55474';
|
||||
$wp_version = '6.2-beta4-55475';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user