Editor: update npm packages with second round of bug fixes for 6.3 RC1.

Includes miscellaneous bug fixes for 6.3 RC1.

Props ramonopoly, mukesh27.
Fixes #58804.

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


git-svn-id: http://core.svn.wordpress.org/trunk@55767 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
isabel_brison 2023-07-18 07:20:48 +00:00
parent 75f25fd334
commit 780ddef241
37 changed files with 537 additions and 346 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4883,6 +4883,7 @@
),
'html' => false
),
'viewScript' => 'file:./view.min.js',
'editorStyle' => 'wp-block-search-editor',
'style' => 'wp-block-search'
),

View File

@ -9,10 +9,12 @@
* Dynamically renders the `core/search` block.
*
* @param array $attributes The block attributes.
* @param string $content The saved content.
* @param WP_Block $block The parsed block.
*
* @return string The search block markup.
*/
function render_block_core_search( $attributes ) {
function render_block_core_search( $attributes, $content, $block ) {
// Older versions of the Search block defaulted the label and buttonText
// attributes to `__( 'Search' )` meaning that many posts contain `<!--
// wp:search /-->`. Support these by defaulting an undefined label and
@ -70,10 +72,26 @@ function render_block_core_search( $attributes ) {
$input->set_attribute( 'id', $input_id );
$input->set_attribute( 'value', get_search_query() );
$input->set_attribute( 'placeholder', $attributes['placeholder'] );
if ( 'button-only' === $button_position && 'expand-searchfield' === $button_behavior ) {
$is_expandable_searchfield = 'button-only' === $button_position && 'expand-searchfield' === $button_behavior;
if ( $is_expandable_searchfield ) {
$input->set_attribute( 'aria-hidden', 'true' );
$input->set_attribute( 'tabindex', '-1' );
wp_enqueue_script( 'wp-block--search-view', plugins_url( 'search/view.min.js', __FILE__ ) );
}
// If the script already exists, there is no point in removing it from viewScript.
$view_js_file = 'wp-block-search-view';
if ( ! wp_script_is( $view_js_file ) ) {
$script_handles = $block->block_type->view_script_handles;
// If the script is not needed, and it is still in the `view_script_handles`, remove it.
if ( ! $is_expandable_searchfield && in_array( $view_js_file, $script_handles, true ) ) {
$block->block_type->view_script_handles = array_diff( $script_handles, array( $view_js_file ) );
}
// If the script is needed, but it was previously removed, add it again.
if ( $is_expandable_searchfield && ! in_array( $view_js_file, $script_handles, true ) ) {
$block->block_type->view_script_handles = array_merge( $script_handles, array( $view_js_file ) );
}
}
}

View File

@ -90,6 +90,7 @@
},
"html": false
},
"viewScript": "file:./view.min.js",
"editorStyle": "wp-block-search-editor",
"style": "wp-block-search"
}

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '3eb70ca99788ad066a38');

View File

@ -0,0 +1,69 @@
/******/ (function() { // webpackBootstrap
var __webpack_exports__ = {};
window.addEventListener('DOMContentLoaded', () => {
const hiddenClass = 'wp-block-search__searchfield-hidden';
Array.from(document.getElementsByClassName('wp-block-search__button-behavior-expand')).forEach(block => {
const searchField = block.querySelector('.wp-block-search__input');
const searchButton = block.querySelector('.wp-block-search__button');
const searchLabel = block.querySelector('.wp-block-search__label');
const ariaLabel = searchButton.getAttribute('aria-label');
const id = searchField.getAttribute('id');
const toggleSearchField = showSearchField => {
if (showSearchField) {
searchField.removeAttribute('aria-hidden');
searchField.removeAttribute('tabindex');
searchButton.removeAttribute('aria-expanded');
searchButton.removeAttribute('aria-controls');
searchButton.setAttribute('type', 'submit');
searchButton.setAttribute('aria-label', 'Submit Search');
return block.classList.remove(hiddenClass);
}
searchButton.removeAttribute('type');
searchField.setAttribute('aria-hidden', 'true');
searchField.setAttribute('tabindex', '-1');
searchButton.setAttribute('aria-expanded', 'false');
searchButton.setAttribute('aria-controls', id);
searchButton.setAttribute('aria-label', ariaLabel);
return block.classList.add(hiddenClass);
};
const hideSearchField = e => {
if (!e.target.closest('.wp-block-search')) {
return toggleSearchField(false);
}
if (e.key === 'Escape') {
searchButton.focus();
return toggleSearchField(false);
}
};
const handleButtonClick = e => {
if (block.classList.contains(hiddenClass)) {
e.preventDefault();
searchField.focus();
toggleSearchField(true);
}
};
searchButton.removeAttribute('type');
searchField.addEventListener('keydown', e => {
hideSearchField(e);
});
searchButton.addEventListener('click', handleButtonClick);
searchButton.addEventListener('keydown', e => {
hideSearchField(e);
});
if (searchLabel) {
searchLabel.addEventListener('click', handleButtonClick);
}
document.body.addEventListener('click', hideSearchField);
});
});
/******/ })()
;

View File

@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => 'c6277d25063d1381b56e');

1
wp-includes/blocks/search/view.min.js vendored Normal file
View File

@ -0,0 +1 @@
window.addEventListener("DOMContentLoaded",(()=>{const e="wp-block-search__searchfield-hidden";Array.from(document.getElementsByClassName("wp-block-search__button-behavior-expand")).forEach((t=>{const r=t.querySelector(".wp-block-search__input"),a=t.querySelector(".wp-block-search__button"),i=t.querySelector(".wp-block-search__label"),s=a.getAttribute("aria-label"),o=r.getAttribute("id"),c=i=>i?(r.removeAttribute("aria-hidden"),r.removeAttribute("tabindex"),a.removeAttribute("aria-expanded"),a.removeAttribute("aria-controls"),a.setAttribute("type","submit"),a.setAttribute("aria-label","Submit Search"),t.classList.remove(e)):(a.removeAttribute("type"),r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex","-1"),a.setAttribute("aria-expanded","false"),a.setAttribute("aria-controls",o),a.setAttribute("aria-label",s),t.classList.add(e)),d=e=>e.target.closest(".wp-block-search")?"Escape"===e.key?(a.focus(),c(!1)):void 0:c(!1),n=a=>{t.classList.contains(e)&&(a.preventDefault(),r.focus(),c(!0))};a.removeAttribute("type"),r.addEventListener("keydown",(e=>{d(e)})),a.addEventListener("click",n),a.addEventListener("keydown",(e=>{d(e)})),i&&i.addEventListener("click",n),document.body.addEventListener("click",d)}))}));

View File

@ -18,12 +18,11 @@ function render_block_core_template_part( $attributes ) {
$template_part_id = null;
$content = null;
$area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
$stylesheet = get_stylesheet();
if (
isset( $attributes['slug'] ) &&
isset( $attributes['theme'] ) &&
$stylesheet === $attributes['theme']
get_stylesheet() === $attributes['theme']
) {
$template_part_id = $attributes['theme'] . '//' . $attributes['slug'];
$template_part_query = new WP_Query(
@ -64,22 +63,17 @@ function render_block_core_template_part( $attributes ) {
*/
do_action( 'render_block_core_template_part_post', $template_part_id, $attributes, $template_part_post, $content );
} else {
$template_part_file_path = '';
// Else, if the template part was provided by the active theme,
// render the corresponding file content.
if ( 0 === validate_file( $attributes['slug'] ) ) {
$themes = array( $stylesheet );
$template = get_template();
if ( $stylesheet !== $template ) {
$themes[] = $template;
}
foreach ( $themes as $theme ) {
$theme_folders = get_block_theme_folders( $theme );
$template_part_file_path = get_theme_file_path( '/' . $theme_folders['wp_template_part'] . '/' . $attributes['slug'] . '.html' );
if ( file_exists( $template_part_file_path ) ) {
$block_template_file = _get_block_template_file( 'wp_template_part', $attributes['slug'] );
if ( $block_template_file ) {
$template_part_file_path = $block_template_file['path'];
$content = (string) file_get_contents( $template_part_file_path );
$content = '' !== $content ? _inject_theme_attribute_in_block_template_content( $content ) : '';
break;
if ( isset( $block_template_file['area'] ) ) {
$area = $block_template_file['area'];
}
}
}

View File

@ -3078,17 +3078,17 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
}
.edit-site-sidebar-navigation-screen-patterns__group{
margin-bottom:32px;
margin-bottom:24px;
}
.edit-site-sidebar-navigation-screen-patterns__group:first-of-type,.edit-site-sidebar-navigation-screen-patterns__group:last-of-type{
.edit-site-sidebar-navigation-screen-patterns__group:last-of-type{
border-bottom:0;
margin-bottom:0;
padding-bottom:0;
}
.edit-site-sidebar-navigation-screen-patterns__group:first-of-type{
margin-bottom:32px;
}
.edit-site-sidebar-navigation-screen-patterns__group-header{
margin-top:16px;
}
.edit-site-sidebar-navigation-screen-patterns__group-header p{
color:#949494;
}

File diff suppressed because one or more lines are too long

View File

@ -3078,17 +3078,17 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
}
.edit-site-sidebar-navigation-screen-patterns__group{
margin-bottom:32px;
margin-bottom:24px;
}
.edit-site-sidebar-navigation-screen-patterns__group:first-of-type,.edit-site-sidebar-navigation-screen-patterns__group:last-of-type{
.edit-site-sidebar-navigation-screen-patterns__group:last-of-type{
border-bottom:0;
margin-bottom:0;
padding-bottom:0;
}
.edit-site-sidebar-navigation-screen-patterns__group:first-of-type{
margin-bottom:32px;
}
.edit-site-sidebar-navigation-screen-patterns__group-header{
margin-top:16px;
}
.edit-site-sidebar-navigation-screen-patterns__group-header p{
color:#949494;
}

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@
--wp-block-synced-color:#7a00df;
--wp-block-synced-color--rgb:122, 0, 223;
}
@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){
@media (min-resolution:192dpi){
:root{
--wp-admin-border-width-focus:1.5px;
}

View File

@ -1 +1 @@
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.nux-dot-tip:after,.nux-dot-tip:before{border-radius:100%;content:" ";pointer-events:none;position:absolute}.nux-dot-tip:before{animation:nux-pulse 1.6s cubic-bezier(.17,.67,.92,.62) infinite;background:rgba(0,115,156,.9);height:24px;opacity:.9;right:-12px;top:-12px;transform:scale(.3333333333);width:24px}.nux-dot-tip:after{background:#00739c;height:8px;right:-4px;top:-4px;width:8px}@keyframes nux-pulse{to{background:rgba(0,115,156,0);transform:scale(1)}}.nux-dot-tip .components-popover__content{padding:20px 18px;width:350px}@media (min-width:600px){.nux-dot-tip .components-popover__content{width:450px}}.nux-dot-tip .components-popover__content .nux-dot-tip__disable{left:0;position:absolute;top:0}.nux-dot-tip[data-y-axis=top]{margin-top:-4px}.nux-dot-tip[data-y-axis=bottom]{margin-top:4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left]{margin-right:-4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right]{margin-right:4px}.nux-dot-tip[data-y-axis=top] .components-popover__content{margin-bottom:20px}.nux-dot-tip[data-y-axis=bottom] .components-popover__content{margin-top:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left] .components-popover__content{margin-left:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right] .components-popover__content{margin-right:20px}.nux-dot-tip[data-y-axis=center],.nux-dot-tip[data-y-axis=left],.nux-dot-tip[data-y-axis=right]{z-index:1000001}@media (max-width:600px){.nux-dot-tip[data-y-axis=center] .components-popover__content,.nux-dot-tip[data-y-axis=left] .components-popover__content,.nux-dot-tip[data-y-axis=right] .components-popover__content{align-self:end;left:5px;margin:20px 0 0;max-width:none!important;position:fixed;right:5px;width:auto}}.nux-dot-tip.components-popover:not([data-y-axis=middle])[data-y-axis=right] .components-popover__content{margin-left:0}.nux-dot-tip.components-popover:not([data-y-axis=middle])[data-y-axis=left] .components-popover__content{margin-right:0}.nux-dot-tip.components-popover.interface-more-menu-dropdown__content:not([data-y-axis=middle])[data-y-axis=right] .components-popover__content{margin-left:-12px}.nux-dot-tip.components-popover.interface-more-menu-dropdown__content:not([data-y-axis=middle])[data-y-axis=left] .components-popover__content{margin-right:-12px}
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.nux-dot-tip:after,.nux-dot-tip:before{border-radius:100%;content:" ";pointer-events:none;position:absolute}.nux-dot-tip:before{animation:nux-pulse 1.6s cubic-bezier(.17,.67,.92,.62) infinite;background:rgba(0,115,156,.9);height:24px;opacity:.9;right:-12px;top:-12px;transform:scale(.3333333333);width:24px}.nux-dot-tip:after{background:#00739c;height:8px;right:-4px;top:-4px;width:8px}@keyframes nux-pulse{to{background:rgba(0,115,156,0);transform:scale(1)}}.nux-dot-tip .components-popover__content{padding:20px 18px;width:350px}@media (min-width:600px){.nux-dot-tip .components-popover__content{width:450px}}.nux-dot-tip .components-popover__content .nux-dot-tip__disable{left:0;position:absolute;top:0}.nux-dot-tip[data-y-axis=top]{margin-top:-4px}.nux-dot-tip[data-y-axis=bottom]{margin-top:4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left]{margin-right:-4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right]{margin-right:4px}.nux-dot-tip[data-y-axis=top] .components-popover__content{margin-bottom:20px}.nux-dot-tip[data-y-axis=bottom] .components-popover__content{margin-top:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left] .components-popover__content{margin-left:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right] .components-popover__content{margin-right:20px}.nux-dot-tip[data-y-axis=center],.nux-dot-tip[data-y-axis=left],.nux-dot-tip[data-y-axis=right]{z-index:1000001}@media (max-width:600px){.nux-dot-tip[data-y-axis=center] .components-popover__content,.nux-dot-tip[data-y-axis=left] .components-popover__content,.nux-dot-tip[data-y-axis=right] .components-popover__content{align-self:end;left:5px;margin:20px 0 0;max-width:none!important;position:fixed;right:5px;width:auto}}.nux-dot-tip.components-popover:not([data-y-axis=middle])[data-y-axis=right] .components-popover__content{margin-left:0}.nux-dot-tip.components-popover:not([data-y-axis=middle])[data-y-axis=left] .components-popover__content{margin-right:0}.nux-dot-tip.components-popover.interface-more-menu-dropdown__content:not([data-y-axis=middle])[data-y-axis=right] .components-popover__content{margin-left:-12px}.nux-dot-tip.components-popover.interface-more-menu-dropdown__content:not([data-y-axis=middle])[data-y-axis=left] .components-popover__content{margin-right:-12px}

View File

@ -9,7 +9,7 @@
--wp-block-synced-color:#7a00df;
--wp-block-synced-color--rgb:122, 0, 223;
}
@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){
@media (min-resolution:192dpi){
:root{
--wp-admin-border-width-focus:1.5px;
}

View File

@ -1,4 +1,4 @@
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.nux-dot-tip:after,.nux-dot-tip:before{border-radius:100%;content:" ";pointer-events:none;position:absolute}.nux-dot-tip:before{animation:nux-pulse 1.6s cubic-bezier(.17,.67,.92,.62) infinite;background:rgba(0,115,156,.9);height:24px;left:-12px;opacity:.9;top:-12px;transform:scale(.3333333333);width:24px}.nux-dot-tip:after{background:#00739c;height:8px;left:-4px;top:-4px;width:8px}@keyframes nux-pulse{to{background:rgba(0,115,156,0);transform:scale(1)}}.nux-dot-tip .components-popover__content{padding:20px 18px;width:350px}@media (min-width:600px){.nux-dot-tip .components-popover__content{width:450px}}.nux-dot-tip .components-popover__content .nux-dot-tip__disable{position:absolute;right:0;top:0}.nux-dot-tip[data-y-axis=top]{margin-top:-4px}.nux-dot-tip[data-y-axis=bottom]{margin-top:4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left]{margin-left:-4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right]{margin-left:4px}.nux-dot-tip[data-y-axis=top] .components-popover__content{margin-bottom:20px}.nux-dot-tip[data-y-axis=bottom] .components-popover__content{margin-top:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left] .components-popover__content{margin-right:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right] .components-popover__content{margin-left:20px}.nux-dot-tip[data-y-axis=center],.nux-dot-tip[data-y-axis=left],.nux-dot-tip[data-y-axis=right]{z-index:1000001}@media (max-width:600px){.nux-dot-tip[data-y-axis=center] .components-popover__content,.nux-dot-tip[data-y-axis=left] .components-popover__content,.nux-dot-tip[data-y-axis=right] .components-popover__content{align-self:end;left:5px;margin:20px 0 0;max-width:none!important;position:fixed;right:5px;width:auto}}.nux-dot-tip.components-popover:not([data-y-axis=middle])[data-y-axis=right] .components-popover__content{
:root{--wp-admin-theme-color:#007cba;--wp-admin-theme-color--rgb:0,124,186;--wp-admin-theme-color-darker-10:#006ba1;--wp-admin-theme-color-darker-10--rgb:0,107,161;--wp-admin-theme-color-darker-20:#005a87;--wp-admin-theme-color-darker-20--rgb:0,90,135;--wp-admin-border-width-focus:2px;--wp-block-synced-color:#7a00df;--wp-block-synced-color--rgb:122,0,223}@media (min-resolution:192dpi){:root{--wp-admin-border-width-focus:1.5px}}.nux-dot-tip:after,.nux-dot-tip:before{border-radius:100%;content:" ";pointer-events:none;position:absolute}.nux-dot-tip:before{animation:nux-pulse 1.6s cubic-bezier(.17,.67,.92,.62) infinite;background:rgba(0,115,156,.9);height:24px;left:-12px;opacity:.9;top:-12px;transform:scale(.3333333333);width:24px}.nux-dot-tip:after{background:#00739c;height:8px;left:-4px;top:-4px;width:8px}@keyframes nux-pulse{to{background:rgba(0,115,156,0);transform:scale(1)}}.nux-dot-tip .components-popover__content{padding:20px 18px;width:350px}@media (min-width:600px){.nux-dot-tip .components-popover__content{width:450px}}.nux-dot-tip .components-popover__content .nux-dot-tip__disable{position:absolute;right:0;top:0}.nux-dot-tip[data-y-axis=top]{margin-top:-4px}.nux-dot-tip[data-y-axis=bottom]{margin-top:4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left]{margin-left:-4px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right]{margin-left:4px}.nux-dot-tip[data-y-axis=top] .components-popover__content{margin-bottom:20px}.nux-dot-tip[data-y-axis=bottom] .components-popover__content{margin-top:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=left] .components-popover__content{margin-right:20px}.nux-dot-tip[data-y-axis=middle][data-y-axis=right] .components-popover__content{margin-left:20px}.nux-dot-tip[data-y-axis=center],.nux-dot-tip[data-y-axis=left],.nux-dot-tip[data-y-axis=right]{z-index:1000001}@media (max-width:600px){.nux-dot-tip[data-y-axis=center] .components-popover__content,.nux-dot-tip[data-y-axis=left] .components-popover__content,.nux-dot-tip[data-y-axis=right] .components-popover__content{align-self:end;left:5px;margin:20px 0 0;max-width:none!important;position:fixed;right:5px;width:auto}}.nux-dot-tip.components-popover:not([data-y-axis=middle])[data-y-axis=right] .components-popover__content{
/*!rtl:ignore*/margin-left:0}.nux-dot-tip.components-popover:not([data-y-axis=middle])[data-y-axis=left] .components-popover__content{
/*!rtl:ignore*/margin-right:0}.nux-dot-tip.components-popover.interface-more-menu-dropdown__content:not([data-y-axis=middle])[data-y-axis=right] .components-popover__content{
/*!rtl:ignore*/margin-left:-12px}.nux-dot-tip.components-popover.interface-more-menu-dropdown__content:not([data-y-axis=middle])[data-y-axis=left] .components-popover__content{

View File

@ -3314,7 +3314,6 @@ __webpack_require__.d(__webpack_exports__, {
"ObserveTyping": function() { return /* reexport */ observe_typing; },
"PanelColorSettings": function() { return /* reexport */ panel_color_settings; },
"PlainText": function() { return /* reexport */ plain_text; },
"ReusableBlocksRenameHint": function() { return /* reexport */ ReusableBlocksRenameHint; },
"RichText": function() { return /* reexport */ rich_text; },
"RichTextShortcut": function() { return /* reexport */ RichTextShortcut; },
"RichTextToolbarButton": function() { return /* reexport */ RichTextToolbarButton; },
@ -3429,13 +3428,13 @@ var private_selectors_namespaceObject = {};
__webpack_require__.r(private_selectors_namespaceObject);
__webpack_require__.d(private_selectors_namespaceObject, {
"getBlockEditingMode": function() { return getBlockEditingMode; },
"getBlockRemovalRules": function() { return getBlockRemovalRules; },
"getEnabledBlockParents": function() { return getEnabledBlockParents; },
"getEnabledClientIdsTree": function() { return getEnabledClientIdsTree; },
"getLastInsertedBlocksClientIds": function() { return getLastInsertedBlocksClientIds; },
"getRemovalPromptData": function() { return getRemovalPromptData; },
"isBlockInterfaceHidden": function() { return private_selectors_isBlockInterfaceHidden; },
"isBlockSubtreeDisabled": function() { return isBlockSubtreeDisabled; },
"isRemovalPromptSupported": function() { return private_selectors_isRemovalPromptSupported; }
"isBlockSubtreeDisabled": function() { return isBlockSubtreeDisabled; }
});
// NAMESPACE OBJECT: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js
@ -3558,14 +3557,13 @@ var private_actions_namespaceObject = {};
__webpack_require__.r(private_actions_namespaceObject);
__webpack_require__.d(private_actions_namespaceObject, {
"__experimentalUpdateSettings": function() { return __experimentalUpdateSettings; },
"clearRemovalPrompt": function() { return clearRemovalPrompt; },
"displayRemovalPrompt": function() { return displayRemovalPrompt; },
"clearBlockRemovalPrompt": function() { return clearBlockRemovalPrompt; },
"ensureDefaultBlock": function() { return ensureDefaultBlock; },
"hideBlockInterface": function() { return hideBlockInterface; },
"privateRemoveBlocks": function() { return privateRemoveBlocks; },
"setBlockEditingMode": function() { return setBlockEditingMode; },
"setBlockRemovalRules": function() { return setBlockRemovalRules; },
"showBlockInterface": function() { return showBlockInterface; },
"toggleRemovalPromptSupport": function() { return toggleRemovalPromptSupport; },
"unsetBlockEditingMode": function() { return unsetBlockEditingMode; }
});
@ -5412,7 +5410,7 @@ function isSelectionEnabled(state = true, action) {
function removalPromptData(state = false, action) {
switch (action.type) {
case 'DISPLAY_REMOVAL_PROMPT':
case 'DISPLAY_BLOCK_REMOVAL_PROMPT':
const {
clientIds,
selectPrevious,
@ -5424,26 +5422,34 @@ function removalPromptData(state = false, action) {
blockNamesForPrompt
};
case 'CLEAR_REMOVAL_PROMPT':
case 'CLEAR_BLOCK_REMOVAL_PROMPT':
return false;
}
return state;
}
/**
* Reducer prompt availability state.
* Reducer returning any rules that a block editor may provide in order to
* prevent a user from accidentally removing certain blocks. These rules are
* then used to display a confirmation prompt to the user. For instance, in the
* Site Editor, the Query Loop block is important enough to warrant such
* confirmation.
*
* The data is a record whose keys are block types (e.g. 'core/query') and
* whose values are the explanation to be shown to users (e.g. 'Query Loop
* displays a list of posts or pages.').
*
* @param {boolean} state Current state.
* @param {Object} action Dispatched action.
*
* @return {boolean} Updated state.
* @return {Record<string,string>} Updated state.
*/
function isRemovalPromptSupported(state = false, action) {
function blockRemovalRules(state = false, action) {
switch (action.type) {
case 'TOGGLE_REMOVAL_PROMPT_SUPPORT':
return action.status;
case 'SET_BLOCK_REMOVAL_RULES':
return action.rules;
}
return state;
@ -5863,7 +5869,7 @@ const combinedReducers = (0,external_wp_data_namespaceObject.combineReducers)({
blockVisibility,
blockEditingModes,
removalPromptData,
isRemovalPromptSupported
blockRemovalRules
});
function withAutomaticChangeReset(reducer) {
@ -6480,8 +6486,8 @@ function getRemovalPromptData(state) {
* @return {boolean} Whether removal prompt exists.
*/
function private_selectors_isRemovalPromptSupported(state) {
return state.isRemovalPromptSupported;
function getBlockRemovalRules(state) {
return state.blockRemovalRules;
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/selectors.js
@ -9042,108 +9048,11 @@ function __unstableIsWithinBlockOverlay(state, clientId) {
return false;
}
;// CONCATENATED MODULE: external ["wp","privateApis"]
var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/lock-unlock.js
/**
* WordPress dependencies
*/
const {
lock,
unlock
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/block-editor');
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-removal-warning-modal/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
// In certain editing contexts, we'd like to prevent accidental removal of
// important blocks. For example, in the site editor, the Query Loop block is
// deemed important. In such cases, we'll ask the user for confirmation that
// they intended to remove such block(s).
//
// @see https://github.com/WordPress/gutenberg/pull/51145
const blockTypePromptMessages = {
'core/query': (0,external_wp_i18n_namespaceObject.__)('Query Loop displays a list of posts or pages.'),
'core/post-content': (0,external_wp_i18n_namespaceObject.__)('Post Content displays the content of a post or page.')
};
function BlockRemovalWarningModal() {
const {
clientIds,
selectPrevious,
blockNamesForPrompt
} = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getRemovalPromptData());
const {
clearRemovalPrompt,
toggleRemovalPromptSupport,
privateRemoveBlocks
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); // Signalling the removal prompt is in place.
(0,external_wp_element_namespaceObject.useEffect)(() => {
toggleRemovalPromptSupport(true);
return () => {
toggleRemovalPromptSupport(false);
};
}, [toggleRemovalPromptSupport]);
if (!blockNamesForPrompt) {
return;
}
const onConfirmRemoval = () => {
privateRemoveBlocks(clientIds, selectPrevious,
/* force */
true);
clearRemovalPrompt();
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Are you sure?'),
onRequestClose: clearRemovalPrompt,
style: {
maxWidth: '40rem'
}
}, blockNamesForPrompt.length === 1 ? (0,external_wp_element_namespaceObject.createElement)("p", null, blockTypePromptMessages[blockNamesForPrompt[0]]) : (0,external_wp_element_namespaceObject.createElement)("ul", {
style: {
listStyleType: 'disc',
paddingLeft: '1rem'
}
}, blockNamesForPrompt.map(name => (0,external_wp_element_namespaceObject.createElement)("li", {
key: name
}, blockTypePromptMessages[name]))), (0,external_wp_element_namespaceObject.createElement)("p", null, blockNamesForPrompt.length > 1 ? (0,external_wp_i18n_namespaceObject.__)('Removing these blocks is not advised.') : (0,external_wp_i18n_namespaceObject.__)('Removing this block is not advised.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "right"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: clearRemovalPrompt
}, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
onClick: onConfirmRemoval
}, (0,external_wp_i18n_namespaceObject.__)('Delete'))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/private-actions.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const castArray = maybeArray => Array.isArray(maybeArray) ? maybeArray : [maybeArray];
/**
@ -9284,26 +9193,18 @@ const privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemove = fal
// confirmation that they intended to remove such block(s). However,
// the editor instance is responsible for presenting those confirmation
// prompts to the user. Any instance opting into removal prompts must
// register using `toggleRemovalPromptSupport()`.
// register using `setBlockRemovalRules()`.
//
// @see https://github.com/WordPress/gutenberg/pull/51145
if (!forceRemove && // FIXME: Without this existence check, the unit tests for
// `__experimentalDeleteReusableBlock` in
// `packages/reusable-blocks/src/store/test/actions.js` fail due to
// the fact that the `registry` object passed to the thunk actions
// doesn't include this private action. This needs to be
// investigated to understand whether it's a real smell or if it's
// because not all store code has been updated to accommodate
// private selectors.
select.isRemovalPromptSupported && select.isRemovalPromptSupported()) {
const rules = !forceRemove && select.getBlockRemovalRules();
if (rules) {
const blockNamesForPrompt = new Set(); // Given a list of client IDs of blocks that the user intended to
// remove, perform a tree search (BFS) to find all block names
// corresponding to "important" blocks, i.e. blocks that require a
// removal prompt.
//
// @see blockTypePromptMessages
const queue = [...clientIds];
@ -9311,7 +9212,7 @@ const privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemove = fal
const clientId = queue.shift();
const blockName = select.getBlockName(clientId);
if (blockTypePromptMessages[blockName]) {
if (rules[blockName]) {
blockNamesForPrompt.add(blockName);
}
@ -9322,7 +9223,7 @@ const privateRemoveBlocks = (clientIds, selectPrevious = true, forceRemove = fal
if (blockNamesForPrompt.size) {
dispatch(displayRemovalPrompt(clientIds, selectPrevious, Array.from(blockNamesForPrompt)));
dispatch(displayBlockRemovalPrompt(clientIds, selectPrevious, Array.from(blockNamesForPrompt)));
return;
}
}
@ -9375,7 +9276,7 @@ const ensureDefaultBlock = () => ({
* Returns an action object used in signalling that a block removal prompt must
* be displayed.
*
* Contrast with `toggleRemovalPromptSupport`.
* Contrast with `setBlockRemovalRules`.
*
* @param {string|string[]} clientIds Client IDs of blocks to remove.
* @param {boolean} selectPrevious True if the previous block
@ -9383,13 +9284,16 @@ const ensureDefaultBlock = () => ({
* (if no previous block exists)
* should be selected
* when a block is removed.
* @param {string[]} blockNamesForPrompt Names of blocks requiring user
* @param {string[]} blockNamesForPrompt Names of the blocks that
* triggered the need for
* confirmation before removal.
*
* @return {Object} Action object.
*/
function displayRemovalPrompt(clientIds, selectPrevious, blockNamesForPrompt) {
function displayBlockRemovalPrompt(clientIds, selectPrevious, blockNamesForPrompt) {
return {
type: 'DISPLAY_REMOVAL_PROMPT',
type: 'DISPLAY_BLOCK_REMOVAL_PROMPT',
clientIds,
selectPrevious,
blockNamesForPrompt
@ -9403,25 +9307,38 @@ function displayRemovalPrompt(clientIds, selectPrevious, blockNamesForPrompt) {
* @return {Object} Action object.
*/
function clearRemovalPrompt() {
function clearBlockRemovalPrompt() {
return {
type: 'CLEAR_REMOVAL_PROMPT'
type: 'CLEAR_BLOCK_REMOVAL_PROMPT'
};
}
/**
* Returns an action object used in signalling that a removal prompt display
* mechanism is available or unavailable in the current editor.
* Returns an action object used to set up any rules that a block editor may
* provide in order to prevent a user from accidentally removing certain
* blocks. These rules are then used to display a confirmation prompt to the
* user. For instance, in the Site Editor, the Query Loop block is important
* enough to warrant such confirmation.
*
* Contrast with `displayRemovalPrompt`.
* IMPORTANT: Registering rules implicitly signals to the `privateRemoveBlocks`
* action that the editor will be responsible for displaying block removal
* prompts and confirming deletions. This action is meant to be used by
* component `BlockRemovalWarningModal` only.
*
* @param {boolean} status Whether a prompt display mechanism exists.
* The data is a record whose keys are block types (e.g. 'core/query') and
* whose values are the explanation to be shown to users (e.g. 'Query Loop
* displays a list of posts or pages.').
*
* Contrast with `displayBlockRemovalPrompt`.
*
* @param {Record<string,string>|false} rules Block removal rules.
* @return {Object} Action object.
*/
function toggleRemovalPromptSupport(status = true) {
function setBlockRemovalRules(rules = false) {
return {
type: 'TOGGLE_REMOVAL_PROMPT_SUPPORT',
status
type: 'SET_BLOCK_REMOVAL_RULES',
rules
};
}
@ -10925,6 +10842,18 @@ function __unstableSetTemporarilyEditingAsBlocks(temporarilyEditingAsBlocks) {
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/constants.js
const STORE_NAME = 'core/block-editor';
;// CONCATENATED MODULE: external ["wp","privateApis"]
var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/lock-unlock.js
/**
* WordPress dependencies
*/
const {
lock,
unlock
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/block-editor');
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/store/index.js
/**
* WordPress dependencies
@ -10967,7 +10896,16 @@ const registeredStore = (0,external_wp_data_namespaceObject.registerStore)(STORE
persist: ['preferences']
});
unlock(registeredStore).registerPrivateActions(private_actions_namespaceObject);
unlock(registeredStore).registerPrivateSelectors(private_selectors_namespaceObject);
unlock(registeredStore).registerPrivateSelectors(private_selectors_namespaceObject); // TODO: Remove once we switch to the `register` function (see above).
//
// Until then, private functions also need to be attached to the original
// `store` descriptor in order to avoid unit tests failing, which could happen
// when tests create new registries in which they register stores.
//
// @see https://github.com/WordPress/gutenberg/pull/51145#discussion_r1239999590
unlock(store).registerPrivateActions(private_actions_namespaceObject);
unlock(store).registerPrivateSelectors(private_selectors_namespaceObject);
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-edit/context.js
/**
@ -11807,7 +11745,7 @@ function getCustomValueFromPreset(value, spacingSizes) {
function getPresetValueFromCustomValue(value, spacingSizes) {
// Return value as-is if it is already a preset;
if (isValueSpacingPreset(value)) {
if (isValueSpacingPreset(value) || value === '0') {
return value;
}
@ -25049,6 +24987,11 @@ function useCompatibilityStyles() {
if (ownerNode.id === 'wp-reset-editor-styles-css') {
return accumulator;
} // Don't try to add styles without ID. Styles enqueued via the WP dependency system will always have IDs.
if (!ownerNode.id) {
return accumulator;
}
function matchFromRules(_cssRules) {
@ -25187,10 +25130,20 @@ function Iframe({
forwardedRef: ref,
...props
}) {
const {
resolvedAssets,
isPreviewMode
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const settings = select(store).getSettings();
return {
resolvedAssets: settings.__unstableResolvedAssets,
isPreviewMode: settings.__unstableIsPreviewMode
};
}, []);
const {
styles = '',
scripts = ''
} = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getSettings().__unstableResolvedAssets, []);
} = resolvedAssets;
const [iframeDocument, setIframeDocument] = (0,external_wp_element_namespaceObject.useState)();
const [bodyClasses, setBodyClasses] = (0,external_wp_element_namespaceObject.useState)([]);
const compatStyles = useCompatibilityStyles();
@ -25232,10 +25185,13 @@ function Iframe({
continue;
}
contentDocument.head.appendChild(compatStyle.cloneNode(true)); // eslint-disable-next-line no-console
contentDocument.head.appendChild(compatStyle.cloneNode(true));
if (!isPreviewMode) {
// eslint-disable-next-line no-console
console.warn(`${compatStyle.id} was added to the iframe incorrectly. Please use block.json or enqueue_block_assets to add styles to the iframe.`, compatStyle);
}
}
iFrameDocument.addEventListener('dragover', preventFileDropDefault, false);
iFrameDocument.addEventListener('drop', preventFileDropDefault, false);
@ -28767,12 +28723,31 @@ var external_wp_preferences_namespaceObject = window["wp"]["preferences"];
const PREFERENCE_NAME = 'isResuableBlocksrRenameHintVisible';
function ReusableBlocksRenameHint() {
const isReusableBlocksRenameHint = (0,external_wp_data_namespaceObject.useSelect)(select => {
/*
* This hook was added in 6.3 to help users with the transition from Reusable blocks to Patterns.
* It is only exported for use in the reusable-blocks package as well as block-editor.
* It will be removed in 6.4. and should not be used in any new code.
*/
function useReusableBlocksRenameHint() {
return (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$get;
return (_select$get = select(external_wp_preferences_namespaceObject.store).get('core', PREFERENCE_NAME)) !== null && _select$get !== void 0 ? _select$get : true;
}, []);
}
/*
* This component was added in 6.3 to help users with the transition from Reusable blocks to Patterns.
* It is only exported for use in the reusable-blocks package as well as block-editor.
* It will be removed in 6.4. and should not be used in any new code.
*/
function ReusableBlocksRenameHint() {
const isReusableBlocksRenameHint = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _select$get2;
return (_select$get2 = select(external_wp_preferences_namespaceObject.store).get('core', PREFERENCE_NAME)) !== null && _select$get2 !== void 0 ? _select$get2 : true;
}, []);
const ref = (0,external_wp_element_namespaceObject.useRef)();
const {
set: setPreference
@ -40307,6 +40282,7 @@ function __experimentalUseGradient({
*/
/**
* Internal dependencies
*/
@ -40315,12 +40291,12 @@ function __experimentalUseGradient({
const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
const TAB_COLOR = {
name: 'color',
title: 'Solid',
title: (0,external_wp_i18n_namespaceObject.__)('Solid'),
value: 'color'
};
const TAB_GRADIENT = {
name: 'gradient',
title: 'Gradient',
title: (0,external_wp_i18n_namespaceObject.__)('Gradient'),
value: 'gradient'
};
const TABS_SETTINGS = [TAB_COLOR, TAB_GRADIENT];
@ -43406,9 +43382,13 @@ function AxialInputControls({
const createHandleOnChange = side => next => {
if (!onChange) {
return;
}
} // Encode the existing value into the preset value if the passed in value matches the value of one of the spacingSizes.
const nextValues = { ...values
const nextValues = { ...Object.keys(values).reduce((acc, key) => {
acc[key] = getPresetValueFromCustomValue(values[key], spacingSizes);
return acc;
}, {})
};
if (side === 'vertical') {
@ -43467,7 +43447,11 @@ function SeparatedInputControls({
const filteredSides = sides?.length ? ALL_SIDES.filter(side => sides.includes(side)) : ALL_SIDES;
const createHandleOnChange = side => next => {
const nextValues = { ...values
// Encode the existing value into the preset value if the passed in value matches the value of one of the spacingSizes.
const nextValues = { ...Object.keys(values).reduce((acc, key) => {
acc[key] = getPresetValueFromCustomValue(values[key], spacingSizes);
return acc;
}, {})
};
nextValues[side] = next;
onChange(nextValues);
@ -43511,7 +43495,11 @@ function SingleInputControl({
values
}) {
const createHandleOnChange = currentSide => next => {
const nextValues = { ...values
// Encode the existing value into the preset value if the passed in value matches the value of one of the spacingSizes.
const nextValues = { ...Object.keys(values).reduce((acc, key) => {
acc[key] = getPresetValueFromCustomValue(values[key], spacingSizes);
return acc;
}, {})
};
nextValues[currentSide] = next;
onChange(nextValues);
@ -43620,7 +43608,7 @@ function useSpacingSizes() {
const spacingSizes = [{
name: 0,
slug: '0',
side: 0
size: 0
}, ...(use_setting_useSetting('spacing.spacingSizes') || [])];
if (spacingSizes.length > 8) {
@ -44131,18 +44119,29 @@ function DimensionsPanel({
}) {
var _settings$parentLayou2, _defaultControls$cont, _defaultControls$wide, _defaultControls$padd, _defaultControls$marg, _defaultControls$bloc, _defaultControls$minH, _defaultControls$chil;
const {
dimensions,
spacing
} = settings;
const decodeValue = rawValue => {
if (rawValue && typeof rawValue === 'object') {
return Object.keys(rawValue).reduce((acc, key) => {
acc[key] = getValueFromVariable({
settings
settings: {
dimensions,
spacing
}
}, '', rawValue[key]);
return acc;
}, {});
}
return getValueFromVariable({
settings
settings: {
dimensions,
spacing
}
}, '', rawValue);
};
@ -61591,11 +61590,6 @@ function PublishDateTimePicker({
/*
* The following rename hint component can be removed in 6.4.
*/
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/elements/index.js
const ELEMENT_CLASS_NAMES = {
@ -63331,6 +63325,10 @@ function addValuesForElements(children, ...args) {
}
}
function _getSaveElement(name, attributes, innerBlocks) {
return (0,external_wp_blocks_namespaceObject.getSaveElement)(name, attributes, innerBlocks.map(block => _getSaveElement(block.name, block.attributes, block.innerBlocks)));
}
function addValuesForBlocks(values, blocks) {
for (let i = 0; i < blocks.length; i++) {
const {
@ -63338,7 +63336,9 @@ function addValuesForBlocks(values, blocks) {
attributes,
innerBlocks
} = blocks[i];
const saveElement = (0,external_wp_blocks_namespaceObject.getSaveElement)(name, attributes);
const saveElement = _getSaveElement(name, attributes, innerBlocks);
addValuesForElement(saveElement, values, innerBlocks);
}
}
@ -63378,6 +63378,79 @@ function ResizableBoxPopover({
}));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/block-removal-warning-modal/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
function BlockRemovalWarningModal({
rules
}) {
const {
clientIds,
selectPrevious,
blockNamesForPrompt
} = (0,external_wp_data_namespaceObject.useSelect)(select => unlock(select(store)).getRemovalPromptData());
const {
clearBlockRemovalPrompt,
setBlockRemovalRules,
privateRemoveBlocks
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store)); // Load block removal rules, simultaneously signalling that the block
// removal prompt is in place.
(0,external_wp_element_namespaceObject.useEffect)(() => {
setBlockRemovalRules(rules);
return () => {
setBlockRemovalRules();
};
}, [rules, setBlockRemovalRules]);
if (!blockNamesForPrompt) {
return;
}
const onConfirmRemoval = () => {
privateRemoveBlocks(clientIds, selectPrevious,
/* force */
true);
clearBlockRemovalPrompt();
};
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Are you sure?'),
onRequestClose: clearBlockRemovalPrompt,
style: {
maxWidth: '40rem'
}
}, blockNamesForPrompt.length === 1 ? (0,external_wp_element_namespaceObject.createElement)("p", null, rules[blockNamesForPrompt[0]]) : (0,external_wp_element_namespaceObject.createElement)("ul", {
style: {
listStyleType: 'disc',
paddingLeft: '1rem'
}
}, blockNamesForPrompt.map(name => (0,external_wp_element_namespaceObject.createElement)("li", {
key: name
}, rules[name]))), (0,external_wp_element_namespaceObject.createElement)("p", null, blockNamesForPrompt.length > 1 ? (0,external_wp_i18n_namespaceObject.__)('Removing these blocks is not advised.') : (0,external_wp_i18n_namespaceObject.__)('Removing this block is not advised.')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "right"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
onClick: clearBlockRemovalPrompt
}, (0,external_wp_i18n_namespaceObject.__)('Cancel')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
variant: "primary",
onClick: onConfirmRemoval
}, (0,external_wp_i18n_namespaceObject.__)('Delete'))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/components/dimensions-tool/aspect-ratio-tool.js
@ -66257,6 +66330,7 @@ function ResolutionTool({
/**
* Private @wordpress/block-editor APIs.
*/
@ -66278,7 +66352,9 @@ lock(privateApis, { ...global_styles_namespaceObject,
useLayoutClasses: useLayoutClasses,
useLayoutStyles: useLayoutStyles,
DimensionsTool: dimensions_tool,
ResolutionTool: ResolutionTool
ResolutionTool: ResolutionTool,
ReusableBlocksRenameHint: ReusableBlocksRenameHint,
useReusableBlocksRenameHint: useReusableBlocksRenameHint
});
;// CONCATENATED MODULE: ./node_modules/@wordpress/block-editor/build-module/index.js

File diff suppressed because one or more lines are too long

View File

@ -48052,6 +48052,7 @@ const search_metadata = {
},
html: false
},
viewScript: "file:./view.min.js",
editorStyle: "wp-block-search-editor",
style: "wp-block-search"
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3871,7 +3871,7 @@ function ManagePatternsMenuItem() {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
role: "menuitem",
href: url
}, (0,external_wp_i18n_namespaceObject.__)('Manage Patterns'));
}, (0,external_wp_i18n_namespaceObject.__)('Manage patterns'));
}
(0,external_wp_plugins_namespaceObject.registerPlugin)('edit-post', {

File diff suppressed because one or more lines are too long

View File

@ -10041,6 +10041,7 @@ function CreateTemplatePartModal({
/**
* Internal dependencies
*/
@ -10049,6 +10050,7 @@ function CreateTemplatePartModal({
const {
useHistory: add_new_pattern_useHistory
} = unlock(external_wp_router_namespaceObject.privateApis);
@ -10056,6 +10058,10 @@ function AddNewPattern() {
const history = add_new_pattern_useHistory();
const [showPatternModal, setShowPatternModal] = (0,external_wp_element_namespaceObject.useState)(false);
const [showTemplatePartModal, setShowTemplatePartModal] = (0,external_wp_element_namespaceObject.useState)(false);
const isTemplatePartsMode = (0,external_wp_data_namespaceObject.useSelect)(select => {
const settings = select(store_store).getSettings();
return !!settings.supportsTemplatePartsMode;
}, []);
function handleCreatePattern({
pattern,
@ -10087,7 +10093,7 @@ function AddNewPattern() {
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
controls: [{
controls: [!isTemplatePartsMode && {
icon: library_header,
onClick: () => setShowTemplatePartModal(true),
title: (0,external_wp_i18n_namespaceObject.__)('Create template part')
@ -10095,7 +10101,7 @@ function AddNewPattern() {
icon: library_file,
onClick: () => setShowPatternModal(true),
title: (0,external_wp_i18n_namespaceObject.__)('Create pattern')
}],
}].filter(Boolean),
toggleProps: {
as: SidebarButton
},
@ -10210,6 +10216,7 @@ function useThemePatterns() {
* WordPress dependencies
*/
/**
* Internal dependencies
*/
@ -10218,6 +10225,10 @@ function useThemePatterns() {
function usePatternCategories() {
const defaultCategories = useDefaultPatternCategories();
defaultCategories.push({
name: 'uncategorized',
label: (0,external_wp_i18n_namespaceObject.__)('Uncategorized')
});
const themePatterns = useThemePatterns();
const patternCategories = (0,external_wp_element_namespaceObject.useMemo)(() => {
const categoryMap = {};
@ -10236,7 +10247,11 @@ function usePatternCategories() {
if (categoryMap[category]) {
categoryMap[category].count += 1;
}
});
}); // If the pattern has no categories, add it to uncategorized.
if (!pattern.categories?.length) {
categoryMap.uncategorized.count += 1;
}
}); // Filter categories so we only have those containing patterns.
defaultCategories.forEach(category => {
@ -10379,11 +10394,7 @@ function ThemePatternsGroup({
currentCategory,
currentType
}) {
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-patterns__group-header"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHeading, {
level: 2
}, (0,external_wp_i18n_namespaceObject.__)('Theme patterns'))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, {
className: "edit-site-sidebar-navigation-screen-patterns__group"
}, categories.map(category => (0,external_wp_element_namespaceObject.createElement)(CategoryItem, {
key: category.name,
@ -10436,13 +10447,13 @@ function SidebarNavigationScreenPatterns() {
path: '/wp_template_part/all'
});
const footer = !isMobileViewport ? (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalItemGroup, null, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationItem, {
withChevron: true,
...templatePartsLink
}, (0,external_wp_i18n_namespaceObject.__)('Manage all template parts')), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationItem, {
as: "a",
href: "edit.php?post_type=wp_block",
withChevron: true
}, (0,external_wp_i18n_namespaceObject.__)('Manage all of my patterns'))) : undefined;
}, (0,external_wp_i18n_namespaceObject.__)('Manage all of my patterns')), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationItem, {
withChevron: true,
...templatePartsLink
}, (0,external_wp_i18n_namespaceObject.__)('Manage all template parts'))) : undefined;
return (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
isRoot: isTemplatePartsMode,
title: (0,external_wp_i18n_namespaceObject.__)('Patterns'),
@ -10461,14 +10472,14 @@ function SidebarNavigationScreenPatterns() {
id: myPatterns.name,
type: "wp_block",
isActive: currentCategory === `${myPatterns.name}` && currentType === 'wp_block'
})), hasTemplateParts && (0,external_wp_element_namespaceObject.createElement)(TemplatePartGroup, {
areas: templatePartAreas,
currentArea: currentCategory,
currentType: currentType
}), hasPatterns && (0,external_wp_element_namespaceObject.createElement)(ThemePatternsGroup, {
})), hasPatterns && (0,external_wp_element_namespaceObject.createElement)(ThemePatternsGroup, {
categories: patternCategories,
currentCategory: currentCategory,
currentType: currentType
}), hasTemplateParts && (0,external_wp_element_namespaceObject.createElement)(TemplatePartGroup, {
areas: templatePartAreas,
currentArea: currentCategory,
currentType: currentType
})))
});
}
@ -12264,12 +12275,7 @@ function AddNewPageModal({
onSubmit: createPage
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 3
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl
/* eslint-disable jsx-a11y/no-autofocus */
, {
autoFocus: true
/* eslint-enable jsx-a11y/no-autofocus */
,
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Page title'),
onChange: setTitle,
placeholder: (0,external_wp_i18n_namespaceObject.__)('No title'),
@ -12668,7 +12674,7 @@ function PageDetails({
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenDetailsPanelLabel, null, label), (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenDetailsPanelValue, null, value))));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-actions/delete-page-menu-item.js
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-actions/trash-page-menu-item.js
/**
@ -12680,12 +12686,10 @@ function PageDetails({
function DeletePageMenuItem({
function TrashPageMenuItem({
postId,
onRemove
}) {
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const {
createSuccessNotice,
createErrorNotice
@ -12702,29 +12706,23 @@ function DeletePageMenuItem({
});
createSuccessNotice((0,external_wp_i18n_namespaceObject.sprintf)(
/* translators: The page's title. */
(0,external_wp_i18n_namespaceObject.__)('"%s" deleted.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered)), {
(0,external_wp_i18n_namespaceObject.__)('"%s" moved to the Trash.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(page.title.rendered)), {
type: 'snackbar',
id: 'edit-site-page-removed'
id: 'edit-site-page-trashed'
});
onRemove?.();
} catch (error) {
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while deleting the page.');
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : (0,external_wp_i18n_namespaceObject.__)('An error occurred while moving the page to the trash.');
createErrorNotice(errorMessage, {
type: 'snackbar'
});
} finally {
setIsModalOpen(false);
}
}
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => setIsModalOpen(true),
onClick: () => removePage(),
isDestructive: true
}, (0,external_wp_i18n_namespaceObject.__)('Delete')), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalConfirmDialog, {
isOpen: isModalOpen,
onConfirm: removePage,
onCancel: () => setIsModalOpen(false)
}, (0,external_wp_i18n_namespaceObject.__)('Are you sure you want to delete this page?')));
}, (0,external_wp_i18n_namespaceObject.__)('Move to Trash')));
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/page-actions/index.js
@ -12752,7 +12750,7 @@ function PageActions({
label: (0,external_wp_i18n_namespaceObject.__)('Actions'),
className: className,
toggleProps: toggleProps
}, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(DeletePageMenuItem, {
}, () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuGroup, null, (0,external_wp_element_namespaceObject.createElement)(TrashPageMenuItem, {
postId: postId,
onRemove: onRemove
})));
@ -15764,7 +15762,7 @@ function PageStatus({
/* eslint-enable jsx-a11y/no-autofocus */
,
placeholder: (0,external_wp_i18n_namespaceObject.__)('Enter a secure password'),
type: "password"
type: "text"
})))))
}));
}
@ -18721,6 +18719,13 @@ const typeLabels = {
wp_template: (0,external_wp_i18n_namespaceObject.__)('Template Part'),
wp_template_part: (0,external_wp_i18n_namespaceObject.__)('Template Part'),
wp_block: (0,external_wp_i18n_namespaceObject.__)('Pattern')
}; // Prevent accidental removal of certain blocks, asking the user for
// confirmation.
const blockRemovalRules = {
'core/query': (0,external_wp_i18n_namespaceObject.__)('Query Loop displays a list of posts or pages.'),
'core/post-content': (0,external_wp_i18n_namespaceObject.__)('Post Content displays the content of a post or page.'),
'core/post-template': (0,external_wp_i18n_namespaceObject.__)('Post Template displays each post or page in a Query Loop.')
};
function Editor({
isLoading
@ -18831,7 +18836,9 @@ function Editor({
'is-loading': isLoading
}),
notices: (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorSnackbars, null),
content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(GlobalStylesRenderer, null), isEditMode && (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorNotices, null), showVisualEditor && editedPost && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(BlockEditor, null), (0,external_wp_element_namespaceObject.createElement)(BlockRemovalWarningModal, null)), editorMode === 'text' && editedPost && isEditMode && (0,external_wp_element_namespaceObject.createElement)(CodeEditor, null), hasLoadedPost && !editedPost && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
content: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(GlobalStylesRenderer, null), isEditMode && (0,external_wp_element_namespaceObject.createElement)(external_wp_editor_namespaceObject.EditorNotices, null), showVisualEditor && editedPost && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(BlockEditor, null), (0,external_wp_element_namespaceObject.createElement)(BlockRemovalWarningModal, {
rules: blockRemovalRules
})), editorMode === 'text' && editedPost && isEditMode && (0,external_wp_element_namespaceObject.createElement)(CodeEditor, null), hasLoadedPost && !editedPost && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Notice, {
status: "warning",
isDismissible: false
}, (0,external_wp_i18n_namespaceObject.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")), isEditMode && (0,external_wp_element_namespaceObject.createElement)(edit_mode, null)),
@ -22315,7 +22322,7 @@ function GridItem({
justify: "left",
spacing: 3,
className: "edit-site-patterns__pattern-title"
}, itemIcon && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
}, itemIcon && !isNonUserPattern && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
position: "top center",
text: (0,external_wp_i18n_namespaceObject.__)('Editing this pattern will also update anywhere it is used')
}, (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
@ -22814,10 +22821,18 @@ const selectThemePatterns = (select, {
type: 'pattern',
blocks: (0,external_wp_blocks_namespaceObject.parse)(pattern.content)
}));
if (categoryId) {
patterns = searchItems(patterns, search, {
categoryId,
hasCategory: (item, currentCategory) => item.categories?.includes(currentCategory)
});
} else {
patterns = searchItems(patterns, search, {
hasCategory: item => !item.hasOwnProperty('categories')
});
}
return {
patterns,
isResolving: false
@ -22948,7 +22963,7 @@ function PatternsList({
const {
patterns,
isResolving
} = use_patterns(type, categoryId, {
} = use_patterns(type, categoryId !== 'uncategorized' ? categoryId : '', {
search: deferredFilterValue,
syncStatus: deferredSyncedFilter === 'all' ? undefined : deferredSyncedFilter
});
@ -23633,47 +23648,50 @@ function Layout() {
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
initial: false
}, isEditorPage && isEditing && (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
key: "header",
className: "edit-site-layout__header",
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Editor top bar'),
as: external_wp_components_namespaceObject.__unstableMotion.div,
variants: {
isDistractionFree: {
opacity: 0
opacity: 0,
y: 0
},
isDistractionFreeHovering: {
opacity: 1
opacity: 1,
y: 0
},
view: {
opacity: 1
opacity: 1,
y: '-100%'
},
edit: {
opacity: 1
opacity: 1,
y: 0
}
},
exit: {
y: '-100%'
},
initial: {
opacity: isDistractionFree ? 1 : 0,
y: isDistractionFree ? 0 : '-100%'
},
transition: {
type: 'tween',
duration: disableMotion ? 0 : 0.2,
ease: 'easeOut'
}
}, isEditing && (0,external_wp_element_namespaceObject.createElement)(HeaderEditMode, null)))), (0,external_wp_element_namespaceObject.createElement)("div", {
}, (0,external_wp_element_namespaceObject.createElement)(HeaderEditMode, null)))), (0,external_wp_element_namespaceObject.createElement)("div", {
className: "edit-site-layout__content"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableAnimatePresence, {
initial: false
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
initial: {
opacity: 0
},
animate: showSidebar ? {
opacity: 1,
display: 'block'
} : {
opacity: 0,
transitionEnd: {
display: 'none'
}
},
exit: {
opacity: 0
// The sidebar is needed for routing on mobile
// (https://github.com/WordPress/gutenberg/pull/51558/files#r1231763003),
// so we can't remove the element entirely. Using `inert` will make
// it inaccessible to screen readers and keyboard navigation.
inert: showSidebar ? undefined : 'inert',
animate: {
opacity: showSidebar ? 1 : 0
},
transition: {
type: 'tween',
@ -23684,7 +23702,7 @@ function Layout() {
className: "edit-site-layout__sidebar"
}, (0,external_wp_element_namespaceObject.createElement)(NavigableRegion, {
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Navigation')
}, (0,external_wp_element_namespaceObject.createElement)(sidebar, null)))), (0,external_wp_element_namespaceObject.createElement)(SavePanel, null), showCanvas && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isListPage && (0,external_wp_element_namespaceObject.createElement)(PageMain, null), isEditorPage && (0,external_wp_element_namespaceObject.createElement)("div", {
}, (0,external_wp_element_namespaceObject.createElement)(sidebar, null))), (0,external_wp_element_namespaceObject.createElement)(SavePanel, null), showCanvas && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isListPage && (0,external_wp_element_namespaceObject.createElement)(PageMain, null), isEditorPage && (0,external_wp_element_namespaceObject.createElement)("div", {
className: classnames_default()('edit-site-layout__canvas-container', {
'is-resizing': isResizing
})

File diff suppressed because one or more lines are too long

View File

@ -11595,6 +11595,18 @@ function PostSwitchToDraftButton({
};
})])(PostSwitchToDraftButton));
;// CONCATENATED MODULE: external ["wp","privateApis"]
var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/lock-unlock.js
/**
* WordPress dependencies
*/
const {
lock,
unlock
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/editor');
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-sync-status/index.js
@ -11611,6 +11623,7 @@ function PostSwitchToDraftButton({
*/
function PostSyncStatus() {
const {
syncStatus,
@ -11676,6 +11689,9 @@ function PostSyncStatusModal() {
return null;
}
const {
ReusableBlocksRenameHint
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, isModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Set pattern sync status'),
onRequestClose: () => {
@ -11690,7 +11706,7 @@ function PostSyncStatusModal() {
}
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: "5"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ReusableBlocksRenameHint, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
}, (0,external_wp_element_namespaceObject.createElement)(ReusableBlocksRenameHint, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Synced'),
help: (0,external_wp_i18n_namespaceObject.__)('Editing the pattern will update it anywhere it is used.'),
checked: !syncType,
@ -13185,18 +13201,6 @@ function useBlockEditorSettings(settings, hasTemplate) {
/* harmony default export */ var use_block_editor_settings = (useBlockEditorSettings);
;// CONCATENATED MODULE: external ["wp","privateApis"]
var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/lock-unlock.js
/**
* WordPress dependencies
*/
const {
lock,
unlock
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/editor');
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/provider/index.js

File diff suppressed because one or more lines are too long

View File

@ -94,10 +94,7 @@ var external_wp_data_namespaceObject = window["wp"]["data"];
* @return {Array} Updated state.
*/
function guides() {
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
let action = arguments.length > 1 ? arguments[1] : undefined;
function guides(state = [], action) {
switch (action.type) {
case 'TRIGGER_GUIDE':
return [...state, action.tipIds];
@ -114,10 +111,7 @@ function guides() {
* @return {boolean} Updated state.
*/
function areTipsEnabled() {
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
let action = arguments.length > 1 ? arguments[1] : undefined;
function areTipsEnabled(state = true, action) {
switch (action.type) {
case 'DISABLE_TIPS':
return false;
@ -138,10 +132,7 @@ function areTipsEnabled() {
* @return {Object} Updated state.
*/
function dismissedTips() {
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
let action = arguments.length > 1 ? arguments[1] : undefined;
function dismissedTips(state = {}, action) {
switch (action.type) {
case 'DISMISS_TIP':
return { ...state,
@ -566,13 +557,11 @@ const getAssociatedGuide = rememo((state, tipId) => {
*/
function isTipVisible(state, tipId) {
var _state$preferences$di;
if (!state.preferences.areTipsEnabled) {
return false;
}
if ((_state$preferences$di = state.preferences.dismissedTips) !== null && _state$preferences$di !== void 0 && _state$preferences$di.hasOwnProperty(tipId)) {
if (state.preferences.dismissedTips?.hasOwnProperty(tipId)) {
return false;
}
@ -681,15 +670,14 @@ function onClick(event) {
event.stopPropagation();
}
function DotTip(_ref) {
let {
function DotTip({
position = 'middle right',
children,
isVisible,
hasNextTip,
onDismiss,
onDisable
} = _ref;
}) {
const anchorParent = (0,external_wp_element_namespaceObject.useRef)(null);
const onFocusOutsideCallback = (0,external_wp_element_namespaceObject.useCallback)(event => {
if (!anchorParent.current) {
@ -725,10 +713,9 @@ function DotTip(_ref) {
onClick: onDisable
}));
}
/* harmony default export */ var dot_tip = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, _ref2) => {
let {
/* harmony default export */ var dot_tip = ((0,external_wp_compose_namespaceObject.compose)((0,external_wp_data_namespaceObject.withSelect)((select, {
tipId
} = _ref2;
}) => {
const {
isTipVisible,
getAssociatedGuide
@ -738,10 +725,9 @@ function DotTip(_ref) {
isVisible: isTipVisible(tipId),
hasNextTip: !!(associatedGuide && associatedGuide.nextTipId)
};
}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, _ref3) => {
let {
}), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, {
tipId
} = _ref3;
}) => {
const {
dismissTip,
disableTips

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
!function(){"use strict";var e={n:function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,{a:t}),t},d:function(n,t){for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{DotTip:function(){return P},store:function(){return m}});var t={};e.r(t),e.d(t,{disableTips:function(){return d},dismissTip:function(){return l},enableTips:function(){return p},triggerGuide:function(){return c}});var r={};e.r(r),e.d(r,{areTipsEnabled:function(){return T},getAssociatedGuide:function(){return h},isTipVisible:function(){return g}});var i=window.wp.deprecated,s=e.n(i),o=window.wp.data;const u=(0,o.combineReducers)({areTipsEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];switch((arguments.length>1?arguments[1]:void 0).type){case"DISABLE_TIPS":return!1;case"ENABLE_TIPS":return!0}return e},dismissedTips:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"DISMISS_TIP":return{...e,[n.id]:!0};case"ENABLE_TIPS":return{}}return e}});var a=(0,o.combineReducers)({guides:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;return"TRIGGER_GUIDE"===n.type?[...e,n.tipIds]:e},preferences:u});function c(e){return{type:"TRIGGER_GUIDE",tipIds:e}}function l(e){return{type:"DISMISS_TIP",id:e}}function d(){return{type:"DISABLE_TIPS"}}function p(){return{type:"ENABLE_TIPS"}}var f={};function w(e){return[e]}function v(e,n,t){var r;if(e.length!==n.length)return!1;for(r=t;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}const h=function(e,n){var t,r=n||w;function i(){t=new WeakMap}function s(){var n,i,s,o,u,a=arguments.length;for(o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];for(n=function(e){var n,r,i,s,o,u=t,a=!0;for(n=0;n<e.length;n++){if(!(o=r=e[n])||"object"!=typeof o){a=!1;break}u.has(r)?u=u.get(r):(i=new WeakMap,u.set(r,i),u=i)}return u.has(f)||((s=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,u.set(f,s)),u.get(f)}(u=r.apply(null,o)),n.isUniqueByDependants||(n.lastDependants&&!v(u,n.lastDependants,0)&&n.clear(),n.lastDependants=u),i=n.head;i;){if(v(i.args,o,1))return i!==n.head&&(i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n.head,i.prev=null,n.head.prev=i,n.head=i),i.val;i=i.next}return i={val:e.apply(null,o)},o[0]=null,i.args=o,n.head&&(n.head.prev=i,i.next=n.head),n.head=i,i.val}return s.getDependants=r,s.clear=i,i(),s}(((e,n)=>{for(const t of e.guides)if(t.includes(n)){const n=t.filter((n=>!Object.keys(e.preferences.dismissedTips).includes(n))),[r=null,i=null]=n;return{tipIds:t,currentTipId:r,nextTipId:i}}return null}),(e=>[e.guides,e.preferences.dismissedTips]));function g(e,n){var t;if(!e.preferences.areTipsEnabled)return!1;if(null!==(t=e.preferences.dismissedTips)&&void 0!==t&&t.hasOwnProperty(n))return!1;const r=h(e,n);return!r||r.currentTipId===n}function T(e){return e.preferences.areTipsEnabled}const b="core/nux",m=(0,o.createReduxStore)(b,{reducer:a,actions:t,selectors:r,persist:["preferences"]});(0,o.registerStore)(b,{reducer:a,actions:t,selectors:r,persist:["preferences"]});var I=window.wp.element,y=window.wp.compose,E=window.wp.components,S=window.wp.i18n,_=window.wp.primitives;var x=(0,I.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,I.createElement)(_.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function D(e){e.stopPropagation()}var P=(0,y.compose)((0,o.withSelect)(((e,n)=>{let{tipId:t}=n;const{isTipVisible:r,getAssociatedGuide:i}=e(m),s=i(t);return{isVisible:r(t),hasNextTip:!(!s||!s.nextTipId)}})),(0,o.withDispatch)(((e,n)=>{let{tipId:t}=n;const{dismissTip:r,disableTips:i}=e(m);return{onDismiss(){r(t)},onDisable(){i()}}})))((function(e){let{position:n="middle right",children:t,isVisible:r,hasNextTip:i,onDismiss:s,onDisable:o}=e;const u=(0,I.useRef)(null),a=(0,I.useCallback)((e=>{u.current&&(u.current.contains(e.relatedTarget)||o())}),[o,u]);return r?(0,I.createElement)(E.Popover,{className:"nux-dot-tip",position:n,focusOnMount:!0,role:"dialog","aria-label":(0,S.__)("Editor tips"),onClick:D,onFocusOutside:a},(0,I.createElement)("p",null,t),(0,I.createElement)("p",null,(0,I.createElement)(E.Button,{variant:"link",onClick:s},i?(0,S.__)("See next tip"):(0,S.__)("Got it"))),(0,I.createElement)(E.Button,{className:"nux-dot-tip__disable",icon:x,label:(0,S.__)("Disable tips"),onClick:o})):null}));s()("wp.nux",{since:"5.4",hint:"wp.components.Guide can be used to show a user guide.",version:"6.2"}),(window.wp=window.wp||{}).nux=n}();
!function(){"use strict";var e={n:function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return e.d(t,{a:t}),t},d:function(n,t){for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{DotTip:function(){return P},store:function(){return g}});var t={};e.r(t),e.d(t,{disableTips:function(){return l},dismissTip:function(){return p},enableTips:function(){return d},triggerGuide:function(){return c}});var r={};e.r(r),e.d(r,{areTipsEnabled:function(){return h},getAssociatedGuide:function(){return v},isTipVisible:function(){return b}});var i=window.wp.deprecated,s=e.n(i),o=window.wp.data;const u=(0,o.combineReducers)({areTipsEnabled:function(e=!0,n){switch(n.type){case"DISABLE_TIPS":return!1;case"ENABLE_TIPS":return!0}return e},dismissedTips:function(e={},n){switch(n.type){case"DISMISS_TIP":return{...e,[n.id]:!0};case"ENABLE_TIPS":return{}}return e}});var a=(0,o.combineReducers)({guides:function(e=[],n){return"TRIGGER_GUIDE"===n.type?[...e,n.tipIds]:e},preferences:u});function c(e){return{type:"TRIGGER_GUIDE",tipIds:e}}function p(e){return{type:"DISMISS_TIP",id:e}}function l(){return{type:"DISABLE_TIPS"}}function d(){return{type:"ENABLE_TIPS"}}var f={};function w(e){return[e]}function T(e,n,t){var r;if(e.length!==n.length)return!1;for(r=t;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}const v=function(e,n){var t,r=n||w;function i(){t=new WeakMap}function s(){var n,i,s,o,u,a=arguments.length;for(o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];for(n=function(e){var n,r,i,s,o,u=t,a=!0;for(n=0;n<e.length;n++){if(!(o=r=e[n])||"object"!=typeof o){a=!1;break}u.has(r)?u=u.get(r):(i=new WeakMap,u.set(r,i),u=i)}return u.has(f)||((s=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,u.set(f,s)),u.get(f)}(u=r.apply(null,o)),n.isUniqueByDependants||(n.lastDependants&&!T(u,n.lastDependants,0)&&n.clear(),n.lastDependants=u),i=n.head;i;){if(T(i.args,o,1))return i!==n.head&&(i.prev.next=i.next,i.next&&(i.next.prev=i.prev),i.next=n.head,i.prev=null,n.head.prev=i,n.head=i),i.val;i=i.next}return i={val:e.apply(null,o)},o[0]=null,i.args=o,n.head&&(n.head.prev=i,i.next=n.head),n.head=i,i.val}return s.getDependants=r,s.clear=i,i(),s}(((e,n)=>{for(const t of e.guides)if(t.includes(n)){const n=t.filter((n=>!Object.keys(e.preferences.dismissedTips).includes(n))),[r=null,i=null]=n;return{tipIds:t,currentTipId:r,nextTipId:i}}return null}),(e=>[e.guides,e.preferences.dismissedTips]));function b(e,n){if(!e.preferences.areTipsEnabled)return!1;if(e.preferences.dismissedTips?.hasOwnProperty(n))return!1;const t=v(e,n);return!t||t.currentTipId===n}function h(e){return e.preferences.areTipsEnabled}const m="core/nux",g=(0,o.createReduxStore)(m,{reducer:a,actions:t,selectors:r,persist:["preferences"]});(0,o.registerStore)(m,{reducer:a,actions:t,selectors:r,persist:["preferences"]});var I=window.wp.element,y=window.wp.compose,E=window.wp.components,S=window.wp.i18n,_=window.wp.primitives;var x=(0,I.createElement)(_.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,I.createElement)(_.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));function D(e){e.stopPropagation()}var P=(0,y.compose)((0,o.withSelect)(((e,{tipId:n})=>{const{isTipVisible:t,getAssociatedGuide:r}=e(g),i=r(n);return{isVisible:t(n),hasNextTip:!(!i||!i.nextTipId)}})),(0,o.withDispatch)(((e,{tipId:n})=>{const{dismissTip:t,disableTips:r}=e(g);return{onDismiss(){t(n)},onDisable(){r()}}})))((function({position:e="middle right",children:n,isVisible:t,hasNextTip:r,onDismiss:i,onDisable:s}){const o=(0,I.useRef)(null),u=(0,I.useCallback)((e=>{o.current&&(o.current.contains(e.relatedTarget)||s())}),[s,o]);return t?(0,I.createElement)(E.Popover,{className:"nux-dot-tip",position:e,focusOnMount:!0,role:"dialog","aria-label":(0,S.__)("Editor tips"),onClick:D,onFocusOutside:u},(0,I.createElement)("p",null,n),(0,I.createElement)("p",null,(0,I.createElement)(E.Button,{variant:"link",onClick:i},r?(0,S.__)("See next tip"):(0,S.__)("Got it"))),(0,I.createElement)(E.Button,{className:"nux-dot-tip__disable",icon:x,label:(0,S.__)("Disable tips"),onClick:s})):null}));s()("wp.nux",{since:"5.4",hint:"wp.components.Guide can be used to show a user guide.",version:"6.2"}),(window.wp=window.wp||{}).nux=n}();

View File

@ -54,7 +54,7 @@ __webpack_require__.d(__webpack_exports__, {
/**
* The list of core modules allowed to opt-in to the private APIs.
*/
const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/router'];
const CORE_MODULES_USING_PRIVATE_APIS = ['@wordpress/block-editor', '@wordpress/block-library', '@wordpress/blocks', '@wordpress/commands', '@wordpress/components', '@wordpress/core-commands', '@wordpress/core-data', '@wordpress/customize-widgets', '@wordpress/data', '@wordpress/edit-post', '@wordpress/edit-site', '@wordpress/edit-widgets', '@wordpress/editor', '@wordpress/reusable-blocks', '@wordpress/router'];
/**
* A list of core modules that already opted-in to
* the privateApis package.

View File

@ -1,2 +1,2 @@
/*! This file is auto-generated */
!function(){"use strict";var e={d:function(o,r){for(var t in r)e.o(r,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:r[t]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{__dangerousOptInToUnstableAPIsOnlyForCoreModules:function(){return s}});const r=["@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/router"],t=[];let n;try{n=!1}catch(e){n=!0}const s=(e,o)=>{if(!r.includes(o))throw new Error(`You tried to opt-in to unstable APIs as module "${o}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!n&&t.includes(o))throw new Error(`You tried to opt-in to unstable APIs as module "${o}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return t.push(o),{lock:i,unlock:a}};function i(e,o){if(!e)throw new Error("Cannot lock an undefined object.");u in e||(e[u]={}),d.set(e[u],o)}function a(e){if(!e)throw new Error("Cannot unlock an undefined object.");if(!(u in e))throw new Error("Cannot unlock an object that was not locked before. ");return d.get(e[u])}const d=new WeakMap,u=Symbol("Private API ID");(window.wp=window.wp||{}).privateApis=o}();
!function(){"use strict";var e={d:function(o,r){for(var t in r)e.o(r,t)&&!e.o(o,t)&&Object.defineProperty(o,t,{enumerable:!0,get:r[t]})},o:function(e,o){return Object.prototype.hasOwnProperty.call(e,o)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},o={};e.r(o),e.d(o,{__dangerousOptInToUnstableAPIsOnlyForCoreModules:function(){return s}});const r=["@wordpress/block-editor","@wordpress/block-library","@wordpress/blocks","@wordpress/commands","@wordpress/components","@wordpress/core-commands","@wordpress/core-data","@wordpress/customize-widgets","@wordpress/data","@wordpress/edit-post","@wordpress/edit-site","@wordpress/edit-widgets","@wordpress/editor","@wordpress/reusable-blocks","@wordpress/router"],t=[];let n;try{n=!1}catch(e){n=!0}const s=(e,o)=>{if(!r.includes(o))throw new Error(`You tried to opt-in to unstable APIs as module "${o}". This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if(!n&&t.includes(o))throw new Error(`You tried to opt-in to unstable APIs as module "${o}" which is already registered. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will be removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on one of the next WordPress releases.`);if("I know using unstable features means my plugin or theme will inevitably break on the next WordPress release."!==e)throw new Error("You tried to opt-in to unstable APIs without confirming you know the consequences. This feature is only for JavaScript modules shipped with WordPress core. Please do not use it in plugins and themes as the unstable APIs will removed without a warning. If you ignore this error and depend on unstable features, your product will inevitably break on the next WordPress release.");return t.push(o),{lock:i,unlock:a}};function i(e,o){if(!e)throw new Error("Cannot lock an undefined object.");u in e||(e[u]={}),d.set(e[u],o)}function a(e){if(!e)throw new Error("Cannot unlock an undefined object.");if(!(u in e))throw new Error("Cannot unlock an object that was not locked before. ");return d.get(e[u])}const d=new WeakMap,u=Symbol("Private API ID");(window.wp=window.wp||{}).privateApis=o}();

View File

@ -94,7 +94,7 @@ const __experimentalConvertBlockToStatic = clientId => ({
*
* @param {string[]} clientIds The client IDs of the block to detach.
* @param {string} title Pattern title.
* @param {'fully'|'unsynced'} syncType They way block is synced, current 'fully' and 'unsynced'.
* @param {undefined|'unsynced'} syncType They way block is synced, current undefined (synced) and 'unsynced'.
*/
const __experimentalConvertBlocksToReusable = (clientIds, title, syncType) => async ({
@ -248,6 +248,17 @@ const symbol = (0,external_wp_element_namespaceObject.createElement)(external_wp
var external_wp_notices_namespaceObject = window["wp"]["notices"];
;// CONCATENATED MODULE: external ["wp","coreData"]
var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
;// CONCATENATED MODULE: external ["wp","privateApis"]
var external_wp_privateApis_namespaceObject = window["wp"]["privateApis"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/lock-unlock.js
/**
* WordPress dependencies
*/
const {
unlock
} = (0,external_wp_privateApis_namespaceObject.__dangerousOptInToUnstableAPIsOnlyForCoreModules)('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/reusable-blocks');
;// CONCATENATED MODULE: ./node_modules/@wordpress/reusable-blocks/build-module/components/reusable-blocks-menu-items/reusable-block-convert-button.js
@ -268,6 +279,7 @@ var external_wp_coreData_namespaceObject = window["wp"]["coreData"];
*/
/**
* Menu control to convert block(s) to reusable block.
*
@ -281,7 +293,12 @@ function ReusableBlockConvertButton({
clientIds,
rootClientId
}) {
const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)('unsynced');
const {
useReusableBlocksRenameHint,
ReusableBlocksRenameHint
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
const showRenameHint = useReusableBlocksRenameHint();
const [syncType, setSyncType] = (0,external_wp_element_namespaceObject.useState)(undefined);
const [isModalOpen, setIsModalOpen] = (0,external_wp_element_namespaceObject.useState)(false);
const [title, setTitle] = (0,external_wp_element_namespaceObject.useState)('');
const canConvert = (0,external_wp_data_namespaceObject.useSelect)(select => {
@ -317,7 +334,7 @@ function ReusableBlockConvertButton({
const onConvert = (0,external_wp_element_namespaceObject.useCallback)(async function (reusableBlockTitle) {
try {
await convertBlocksToReusable(clientIds, reusableBlockTitle, syncType);
createSuccessNotice(syncType === 'fully' ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name the user has given to the pattern.
createSuccessNotice(!syncType ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name the user has given to the pattern.
(0,external_wp_i18n_namespaceObject.__)('Synced Pattern created: %s'), reusableBlockTitle) : (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name the user has given to the pattern.
(0,external_wp_i18n_namespaceObject.__)('Unsynced Pattern created: %s'), reusableBlockTitle), {
type: 'snackbar',
@ -340,7 +357,7 @@ function ReusableBlockConvertButton({
}) => (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
icon: library_symbol,
onClick: () => setIsModalOpen(true)
}, (0,external_wp_i18n_namespaceObject.__)('Create pattern/reusable block')), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
}, showRenameHint ? (0,external_wp_i18n_namespaceObject.__)('Create pattern/reusable block') : (0,external_wp_i18n_namespaceObject.__)('Create pattern')), isModalOpen && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Modal, {
title: (0,external_wp_i18n_namespaceObject.__)('Create pattern'),
onRequestClose: () => {
setIsModalOpen(false);
@ -357,7 +374,7 @@ function ReusableBlockConvertButton({
}
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: "5"
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.ReusableBlocksRenameHint, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
}, (0,external_wp_element_namespaceObject.createElement)(ReusableBlocksRenameHint, null), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.TextControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Name'),
value: title,
@ -366,9 +383,9 @@ function ReusableBlockConvertButton({
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Synced'),
help: (0,external_wp_i18n_namespaceObject.__)('Editing the pattern will update it anywhere it is used.'),
checked: syncType === 'fully',
checked: !syncType,
onChange: () => {
setSyncType(syncType === 'fully' ? 'unsynced' : 'fully');
setSyncType(!syncType ? 'unsynced' : undefined);
}
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "right"
@ -451,7 +468,7 @@ function ReusableBlocksManageButton({
return (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockSettingsMenuControls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
href: managePatternsUrl
}, (0,external_wp_i18n_namespaceObject.__)('Manage Patterns')), canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
}, (0,external_wp_i18n_namespaceObject.__)('Manage patterns')), canRemove && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
onClick: () => convertBlockToStatic(clientId)
}, innerBlockCount > 1 ? (0,external_wp_i18n_namespaceObject.__)('Detach patterns') : (0,external_wp_i18n_namespaceObject.__)('Detach pattern')));
}
@ -487,10 +504,13 @@ function ReusableBlocksMenuItems({
/* harmony default export */ var reusable_blocks_menu_items = ((0,external_wp_data_namespaceObject.withSelect)(select => {
const {
getSelectedBlockClientIds
getSelectedBlockClientIds,
getBlockRootClientId
} = select(external_wp_blockEditor_namespaceObject.store);
const clientIds = getSelectedBlockClientIds();
return {
clientIds: getSelectedBlockClientIds()
clientIds,
rootClientId: clientIds?.length > 0 ? getBlockRootClientId(clientIds[0]) : undefined
};
})(ReusableBlocksMenuItems));

File diff suppressed because one or more lines are too long

View File

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