ellatrix 2024-07-09 13:45:25 +00:00
parent c56593dfe1
commit 6d7e0b6a60
36 changed files with 633 additions and 455 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

@ -28,12 +28,33 @@ function render_block_core_image( $attributes, $content, $block ) {
return ''; return '';
} }
$has_id_binding = isset( $attributes['metadata']['bindings']['id'] ) && isset( $attributes['id'] );
// Ensure the `wp-image-id` classname on the image block supports block bindings.
if ( $has_id_binding ) {
// If there's a mismatch with the 'wp-image-' class and the actual id, the id was
// probably overridden by block bindings. Update it to the correct value.
// See https://github.com/WordPress/gutenberg/issues/62886 for why this is needed.
$id = $attributes['id'];
$image_classnames = $p->get_attribute( 'class' );
$class_with_binding_value = "wp-image-$id";
if ( is_string( $image_classnames ) && ! str_contains( $image_classnames, $class_with_binding_value ) ) {
$image_classnames = preg_replace( '/wp-image-(\d+)/', $class_with_binding_value, $image_classnames );
$p->set_attribute( 'class', $image_classnames );
}
}
// For backwards compatibility, the data-id html attribute is only set for
// image blocks nested in a gallery. Detect if the image is in a gallery by
// checking the data-id attribute.
// See the `block_core_gallery_data_id_backcompatibility` function.
if ( isset( $attributes['data-id'] ) ) { if ( isset( $attributes['data-id'] ) ) {
// Adds the data-id="$id" attribute to the img element to provide backwards // If there's a binding for the `id`, the `id` attribute is used for the
// compatibility for the Gallery Block, which now wraps Image Blocks within // value, since `data-id` does not support block bindings.
// innerBlocks. The data-id attribute is added in a core/gallery // Else the `data-id` is used for backwards compatibility, since
// `render_block_data` hook. // third parties may be filtering its value.
$p->set_attribute( 'data-id', $attributes['data-id'] ); $data_id = $has_id_binding ? $attributes['id'] : $attributes['data-id'];
$p->set_attribute( 'data-id', $data_id );
} }
$link_destination = isset( $attributes['linkDestination'] ) ? $attributes['linkDestination'] : 'none'; $link_destination = isset( $attributes['linkDestination'] ) ? $attributes['linkDestination'] : 'none';

View File

@ -1,3 +1,12 @@
:where(.wp-block-post-comments-form) input:not([type=submit]),:where(.wp-block-post-comments-form) textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
:where(.wp-block-post-comments-form) input:where(:not([type=submit]):not([type=checkbox])),:where(.wp-block-post-comments-form) textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form{ .wp-block-post-comments-form{
box-sizing:border-box; box-sizing:border-box;
} }
@ -26,14 +35,6 @@
overflow-wrap:break-word; overflow-wrap:break-word;
text-align:center; text-align:center;
} }
.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{ .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{
box-sizing:border-box; box-sizing:border-box;
display:block; display:block;

View File

@ -1 +1 @@
.wp-block-post-comments-form{box-sizing:border-box}.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{box-shadow:none;cursor:pointer;display:inline-block;overflow-wrap:break-word;text-align:center}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em} :where(.wp-block-post-comments-form) input:not([type=submit]),:where(.wp-block-post-comments-form) textarea{border:1px solid #949494;font-family:inherit;font-size:1em}:where(.wp-block-post-comments-form) input:where(:not([type=submit]):not([type=checkbox])),:where(.wp-block-post-comments-form) textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form{box-sizing:border-box}.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{box-shadow:none;cursor:pointer;display:inline-block;overflow-wrap:break-word;text-align:center}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-right:.5em}

View File

@ -1,3 +1,12 @@
:where(.wp-block-post-comments-form) input:not([type=submit]),:where(.wp-block-post-comments-form) textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
:where(.wp-block-post-comments-form) input:where(:not([type=submit]):not([type=checkbox])),:where(.wp-block-post-comments-form) textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form{ .wp-block-post-comments-form{
box-sizing:border-box; box-sizing:border-box;
} }
@ -26,14 +35,6 @@
overflow-wrap:break-word; overflow-wrap:break-word;
text-align:center; text-align:center;
} }
.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{ .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{
box-sizing:border-box; box-sizing:border-box;
display:block; display:block;

View File

@ -1 +1 @@
.wp-block-post-comments-form{box-sizing:border-box}.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{box-shadow:none;cursor:pointer;display:inline-block;overflow-wrap:break-word;text-align:center}.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{border:1px solid #949494;font-family:inherit;font-size:1em}.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em} :where(.wp-block-post-comments-form) input:not([type=submit]),:where(.wp-block-post-comments-form) textarea{border:1px solid #949494;font-family:inherit;font-size:1em}:where(.wp-block-post-comments-form) input:where(:not([type=submit]):not([type=checkbox])),:where(.wp-block-post-comments-form) textarea{padding:calc(.667em + 2px)}.wp-block-post-comments-form{box-sizing:border-box}.wp-block-post-comments-form[style*=font-weight] :where(.comment-reply-title){font-weight:inherit}.wp-block-post-comments-form[style*=font-family] :where(.comment-reply-title){font-family:inherit}.wp-block-post-comments-form[class*=-font-size] :where(.comment-reply-title),.wp-block-post-comments-form[style*=font-size] :where(.comment-reply-title){font-size:inherit}.wp-block-post-comments-form[style*=line-height] :where(.comment-reply-title){line-height:inherit}.wp-block-post-comments-form[style*=font-style] :where(.comment-reply-title){font-style:inherit}.wp-block-post-comments-form[style*=letter-spacing] :where(.comment-reply-title){letter-spacing:inherit}.wp-block-post-comments-form input[type=submit]{box-shadow:none;cursor:pointer;display:inline-block;overflow-wrap:break-word;text-align:center}.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{box-sizing:border-box;display:block;width:100%}.wp-block-post-comments-form .comment-form-author label,.wp-block-post-comments-form .comment-form-email label,.wp-block-post-comments-form .comment-form-url label{display:block;margin-bottom:.25em}.wp-block-post-comments-form .comment-form-cookies-consent{display:flex;gap:.25em}.wp-block-post-comments-form .comment-form-cookies-consent #wp-comment-cookies-consent{margin-top:.35em}.wp-block-post-comments-form .comment-reply-title{margin-bottom:0}.wp-block-post-comments-form .comment-reply-title :where(small){font-size:var(--wp--preset--font-size--medium,smaller);margin-left:.5em}

View File

@ -2181,6 +2181,15 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
margin:0; margin:0;
} }
:where(.wp-block-post-comments-form) input:not([type=submit]),:where(.wp-block-post-comments-form) textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
:where(.wp-block-post-comments-form) input:where(:not([type=submit]):not([type=checkbox])),:where(.wp-block-post-comments-form) textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form{ .wp-block-post-comments-form{
box-sizing:border-box; box-sizing:border-box;
} }
@ -2209,14 +2218,6 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
overflow-wrap:break-word; overflow-wrap:break-word;
text-align:center; text-align:center;
} }
.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{ .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{
box-sizing:border-box; box-sizing:border-box;
display:block; display:block;

File diff suppressed because one or more lines are too long

View File

@ -2181,6 +2181,15 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
margin:0; margin:0;
} }
:where(.wp-block-post-comments-form) input:not([type=submit]),:where(.wp-block-post-comments-form) textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
:where(.wp-block-post-comments-form) input:where(:not([type=submit]):not([type=checkbox])),:where(.wp-block-post-comments-form) textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form{ .wp-block-post-comments-form{
box-sizing:border-box; box-sizing:border-box;
} }
@ -2209,14 +2218,6 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"],p.has-text-align-right[
overflow-wrap:break-word; overflow-wrap:break-word;
text-align:center; text-align:center;
} }
.wp-block-post-comments-form input:not([type=submit]),.wp-block-post-comments-form textarea{
border:1px solid #949494;
font-family:inherit;
font-size:1em;
}
.wp-block-post-comments-form input:not([type=submit]):not([type=checkbox]),.wp-block-post-comments-form textarea{
padding:calc(.667em + 2px);
}
.wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{ .wp-block-post-comments-form .comment-form input:not([type=submit]):not([type=checkbox]):not([type=hidden]),.wp-block-post-comments-form .comment-form textarea{
box-sizing:border-box; box-sizing:border-box;
display:block; display:block;

File diff suppressed because one or more lines are too long

View File

@ -85,7 +85,7 @@
content:none; content:none;
} }
.edit-post-layout.has-metaboxes .edit-post-visual-editor{ .edit-post-visual-editor:not(.is-iframed){
flex:1 0 auto; flex:1 0 auto;
height:auto; height:auto;
} }

File diff suppressed because one or more lines are too long

View File

@ -85,7 +85,7 @@
content:none; content:none;
} }
.edit-post-layout.has-metaboxes .edit-post-visual-editor{ .edit-post-visual-editor:not(.is-iframed){
flex:1 0 auto; flex:1 0 auto;
height:auto; height:auto;
} }

File diff suppressed because one or more lines are too long

View File

@ -1940,6 +1940,9 @@
width:100%; width:100%;
z-index:2; z-index:2;
} }
.edit-site-layout__mobile .edit-site-sidebar__screen-wrapper{
padding:0;
}
.edit-site-layout__canvas-container{ .edit-site-layout__canvas-container{
flex-grow:1; flex-grow:1;
@ -2132,7 +2135,9 @@ html.canvas-mode-edit-transition::view-transition-group(toggle){
} }
.edit-site-sidebar__content{ .edit-site-sidebar__content{
contain:content;
flex-grow:1; flex-grow:1;
overflow-x:hidden;
overflow-y:auto; overflow-y:auto;
} }

File diff suppressed because one or more lines are too long

View File

@ -1940,6 +1940,9 @@
width:100%; width:100%;
z-index:2; z-index:2;
} }
.edit-site-layout__mobile .edit-site-sidebar__screen-wrapper{
padding:0;
}
.edit-site-layout__canvas-container{ .edit-site-layout__canvas-container{
flex-grow:1; flex-grow:1;
@ -2132,7 +2135,9 @@ html.canvas-mode-edit-transition::view-transition-group(toggle){
} }
.edit-site-sidebar__content{ .edit-site-sidebar__content{
contain:content;
flex-grow:1; flex-grow:1;
overflow-x:hidden;
overflow-y:auto; overflow-y:auto;
} }

File diff suppressed because one or more lines are too long

View File

@ -1539,6 +1539,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
text-align:right; text-align:right;
text-wrap:balance; text-wrap:balance;
text-wrap:pretty; text-wrap:pretty;
white-space:normal;
} }
.editor-post-panel__row-control .components-dropdown{ .editor-post-panel__row-control .components-dropdown{
max-width:100%; max-width:100%;

File diff suppressed because one or more lines are too long

View File

@ -1539,6 +1539,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
text-align:left; text-align:left;
text-wrap:balance; text-wrap:balance;
text-wrap:pretty; text-wrap:pretty;
white-space:normal;
} }
.editor-post-panel__row-control .components-dropdown{ .editor-post-panel__row-control .components-dropdown{
max-width:100%; max-width:100%;

File diff suppressed because one or more lines are too long

View File

@ -34166,7 +34166,7 @@ const getNodesWithStyles = (tree, blockSelectors) => {
if (variation?.css) { if (variation?.css) {
variations[variationName].css = variation.css; variations[variationName].css = variation.css;
} }
const variationSelector = blockSelectors[blockName].styleVariationSelectors?.[variationName]; const variationSelector = blockSelectors[blockName]?.styleVariationSelectors?.[variationName];
// Process the variation's inner element styles. // Process the variation's inner element styles.
// This comes before the inner block styles so the // This comes before the inner block styles so the
@ -34184,9 +34184,9 @@ const getNodesWithStyles = (tree, blockSelectors) => {
// Process the variations inner block type styles. // Process the variations inner block type styles.
Object.entries((_variation$blocks = variation?.blocks) !== null && _variation$blocks !== void 0 ? _variation$blocks : {}).forEach(([variationBlockName, variationBlockStyles]) => { Object.entries((_variation$blocks = variation?.blocks) !== null && _variation$blocks !== void 0 ? _variation$blocks : {}).forEach(([variationBlockName, variationBlockStyles]) => {
var _variationBlockStyles; var _variationBlockStyles;
const variationBlockSelector = scopeSelector(variationSelector, blockSelectors[variationBlockName].selector); const variationBlockSelector = scopeSelector(variationSelector, blockSelectors[variationBlockName]?.selector);
const variationDuotoneSelector = scopeSelector(variationSelector, blockSelectors[variationBlockName].duotoneSelector); const variationDuotoneSelector = scopeSelector(variationSelector, blockSelectors[variationBlockName]?.duotoneSelector);
const variationFeatureSelectors = scopeFeatureSelectors(variationSelector, blockSelectors[variationBlockName].featureSelectors); const variationFeatureSelectors = scopeFeatureSelectors(variationSelector, blockSelectors[variationBlockName]?.featureSelectors);
const variationBlockStyleNodes = pickStyleKeys(variationBlockStyles); const variationBlockStyleNodes = pickStyleKeys(variationBlockStyles);
if (variationBlockStyles?.css) { if (variationBlockStyles?.css) {
variationBlockStyleNodes.css = variationBlockStyles.css; variationBlockStyleNodes.css = variationBlockStyles.css;
@ -34195,8 +34195,8 @@ const getNodesWithStyles = (tree, blockSelectors) => {
selector: variationBlockSelector, selector: variationBlockSelector,
duotoneSelector: variationDuotoneSelector, duotoneSelector: variationDuotoneSelector,
featureSelectors: variationFeatureSelectors, featureSelectors: variationFeatureSelectors,
fallbackGapValue: blockSelectors[variationBlockName].fallbackGapValue, fallbackGapValue: blockSelectors[variationBlockName]?.fallbackGapValue,
hasLayoutSupport: blockSelectors[variationBlockName].hasLayoutSupport, hasLayoutSupport: blockSelectors[variationBlockName]?.hasLayoutSupport,
styles: variationBlockStyleNodes styles: variationBlockStyleNodes
}); });
@ -34349,8 +34349,8 @@ const toStyles = (tree, blockSelectors, hasBlockGapSupport, hasFallbackGapSuppor
ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) } ruleset += `padding-right: 0; padding-left: 0; padding-top: var(--wp--style--root--padding-top); padding-bottom: var(--wp--style--root--padding-bottom) }
.has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); } .has-global-padding { padding-right: var(--wp--style--root--padding-right); padding-left: var(--wp--style--root--padding-left); }
.has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); } .has-global-padding > .alignfull { margin-right: calc(var(--wp--style--root--padding-right) * -1); margin-left: calc(var(--wp--style--root--padding-left) * -1); }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) { padding-right: 0; padding-left: 0; } .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) { padding-right: 0; padding-left: 0; }
.has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull, .alignwide)) > .alignfull { margin-left: 0; margin-right: 0; .has-global-padding :where(:not(.alignfull.is-layout-flow) > .has-global-padding:not(.wp-block-block, .alignfull)) > .alignfull { margin-left: 0; margin-right: 0;
`; `;
} }
ruleset += '}'; ruleset += '}';
@ -34706,6 +34706,7 @@ function useGlobalStylesOutput(disableRootPadding = false) {
const VARIATION_PREFIX = 'is-style-'; const VARIATION_PREFIX = 'is-style-';
function getVariationMatches(className) { function getVariationMatches(className) {
if (!className) { if (!className) {
@ -34846,6 +34847,61 @@ function __unstableBlockStyleVariationOverridesWithConfig({
}, override.id)) }, override.id))
}); });
} }
/**
* Retrieves any variation styles data and resolves any referenced values.
*
* @param {Object} globalStyles A complete global styles object, containing settings and styles.
* @param {string} name The name of the desired block type.
* @param {variation} variation The of the block style variation to retrieve data for.
*
* @return {Object|undefined} The global styles data for the specified variation.
*/
function getVariationStylesWithRefValues(globalStyles, name, variation) {
if (!globalStyles?.styles?.blocks?.[name]?.variations?.[variation]) {
return;
}
// Helper to recursively look for `ref` values to resolve.
const replaceRefs = variationStyles => {
Object.keys(variationStyles).forEach(key => {
const value = variationStyles[key];
// Only process objects.
if (typeof value === 'object' && value !== null) {
// Process `ref` value if present.
if (value.ref !== undefined) {
if (typeof value.ref !== 'string' || value.ref.trim() === '') {
// Remove invalid ref.
delete variationStyles[key];
} else {
// Resolve `ref` value.
const refValue = getValueFromObjectPath(globalStyles, value.ref);
if (refValue) {
variationStyles[key] = refValue;
} else {
delete variationStyles[key];
}
}
} else {
// Recursively resolve `ref` values in nested objects.
replaceRefs(value);
// After recursion, if value is empty due to explicitly
// `undefined` ref value, remove it.
if (Object.keys(value).length === 0) {
delete variationStyles[key];
}
}
}
});
};
// Deep clone variation node to avoid mutating it within global styles and losing refs.
const styles = JSON.parse(JSON.stringify(globalStyles.styles.blocks[name].variations[variation]));
replaceRefs(styles);
return styles;
}
function useBlockStyleVariation(name, variation, clientId) { function useBlockStyleVariation(name, variation, clientId) {
// Prefer global styles data in GlobalStylesContext, which are available // Prefer global styles data in GlobalStylesContext, which are available
// if in the site editor. Otherwise fall back to whatever is in the // if in the site editor. Otherwise fall back to whatever is in the
@ -34864,11 +34920,13 @@ function useBlockStyleVariation(name, variation, clientId) {
}; };
}, []); }, []);
return (0,external_wp_element_namespaceObject.useMemo)(() => { return (0,external_wp_element_namespaceObject.useMemo)(() => {
var _mergedConfig$styles, _mergedConfig$setting; var _mergedConfig$setting, _mergedConfig$styles, _mergedConfig$setting2;
const styles = (_mergedConfig$styles = mergedConfig?.styles) !== null && _mergedConfig$styles !== void 0 ? _mergedConfig$styles : globalStyles; const variationStyles = getVariationStylesWithRefValues({
const variationStyles = styles?.blocks?.[name]?.variations?.[variation];
return {
settings: (_mergedConfig$setting = mergedConfig?.settings) !== null && _mergedConfig$setting !== void 0 ? _mergedConfig$setting : globalSettings, settings: (_mergedConfig$setting = mergedConfig?.settings) !== null && _mergedConfig$setting !== void 0 ? _mergedConfig$setting : globalSettings,
styles: (_mergedConfig$styles = mergedConfig?.styles) !== null && _mergedConfig$styles !== void 0 ? _mergedConfig$styles : globalStyles
}, name, variation);
return {
settings: (_mergedConfig$setting2 = mergedConfig?.settings) !== null && _mergedConfig$setting2 !== void 0 ? _mergedConfig$setting2 : globalSettings,
// The variation style data is all that is needed to generate // The variation style data is all that is needed to generate
// the styles for the current application to a block. The variation // the styles for the current application to a block. The variation
// name is updated to match the instance specific class name. // name is updated to match the instance specific class name.

File diff suppressed because one or more lines are too long

View File

@ -517,7 +517,7 @@ function useSiteEditorBasicNavigationCommands() {
close close
}) => { }) => {
const args = { const args = {
post_type: 'page' postType: 'page'
}; };
const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args); const targetUrl = (0,external_wp_url_namespaceObject.addQueryArgs)('site-editor.php', args);
if (isSiteEditor) { if (isSiteEditor) {

File diff suppressed because one or more lines are too long

View File

@ -6217,11 +6217,16 @@ const resolvers_experimentalGetCurrentGlobalStylesId = () => async ({
status: 'active' status: 'active'
}); });
const globalStylesURL = activeThemes?.[0]?._links?.['wp:user-global-styles']?.[0]?.href; const globalStylesURL = activeThemes?.[0]?._links?.['wp:user-global-styles']?.[0]?.href;
if (globalStylesURL) { if (!globalStylesURL) {
const globalStylesObject = await external_wp_apiFetch_default()({ return;
url: globalStylesURL }
});
dispatch.__experimentalReceiveCurrentGlobalStylesId(globalStylesObject.id); // Regex matches the ID at the end of a URL or immediately before
// the query string.
const matches = globalStylesURL.match(/\/(\d+)(?:\?|$)/);
const id = matches ? Number(matches[1]) : null;
if (id) {
dispatch.__experimentalReceiveCurrentGlobalStylesId(id);
} }
}; };
const resolvers_experimentalGetCurrentThemeBaseGlobalStyles = () => async ({ const resolvers_experimentalGetCurrentThemeBaseGlobalStyles = () => async ({

File diff suppressed because one or more lines are too long

View File

@ -2751,7 +2751,9 @@ function useEditorStyles() {
// bottom, there needs to be room to scroll up. // bottom, there needs to be room to scroll up.
if (!isZoomedOutView && !hasMetaBoxes && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) { if (!isZoomedOutView && !hasMetaBoxes && renderingMode === 'post-only' && !DESIGN_POST_TYPES.includes(postType)) {
return [...baseStyles, { return [...baseStyles, {
css: 'body{padding-bottom: 40vh}' // Should override global styles padding, so ensure 0-1-0
// specificity.
css: ':root :where(body){padding-bottom: 40vh}'
}]; }];
} }
return baseStyles; return baseStyles;

File diff suppressed because one or more lines are too long

View File

@ -9519,6 +9519,95 @@ function SiteIcon({
} }
/* harmony default export */ const site_icon = (SiteIcon); /* harmony default export */ const site_icon = (SiteIcon);
;// CONCATENATED MODULE: external ["wp","dom"]
const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const SidebarNavigationContext = (0,external_wp_element_namespaceObject.createContext)(() => {});
// Focus a sidebar element after a navigation. The element to focus is either
// specified by `focusSelector` (when navigating back) or it is the first
// tabbable element (usually the "Back" button).
function focusSidebarElement(el, direction, focusSelector) {
let elementToFocus;
if (direction === 'back' && focusSelector) {
elementToFocus = el.querySelector(focusSelector);
}
if (direction !== null && !elementToFocus) {
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(el);
elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : el;
}
elementToFocus?.focus();
}
// Navigation state that is updated when navigating back or forward. Helps us
// manage the animations and also focus.
function createNavState() {
let state = {
direction: null,
focusSelector: null
};
return {
get() {
return state;
},
navigate(direction, focusSelector = null) {
state = {
direction,
focusSelector: direction === 'forward' && focusSelector ? focusSelector : state.focusSelector
};
}
};
}
function SidebarContentWrapper({
children
}) {
const navState = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext);
const wrapperRef = (0,external_wp_element_namespaceObject.useRef)();
const [navAnimation, setNavAnimation] = (0,external_wp_element_namespaceObject.useState)(null);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const {
direction,
focusSelector
} = navState.get();
focusSidebarElement(wrapperRef.current, direction, focusSelector);
setNavAnimation(direction);
}, [navState]);
const wrapperCls = dist_clsx('edit-site-sidebar__screen-wrapper', {
'slide-from-left': navAnimation === 'back',
'slide-from-right': navAnimation === 'forward'
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref: wrapperRef,
className: wrapperCls,
children: children
});
}
function SidebarContent({
routeKey,
children
}) {
const [navState] = (0,external_wp_element_namespaceObject.useState)(createNavState);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationContext.Provider, {
value: navState,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-site-sidebar__content",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContentWrapper, {
children: children
}, routeKey)
})
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/site-hub/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/site-hub/index.js
/** /**
* External dependencies * External dependencies
@ -9539,12 +9628,17 @@ function SiteIcon({
/** /**
* Internal dependencies * Internal dependencies
*/ */
const {
useHistory
} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis);
const SiteHub = (0,external_wp_element_namespaceObject.memo)((0,external_wp_element_namespaceObject.forwardRef)(({ const SiteHub = (0,external_wp_element_namespaceObject.memo)((0,external_wp_element_namespaceObject.forwardRef)(({
@ -9621,6 +9715,81 @@ const SiteHub = (0,external_wp_element_namespaceObject.memo)((0,external_wp_elem
}); });
})); }));
/* harmony default export */ const site_hub = (SiteHub); /* harmony default export */ const site_hub = (SiteHub);
const SiteHubMobile = (0,external_wp_element_namespaceObject.memo)((0,external_wp_element_namespaceObject.forwardRef)(({
isTransparent
}, ref) => {
const history = useHistory();
const {
navigate
} = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext);
const {
homeUrl,
siteTitle
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
const {
getSite,
getUnstableBase // Site index.
} = select(external_wp_coreData_namespaceObject.store);
const _site = getSite();
return {
homeUrl: getUnstableBase()?.home,
siteTitle: !_site?.title && !!_site?.url ? (0,external_wp_url_namespaceObject.filterURLForDisplay)(_site?.url) : _site?.title
};
}, []);
const {
open: openCommandCenter
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_commands_namespaceObject.store);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-site-site-hub",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
justify: "flex-start",
spacing: "0",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: dist_clsx('edit-site-site-hub__view-mode-toggle-container', {
'has-transparent-background': isTransparent
}),
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
ref: ref,
label: (0,external_wp_i18n_namespaceObject.__)('Go to Site Editor'),
className: "edit-site-layout__view-mode-toggle",
style: {
transform: 'scale(0.5)',
borderRadius: 4
},
onClick: () => {
history.push({});
navigate('back');
},
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(site_icon, {
className: "edit-site-layout__view-mode-toggle-icon"
})
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-site-site-hub__title",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
variant: "link",
href: homeUrl,
target: "_blank",
label: (0,external_wp_i18n_namespaceObject.__)('View site (opens in a new tab)'),
children: (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(siteTitle)
})
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalHStack, {
spacing: 0,
expanded: false,
className: "edit-site-site-hub__actions",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
className: "edit-site-site-hub_toggle-command-center",
icon: library_search,
onClick: () => openCommandCenter(),
label: (0,external_wp_i18n_namespaceObject.__)('Open command palette'),
shortcut: external_wp_keycodes_namespaceObject.displayShortcut.primary('k')
})
})]
})]
})
});
}));
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/resizable-frame/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/resizable-frame/index.js
/** /**
@ -9913,10 +10082,10 @@ function ResizableFrame({
const { const {
useLocation: use_sync_canvas_mode_with_url_useLocation, useLocation: use_sync_canvas_mode_with_url_useLocation,
useHistory useHistory: use_sync_canvas_mode_with_url_useHistory
} = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis); } = lock_unlock_unlock(external_wp_router_namespaceObject.privateApis);
function useSyncCanvasModeWithURL() { function useSyncCanvasModeWithURL() {
const history = useHistory(); const history = use_sync_canvas_mode_with_url_useHistory();
const { const {
params params
} = use_sync_canvas_mode_with_url_useLocation(); } = use_sync_canvas_mode_with_url_useLocation();
@ -21285,8 +21454,7 @@ function shadows_edit_panel_ShadowItem({
className: dist_clsx('edit-site-global-styles__shadow-editor__remove-button', { className: dist_clsx('edit-site-global-styles__shadow-editor__remove-button', {
'is-open': isOpen 'is-open': isOpen
}), }),
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Remove shadow'), label: (0,external_wp_i18n_namespaceObject.__)('Remove shadow')
tooltip: (0,external_wp_i18n_namespaceObject.__)('Remove shadow')
}; };
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalHStack, {
align: "center", align: "center",
@ -37300,95 +37468,6 @@ function SidebarButton(props) {
}); });
} }
;// CONCATENATED MODULE: external ["wp","dom"]
const external_wp_dom_namespaceObject = window["wp"]["dom"];
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar/index.js
/**
* External dependencies
*/
/**
* WordPress dependencies
*/
const SidebarNavigationContext = (0,external_wp_element_namespaceObject.createContext)(() => {});
// Focus a sidebar element after a navigation. The element to focus is either
// specified by `focusSelector` (when navigating back) or it is the first
// tabbable element (usually the "Back" button).
function focusSidebarElement(el, direction, focusSelector) {
let elementToFocus;
if (direction === 'back' && focusSelector) {
elementToFocus = el.querySelector(focusSelector);
}
if (direction !== null && !elementToFocus) {
const [firstTabbable] = external_wp_dom_namespaceObject.focus.tabbable.find(el);
elementToFocus = firstTabbable !== null && firstTabbable !== void 0 ? firstTabbable : el;
}
elementToFocus?.focus();
}
// Navigation state that is updated when navigating back or forward. Helps us
// manage the animations and also focus.
function createNavState() {
let state = {
direction: null,
focusSelector: null
};
return {
get() {
return state;
},
navigate(direction, focusSelector = null) {
state = {
direction,
focusSelector: direction === 'forward' && focusSelector ? focusSelector : state.focusSelector
};
}
};
}
function SidebarContentWrapper({
children
}) {
const navState = (0,external_wp_element_namespaceObject.useContext)(SidebarNavigationContext);
const wrapperRef = (0,external_wp_element_namespaceObject.useRef)();
const [navAnimation, setNavAnimation] = (0,external_wp_element_namespaceObject.useState)(null);
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
const {
direction,
focusSelector
} = navState.get();
focusSidebarElement(wrapperRef.current, direction, focusSelector);
setNavAnimation(direction);
}, [navState]);
const wrapperCls = dist_clsx('edit-site-sidebar__screen-wrapper', {
'slide-from-left': navAnimation === 'back',
'slide-from-right': navAnimation === 'forward'
});
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
ref: wrapperRef,
className: wrapperCls,
children: children
});
}
function SidebarContent({
routeKey,
children
}) {
const [navState] = (0,external_wp_element_namespaceObject.useState)(createNavState);
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarNavigationContext.Provider, {
value: navState,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-site-sidebar__content",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContentWrapper, {
children: children
}, routeKey)
})
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js
/** /**
* External dependencies * External dependencies
@ -40369,9 +40448,15 @@ function Layout() {
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})] }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SaveHub, {}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SavePanel, {})]
}) })
}) })
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), isMobileViewport && areas.mobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_editor_namespaceObject.EditorSnackbars, {}), isMobileViewport && areas.mobile && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
className: "edit-site-layout__mobile", className: "edit-site-layout__mobile",
children: areas.mobile children: [canvasMode !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SidebarContent, {
routeKey: routeKey,
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(SiteHubMobile, {
ref: toggleRef,
isTransparent: isResizableFrameOversized
})
}), areas.mobile]
}), !isMobileViewport && areas.content && canvasMode !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", { }), !isMobileViewport && areas.content && canvasMode !== 'edit' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "edit-site-layout__area", className: "edit-site-layout__area",
style: { style: {

File diff suppressed because one or more lines are too long

View File

@ -5242,18 +5242,16 @@ const external_wp_htmlEntities_namespaceObject = window["wp"]["htmlEntities"];
// Copy of the function from packages/edit-site/src/utils/is-template-revertable.js // Copy of the function from packages/edit-site/src/utils/is-template-revertable.js
/** /**
* Check if a template is revertable to its original theme-provided template file. * Check if a template or template part is revertable to its original theme-provided file.
* *
* @param {Object} template The template entity to check. * @param {Object} templateOrTemplatePart The entity to check.
* @return {boolean} Whether the template is revertable. * @return {boolean} Whether the entity is revertable.
*/ */
function isTemplateRevertable(template) { function isTemplateRevertable(templateOrTemplatePart) {
if (!template) { if (!templateOrTemplatePart) {
return false; return false;
} }
/* eslint-disable camelcase */ return templateOrTemplatePart.source === TEMPLATE_ORIGINS.custom && templateOrTemplatePart.has_theme_file;
return template?.source === TEMPLATE_ORIGINS.custom && template?.has_theme_file;
/* eslint-enable camelcase */
} }
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/private-actions.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/store/private-actions.js
@ -6089,6 +6087,10 @@ unlock(store_store).registerPrivateSelectors(private_selectors_namespaceObject);
context, context,
args args
}) { }) {
// Lock editing in query loop.
if (context?.query || context?.queryId) {
return false;
}
const postType = context?.postType || select(store_store).getCurrentPostType(); const postType = context?.postType || select(store_store).getCurrentPostType();
// Check that editing is happening in the post editor and not a template. // Check that editing is happening in the post editor and not a template.
@ -10073,7 +10075,8 @@ function ParentRow() {
title: (0,external_wp_i18n_namespaceObject.__)('Parent'), title: (0,external_wp_i18n_namespaceObject.__)('Parent'),
onClose: onClose onClose: onClose
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", { }), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("div", {
children: [(0,external_wp_i18n_namespaceObject.__)("Child pages inherit characteristics from their parent, such as URL structure. For instance, if 'Web Design' is a child of 'Services,' its URL would be mysite.com/services/web-design."), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", { children: [/* translators: The domain name should be a reserved domain name to prevent linking to third party sites outside the WordPress project's control. You may also wish to use wordpress.org or a wordpress.org sub-domain. */
(0,external_wp_i18n_namespaceObject.__)("Child pages inherit characteristics from their parent, such as URL structure. For instance, if 'Web Design' is a child of 'Services', its URL would be example.org/services/web-design."), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)("p", {
children: [(0,external_wp_i18n_namespaceObject.__)('They also show up as sub-items in the default navigation menu. '), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, { children: [(0,external_wp_i18n_namespaceObject.__)('They also show up as sub-items in the default navigation menu. '), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.ExternalLink, {
href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'), href: (0,external_wp_i18n_namespaceObject.__)('https://wordpress.org/documentation/article/page-post-settings-sidebar/#page-attributes'),
children: (0,external_wp_i18n_namespaceObject.__)('Learn more') children: (0,external_wp_i18n_namespaceObject.__)('Learn more')
@ -16728,6 +16731,239 @@ const cloud = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exte
}); });
/* harmony default export */ const library_cloud = (cloud); /* harmony default export */ const library_cloud = (cloud);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-status/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const labels = {
'auto-draft': (0,external_wp_i18n_namespaceObject.__)('Draft'),
draft: (0,external_wp_i18n_namespaceObject.__)('Draft'),
pending: (0,external_wp_i18n_namespaceObject.__)('Pending'),
private: (0,external_wp_i18n_namespaceObject.__)('Private'),
future: (0,external_wp_i18n_namespaceObject.__)('Scheduled'),
publish: (0,external_wp_i18n_namespaceObject.__)('Published')
};
const STATUS_OPTIONS = [{
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Draft'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Not ready to publish.')
})]
}),
value: 'draft'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Pending'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Waiting for review before publishing.')
})]
}),
value: 'pending'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Private'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.')
})]
}),
value: 'private'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Scheduled'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Publish automatically on a chosen date.')
})]
}),
value: 'future'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Published'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.')
})]
}),
value: 'publish'
}];
const DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE];
function PostStatus() {
const {
status,
date,
password,
postId,
postType,
canEdit
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getCurrentPost$_link;
const {
getEditedPostAttribute,
getCurrentPostId,
getCurrentPostType,
getCurrentPost
} = select(store_store);
return {
status: getEditedPostAttribute('status'),
date: getEditedPostAttribute('date'),
password: getEditedPostAttribute('password'),
postId: getCurrentPostId(),
postType: getCurrentPostType(),
canEdit: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false
};
}, []);
const [showPassword, setShowPassword] = (0,external_wp_element_namespaceObject.useState)(!!password);
const passwordInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostStatus, 'editor-change-status__password-input');
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
// Memoize popoverProps to avoid returning a new object every time.
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
// Anchor the popover to the middle of the entire row so that it doesn't
// move around when the label changes.
anchor: popoverAnchor,
'aria-label': (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
headerTitle: (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
placement: 'left-start',
offset: 36,
shift: true
}), [popoverAnchor]);
if (DESIGN_POST_TYPES.includes(postType)) {
return null;
}
const updatePost = ({
status: newStatus = status,
password: newPassword = password,
date: newDate = date
}) => {
editEntityRecord('postType', postType, postId, {
status: newStatus,
date: newDate,
password: newPassword
});
};
const handleTogglePassword = value => {
setShowPassword(value);
if (!value) {
updatePost({
password: ''
});
}
};
const handleStatus = value => {
let newDate = date;
let newPassword = password;
if (status === 'future' && new Date(date) > new Date()) {
newDate = null;
}
if (value === 'private' && password) {
newPassword = '';
}
updatePost({
status: value,
date: newDate,
password: newPassword
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Status'),
ref: setPopoverAnchor,
children: canEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
className: "editor-post-status",
contentClassName: "editor-change-status__content",
popoverProps: popoverProps,
focusOnMount: true,
renderToggle: ({
onToggle
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
size: "compact",
onClick: onToggle,
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Current post status.
(0,external_wp_i18n_namespaceObject.__)('Change post status: %s'), labels[status]),
children: labels[status]
}),
renderContent: ({
onClose
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
title: (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
onClose: onClose
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 4,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
className: "editor-change-status__options",
hideLabelFromVision: true,
label: (0,external_wp_i18n_namespaceObject.__)('Status'),
options: STATUS_OPTIONS,
onChange: handleStatus,
selected: status === 'auto-draft' ? 'draft' : status
}), status === 'future' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-change-status__publish-date-wrapper",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostSchedule, {
showPopoverHeaderActions: false,
isCompact: true
})
}), status !== 'private' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
as: "fieldset",
spacing: 4,
className: "editor-change-status__password-fieldset",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Password protected'),
help: (0,external_wp_i18n_namespaceObject.__)('Only visible to those who know the password'),
checked: showPassword,
onChange: handleTogglePassword
}), showPassword && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-change-status__password-input",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Password'),
onChange: value => updatePost({
password: value
}),
value: password,
placeholder: (0,external_wp_i18n_namespaceObject.__)('Use a secure password'),
type: "text",
id: passwordInputId,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true
})
})]
})]
})
})]
})
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-post-status is-read-only",
children: labels[status]
})
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-saved-state/index.js
/** /**
* External dependencies * External dependencies
@ -16751,6 +16987,7 @@ const cloud = /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(exte
*/ */
/** /**
* Component showing whether the post is saved or not and providing save * Component showing whether the post is saved or not and providing save
* buttons. * buttons.
@ -16831,7 +17068,16 @@ function PostSavedState({
if (!hasPublishAction && isPending) { if (!hasPublishAction && isPending) {
return null; return null;
} }
if (isPublished || isScheduled || !['pending', 'draft', 'auto-draft'].includes(postStatus) || postStatusHasChanged && ['pending', 'draft'].includes(postStatus)) {
// We shouldn't render the button if the post has not one of the following statuses: pending, draft, auto-draft.
// The reason for this is that this button handles the `save as pending` and `save draft` actions.
// An exception for this is when the post has a custom status and there should be a way to save changes without
// having to publish. This should be handled better in the future when custom statuses have better support.
// @see https://github.com/WordPress/gutenberg/issues/3144.
const isIneligibleStatus = !['pending', 'draft', 'auto-draft'].includes(postStatus) && STATUS_OPTIONS.map(({
value
}) => value).includes(postStatus);
if (isPublished || isScheduled || isIneligibleStatus || postStatusHasChanged && ['pending', 'draft'].includes(postStatus)) {
return null; return null;
} }
@ -16935,7 +17181,7 @@ function PostScheduleCheck({
const DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE]; const panel_DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE];
/** /**
* Renders the Post Schedule Panel component. * Renders the Post Schedule Panel component.
@ -16959,7 +17205,7 @@ function PostSchedulePanel() {
const fullLabel = usePostScheduleLabel({ const fullLabel = usePostScheduleLabel({
full: true full: true
}); });
if (DESIGN_POST_TYPES.includes(postType)) { if (panel_DESIGN_POST_TYPES.includes(postType)) {
return null; return null;
} }
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleCheck, { return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PostScheduleCheck, {
@ -24914,8 +25160,8 @@ function getJsonFromItem(item) {
return JSON.stringify({ return JSON.stringify({
__file: item.type, __file: item.type,
title: item.title || item.name, title: item.title || item.name,
content: item.patternPost.content.raw, content: item?.patternPost?.content?.raw || item.content,
syncStatus: item.patternPost.wp_pattern_sync_status syncStatus: item?.patternPost?.wp_pattern_sync_status || item.wp_pattern_sync_status
}, null, 2); }, null, 2);
} }
const exportPatternAsJSONAction = { const exportPatternAsJSONAction = {
@ -24995,11 +25241,6 @@ function isTemplateRemovable(template) {
// two props whether is custom or has a theme file. // two props whether is custom or has a theme file.
return [template.source, template.templatePart?.source].includes(TEMPLATE_ORIGINS.custom) && !template.has_theme_file && !template.templatePart?.has_theme_file; return [template.source, template.templatePart?.source].includes(TEMPLATE_ORIGINS.custom) && !template.has_theme_file && !template.templatePart?.has_theme_file;
} }
const canDeleteOrReset = item => {
const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
const isUserPattern = item.type === actions_PATTERN_TYPES.user;
return isUserPattern || isTemplatePart && item.isCustom;
};
function getItemTitle(item) { function getItemTitle(item) {
if (typeof item.title === 'string') { if (typeof item.title === 'string') {
return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title); return (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(item.title);
@ -25140,12 +25381,9 @@ const trashPostAction = {
if (promiseResult.length === 1) { if (promiseResult.length === 1) {
successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The item's title. */ successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The item's title. */
(0,external_wp_i18n_namespaceObject.__)('"%s" moved to trash.'), getItemTitle(items[0])); (0,external_wp_i18n_namespaceObject.__)('"%s" moved to trash.'), getItemTitle(items[0]));
} else if (items[0].type === 'page') { } else {
successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */ successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */
(0,external_wp_i18n_namespaceObject._n)('%s item moved to trash.', '%s items moved to trash.', items.length), items.length); (0,external_wp_i18n_namespaceObject._n)('%s item moved to trash.', '%s items moved to trash.', items.length), items.length);
} else {
successMessage = (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of posts. */
(0,external_wp_i18n_namespaceObject.__)('%s items move to trash.'), items.length);
} }
createSuccessNotice(successMessage, { createSuccessNotice(successMessage, {
type: 'snackbar', type: 'snackbar',
@ -25620,18 +25858,11 @@ const duplicatePostAction = {
}); });
} }
}; };
const isTemplatePartRevertable = item => {
if (!item) {
return false;
}
const hasThemeFile = item.templatePart?.has_theme_file;
return canDeleteOrReset(item) && hasThemeFile;
};
const resetTemplateAction = { const resetTemplateAction = {
id: 'reset-template', id: 'reset-template',
label: (0,external_wp_i18n_namespaceObject.__)('Reset'), label: (0,external_wp_i18n_namespaceObject.__)('Reset'),
isEligible: item => { isEligible: item => {
return item.type === TEMPLATE_PART_POST_TYPE ? isTemplatePartRevertable(item) : isTemplateRevertable(item); return isTemplateRevertable(item);
}, },
icon: library_backup, icon: library_backup,
supportsBulk: true, supportsBulk: true,
@ -25644,8 +25875,7 @@ const resetTemplateAction = {
}) => { }) => {
const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false); const [isBusy, setIsBusy] = (0,external_wp_element_namespaceObject.useState)(false);
const { const {
revertTemplate, revertTemplate
removeTemplates
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store)); } = unlock((0,external_wp_data_namespaceObject.useDispatch)(store_store));
const { const {
saveEditedEntityRecord saveEditedEntityRecord
@ -25656,24 +25886,18 @@ const resetTemplateAction = {
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store); } = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_notices_namespaceObject.store);
const onConfirm = async () => { const onConfirm = async () => {
try { try {
if (items[0].type === TEMPLATE_PART_POST_TYPE) { for (const template of items) {
await removeTemplates(items); await revertTemplate(template, {
} else { allowUndo: false
for (const template of items) {
if (template.type === TEMPLATE_POST_TYPE) {
await revertTemplate(template, {
allowUndo: false
});
await saveEditedEntityRecord('postType', template.type, template.id);
}
}
createSuccessNotice(items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */
(0,external_wp_i18n_namespaceObject.__)('%s items reset.'), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */
(0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(items[0]))), {
type: 'snackbar',
id: 'revert-template-action'
}); });
await saveEditedEntityRecord('postType', template.type, template.id);
} }
createSuccessNotice(items.length > 1 ? (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The number of items. */
(0,external_wp_i18n_namespaceObject.__)('%s items reset.'), items.length) : (0,external_wp_i18n_namespaceObject.sprintf)( /* translators: The template/part's name. */
(0,external_wp_i18n_namespaceObject.__)('"%s" reset.'), (0,external_wp_htmlEntities_namespaceObject.decodeEntities)(getItemTitle(items[0]))), {
type: 'snackbar',
id: 'revert-template-action'
});
} catch (error) { } catch (error) {
let fallbackErrorMessage; let fallbackErrorMessage;
if (items[0].type === TEMPLATE_POST_TYPE) { if (items[0].type === TEMPLATE_POST_TYPE) {
@ -26341,239 +26565,6 @@ function PostPanelSection({
} }
/* harmony default export */ const post_panel_section = (PostPanelSection); /* harmony default export */ const post_panel_section = (PostPanelSection);
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/post-status/index.js
/**
* WordPress dependencies
*/
/**
* Internal dependencies
*/
const labels = {
'auto-draft': (0,external_wp_i18n_namespaceObject.__)('Draft'),
draft: (0,external_wp_i18n_namespaceObject.__)('Draft'),
pending: (0,external_wp_i18n_namespaceObject.__)('Pending'),
private: (0,external_wp_i18n_namespaceObject.__)('Private'),
future: (0,external_wp_i18n_namespaceObject.__)('Scheduled'),
publish: (0,external_wp_i18n_namespaceObject.__)('Published')
};
const STATUS_OPTIONS = [{
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Draft'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Not ready to publish.')
})]
}),
value: 'draft'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Pending'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Waiting for review before publishing.')
})]
}),
value: 'pending'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Private'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Only visible to site admins and editors.')
})]
}),
value: 'private'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Scheduled'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Publish automatically on a chosen date.')
})]
}),
value: 'future'
}, {
label: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [(0,external_wp_i18n_namespaceObject.__)('Published'), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.__experimentalText, {
variant: "muted",
size: 12,
children: (0,external_wp_i18n_namespaceObject.__)('Visible to everyone.')
})]
}),
value: 'publish'
}];
const post_status_DESIGN_POST_TYPES = [TEMPLATE_POST_TYPE, TEMPLATE_PART_POST_TYPE, PATTERN_POST_TYPE, NAVIGATION_POST_TYPE];
function PostStatus() {
const {
status,
date,
password,
postId,
postType,
canEdit
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
var _getCurrentPost$_link;
const {
getEditedPostAttribute,
getCurrentPostId,
getCurrentPostType,
getCurrentPost
} = select(store_store);
return {
status: getEditedPostAttribute('status'),
date: getEditedPostAttribute('date'),
password: getEditedPostAttribute('password'),
postId: getCurrentPostId(),
postType: getCurrentPostType(),
canEdit: (_getCurrentPost$_link = getCurrentPost()._links?.['wp:action-publish']) !== null && _getCurrentPost$_link !== void 0 ? _getCurrentPost$_link : false
};
}, []);
const [showPassword, setShowPassword] = (0,external_wp_element_namespaceObject.useState)(!!password);
const passwordInputId = (0,external_wp_compose_namespaceObject.useInstanceId)(PostStatus, 'editor-change-status__password-input');
const {
editEntityRecord
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_coreData_namespaceObject.store);
const [popoverAnchor, setPopoverAnchor] = (0,external_wp_element_namespaceObject.useState)(null);
// Memoize popoverProps to avoid returning a new object every time.
const popoverProps = (0,external_wp_element_namespaceObject.useMemo)(() => ({
// Anchor the popover to the middle of the entire row so that it doesn't
// move around when the label changes.
anchor: popoverAnchor,
'aria-label': (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
headerTitle: (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
placement: 'left-start',
offset: 36,
shift: true
}), [popoverAnchor]);
if (post_status_DESIGN_POST_TYPES.includes(postType)) {
return null;
}
const updatePost = ({
status: newStatus = status,
password: newPassword = password,
date: newDate = date
}) => {
editEntityRecord('postType', postType, postId, {
status: newStatus,
date: newDate,
password: newPassword
});
};
const handleTogglePassword = value => {
setShowPassword(value);
if (!value) {
updatePost({
password: ''
});
}
};
const handleStatus = value => {
let newDate = date;
let newPassword = password;
if (status === 'future' && new Date(date) > new Date()) {
newDate = null;
}
if (value === 'private' && password) {
newPassword = '';
}
updatePost({
status: value,
date: newDate,
password: newPassword
});
};
return /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(post_panel_row, {
label: (0,external_wp_i18n_namespaceObject.__)('Status'),
ref: setPopoverAnchor,
children: canEdit ? /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Dropdown, {
className: "editor-post-status",
contentClassName: "editor-change-status__content",
popoverProps: popoverProps,
focusOnMount: true,
renderToggle: ({
onToggle
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.Button, {
variant: "tertiary",
size: "compact",
onClick: onToggle,
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
// translators: %s: Current post status.
(0,external_wp_i18n_namespaceObject.__)('Change post status: %s'), labels[status]),
children: labels[status]
}),
renderContent: ({
onClose
}) => /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_ReactJSXRuntime_namespaceObject.Fragment, {
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_blockEditor_namespaceObject.__experimentalInspectorPopoverHeader, {
title: (0,external_wp_i18n_namespaceObject.__)('Status & visibility'),
onClose: onClose
}), /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("form", {
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
spacing: 4,
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.RadioControl, {
className: "editor-change-status__options",
hideLabelFromVision: true,
label: (0,external_wp_i18n_namespaceObject.__)('Status'),
options: STATUS_OPTIONS,
onChange: handleStatus,
selected: status === 'auto-draft' ? 'draft' : status
}), status === 'future' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-change-status__publish-date-wrapper",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(PrivatePostSchedule, {
showPopoverHeaderActions: false,
isCompact: true
})
}), status !== 'private' && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsxs)(external_wp_components_namespaceObject.__experimentalVStack, {
as: "fieldset",
spacing: 4,
className: "editor-change-status__password-fieldset",
children: [/*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.CheckboxControl, {
__nextHasNoMarginBottom: true,
label: (0,external_wp_i18n_namespaceObject.__)('Password protected'),
help: (0,external_wp_i18n_namespaceObject.__)('Only visible to those who know the password'),
checked: showPassword,
onChange: handleTogglePassword
}), showPassword && /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-change-status__password-input",
children: /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)(external_wp_components_namespaceObject.TextControl, {
label: (0,external_wp_i18n_namespaceObject.__)('Password'),
onChange: value => updatePost({
password: value
}),
value: password,
placeholder: (0,external_wp_i18n_namespaceObject.__)('Use a secure password'),
type: "text",
id: passwordInputId,
__next40pxDefaultSize: true,
__nextHasNoMarginBottom: true
})
})]
})]
})
})]
})
}) : /*#__PURE__*/(0,external_ReactJSXRuntime_namespaceObject.jsx)("div", {
className: "editor-post-status is-read-only",
children: labels[status]
})
});
}
;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/blog-title/index.js ;// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/blog-title/index.js
/** /**
* WordPress dependencies * WordPress dependencies

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.7-alpha-58691'; $wp_version = '6.7-alpha-58693';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.