Block Editor: Upgrade WordPress packages to the latest versions.

Updated packages:

 - @wordpress/annotations@1.2.3
 - @wordpress/block-editor@2.0.2
 - @wordpress/block-library@2.4.5
 - @wordpress/blocks@6.2.5
 - @wordpress/components@7.3.2
 - @wordpress/dom@2.2.5
 - @wordpress/e2e-tests@1.1.5
 - @wordpress/edit-post@3.3.5
 - @wordpress/editor@9.2.5
 - @wordpress/format-library@1.4.5
 - @wordpress/list-reusable-blocks@1.3.5
 - @wordpress/nux@3.2.5
 - @wordpress/rich-text@3.2.3

Props: youknowriad, gwwar, iseulde, tfrommen, gziolo.

Merges [45319] to the 5.2 branch.
Fixes #47284.

Built from https://develop.svn.wordpress.org/branches/5.2@45320


git-svn-id: http://core.svn.wordpress.org/branches/5.2@45131 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
aduth 2019-05-16 18:12:57 +00:00
parent 64f5990104
commit 6400dfff00
14 changed files with 114 additions and 65 deletions

View File

@ -13917,7 +13917,8 @@ function applyInternetExplorerInputFix(editorNode) {
}
var IS_PLACEHOLDER_VISIBLE_ATTR_NAME = 'data-is-placeholder-visible';
var CLASS_NAME = 'editor-rich-text__editable block-editor-rich-text__editable';
var oldClassName = 'editor-rich-text__editable';
var editable_className = 'block-editor-rich-text__editable';
/**
* Whether or not the user agent is Internet Explorer.
*
@ -13963,7 +13964,7 @@ function (_Component) {
}
if (!Object(external_lodash_["isEqual"])(this.props.className, nextProps.className)) {
this.editorNode.className = classnames_default()(nextProps.className, CLASS_NAME);
this.editorNode.className = classnames_default()(editable_className, oldClassName, nextProps.className);
}
var _diffAriaProps = aria_diffAriaProps(this.props, nextProps),
@ -14014,7 +14015,7 @@ function (_Component) {
style = _this$props.style,
record = _this$props.record,
valueToEditableHTML = _this$props.valueToEditableHTML,
className = _this$props.className,
additionalClassName = _this$props.className,
isPlaceholderVisible = _this$props.isPlaceholderVisible,
remainingProps = Object(objectWithoutProperties["a" /* default */])(_this$props, ["tagName", "style", "record", "valueToEditableHTML", "className", "isPlaceholderVisible"]);
@ -14022,7 +14023,7 @@ function (_Component) {
return Object(external_this_wp_element_["createElement"])(tagName, Object(objectSpread["a" /* default */])((_objectSpread2 = {
role: 'textbox',
'aria-multiline': true,
className: classnames_default()(className, CLASS_NAME),
className: classnames_default()(editable_className, oldClassName, additionalClassName),
contentEditable: true
}, Object(defineProperty["a" /* default */])(_objectSpread2, IS_PLACEHOLDER_VISIBLE_ATTR_NAME, isPlaceholderVisible), Object(defineProperty["a" /* default */])(_objectSpread2, "ref", this.bindEditorNode), Object(defineProperty["a" /* default */])(_objectSpread2, "style", style), Object(defineProperty["a" /* default */])(_objectSpread2, "suppressContentEditableWarning", true), Object(defineProperty["a" /* default */])(_objectSpread2, "dangerouslySetInnerHTML", {
__html: valueToEditableHTML(record)
@ -14666,7 +14667,6 @@ function (_Component) {
range: range,
multilineTag: this.multilineTag,
multilineWrapperTags: this.multilineWrapperTags,
prepareEditableTree: this.props.prepareEditableTree,
__unstableIsEditableTree: true
});
}
@ -14964,11 +14964,15 @@ function (_Component) {
var boundarySelector = '*[data-rich-text-format-boundary]';
var element = this.editableRef.querySelector(boundarySelector);
if (element) {
var computedStyle = getComputedStyle(element);
var newColor = computedStyle.color.replace(')', ', 0.2)').replace('rgb', 'rgba');
globalStyle.innerHTML = "*:focus ".concat(boundarySelector, "{background-color: ").concat(newColor, "}");
if (!element) {
return;
}
var computedStyle = getComputedStyle(element);
var newColor = computedStyle.color.replace(')', ', 0.2)').replace('rgb', 'rgba');
var selector = ".".concat(editable_className, ":focus ").concat(boundarySelector);
var rule = "background-color: ".concat(newColor);
globalStyle.innerHTML = "".concat(selector, " {").concat(rule, "}");
}
/**
* Calls all registered onChangeEditableValue handlers.
@ -15239,8 +15243,13 @@ function (_Component) {
end = value.end;
var _this$state$activeFor = this.state.activeFormats,
activeFormats = _this$state$activeFor === void 0 ? [] : _this$state$activeFor;
var collapsed = Object(external_this_wp_richText_["isCollapsed"])(value);
var isReverse = event.keyCode === external_this_wp_keycodes_["LEFT"]; // If the selection is collapsed and at the very start, do nothing if
var collapsed = Object(external_this_wp_richText_["isCollapsed"])(value); // To do: ideally, we should look at visual position instead.
var _getComputedStyle = getComputedStyle(this.editableRef),
direction = _getComputedStyle.direction;
var reverseKey = direction === 'rtl' ? external_this_wp_keycodes_["RIGHT"] : external_this_wp_keycodes_["LEFT"];
var isReverse = event.keyCode === reverseKey; // If the selection is collapsed and at the very start, do nothing if
// navigating backward.
// If the selection is collapsed and at the very end, do nothing if
// navigating forward.
@ -18713,7 +18722,8 @@ function (_Component) {
*/
var writing_flow_window = window,
writing_flow_getSelection = writing_flow_window.getSelection;
writing_flow_getSelection = writing_flow_window.getSelection,
writing_flow_getComputedStyle = writing_flow_window.getComputedStyle;
/**
* Given an element, returns true if the element is a tabbable text field, or
* false otherwise.
@ -18925,11 +18935,23 @@ function (_Component) {
var isNav = isHorizontal || isVertical;
var isShift = event.shiftKey;
var hasModifier = isShift || event.ctrlKey || event.altKey || event.metaKey;
var isNavEdge = isVertical ? external_this_wp_dom_["isVerticalEdge"] : external_this_wp_dom_["isHorizontalEdge"]; // This logic inside this condition needs to be checked before
var isNavEdge = isVertical ? external_this_wp_dom_["isVerticalEdge"] : external_this_wp_dom_["isHorizontalEdge"]; // When presing any key other than up or down, the initial vertical
// position must ALWAYS be reset. The vertical position is saved so it
// can be restored as well as possible on sebsequent vertical arrow key
// presses. It may not always be possible to restore the exact same
// position (such as at an empty line), so it wouldn't be good to
// compute the position right before any vertical arrow key press.
if (!isVertical) {
this.verticalRect = null;
} else if (!this.verticalRect) {
this.verticalRect = Object(external_this_wp_dom_["computeCaretRect"])(target);
} // This logic inside this condition needs to be checked before
// the check for event.nativeEvent.defaultPrevented.
// The logic handles meta+a keypress and this event is default prevented
// by RichText.
if (!isNav) {
// Set immediately before the meta+a combination can be pressed.
if (external_this_wp_keycodes_["isKeyboardEvent"].primary(event)) {
@ -18964,13 +18986,14 @@ function (_Component) {
if (!isNavigationCandidate(target, keyCode, hasModifier)) {
return;
}
} // In the case of RTL scripts, right means previous and left means next,
// which is the exact reverse of LTR.
if (!isVertical) {
this.verticalRect = null;
} else if (!this.verticalRect) {
this.verticalRect = Object(external_this_wp_dom_["computeCaretRect"])(target);
}
var _getComputedStyle = writing_flow_getComputedStyle(target),
direction = _getComputedStyle.direction;
var isReverseDir = direction === 'rtl' ? !isReverse : isReverse;
if (isShift) {
if (( // Ensure that there is a target block.
@ -18991,10 +19014,10 @@ function (_Component) {
Object(external_this_wp_dom_["placeCaretAtVerticalEdge"])(closestTabbable, isReverse, this.verticalRect);
event.preventDefault();
}
} else if (isHorizontal && writing_flow_getSelection().isCollapsed && Object(external_this_wp_dom_["isHorizontalEdge"])(target, isReverse)) {
var _closestTabbable = this.getClosestTabbable(target, isReverse);
} else if (isHorizontal && writing_flow_getSelection().isCollapsed && Object(external_this_wp_dom_["isHorizontalEdge"])(target, isReverseDir)) {
var _closestTabbable = this.getClosestTabbable(target, isReverseDir);
Object(external_this_wp_dom_["placeCaretAtHorizontalEdge"])(_closestTabbable, isReverse);
Object(external_this_wp_dom_["placeCaretAtHorizontalEdge"])(_closestTabbable, isReverseDir);
event.preventDefault();
}
}

File diff suppressed because one or more lines are too long

View File

@ -10503,6 +10503,29 @@ function segmentHTMLToShortcodeBlock(HTML) {
/* harmony default export */ var shortcode_converter = (segmentHTMLToShortcodeBlock);
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/comment-remover.js
/**
* WordPress dependencies
*/
/**
* Browser dependencies
*/
var comment_remover_COMMENT_NODE = window.Node.COMMENT_NODE;
/**
* Looks for comments, and removes them.
*
* @param {Node} node The node to be processed.
* @return {void}
*/
/* harmony default export */ var comment_remover = (function (node) {
if (node.nodeType === comment_remover_COMMENT_NODE) {
Object(external_this_wp_dom_["remove"])(node);
}
});
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/raw-handling/is-inline-content.js
/**
* External dependencies
@ -10872,6 +10895,7 @@ function slackMarkdownVariantCorrector(text) {
/**
* Browser dependencies
@ -10888,7 +10912,7 @@ var paste_handler_window = window,
*/
function filterInlineHTML(HTML) {
HTML = deepFilterHTML(HTML, [google_docs_uid_remover, phrasing_content_reducer]);
HTML = deepFilterHTML(HTML, [google_docs_uid_remover, phrasing_content_reducer, comment_remover]);
HTML = removeInvalidHTML(HTML, getPhrasingContentSchema(), {
inline: true
}); // Allows us to ask for this information when we get a report.
@ -11036,7 +11060,7 @@ function pasteHandler(_ref3) {
return piece;
}
var filters = [google_docs_uid_remover, ms_list_converter, head_remover, list_reducer, image_corrector, phrasing_content_reducer, special_comment_converter, figure_content_reducer, blockquote_normaliser];
var filters = [google_docs_uid_remover, ms_list_converter, head_remover, list_reducer, image_corrector, phrasing_content_reducer, special_comment_converter, comment_remover, figure_content_reducer, blockquote_normaliser];
if (!canUserUseUnfilteredHTML) {
// Should run before `figureContentReducer`.

File diff suppressed because one or more lines are too long

View File

@ -508,14 +508,17 @@ function isEdge(container, isReverse, onlyVertical) {
if (onlyVertical) {
return true;
} // To calculate the horizontal position, we insert a test range and see if
} // In the case of RTL scripts, the horizontal edge is at the opposite side.
var direction = computedStyle.direction;
var isReverseDir = direction === 'rtl' ? !isReverse : isReverse; // To calculate the horizontal position, we insert a test range and see if
// this test range has the same horizontal position. This method proves to
// be better than a DOM-based calculation, because it ignores empty text
// nodes and a trailing line break element. In other words, we need to check
// visual positioning, not DOM positioning.
var x = isReverse ? containerRect.left + 1 : containerRect.right - 1;
var x = isReverseDir ? containerRect.left + 1 : containerRect.right - 1;
var y = isReverse ? containerRect.top + buffer : containerRect.bottom - buffer;
var testRange = hiddenCaretRangeFromPoint(document, x, y, container);
@ -523,7 +526,7 @@ function isEdge(container, isReverse, onlyVertical) {
return false;
}
var side = isReverse ? 'left' : 'right';
var side = isReverseDir ? 'left' : 'right';
var testRect = getRectangleFromRange(testRange);
return Math.round(testRect[side]) === Math.round(rangeRect[side]);
}

File diff suppressed because one or more lines are too long

View File

@ -2738,6 +2738,7 @@ __webpack_require__.d(actions_namespaceObject, "multiSelect", function() { retur
__webpack_require__.d(actions_namespaceObject, "clearSelectedBlock", function() { return clearSelectedBlock; });
__webpack_require__.d(actions_namespaceObject, "toggleSelection", function() { return toggleSelection; });
__webpack_require__.d(actions_namespaceObject, "replaceBlocks", function() { return replaceBlocks; });
__webpack_require__.d(actions_namespaceObject, "replaceBlock", function() { return replaceBlock; });
__webpack_require__.d(actions_namespaceObject, "moveBlocksDown", function() { return moveBlocksDown; });
__webpack_require__.d(actions_namespaceObject, "moveBlocksUp", function() { return moveBlocksUp; });
__webpack_require__.d(actions_namespaceObject, "moveBlockToPosition", function() { return moveBlockToPosition; });
@ -5258,6 +5259,7 @@ var multiSelect = actions_getBlockEditorAction('multiSelect');
var clearSelectedBlock = actions_getBlockEditorAction('clearSelectedBlock');
var toggleSelection = actions_getBlockEditorAction('toggleSelection');
var replaceBlocks = actions_getBlockEditorAction('replaceBlocks');
var replaceBlock = actions_getBlockEditorAction('replaceBlock');
var moveBlocksDown = actions_getBlockEditorAction('moveBlocksDown');
var moveBlocksUp = actions_getBlockEditorAction('moveBlocksUp');
var moveBlockToPosition = actions_getBlockEditorAction('moveBlockToPosition');

File diff suppressed because one or more lines are too long

View File

@ -1005,7 +1005,8 @@ var inline_URLPopoverAtLink = function URLPopoverAtLink(_ref3) {
props = Object(objectWithoutProperties["a" /* default */])(_ref3, ["isActive", "addingLink", "value"]);
var anchorRect = Object(external_this_wp_element_["useMemo"])(function () {
var range = window.getSelection().getRangeAt(0);
var selection = window.getSelection();
var range = selection.rangeCount > 0 ? selection.getRangeAt(0) : null;
if (!range) {
return;

File diff suppressed because one or more lines are too long

View File

@ -819,8 +819,7 @@ function applyFormat(value, format) {
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
var formats = value.formats,
_value$activeFormats = value.activeFormats,
activeFormats = _value$activeFormats === void 0 ? [] : _value$activeFormats;
activeFormats = value.activeFormats;
var newFormats = formats.slice(); // The selection is collapsed.
if (startIndex === endIndex) {
@ -840,13 +839,7 @@ function applyFormat(value, format) {
while (Object(external_lodash_["find"])(newFormats[endIndex], startFormat)) {
applyFormats(newFormats, endIndex, format);
endIndex++;
} // Otherwise, insert a placeholder with the format so new input appears
// with the format applied.
} else {
return Object(objectSpread["a" /* default */])({}, value, {
activeFormats: [].concat(Object(toConsumableArray["a" /* default */])(activeFormats), [format])
});
}
}
} else {
for (var index = startIndex; index < endIndex; index++) {
@ -855,7 +848,13 @@ function applyFormat(value, format) {
}
return normaliseFormats(Object(objectSpread["a" /* default */])({}, value, {
formats: newFormats
formats: newFormats,
// Always revise active formats. This serves as a placeholder for new
// inputs with the format so new input appears with the format applied,
// and ensures a format of the same type uses the latest values.
activeFormats: [].concat(Object(toConsumableArray["a" /* default */])(Object(external_lodash_["reject"])(activeFormats, {
type: format.type
})), [format])
}));
}
@ -1980,12 +1979,6 @@ function removeFormat(value, formatType) {
filterFormats(newFormats, endIndex, formatType);
endIndex++;
}
} else {
return Object(objectSpread["a" /* default */])({}, value, {
activeFormats: Object(external_lodash_["reject"])(activeFormats, {
type: formatType
})
});
}
} else {
for (var i = startIndex; i < endIndex; i++) {
@ -1996,7 +1989,10 @@ function removeFormat(value, formatType) {
}
return normaliseFormats(Object(objectSpread["a" /* default */])({}, value, {
formats: newFormats
formats: newFormats,
activeFormats: Object(external_lodash_["reject"])(activeFormats, {
type: formatType
})
}));
}

File diff suppressed because one or more lines are too long

View File

@ -225,39 +225,39 @@ function wp_default_packages_scripts( &$scripts ) {
$packages_versions = array(
'a11y' => '2.2.0',
'annotations' => '1.2.2',
'annotations' => '1.2.3',
'api-fetch' => '3.1.2',
'autop' => '2.0.0',
'blob' => '2.3.0',
'block-editor' => '2.0.1',
'block-library' => '2.4.4',
'block-editor' => '2.0.2',
'block-library' => '2.4.5',
'block-serialization-default-parser' => '3.1.0',
'blocks' => '6.2.4',
'components' => '7.3.1',
'blocks' => '6.2.5',
'components' => '7.3.2',
'compose' => '3.2.0',
'core-data' => '2.2.2',
'data' => '4.4.0',
'date' => '3.2.0',
'deprecated' => '2.2.0',
'dom' => '2.2.4',
'dom' => '2.2.5',
'dom-ready' => '2.2.0',
'edit-post' => '3.3.4',
'editor' => '9.2.4',
'edit-post' => '3.3.5',
'editor' => '9.2.5',
'element' => '2.3.0',
'escape-html' => '1.2.0',
'format-library' => '1.4.4',
'format-library' => '1.4.5',
'hooks' => '2.2.0',
'html-entities' => '2.2.0',
'i18n' => '3.3.0',
'is-shallow-equal' => '1.2.0',
'keycodes' => '2.2.0',
'list-reusable-blocks' => '1.3.4',
'list-reusable-blocks' => '1.3.5',
'notices' => '1.3.0',
'nux' => '3.2.4',
'nux' => '3.2.5',
'plugins' => '2.2.0',
'priority-queue' => '1.1.0',
'redux-routine' => '3.2.0',
'rich-text' => '3.2.2',
'rich-text' => '3.2.3',
'shortcode' => '2.2.0',
'token-list' => '1.2.0',
'url' => '2.5.0',

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2.1-alpha-45318';
$wp_version = '5.2.1-alpha-45320';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.