mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
Editor: second update of npm packages for 6.3 RC3.
Includes bug fixes for footnotes, patterns, command palette, top toolbar and other small regressions. Props andrewserong, spacedmonkey. See #58926. Built from https://develop.svn.wordpress.org/trunk@56332 git-svn-id: http://core.svn.wordpress.org/trunk@55844 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8fa9aad5e6
commit
3e103142ab
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -211,4 +211,77 @@ add_filter( '_wp_post_revision_fields', 'wp_add_footnotes_to_revision' );
|
||||
function wp_get_footnotes_from_revision( $revision_field, $field, $revision ) {
|
||||
return get_metadata( 'post', $revision->ID, $field, true );
|
||||
}
|
||||
add_filter( 'wp_post_revision_field_footnotes', 'wp_get_footnotes_from_revision', 10, 3 );
|
||||
add_filter( '_wp_post_revision_field_footnotes', 'wp_get_footnotes_from_revision', 10, 3 );
|
||||
|
||||
/**
|
||||
* The REST API autosave endpoint doesn't save meta, so we can use the
|
||||
* `wp_creating_autosave` when it updates an exiting autosave, and
|
||||
* `_wp_put_post_revision` when it creates a new autosave.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param int|array $autosave The autosave ID or array.
|
||||
*/
|
||||
function _wp_rest_api_autosave_meta( $autosave ) {
|
||||
// Ensure it's a REST API request.
|
||||
if ( ! defined( 'REST_REQUEST' ) || ! REST_REQUEST ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$body = rest_get_server()->get_raw_data();
|
||||
$body = json_decode( $body, true );
|
||||
|
||||
if ( ! isset( $body['meta']['footnotes'] ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// `wp_creating_autosave` passes the array,
|
||||
// `_wp_put_post_revision` passes the ID.
|
||||
$id = is_int( $autosave ) ? $autosave : $autosave['ID'];
|
||||
|
||||
if ( ! $id ) {
|
||||
return;
|
||||
}
|
||||
|
||||
update_post_meta( $id, 'footnotes', $body['meta']['footnotes'] );
|
||||
}
|
||||
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
|
||||
add_action( 'wp_creating_autosave', '_wp_rest_api_autosave_meta' );
|
||||
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L398.
|
||||
// Then https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/revision.php#L367.
|
||||
add_action( '_wp_put_post_revision', '_wp_rest_api_autosave_meta' );
|
||||
|
||||
/**
|
||||
* This is a workaround for the autosave endpoint returning early if the
|
||||
* revision field are equal. The problem is that "footnotes" is not real
|
||||
* revision post field, so there's nothing to compare against.
|
||||
*
|
||||
* This trick sets the "footnotes" field (value doesn't matter), which will
|
||||
* cause the autosave endpoint to always update the latest revision. That should
|
||||
* be fine, it should be ok to update the revision even if nothing changed. Of
|
||||
* course, this is temporary fix.
|
||||
*
|
||||
* @since 6.3.0
|
||||
*
|
||||
* @param WP_Post $prepared_post The prepared post object.
|
||||
* @param WP_REST_Request $request The request object.
|
||||
*
|
||||
* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L365-L384.
|
||||
* See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L219.
|
||||
*/
|
||||
function _wp_rest_api_force_autosave_difference( $prepared_post, $request ) {
|
||||
// We only want to be altering POST requests.
|
||||
if ( $request->get_method() !== 'POST' ) {
|
||||
return $prepared_post;
|
||||
}
|
||||
|
||||
// Only alter requests for the '/autosaves' route.
|
||||
if ( substr( $request->get_route(), -strlen( '/autosaves' ) ) !== '/autosaves' ) {
|
||||
return $prepared_post;
|
||||
}
|
||||
|
||||
$prepared_post->footnotes = '[]';
|
||||
return $prepared_post;
|
||||
}
|
||||
|
||||
add_filter( 'rest_pre_insert_post', '_wp_rest_api_force_autosave_difference', 10, 2 );
|
||||
|
10
wp-includes/css/dist/block-editor/style-rtl.css
vendored
10
wp-includes/css/dist/block-editor/style-rtl.css
vendored
@ -221,6 +221,14 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
|
||||
.block-editor-block-contextual-toolbar:has(.block-editor-block-toolbar:empty){
|
||||
display:none;
|
||||
}
|
||||
.block-editor-block-contextual-toolbar.is-collapsed:after{
|
||||
background:linear-gradient(270deg, #fff, transparent);
|
||||
content:"";
|
||||
height:100%;
|
||||
position:absolute;
|
||||
right:100%;
|
||||
width:48px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.block-editor-block-contextual-toolbar.is-fixed{
|
||||
border-bottom:none;
|
||||
@ -363,7 +371,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
|
||||
width:auto;
|
||||
}
|
||||
.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
|
||||
width:calc(100% - 496px);
|
||||
width:calc(100% - 536px);
|
||||
}
|
||||
}
|
||||
.block-editor-block-list__block-selection-button{
|
||||
|
File diff suppressed because one or more lines are too long
10
wp-includes/css/dist/block-editor/style.css
vendored
10
wp-includes/css/dist/block-editor/style.css
vendored
@ -221,6 +221,14 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
|
||||
.block-editor-block-contextual-toolbar:has(.block-editor-block-toolbar:empty){
|
||||
display:none;
|
||||
}
|
||||
.block-editor-block-contextual-toolbar.is-collapsed:after{
|
||||
background:linear-gradient(90deg, #fff, transparent);
|
||||
content:"";
|
||||
height:100%;
|
||||
left:100%;
|
||||
position:absolute;
|
||||
width:48px;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.block-editor-block-contextual-toolbar.is-fixed{
|
||||
border-bottom:none;
|
||||
@ -363,7 +371,7 @@ body.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
|
||||
width:auto;
|
||||
}
|
||||
.is-fullscreen-mode .block-editor-block-contextual-toolbar.is-fixed{
|
||||
width:calc(100% - 496px);
|
||||
width:calc(100% - 536px);
|
||||
}
|
||||
}
|
||||
.block-editor-block-list__block-selection-button{
|
||||
|
File diff suppressed because one or more lines are too long
1
wp-includes/css/dist/edit-post/style-rtl.css
vendored
1
wp-includes/css/dist/edit-post/style-rtl.css
vendored
@ -770,6 +770,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
||||
.edit-post-header-toolbar__left{
|
||||
align-items:center;
|
||||
display:inline-flex;
|
||||
margin-left:8px;
|
||||
padding-right:8px;
|
||||
}
|
||||
@media (min-width:600px){
|
||||
|
File diff suppressed because one or more lines are too long
1
wp-includes/css/dist/edit-post/style.css
vendored
1
wp-includes/css/dist/edit-post/style.css
vendored
@ -770,6 +770,7 @@ body.is-fullscreen-mode .interface-interface-skeleton{
|
||||
.edit-post-header-toolbar__left{
|
||||
align-items:center;
|
||||
display:inline-flex;
|
||||
margin-right:8px;
|
||||
padding-left:8px;
|
||||
}
|
||||
@media (min-width:600px){
|
||||
|
2
wp-includes/css/dist/edit-post/style.min.css
vendored
2
wp-includes/css/dist/edit-post/style.min.css
vendored
File diff suppressed because one or more lines are too long
17
wp-includes/css/dist/edit-site/style-rtl.css
vendored
17
wp-includes/css/dist/edit-site/style-rtl.css
vendored
@ -1300,6 +1300,9 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
||||
min-width:0;
|
||||
width:min(100%, 450px);
|
||||
}
|
||||
.has-fixed-toolbar .edit-site-document-actions{
|
||||
width:min(100%, 380px);
|
||||
}
|
||||
.edit-site-document-actions .components-button:hover{
|
||||
background:#e0e0e0;
|
||||
color:var(--wp-block-synced-color);
|
||||
@ -2479,28 +2482,28 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.edit-site-layout__sidebar{
|
||||
.edit-site-layout__sidebar-region{
|
||||
flex-shrink:0;
|
||||
width:100vw;
|
||||
z-index:1;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.edit-site-layout__sidebar{
|
||||
.edit-site-layout__sidebar-region{
|
||||
width:360px;
|
||||
}
|
||||
}
|
||||
.edit-site-layout.is-full-canvas .edit-site-layout__sidebar{
|
||||
.edit-site-layout.is-full-canvas .edit-site-layout__sidebar-region{
|
||||
height:100vh;
|
||||
position:fixed !important;
|
||||
right:0;
|
||||
top:0;
|
||||
}
|
||||
.edit-site-layout__sidebar>div{
|
||||
.edit-site-layout__sidebar-region .edit-site-layout__sidebar{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
height:100%;
|
||||
}
|
||||
.edit-site-layout__sidebar .resizable-editor__drag-handle{
|
||||
.edit-site-layout__sidebar-region .resizable-editor__drag-handle{
|
||||
left:0;
|
||||
}
|
||||
|
||||
@ -2829,6 +2832,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
|
||||
.edit-site-sidebar-navigation-screen__main{
|
||||
flex-grow:1;
|
||||
margin-bottom:16px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__main.has-footer{
|
||||
margin-bottom:0;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content{
|
||||
|
File diff suppressed because one or more lines are too long
17
wp-includes/css/dist/edit-site/style.css
vendored
17
wp-includes/css/dist/edit-site/style.css
vendored
@ -1300,6 +1300,9 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
|
||||
min-width:0;
|
||||
width:min(100%, 450px);
|
||||
}
|
||||
.has-fixed-toolbar .edit-site-document-actions{
|
||||
width:min(100%, 380px);
|
||||
}
|
||||
.edit-site-document-actions .components-button:hover{
|
||||
background:#e0e0e0;
|
||||
color:var(--wp-block-synced-color);
|
||||
@ -2479,28 +2482,28 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
height:100%;
|
||||
}
|
||||
|
||||
.edit-site-layout__sidebar{
|
||||
.edit-site-layout__sidebar-region{
|
||||
flex-shrink:0;
|
||||
width:100vw;
|
||||
z-index:1;
|
||||
}
|
||||
@media (min-width:782px){
|
||||
.edit-site-layout__sidebar{
|
||||
.edit-site-layout__sidebar-region{
|
||||
width:360px;
|
||||
}
|
||||
}
|
||||
.edit-site-layout.is-full-canvas .edit-site-layout__sidebar{
|
||||
.edit-site-layout.is-full-canvas .edit-site-layout__sidebar-region{
|
||||
height:100vh;
|
||||
left:0;
|
||||
position:fixed !important;
|
||||
top:0;
|
||||
}
|
||||
.edit-site-layout__sidebar>div{
|
||||
.edit-site-layout__sidebar-region .edit-site-layout__sidebar{
|
||||
display:flex;
|
||||
flex-direction:column;
|
||||
height:100%;
|
||||
}
|
||||
.edit-site-layout__sidebar .resizable-editor__drag-handle{
|
||||
.edit-site-layout__sidebar-region .resizable-editor__drag-handle{
|
||||
right:0;
|
||||
}
|
||||
|
||||
@ -2829,6 +2832,10 @@ body.is-fullscreen-mode .edit-site .components-editor-notices__snackbar{
|
||||
|
||||
.edit-site-sidebar-navigation-screen__main{
|
||||
flex-grow:1;
|
||||
margin-bottom:16px;
|
||||
}
|
||||
.edit-site-sidebar-navigation-screen__main.has-footer{
|
||||
margin-bottom:0;
|
||||
}
|
||||
|
||||
.edit-site-sidebar-navigation-screen__content{
|
||||
|
2
wp-includes/css/dist/edit-site/style.min.css
vendored
2
wp-includes/css/dist/edit-site/style.min.css
vendored
File diff suppressed because one or more lines are too long
12035
wp-includes/js/dist/block-editor.js
vendored
12035
wp-includes/js/dist/block-editor.js
vendored
File diff suppressed because it is too large
Load Diff
4
wp-includes/js/dist/block-editor.min.js
vendored
4
wp-includes/js/dist/block-editor.min.js
vendored
File diff suppressed because one or more lines are too long
79
wp-includes/js/dist/block-library.js
vendored
79
wp-includes/js/dist/block-library.js
vendored
@ -24407,8 +24407,8 @@ function image_Image({
|
||||
ref: imageRef,
|
||||
className: borderProps.className,
|
||||
style: {
|
||||
width: width && height || aspectRatio ? '100%' : 'inherit',
|
||||
height: width && height || aspectRatio ? '100%' : 'inherit',
|
||||
width: width && height || aspectRatio ? '100%' : undefined,
|
||||
height: width && height || aspectRatio ? '100%' : undefined,
|
||||
objectFit: scale,
|
||||
...borderProps.style
|
||||
}
|
||||
@ -35988,6 +35988,11 @@ const nextpage_init = () => initBlock({
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
||||
|
||||
|
||||
const PatternEdit = ({
|
||||
attributes,
|
||||
@ -35997,7 +36002,14 @@ const PatternEdit = ({
|
||||
const {
|
||||
replaceBlocks,
|
||||
__unstableMarkNextChangeAsNotPersistent
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store); // Run this effect when the component loads.
|
||||
} = (0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store);
|
||||
const {
|
||||
setBlockEditingMode
|
||||
} = unlock((0,external_wp_data_namespaceObject.useDispatch)(external_wp_blockEditor_namespaceObject.store));
|
||||
const {
|
||||
getBlockRootClientId,
|
||||
getBlockEditingMode
|
||||
} = unlock((0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store)); // Run this effect when the component loads.
|
||||
// This adds the Pattern's contents to the post.
|
||||
// This change won't be saved.
|
||||
// It will continue to pull from the pattern file unless changes are made to its respective template part.
|
||||
@ -36010,16 +36022,27 @@ const PatternEdit = ({
|
||||
// because nested pattern blocks cannot be inserted if the parent block supports
|
||||
// inner blocks but doesn't have blockSettings in the state.
|
||||
window.queueMicrotask(() => {
|
||||
// Clone blocks from the pattern before insertion to ensure they receive
|
||||
const rootClientId = getBlockRootClientId(clientId); // Clone blocks from the pattern before insertion to ensure they receive
|
||||
// distinct client ids. See https://github.com/WordPress/gutenberg/issues/50628.
|
||||
|
||||
const clonedBlocks = selectedPattern.blocks.map(block => (0,external_wp_blocks_namespaceObject.cloneBlock)(block));
|
||||
const rootEditingMode = getBlockEditingMode(rootClientId); // Temporarily set the root block to default mode to allow replacing the pattern.
|
||||
// This could happen when the page is disabling edits of non-content blocks.
|
||||
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
replaceBlocks(clientId, clonedBlocks);
|
||||
setBlockEditingMode(rootClientId, 'default');
|
||||
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
replaceBlocks(clientId, clonedBlocks); // Restore the root block's original mode.
|
||||
|
||||
__unstableMarkNextChangeAsNotPersistent();
|
||||
|
||||
setBlockEditingMode(rootClientId, rootEditingMode);
|
||||
});
|
||||
}
|
||||
}, [clientId, selectedPattern?.blocks, __unstableMarkNextChangeAsNotPersistent, replaceBlocks]);
|
||||
}, [clientId, selectedPattern?.blocks, __unstableMarkNextChangeAsNotPersistent, replaceBlocks, getBlockEditingMode, setBlockEditingMode, getBlockRootClientId]);
|
||||
const props = (0,external_wp_blockEditor_namespaceObject.useBlockProps)();
|
||||
return (0,external_wp_element_namespaceObject.createElement)("div", { ...props
|
||||
});
|
||||
@ -58650,6 +58673,8 @@ const {
|
||||
usesContextKey
|
||||
} = unlock(external_wp_blockEditor_namespaceObject.privateApis);
|
||||
const formatName = 'core/footnote';
|
||||
const POST_CONTENT_BLOCK_NAME = 'core/post-content';
|
||||
const SYNCED_PATTERN_BLOCK_NAME = 'core/block';
|
||||
const format = {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Footnote'),
|
||||
tagName: 'sup',
|
||||
@ -58670,11 +58695,27 @@ const format = {
|
||||
const registry = (0,external_wp_data_namespaceObject.useRegistry)();
|
||||
const {
|
||||
getSelectedBlockClientId,
|
||||
getBlocks,
|
||||
getBlockRootClientId,
|
||||
getBlockName,
|
||||
getBlocks
|
||||
getBlockParentsByBlockName
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_blockEditor_namespaceObject.store);
|
||||
const footnotesBlockType = (0,external_wp_data_namespaceObject.useSelect)(select => select(external_wp_blocks_namespaceObject.store).getBlockType(format_name));
|
||||
/*
|
||||
* This useSelect exists because we need to use its return value
|
||||
* outside the event callback.
|
||||
*/
|
||||
|
||||
const isBlockWithinPattern = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
const {
|
||||
getBlockParentsByBlockName: _getBlockParentsByBlockName,
|
||||
getSelectedBlockClientId: _getSelectedBlockClientId
|
||||
} = select(external_wp_blockEditor_namespaceObject.store);
|
||||
|
||||
const parentCoreBlocks = _getBlockParentsByBlockName(_getSelectedBlockClientId(), SYNCED_PATTERN_BLOCK_NAME);
|
||||
|
||||
return parentCoreBlocks && parentCoreBlocks.length > 0;
|
||||
}, []);
|
||||
const {
|
||||
selectionChange,
|
||||
insertBlock
|
||||
@ -58686,6 +58727,11 @@ const format = {
|
||||
|
||||
if (postType !== 'post' && postType !== 'page') {
|
||||
return null;
|
||||
} // Checks if the selected block lives within a pattern.
|
||||
|
||||
|
||||
if (isBlockWithinPattern) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function onClick() {
|
||||
@ -58706,12 +58752,22 @@ const format = {
|
||||
}, value.end, value.end);
|
||||
newValue.start = newValue.end - 1;
|
||||
onChange(newValue);
|
||||
} // BFS search to find the first footnote block.
|
||||
}
|
||||
|
||||
const selectedClientId = getSelectedBlockClientId();
|
||||
/*
|
||||
* Attempts to find a common parent post content block.
|
||||
* This allows for locating blocks within a page edited in the site editor.
|
||||
*/
|
||||
|
||||
const parentPostContent = getBlockParentsByBlockName(selectedClientId, POST_CONTENT_BLOCK_NAME); // When called with a post content block, getBlocks will return
|
||||
// the block with controlled inner blocks included.
|
||||
|
||||
const blocks = parentPostContent.length ? getBlocks(parentPostContent[0]) : getBlocks(); // BFS search to find the first footnote block.
|
||||
|
||||
let fnBlock = null;
|
||||
{
|
||||
const queue = [...getBlocks()];
|
||||
const queue = [...blocks];
|
||||
|
||||
while (queue.length) {
|
||||
const block = queue.shift();
|
||||
@ -58728,10 +58784,9 @@ const format = {
|
||||
// insert it at the bottom.
|
||||
|
||||
if (!fnBlock) {
|
||||
const clientId = getSelectedBlockClientId();
|
||||
let rootClientId = getBlockRootClientId(clientId);
|
||||
let rootClientId = getBlockRootClientId(selectedClientId);
|
||||
|
||||
while (rootClientId && getBlockName(rootClientId) !== 'core/post-content') {
|
||||
while (rootClientId && getBlockName(rootClientId) !== POST_CONTENT_BLOCK_NAME) {
|
||||
rootClientId = getBlockRootClientId(rootClientId);
|
||||
}
|
||||
|
||||
|
4
wp-includes/js/dist/block-library.min.js
vendored
4
wp-includes/js/dist/block-library.min.js
vendored
File diff suppressed because one or more lines are too long
14
wp-includes/js/dist/blocks.js
vendored
14
wp-includes/js/dist/blocks.js
vendored
@ -10516,15 +10516,15 @@ function getBlockProps(props = {}) {
|
||||
function getInnerBlocksProps(props = {}) {
|
||||
const {
|
||||
innerBlocks
|
||||
} = innerBlocksPropsProvider;
|
||||
const [firstBlock] = innerBlocks !== null && innerBlocks !== void 0 ? innerBlocks : [];
|
||||
if (!firstBlock) return props; // If the innerBlocks passed to `getSaveElement` are not blocks but already
|
||||
// components, return the props as is. This is the case for
|
||||
// `getRichTextValues`.
|
||||
} = innerBlocksPropsProvider; // Allow a different component to be passed to getSaveElement to handle
|
||||
// inner blocks, bypassing the default serialisation.
|
||||
|
||||
if (!firstBlock.clientId) return { ...props,
|
||||
if (!Array.isArray(innerBlocks)) {
|
||||
return { ...props,
|
||||
children: innerBlocks
|
||||
}; // Value is an array of blocks, so defer to block serializer.
|
||||
};
|
||||
} // Value is an array of blocks, so defer to block serializer.
|
||||
|
||||
|
||||
const html = serialize(innerBlocks, {
|
||||
isInnerBlocks: true
|
||||
|
2
wp-includes/js/dist/blocks.min.js
vendored
2
wp-includes/js/dist/blocks.min.js
vendored
File diff suppressed because one or more lines are too long
6
wp-includes/js/dist/commands.js
vendored
6
wp-includes/js/dist/commands.js
vendored
@ -3949,7 +3949,11 @@ function CommandMenu() {
|
||||
}
|
||||
});
|
||||
}, [registerShortcut]);
|
||||
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/commands', event => {
|
||||
(0,external_wp_keyboardShortcuts_namespaceObject.useShortcut)('core/commands',
|
||||
/** @type {import('react').KeyboardEventHandler} */
|
||||
event => {
|
||||
// Bails to avoid obscuring the effect of the preceding handler(s).
|
||||
if (event.defaultPrevented) return;
|
||||
event.preventDefault();
|
||||
|
||||
if (isOpen) {
|
||||
|
2
wp-includes/js/dist/commands.min.js
vendored
2
wp-includes/js/dist/commands.min.js
vendored
File diff suppressed because one or more lines are too long
2
wp-includes/js/dist/core-data.js
vendored
2
wp-includes/js/dist/core-data.js
vendored
@ -2196,7 +2196,7 @@ const saveEntityRecord = (kind, name, record, {
|
||||
...record
|
||||
};
|
||||
data = Object.keys(data).reduce((acc, key) => {
|
||||
if (['title', 'excerpt', 'content'].includes(key)) {
|
||||
if (['title', 'excerpt', 'content', 'meta'].includes(key)) {
|
||||
acc[key] = data[key];
|
||||
}
|
||||
|
||||
|
2
wp-includes/js/dist/core-data.min.js
vendored
2
wp-includes/js/dist/core-data.min.js
vendored
File diff suppressed because one or more lines are too long
80
wp-includes/js/dist/edit-site.js
vendored
80
wp-includes/js/dist/edit-site.js
vendored
@ -5454,6 +5454,10 @@ function SidebarButton(props) {
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen/index.js
|
||||
|
||||
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
|
||||
/**
|
||||
* WordPress dependencies
|
||||
*/
|
||||
@ -5463,6 +5467,7 @@ function SidebarButton(props) {
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
@ -5502,7 +5507,9 @@ function SidebarNavigationScreen({
|
||||
const theme = getTheme(currentlyPreviewingTheme());
|
||||
const icon = (0,external_wp_i18n_namespaceObject.isRTL)() ? chevron_right : chevron_left;
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
|
||||
className: "edit-site-sidebar-navigation-screen__main",
|
||||
className: classnames_default()('edit-site-sidebar-navigation-screen__main', {
|
||||
'has-footer': !!footer
|
||||
}),
|
||||
spacing: 0,
|
||||
justify: "flex-start"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
||||
@ -7009,36 +7016,9 @@ function SidebarNavigationScreenGlobalStylesContent() {
|
||||
}
|
||||
|
||||
function SidebarNavigationScreenGlobalStylesFooter({
|
||||
modifiedDateTime,
|
||||
onClickRevisions
|
||||
}) {
|
||||
const {
|
||||
revisions,
|
||||
isLoading
|
||||
} = useGlobalStylesRevisions();
|
||||
const {
|
||||
revisionsCount
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
var _globalStyles$_links$;
|
||||
|
||||
const {
|
||||
getEntityRecord,
|
||||
__experimentalGetCurrentGlobalStylesId
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
|
||||
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
||||
|
||||
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
||||
return {
|
||||
revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
|
||||
};
|
||||
}, []);
|
||||
const hasRevisions = revisionsCount >= 2;
|
||||
const modified = revisions?.[0]?.modified;
|
||||
|
||||
if (!hasRevisions || isLoading || !modified) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalVStack, {
|
||||
className: "edit-site-sidebar-navigation-screen-global-styles__footer"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationItem, {
|
||||
@ -7054,8 +7034,8 @@ function SidebarNavigationScreenGlobalStylesFooter({
|
||||
}, (0,external_wp_element_namespaceObject.createElement)("span", {
|
||||
className: "edit-site-sidebar-navigation-screen-global-styles__revisions__label"
|
||||
}, (0,external_wp_i18n_namespaceObject.__)('Last modified')), (0,external_wp_element_namespaceObject.createElement)("span", null, (0,external_wp_element_namespaceObject.createElement)("time", {
|
||||
dateTime: modified
|
||||
}, (0,external_wp_date_namespaceObject.humanTimeDiff)(modified))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
||||
dateTime: modifiedDateTime
|
||||
}, (0,external_wp_date_namespaceObject.humanTimeDiff)(modifiedDateTime))), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Icon, {
|
||||
icon: library_backup,
|
||||
style: {
|
||||
fill: 'currentcolor'
|
||||
@ -7064,6 +7044,10 @@ function SidebarNavigationScreenGlobalStylesFooter({
|
||||
}
|
||||
|
||||
function SidebarNavigationScreenGlobalStyles() {
|
||||
const {
|
||||
revisions,
|
||||
isLoading: isLoadingRevisions
|
||||
} = useGlobalStylesRevisions();
|
||||
const {
|
||||
openGeneralSidebar,
|
||||
setIsListViewOpened
|
||||
@ -7084,15 +7068,27 @@ function SidebarNavigationScreenGlobalStyles() {
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(external_wp_preferences_namespaceObject.store);
|
||||
const {
|
||||
isViewMode,
|
||||
isStyleBookOpened
|
||||
isStyleBookOpened,
|
||||
revisionsCount
|
||||
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
||||
var _globalStyles$_links$;
|
||||
|
||||
const {
|
||||
getCanvasMode,
|
||||
getEditorCanvasContainerView
|
||||
} = unlock(select(store_store));
|
||||
const {
|
||||
getEntityRecord,
|
||||
__experimentalGetCurrentGlobalStylesId
|
||||
} = select(external_wp_coreData_namespaceObject.store);
|
||||
|
||||
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
||||
|
||||
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
||||
return {
|
||||
isViewMode: 'view' === getCanvasMode(),
|
||||
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView()
|
||||
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
||||
revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
|
||||
};
|
||||
}, []);
|
||||
const turnOffDistractionFreeMode = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
||||
@ -7127,12 +7123,17 @@ function SidebarNavigationScreenGlobalStyles() {
|
||||
// has been set to 'global-styles-revisions'.
|
||||
|
||||
setEditorCanvasContainerView('global-styles-revisions');
|
||||
}, [openGlobalStyles, setEditorCanvasContainerView]);
|
||||
}, [openGlobalStyles, setEditorCanvasContainerView]); // If there are no revisions, do not render a footer.
|
||||
|
||||
const hasRevisions = revisionsCount >= 2;
|
||||
const modifiedDateTime = revisions?.[0]?.modified;
|
||||
const shouldShowGlobalStylesFooter = hasRevisions && !isLoadingRevisions && modifiedDateTime;
|
||||
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreen, {
|
||||
title: (0,external_wp_i18n_namespaceObject.__)('Styles'),
|
||||
description: (0,external_wp_i18n_namespaceObject.__)('Choose a different style combination for the theme styles.'),
|
||||
content: (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenGlobalStylesContent, null),
|
||||
footer: (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenGlobalStylesFooter, {
|
||||
footer: shouldShowGlobalStylesFooter && (0,external_wp_element_namespaceObject.createElement)(SidebarNavigationScreenGlobalStylesFooter, {
|
||||
modifiedDateTime: modifiedDateTime,
|
||||
onClickRevisions: openRevisions
|
||||
}),
|
||||
actions: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, !isMobileViewport && (0,external_wp_element_namespaceObject.createElement)(SidebarButton, {
|
||||
@ -10915,7 +10916,7 @@ function NavigationMenuContent({
|
||||
showAppender: false
|
||||
}), (0,external_wp_element_namespaceObject.createElement)("div", {
|
||||
className: "edit-site-sidebar-navigation-screen-navigation-menus__helper-block-editor"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockTools, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, null))));
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_blockEditor_namespaceObject.BlockList, null)));
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./node_modules/@wordpress/edit-site/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js
|
||||
@ -17064,7 +17065,7 @@ function useDisableNonPageContentBlocks() {
|
||||
}, []);
|
||||
}
|
||||
const withDisableNonPageContentBlocks = (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(BlockEdit => props => {
|
||||
const isDescendentOfQueryLoop = !!props.context.queryId;
|
||||
const isDescendentOfQueryLoop = props.context.queryId !== undefined;
|
||||
const isPageContent = PAGE_CONTENT_BLOCK_TYPES.includes(props.name) && !isDescendentOfQueryLoop;
|
||||
const mode = isPageContent ? 'contentOnly' : undefined;
|
||||
disable_non_page_content_blocks_useBlockEditingMode(mode);
|
||||
@ -23794,6 +23795,9 @@ function Layout() {
|
||||
}
|
||||
}, (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)(NavigableRegion, {
|
||||
ariaLabel: (0,external_wp_i18n_namespaceObject.__)('Navigation'),
|
||||
className: "edit-site-layout__sidebar-region"
|
||||
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__unstableMotion.div, {
|
||||
// The sidebar is needed for routing on mobile
|
||||
// (https://github.com/WordPress/gutenberg/pull/51558/files#r1231763003),
|
||||
@ -23810,8 +23814,6 @@ function Layout() {
|
||||
ease: 'easeOut'
|
||||
},
|
||||
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", {
|
||||
className: classnames_default()('edit-site-layout__canvas-container', {
|
||||
'is-resizing': isResizing
|
||||
|
6
wp-includes/js/dist/edit-site.min.js
vendored
6
wp-includes/js/dist/edit-site.min.js
vendored
File diff suppressed because one or more lines are too long
4
wp-includes/js/dist/editor.js
vendored
4
wp-includes/js/dist/editor.js
vendored
@ -2896,10 +2896,10 @@ const isEditedPostAutosaveable = (0,external_wp_data_namespaceObject.createRegis
|
||||
|
||||
if (hasChangedContent(state)) {
|
||||
return true;
|
||||
} // If the title or excerpt has changed, the post is autosaveable.
|
||||
} // If title, excerpt, or meta have changed, the post is autosaveable.
|
||||
|
||||
|
||||
return ['title', 'excerpt'].some(field => getPostRawValue(autosave[field]) !== getEditedPostAttribute(state, field));
|
||||
return ['title', 'excerpt', 'meta'].some(field => getPostRawValue(autosave[field]) !== getEditedPostAttribute(state, field));
|
||||
});
|
||||
/**
|
||||
* Return true if the post being edited is being scheduled. Preferring the
|
||||
|
2
wp-includes/js/dist/editor.min.js
vendored
2
wp-includes/js/dist/editor.min.js
vendored
File diff suppressed because one or more lines are too long
@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.4-alpha-56331';
|
||||
$wp_version = '6.4-alpha-56332';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user