Editor: Backport changes for WordPress packages added in 5.7.1
Props peterwilsoncc. See #52912. Built from https://develop.svn.wordpress.org/trunk@50760 git-svn-id: http://core.svn.wordpress.org/trunk@50369 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ac9f1a4685
commit
660443bbc7
File diff suppressed because one or more lines are too long
|
@ -134,6 +134,10 @@ function render_block_core_latest_posts( $attributes ) {
|
|||
|
||||
$trimmed_excerpt = get_the_excerpt( $post );
|
||||
|
||||
if ( post_password_required( $post ) ) {
|
||||
$trimmed_excerpt = __( 'This content is password protected.' );
|
||||
}
|
||||
|
||||
$list_items_markup .= sprintf(
|
||||
'<div class="wp-block-latest-posts__post-excerpt">%1$s</div>',
|
||||
$trimmed_excerpt
|
||||
|
@ -142,9 +146,16 @@ function render_block_core_latest_posts( $attributes ) {
|
|||
|
||||
if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent']
|
||||
&& isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) {
|
||||
|
||||
$post_content = wp_kses_post( html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ) );
|
||||
|
||||
if ( post_password_required( $post ) ) {
|
||||
$post_content = __( 'This content is password protected.' );
|
||||
}
|
||||
|
||||
$list_items_markup .= sprintf(
|
||||
'<div class="wp-block-latest-posts__post-full-content">%1$s</div>',
|
||||
wp_kses_post( html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ) )
|
||||
$post_content
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -723,6 +723,7 @@ figure.wp-block-gallery {
|
|||
bottom: 0;
|
||||
right: 0;
|
||||
z-index: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
.blocks-gallery-item figure.is-selected figcaption {
|
||||
z-index: 2;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -728,6 +728,7 @@ figure.wp-block-gallery {
|
|||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
pointer-events: none;
|
||||
}
|
||||
.blocks-gallery-item figure.is-selected figcaption {
|
||||
z-index: 2;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1495,10 +1495,6 @@ p.has-text-color a {
|
|||
color: inherit;
|
||||
}
|
||||
|
||||
p:empty::before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.wp-block-post-author {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1530,10 +1530,6 @@ p.has-text-color a {
|
|||
color: inherit;
|
||||
}
|
||||
|
||||
p:empty::before {
|
||||
content: "";
|
||||
}
|
||||
|
||||
.wp-block-post-author {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -20175,7 +20175,7 @@ function BlockTypesTab(_ref) {
|
|||
onHover: onHover,
|
||||
label: category.title
|
||||
}));
|
||||
}), !uncategorizedItems.length && Object(external_wp_element_["createElement"])(panel, {
|
||||
}), uncategorizedItems.length > 0 && Object(external_wp_element_["createElement"])(panel, {
|
||||
className: "block-editor-inserter__uncategorized-blocks-panel",
|
||||
title: Object(external_wp_i18n_["__"])('Uncategorized')
|
||||
}, Object(external_wp_element_["createElement"])(block_types_list, {
|
||||
|
@ -22413,7 +22413,16 @@ function InsertionPointPopover(_ref2) {
|
|||
if (event.target !== ref.current) {
|
||||
setIsInserterForced(true);
|
||||
}
|
||||
}
|
||||
} // Only show the inserter when there's a `nextElement` (a block after the
|
||||
// insertion point). At the end of the block list the trailing appender
|
||||
// should serve the purpose of inserting blocks.
|
||||
|
||||
|
||||
var showInsertionPointInserter = !isHidden && nextElement && (isInserterShown || isInserterForced); // Show the indicator if the insertion point inserter is visible, or if
|
||||
// the `showInsertionPoint` state is `true`. The latter is generally true
|
||||
// when hovering blocks for insertion in the block library.
|
||||
|
||||
var showInsertionPointIndicator = showInsertionPointInserter || !isHidden && showInsertionPoint;
|
||||
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
||||
// While ideally it would be enough to capture the
|
||||
// bubbling focus event from the Inserter, due to the
|
||||
|
@ -22422,7 +22431,6 @@ function InsertionPointPopover(_ref2) {
|
|||
//
|
||||
// See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
|
||||
|
||||
|
||||
return Object(external_wp_element_["createElement"])(external_wp_components_["Popover"], {
|
||||
noArrow: true,
|
||||
animate: false,
|
||||
|
@ -22437,9 +22445,9 @@ function InsertionPointPopover(_ref2) {
|
|||
onFocus: onFocus,
|
||||
className: className,
|
||||
style: style
|
||||
}, !isHidden && (showInsertionPoint || isInserterShown || isInserterForced) && Object(external_wp_element_["createElement"])("div", {
|
||||
}, showInsertionPointIndicator && Object(external_wp_element_["createElement"])("div", {
|
||||
className: "block-editor-block-list__insertion-point-indicator"
|
||||
}), !isHidden && (isInserterShown || isInserterForced) && Object(external_wp_element_["createElement"])(InsertionPointInserter, {
|
||||
}), showInsertionPointInserter && Object(external_wp_element_["createElement"])(InsertionPointInserter, {
|
||||
rootClientId: rootClientId,
|
||||
clientId: nextClientId,
|
||||
setIsInserterForced: setIsInserterForced
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2588,7 +2588,7 @@ var toConsumableArray = __webpack_require__(15);
|
|||
var defineProperty = __webpack_require__(5);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","coreData"]
|
||||
var external_wp_coreData_ = __webpack_require__(57);
|
||||
var external_wp_coreData_ = __webpack_require__(56);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","blockEditor"]
|
||||
var external_wp_blockEditor_ = __webpack_require__(6);
|
||||
|
@ -4703,6 +4703,8 @@ function (_super) {
|
|||
};
|
||||
|
||||
Cropper.prototype.componentWillUnmount = function () {
|
||||
var _a;
|
||||
|
||||
window.removeEventListener('resize', this.computeSizes);
|
||||
|
||||
if (this.containerRef) {
|
||||
|
@ -4711,7 +4713,7 @@ function (_super) {
|
|||
}
|
||||
|
||||
if (this.styleRef) {
|
||||
this.styleRef.remove();
|
||||
(_a = this.styleRef.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this.styleRef);
|
||||
}
|
||||
|
||||
this.cleanEvents();
|
||||
|
@ -9610,8 +9612,11 @@ function GalleryEdit(props) {
|
|||
}
|
||||
}, [linkTo]);
|
||||
var hasImages = !!images.length;
|
||||
var hasImageIds = hasImages && images.some(function (image) {
|
||||
return !!image.id;
|
||||
});
|
||||
var mediaPlaceholder = Object(external_wp_element_["createElement"])(external_wp_blockEditor_["MediaPlaceholder"], {
|
||||
addToGallery: hasImages,
|
||||
addToGallery: hasImageIds,
|
||||
isAppender: hasImages,
|
||||
disableMediaButtons: hasImages && !isSelected,
|
||||
icon: !hasImages && sharedIcon,
|
||||
|
@ -9623,7 +9628,7 @@ function GalleryEdit(props) {
|
|||
accept: "image/*",
|
||||
allowedTypes: edit_ALLOWED_MEDIA_TYPES,
|
||||
multiple: true,
|
||||
value: images,
|
||||
value: hasImageIds ? images : {},
|
||||
onError: onUploadError,
|
||||
notices: hasImages ? undefined : noticeUI,
|
||||
onFocus: onFocus
|
||||
|
@ -28388,7 +28393,7 @@ function _setPrototypeOf(o, p) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 57:
|
||||
/***/ 56:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = window["wp"]["coreData"]; }());
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -672,7 +672,7 @@ function _unsupportedIterableToArray(o, minLen) {
|
|||
/* harmony import */ var _wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_deprecated__WEBPACK_IMPORTED_MODULE_5__);
|
||||
/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(79);
|
||||
/* harmony import */ var _icon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(76);
|
||||
/* harmony import */ var _visually_hidden__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(56);
|
||||
/* harmony import */ var _visually_hidden__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(57);
|
||||
|
||||
|
||||
|
||||
|
@ -1739,7 +1739,8 @@ module.exports = function GetIntrinsic(name, allowMissing) {
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 56 */
|
||||
/* 56 */,
|
||||
/* 57 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
@ -1852,7 +1853,6 @@ function VisuallyHidden(_ref) {
|
|||
|
||||
|
||||
/***/ }),
|
||||
/* 57 */,
|
||||
/* 58 */
|
||||
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
|
@ -18169,7 +18169,7 @@ var CompositeItem = __webpack_require__(179);
|
|||
var build_module_tooltip = __webpack_require__(79);
|
||||
|
||||
// EXTERNAL MODULE: ./node_modules/@wordpress/components/build-module/visually-hidden/index.js + 1 modules
|
||||
var visually_hidden = __webpack_require__(56);
|
||||
var visually_hidden = __webpack_require__(57);
|
||||
|
||||
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/alignment-matrix-control/utils.js
|
||||
/**
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2797,7 +2797,7 @@ __webpack_require__.d(__webpack_exports__, "__experimentalMainDashboardButton",
|
|||
var external_wp_element_ = __webpack_require__(0);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","coreData"]
|
||||
var external_wp_coreData_ = __webpack_require__(57);
|
||||
var external_wp_coreData_ = __webpack_require__(56);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","blockEditor"]
|
||||
var external_wp_blockEditor_ = __webpack_require__(6);
|
||||
|
@ -8354,7 +8354,7 @@ function _setPrototypeOf(o, p) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 57:
|
||||
/***/ 56:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = window["wp"]["coreData"]; }());
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2009,7 +2009,7 @@ __webpack_require__.d(actions_namespaceObject, "updateBlockListSettings", functi
|
|||
var external_wp_blockEditor_ = __webpack_require__(6);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","coreData"]
|
||||
var external_wp_coreData_ = __webpack_require__(57);
|
||||
var external_wp_coreData_ = __webpack_require__(56);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","richText"]
|
||||
var external_wp_richText_ = __webpack_require__(21);
|
||||
|
@ -7615,6 +7615,7 @@ function PostAuthorSelect() {
|
|||
* WordPress dependencies
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
|
@ -7625,10 +7626,8 @@ var minimumUsersForCombobox = 25;
|
|||
|
||||
function PostAuthor() {
|
||||
var showCombobox = Object(external_wp_data_["useSelect"])(function (select) {
|
||||
var authors = select('core').getUsers({
|
||||
who: 'authors',
|
||||
per_page: minimumUsersForCombobox + 1
|
||||
});
|
||||
// Not using `getUsers()` because it requires `list_users` capability.
|
||||
var authors = select(external_wp_coreData_["store"]).getAuthors();
|
||||
return (authors === null || authors === void 0 ? void 0 : authors.length) >= minimumUsersForCombobox;
|
||||
}, []);
|
||||
|
||||
|
@ -11569,7 +11568,6 @@ var lib_default = /*#__PURE__*/__webpack_require__.n(lib);
|
|||
|
||||
|
||||
|
||||
var DEBOUNCE_TIME = 300;
|
||||
function PostTextEditor() {
|
||||
var postContent = Object(external_wp_data_["useSelect"])(function (select) {
|
||||
return select('core/editor').getEditedPostContent();
|
||||
|
@ -11594,18 +11592,6 @@ function PostTextEditor() {
|
|||
if (!isDirty && value !== postContent) {
|
||||
setValue(postContent);
|
||||
}
|
||||
|
||||
var saveText = function saveText() {
|
||||
var blocks = Object(external_wp_blocks_["parse"])(value);
|
||||
resetEditorBlocks(blocks);
|
||||
};
|
||||
|
||||
Object(external_wp_element_["useEffect"])(function () {
|
||||
var timeoutId = setTimeout(saveText, DEBOUNCE_TIME);
|
||||
return function () {
|
||||
clearTimeout(timeoutId);
|
||||
};
|
||||
}, [value]);
|
||||
/**
|
||||
* Handles a textarea change event to notify the onChange prop callback and
|
||||
* reflect the new value in the component's own state. This marks the start
|
||||
|
@ -11618,6 +11604,7 @@ function PostTextEditor() {
|
|||
* @param {Event} event Change event.
|
||||
*/
|
||||
|
||||
|
||||
var onChange = function onChange(event) {
|
||||
var newValue = event.target.value;
|
||||
editPost({
|
||||
|
@ -11635,7 +11622,8 @@ function PostTextEditor() {
|
|||
|
||||
var stopEditing = function stopEditing() {
|
||||
if (isDirty) {
|
||||
saveText();
|
||||
var blocks = Object(external_wp_blocks_["parse"])(value);
|
||||
resetEditorBlocks(blocks);
|
||||
setIsDirty(false);
|
||||
}
|
||||
};
|
||||
|
@ -12984,7 +12972,7 @@ function _setPrototypeOf(o, p) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 57:
|
||||
/***/ 56:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = window["wp"]["coreData"]; }());
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -164,7 +164,7 @@ __webpack_require__.d(selectors_namespaceObject, "__experimentalIsEditingReusabl
|
|||
var external_wp_blockEditor_ = __webpack_require__(6);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","coreData"]
|
||||
var external_wp_coreData_ = __webpack_require__(57);
|
||||
var external_wp_coreData_ = __webpack_require__(56);
|
||||
|
||||
// EXTERNAL MODULE: external ["wp","data"]
|
||||
var external_wp_data_ = __webpack_require__(4);
|
||||
|
@ -812,7 +812,7 @@ function _defineProperty(obj, key, value) {
|
|||
|
||||
/***/ }),
|
||||
|
||||
/***/ 57:
|
||||
/***/ 56:
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
(function() { module.exports = window["wp"]["coreData"]; }());
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.8-alpha-50759';
|
||||
$wp_version = '5.8-alpha-50760';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue