Block Editor: Update WordPress Packages to the latest versions.

Updated Packages:

 - @wordpress/annotations@1.0.8
 - @wordpress/block-library@2.2.15
 - @wordpress/components@7.0.8
 - @wordpress/edit-post@3.1.10
 - @wordpress/editor@9.0.10
 - @wordpress/format-library@1.2.13
 - @wordpress/list-reusable-blocks@1.1.21
 - @wordpress/nux@3.0.9
 - @wordpress/rich-text@3.0.7

Fixes list block indentation and Crowdsignal embed block.

Props iseulde.
Fixes #46137.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44542 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2019-01-29 18:23:55 +00:00
parent 129db19a29
commit 3c7a623f85
26 changed files with 512 additions and 150 deletions

View File

@ -78,8 +78,6 @@
width: 36px; }
.block-library-button__inline-link .dashicon {
color: #8f98a1; }
.block-library-button__inline-link .editor-url-input input[type="text"]::-webkit-input-placeholder {
color: #8f98a1; }
.block-library-button__inline-link .editor-url-input input[type="text"]:-ms-input-placeholder {
color: #8f98a1; }
.block-library-button__inline-link .editor-url-input input[type="text"]::-ms-input-placeholder {

File diff suppressed because one or more lines are too long

View File

@ -79,8 +79,6 @@
width: 36px; }
.block-library-button__inline-link .dashicon {
color: #8f98a1; }
.block-library-button__inline-link .editor-url-input input[type="text"]::-webkit-input-placeholder {
color: #8f98a1; }
.block-library-button__inline-link .editor-url-input input[type="text"]:-ms-input-placeholder {
color: #8f98a1; }
.block-library-button__inline-link .editor-url-input input[type="text"]::-ms-input-placeholder {

File diff suppressed because one or more lines are too long

View File

@ -536,8 +536,7 @@
.components-color-palette__custom-color .components-color-palette__custom-color-gradient::before {
content: "";
-webkit-filter: blur(6px) saturate(0.7) brightness(1.1);
filter: blur(6px) saturate(0.7) brightness(1.1);
filter: blur(6px) saturate(0.7) brightness(1.1);
display: block;
width: 200%;
height: 200%;
@ -2046,13 +2045,11 @@ body.is-dragging-components-draggable {
outline: 1px solid transparent;
outline-offset: -1px;
border: 1px solid #000;
-webkit-filter: invert(100%) contrast(500%);
filter: invert(100%) contrast(500%); }
filter: invert(100%) contrast(500%); }
@supports (-ms-high-contrast-adjust: auto) {
.components-form-toggle .components-form-toggle__on {
-webkit-filter: none;
filter: none;
filter: none;
border: 1px solid #fff; } }
.components-form-token-field__input-container {
@ -2528,8 +2525,7 @@ body.is-dragging-components-draggable {
body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right {
transform: scaleX(-1);
-ms-filter: fliph;
-webkit-filter: FlipH;
filter: FlipH;
filter: FlipH;
margin-top: -10px; }
.components-panel__icon {

File diff suppressed because one or more lines are too long

View File

@ -536,8 +536,7 @@
.components-color-palette__custom-color .components-color-palette__custom-color-gradient::before {
content: "";
-webkit-filter: blur(6px) saturate(0.7) brightness(1.1);
filter: blur(6px) saturate(0.7) brightness(1.1);
filter: blur(6px) saturate(0.7) brightness(1.1);
display: block;
width: 200%;
height: 200%;
@ -2050,13 +2049,11 @@ body.is-dragging-components-draggable {
outline: 1px solid transparent;
outline-offset: -1px;
border: 1px solid #000;
-webkit-filter: invert(100%) contrast(500%);
filter: invert(100%) contrast(500%); }
filter: invert(100%) contrast(500%); }
@supports (-ms-high-contrast-adjust: auto) {
.components-form-toggle .components-form-toggle__on {
-webkit-filter: none;
filter: none;
filter: none;
border: 1px solid #fff; } }
.components-form-token-field__input-container {
@ -2534,8 +2531,7 @@ body.is-dragging-components-draggable {
body.rtl .components-panel__body-toggle.components-button .dashicons-arrow-right {
transform: scaleX(-1);
-ms-filter: fliph;
-webkit-filter: FlipH;
filter: FlipH;
filter: FlipH;
margin-top: -10px; }
.components-panel__icon {

File diff suppressed because one or more lines are too long

View File

@ -263,15 +263,10 @@
/**
* Cross-block selection
*/
.editor-block-list__layout .editor-block-list__block ::-moz-selection {
background-color: #b3e7fe; }
.editor-block-list__layout .editor-block-list__block ::selection {
background-color: #b3e7fe; }
.editor-block-list__layout .editor-block-list__block.is-multi-selected *::-moz-selection {
background-color: transparent; }
.editor-block-list__layout .editor-block-list__block.is-multi-selected *::selection {
background-color: transparent; }
@ -2285,8 +2280,6 @@ body.admin-color-light .editor-post-text-editor__link{
box-shadow: 0 0 0 1px #e8eaeb; }
.editor-rich-text__tinymce img[data-mce-selected] {
outline: none; }
.editor-rich-text__tinymce img::-moz-selection {
background: none !important; }
.editor-rich-text__tinymce img::selection {
background: none !important; }
.editor-rich-text__tinymce[data-is-placeholder-visible="true"] {

File diff suppressed because one or more lines are too long

View File

@ -263,15 +263,10 @@
/**
* Cross-block selection
*/
.editor-block-list__layout .editor-block-list__block ::-moz-selection {
background-color: #b3e7fe; }
.editor-block-list__layout .editor-block-list__block ::selection {
background-color: #b3e7fe; }
.editor-block-list__layout .editor-block-list__block.is-multi-selected *::-moz-selection {
background-color: transparent; }
.editor-block-list__layout .editor-block-list__block.is-multi-selected *::selection {
background-color: transparent; }
@ -2297,8 +2292,6 @@ body.admin-color-light .editor-post-text-editor__link{
box-shadow: 0 0 0 1px #e8eaeb; }
.editor-rich-text__tinymce img[data-mce-selected] {
outline: none; }
.editor-rich-text__tinymce img::-moz-selection {
background: none !important; }
.editor-rich-text__tinymce img::selection {
background: none !important; }
.editor-rich-text__tinymce[data-is-placeholder-visible="true"] {

File diff suppressed because one or more lines are too long

View File

@ -82,7 +82,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["annotations"] =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 315);
/******/ return __webpack_require__(__webpack_require__.s = 316);
/******/ })
/************************************************************************/
/******/ ({
@ -496,7 +496,7 @@ function isShallowEqual( a, b, fromIndex ) {
/***/ }),
/***/ 315:
/***/ 316:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";

File diff suppressed because one or more lines are too long

View File

@ -82,7 +82,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["apiFetch"] =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 316);
/******/ return __webpack_require__(__webpack_require__.s = 315);
/******/ })
/************************************************************************/
/******/ ({
@ -174,7 +174,7 @@ function _objectWithoutProperties(source, excluded) {
/***/ }),
/***/ 316:
/***/ 315:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";

File diff suppressed because one or more lines are too long

View File

@ -2235,6 +2235,24 @@ var others = [{
description: Object(external_this_wp_i18n_["__"])('Embed CollegeHumor content.')
},
patterns: [/^https?:\/\/(www\.)?collegehumor\.com\/.+/i]
}, {
name: 'core-embed/crowdsignal',
settings: {
title: 'Crowdsignal',
icon: embedContentIcon,
keywords: ['polldaddy'],
transform: [{
type: 'block',
blocks: ['core-embed/polldaddy'],
transform: function transform(content) {
return Object(external_this_wp_blocks_["createBlock"])('core-embed/crowdsignal', {
content: content
});
}
}],
description: Object(external_this_wp_i18n_["__"])('Embed Crowdsignal (formerly Polldaddy) content.')
},
patterns: [/^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.survey\.fm)\/.+/i]
}, {
name: 'core-embed/dailymotion',
settings: {
@ -2309,13 +2327,17 @@ var others = [{
},
patterns: [/^http:\/\/g?i*\.photobucket\.com\/.+/i]
}, {
// Deprecated in favour of the core-embed/crowdsignal block
name: 'core-embed/polldaddy',
settings: {
title: 'Polldaddy',
icon: embedContentIcon,
description: Object(external_this_wp_i18n_["__"])('Embed Polldaddy content.')
description: Object(external_this_wp_i18n_["__"])('Embed Polldaddy content.'),
supports: {
inserter: false
}
},
patterns: [/^https?:\/\/(www\.)?polldaddy\.com\/.+/i]
patterns: []
}, {
name: 'core-embed/reddit',
settings: {

File diff suppressed because one or more lines are too long

View File

@ -82,7 +82,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["blocks"] =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 307);
/******/ return __webpack_require__(__webpack_require__.s = 308);
/******/ })
/************************************************************************/
/******/ ({
@ -5421,7 +5421,7 @@ function _slicedToArray(arr, i) {
/***/ }),
/***/ 307:
/***/ 308:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";

File diff suppressed because one or more lines are too long

View File

@ -8732,7 +8732,7 @@ var reducer_withSaveReusableBlock = function withSaveReusableBlock(reducer) {
*/
var reducer_editor = Object(external_lodash_["flow"])([external_this_wp_data_["combineReducers"], reducer_withInnerBlocksRemoveCascade, // Track undo history, starting at editor initialization.
var editor = Object(external_lodash_["flow"])([external_this_wp_data_["combineReducers"], reducer_withInnerBlocksRemoveCascade, // Track undo history, starting at editor initialization.
with_history({
resetTypes: ['SETUP_EDITOR_STATE'],
ignoreTypes: ['RECEIVE_BLOCKS', 'RESET_POST', 'UPDATE_POST'],
@ -9747,7 +9747,7 @@ function reducer_previewLink() {
return state;
}
/* harmony default export */ var store_reducer = (redux_optimist_default()(Object(external_this_wp_data_["combineReducers"])({
editor: reducer_editor,
editor: editor,
initialEdits: initialEdits,
currentPost: currentPost,
isTyping: reducer_isTyping,
@ -20530,23 +20530,15 @@ function (_Component) {
custom_undo_redo_levels: 1,
lists_indent_on_tab: false
};
if (multilineTag === 'li') {
settings.plugins.push('lists');
}
external_tinymce_default.a.init(Object(objectSpread["a" /* default */])({}, settings, {
target: this.editorNode,
setup: function setup(editor) {
_this3.editor = editor;
_this3.props.onSetup(editor); // TinyMCE resets the element content on initialization, even
_this3.editor = editor; // TinyMCE resets the element content on initialization, even
// when it's already identical to what exists currently. This
// behavior clobbers a selection which exists at the time of
// initialization, thus breaking writing flow navigation. The
// hack here neutralizes setHTML during initialization.
var setHTML;
editor.on('preinit', function () {
setHTML = editor.dom.setHTML;
@ -20846,103 +20838,156 @@ function (_Component) {
/**
* Internal dependencies
*/
var _window$Node = window.Node,
list_edit_TEXT_NODE = _window$Node.TEXT_NODE,
ELEMENT_NODE = _window$Node.ELEMENT_NODE;
/**
* Gets the selected list node, which is the closest list node to the start of
* the selection.
*
* @return {?Element} The selected list node, or undefined if none is selected.
*/
function isListRootSelected(editor) {
return !editor.selection || editor.selection.getNode().closest('ol,ul') === editor.getBody();
}
function getSelectedListNode() {
var selection = window.getSelection();
function isActiveListType(editor, tagName, rootTagName) {
if (document.activeElement !== editor.getBody()) {
return tagName === rootTagName;
}
var listItem = editor.selection.getNode();
var list = listItem.closest('ol,ul');
if (!list) {
if (selection.rangeCount === 0) {
return;
}
return list.nodeName.toLowerCase() === tagName;
var _selection$getRangeAt = selection.getRangeAt(0),
startContainer = _selection$getRangeAt.startContainer;
if (startContainer.nodeType === list_edit_TEXT_NODE) {
startContainer = startContainer.parentNode;
}
if (startContainer.nodeType !== ELEMENT_NODE) {
return;
}
var rootNode = startContainer.closest('*[contenteditable]');
if (!rootNode || !rootNode.contains(startContainer)) {
return;
}
return startContainer.closest('ol,ul');
}
/**
* Whether or not the root list is selected.
*
* @return {boolean} True if the root list or nothing is selected, false if an
* inner list is selected.
*/
function isListRootSelected() {
var listNode = getSelectedListNode(); // Consider the root list selected if nothing is selected.
return !listNode || listNode.contentEditable === 'true';
}
/**
* Wether or not the selected list has the given tag name.
*
* @param {string} tagName The tag name the list should have.
* @param {string} rootTagName The current root tag name, to compare with in
* case nothing is selected.
*
* @return {boolean} [description]
*/
function isActiveListType(tagName, rootTagName) {
var listNode = getSelectedListNode();
if (!listNode) {
return tagName === rootTagName;
}
return listNode.nodeName.toLowerCase() === tagName;
}
var list_edit_ListEdit = function ListEdit(_ref) {
var editor = _ref.editor,
onTagNameChange = _ref.onTagNameChange,
var onTagNameChange = _ref.onTagNameChange,
tagName = _ref.tagName,
onSyncDOM = _ref.onSyncDOM;
value = _ref.value,
onChange = _ref.onChange;
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(shortcut_RichTextShortcut, {
type: "primary",
character: "[",
onUse: function onUse() {
editor.execCommand('Outdent');
onSyncDOM();
onChange(Object(external_this_wp_richText_["outdentListItems"])(value));
}
}), Object(external_this_wp_element_["createElement"])(shortcut_RichTextShortcut, {
type: "primary",
character: "]",
onUse: function onUse() {
editor.execCommand('Indent');
onSyncDOM();
onChange(Object(external_this_wp_richText_["indentListItems"])(value, {
type: tagName
}));
}
}), Object(external_this_wp_element_["createElement"])(shortcut_RichTextShortcut, {
type: "primary",
character: "m",
onUse: function onUse() {
editor.execCommand('Indent');
onSyncDOM();
onChange(Object(external_this_wp_richText_["indentListItems"])(value, {
type: tagName
}));
}
}), Object(external_this_wp_element_["createElement"])(shortcut_RichTextShortcut, {
type: "primaryShift",
character: "m",
onUse: function onUse() {
editor.execCommand('Outdent');
onSyncDOM();
onChange(Object(external_this_wp_richText_["outdentListItems"])(value));
}
}), Object(external_this_wp_element_["createElement"])(block_format_controls, null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Toolbar"], {
controls: [{
icon: 'editor-ul',
title: Object(external_this_wp_i18n_["__"])('Convert to unordered list'),
isActive: isActiveListType(editor, 'ul', tagName),
isActive: isActiveListType('ul', tagName),
onClick: function onClick() {
if (isListRootSelected(editor)) {
onChange(Object(external_this_wp_richText_["changeListType"])(value, {
type: 'ul'
}));
if (isListRootSelected()) {
onTagNameChange('ul');
} else {
editor.execCommand('InsertUnorderedList');
onSyncDOM();
}
}
}, {
icon: 'editor-ol',
title: Object(external_this_wp_i18n_["__"])('Convert to ordered list'),
isActive: isActiveListType(editor, 'ol', tagName),
isActive: isActiveListType('ol', tagName),
onClick: function onClick() {
if (isListRootSelected(editor)) {
onChange(Object(external_this_wp_richText_["changeListType"])(value, {
type: 'ol'
}));
if (isListRootSelected()) {
onTagNameChange('ol');
} else {
editor.execCommand('InsertOrderedList');
onSyncDOM();
}
}
}, {
icon: 'editor-outdent',
title: Object(external_this_wp_i18n_["__"])('Outdent list item'),
onClick: function onClick() {
editor.execCommand('Outdent');
onSyncDOM();
onChange(Object(external_this_wp_richText_["outdentListItems"])(value));
}
}, {
icon: 'editor-indent',
title: Object(external_this_wp_i18n_["__"])('Indent list item'),
onClick: function onClick() {
editor.execCommand('Indent');
onSyncDOM();
onChange(Object(external_this_wp_richText_["indentListItems"])(value, {
type: tagName
}));
}
}]
})));
@ -21167,7 +21212,6 @@ function (_Component) {
_this.onSplit = _this.props.unstableOnSplit;
}
_this.onSetup = _this.onSetup.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.onFocus = _this.onFocus.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.onBlur = _this.onBlur.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
_this.onChange = _this.onChange.bind(Object(assertThisInitialized["a" /* default */])(Object(assertThisInitialized["a" /* default */])(_this)));
@ -21216,17 +21260,6 @@ function (_Component) {
value: function setRef(node) {
this.editableRef = node;
}
/**
* Sets a reference to the TinyMCE editor instance.
*
* @param {Editor} editor The editor instance as passed by TinyMCE.
*/
}, {
key: "onSetup",
value: function onSetup(editor) {
this.editor = editor;
}
}, {
key: "setFocusedElement",
value: function setFocusedElement() {
@ -21985,13 +22018,11 @@ function (_Component) {
return Object(external_this_wp_element_["createElement"])("div", {
className: classes,
onFocus: this.setFocusedElement
}, isSelected && this.editor && this.multilineTag === 'li' && Object(external_this_wp_element_["createElement"])(list_edit_ListEdit, {
editor: this.editor,
}, isSelected && this.multilineTag === 'li' && Object(external_this_wp_element_["createElement"])(list_edit_ListEdit, {
onTagNameChange: onTagNameChange,
tagName: Tagname,
onSyncDOM: function onSyncDOM() {
return _this3.onChange(_this3.createRecord());
}
value: record,
onChange: this.onChange
}), isSelected && !inlineToolbar && Object(external_this_wp_element_["createElement"])(block_format_controls, null, Object(external_this_wp_element_["createElement"])(format_toolbar, {
controls: formattingControls
})), isSelected && inlineToolbar && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["IsolatedEventContainer"], {
@ -22008,7 +22039,6 @@ function (_Component) {
activeId = _ref6.activeId;
return Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(tinymce_TinyMCE, Object(esm_extends["a" /* default */])({
tagName: Tagname,
onSetup: _this3.onSetup,
style: style,
record: record,
valueToEditableHTML: _this3.valueToEditableHTML,

File diff suppressed because one or more lines are too long

View File

@ -82,7 +82,7 @@ this["wp"] = this["wp"] || {}; this["wp"]["richText"] =
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 308);
/******/ return __webpack_require__(__webpack_require__.s = 307);
/******/ })
/************************************************************************/
/******/ ({
@ -211,7 +211,7 @@ function _typeof(obj) {
/***/ }),
/***/ 308:
/***/ 307:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
@ -456,10 +456,15 @@ function isFormatEqual(format1, format2) {
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/normalise-formats.js
/**
* External dependencies
*/
/**
* Internal dependencies
*/
/**
* Normalises formats: ensures subsequent equal formats have the same reference.
*
@ -473,21 +478,20 @@ function normaliseFormats(_ref) {
text = _ref.text,
start = _ref.start,
end = _ref.end;
var newFormats = formats.slice(0);
newFormats.forEach(function (formatsAtIndex, index) {
var lastFormatsAtIndex = newFormats[index - 1];
if (lastFormatsAtIndex) {
var newFormatsAtIndex = formatsAtIndex.slice(0);
newFormatsAtIndex.forEach(function (format, formatIndex) {
var lastFormat = lastFormatsAtIndex[formatIndex];
if (isFormatEqual(format, lastFormat)) {
newFormatsAtIndex[formatIndex] = lastFormat;
}
var refs = [];
var newFormats = formats.map(function (formatsAtIndex) {
return formatsAtIndex.map(function (format) {
var equalRef = Object(external_lodash_["find"])(refs, function (ref) {
return isFormatEqual(ref, format);
});
newFormats[index] = newFormatsAtIndex;
}
if (equalRef) {
return equalRef;
}
refs.push(format);
return format;
});
});
return {
formats: newFormats,
@ -2776,6 +2780,333 @@ function unregisterFormatType(name) {
return oldFormat;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-line-index.js
/**
* Internal dependencies
*/
/**
* Gets the currently selected line index, or the first line index if the
* selection spans over multiple items.
*
* @param {Object} value Value to get the line index from.
* @param {boolean} startIndex Optional index that should be contained by the
* line. Defaults to the selection start of the
* value.
*
* @return {?boolean} The line index. Undefined if not found.
*/
function getLineIndex(_ref) {
var start = _ref.start,
text = _ref.text;
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
var index = startIndex;
while (index--) {
if (text[index] === LINE_SEPARATOR) {
return index;
}
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/indent-list-items.js
/**
* Internal dependencies
*/
/**
* Gets the line index of the first previous list item with higher indentation.
*
* @param {Object} value Value to search.
* @param {number} lineIndex Line index of the list item to compare with.
*
* @return {boolean} The line index.
*/
function getTargetLevelLineIndex(_ref, lineIndex) {
var text = _ref.text,
formats = _ref.formats;
var startFormats = formats[lineIndex] || [];
var index = lineIndex;
while (index-- >= 0) {
if (text[index] !== LINE_SEPARATOR) {
continue;
}
var formatsAtIndex = formats[index] || []; // Return the first line index that is one level higher. If the level is
// lower or equal, there is no result.
if (formatsAtIndex.length === startFormats.length + 1) {
return index;
} else if (formatsAtIndex.length <= startFormats.length) {
return;
}
}
}
/**
* Indents any selected list items if possible.
*
* @param {Object} value Value to change.
* @param {Object} rootFormat
*
* @return {Object} The changed value.
*/
function indentListItems(value, rootFormat) {
var lineIndex = getLineIndex(value); // There is only one line, so the line cannot be indented.
if (lineIndex === undefined) {
return value;
}
var text = value.text,
formats = value.formats,
start = value.start,
end = value.end;
var previousLineIndex = getLineIndex(value, lineIndex);
var formatsAtLineIndex = formats[lineIndex] || [];
var formatsAtPreviousLineIndex = formats[previousLineIndex] || []; // The the indentation of the current line is greater than previous line,
// then the line cannot be furter indented.
if (formatsAtLineIndex.length > formatsAtPreviousLineIndex.length) {
return value;
}
var newFormats = formats.slice();
var targetLevelLineIndex = getTargetLevelLineIndex(value, lineIndex);
for (var index = lineIndex; index < end; index++) {
if (text[index] !== LINE_SEPARATOR) {
continue;
} // Get the previous list, and if there's a child list, take over the
// formats. If not, duplicate the last level and create a new level.
if (targetLevelLineIndex) {
var targetFormats = formats[targetLevelLineIndex] || [];
newFormats[index] = targetFormats.concat((newFormats[index] || []).slice(targetFormats.length - 1));
} else {
var _targetFormats = formats[previousLineIndex] || [];
var lastformat = _targetFormats[_targetFormats.length - 1] || rootFormat;
newFormats[index] = _targetFormats.concat([lastformat], (newFormats[index] || []).slice(_targetFormats.length));
}
}
return normaliseFormats({
text: text,
formats: newFormats,
start: start,
end: end
});
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-parent-line-index.js
/**
* Internal dependencies
*/
/**
* Gets the index of the first parent list. To get the parent list formats, we
* go through every list item until we find one with exactly one format type
* less.
*
* @param {Object} value Value to search.
* @param {number} lineIndex Line index of a child list item.
*
* @return {Array} The parent list line index.
*/
function getParentLineIndex(_ref, lineIndex) {
var text = _ref.text,
formats = _ref.formats;
var startFormats = formats[lineIndex] || [];
var index = lineIndex;
while (index-- >= 0) {
if (text[index] !== LINE_SEPARATOR) {
continue;
}
var formatsAtIndex = formats[index] || [];
if (formatsAtIndex.length === startFormats.length - 1) {
return index;
}
}
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/get-last-child-index.js
/**
* Internal dependencies
*/
/**
* Gets the line index of the last child in the list.
*
* @param {Object} value Value to search.
* @param {number} lineIndex Line index of a list item in the list.
*
* @return {Array} The index of the last child.
*/
function getLastChildIndex(_ref, lineIndex) {
var text = _ref.text,
formats = _ref.formats;
var lineFormats = formats[lineIndex] || []; // Use the given line index in case there are no next children.
var childIndex = lineIndex; // `lineIndex` could be `undefined` if it's the first line.
for (var index = lineIndex || 0; index < text.length; index++) {
// We're only interested in line indices.
if (text[index] !== LINE_SEPARATOR) {
continue;
}
var formatsAtIndex = formats[index] || []; // If the amout of formats is equal or more, store it, then return the
// last one if the amount of formats is less.
if (formatsAtIndex.length >= lineFormats.length) {
childIndex = index;
} else {
return childIndex;
}
} // If the end of the text is reached, return the last child index.
return childIndex;
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/outdent-list-items.js
/**
* Internal dependencies
*/
/**
* Outdents any selected list items if possible.
*
* @param {Object} value Value to change.
*
* @return {Object} The changed value.
*/
function outdentListItems(value) {
var text = value.text,
formats = value.formats,
start = value.start,
end = value.end;
var startingLineIndex = getLineIndex(value, start); // Return early if the starting line index cannot be further outdented.
if (formats[startingLineIndex] === undefined) {
return value;
}
var newFormats = formats.slice(0);
var parentFormats = formats[getParentLineIndex(value, startingLineIndex)] || [];
var endingLineIndex = getLineIndex(value, end);
var lastChildIndex = getLastChildIndex(value, endingLineIndex); // Outdent all list items from the starting line index until the last child
// index of the ending list. All children of the ending list need to be
// outdented, otherwise they'll be orphaned.
for (var index = startingLineIndex; index <= lastChildIndex; index++) {
// Skip indices that are not line separators.
if (text[index] !== LINE_SEPARATOR) {
continue;
} // In the case of level 0, the formats at the index are undefined.
var currentFormats = newFormats[index] || []; // Omit the indentation level where the selection starts.
newFormats[index] = parentFormats.concat(currentFormats.slice(parentFormats.length + 1));
if (newFormats[index].length === 0) {
delete newFormats[index];
}
}
return normaliseFormats({
text: text,
formats: newFormats,
start: start,
end: end
});
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/change-list-type.js
/**
* Internal dependencies
*/
/**
* Changes the list type of the selected indented list, if any. Looks at the
* currently selected list item and takes the parent list, then changes the list
* type of this list. When multiple lines are selected, the parent lists are
* takes and changed.
*
* @param {Object} value Value to change.
* @param {Object} newFormat The new list format object. Choose between
* `{ type: 'ol' }` and `{ type: 'ul' }`.
*
* @return {Object} The changed value.
*/
function changeListType(value, newFormat) {
var text = value.text,
formats = value.formats,
start = value.start,
end = value.end;
var startingLineIndex = getLineIndex(value, start);
var startLineFormats = formats[startingLineIndex] || [];
var endLineFormats = formats[getLineIndex(value, end)] || [];
var startIndex = getParentLineIndex(value, startingLineIndex);
var newFormats = formats.slice(0);
var startCount = startLineFormats.length - 1;
var endCount = endLineFormats.length - 1;
var changed;
for (var index = startIndex + 1 || 0; index < text.length; index++) {
if (text[index] !== LINE_SEPARATOR) {
continue;
}
if ((newFormats[index] || []).length <= startCount) {
break;
}
if (!newFormats[index]) {
continue;
}
changed = true;
newFormats[index] = newFormats[index].map(function (format, i) {
return i < startCount || i > endCount ? format : newFormat;
});
}
if (!changed) {
return value;
}
return normaliseFormats({
text: text,
formats: newFormats,
start: start,
end: end
});
}
// CONCATENATED MODULE: ./node_modules/@wordpress/rich-text/build-module/index.js
/* concated harmony reexport applyFormat */__webpack_require__.d(__webpack_exports__, "applyFormat", function() { return applyFormat; });
/* concated harmony reexport charAt */__webpack_require__.d(__webpack_exports__, "charAt", function() { return charAt; });
@ -2804,6 +3135,12 @@ function unregisterFormatType(name) {
/* concated harmony reexport toggleFormat */__webpack_require__.d(__webpack_exports__, "toggleFormat", function() { return toggleFormat; });
/* concated harmony reexport LINE_SEPARATOR */__webpack_require__.d(__webpack_exports__, "LINE_SEPARATOR", function() { return LINE_SEPARATOR; });
/* concated harmony reexport unregisterFormatType */__webpack_require__.d(__webpack_exports__, "unregisterFormatType", function() { return unregisterFormatType; });
/* concated harmony reexport indentListItems */__webpack_require__.d(__webpack_exports__, "indentListItems", function() { return indentListItems; });
/* concated harmony reexport outdentListItems */__webpack_require__.d(__webpack_exports__, "outdentListItems", function() { return outdentListItems; });
/* concated harmony reexport changeListType */__webpack_require__.d(__webpack_exports__, "changeListType", function() { return changeListType; });

File diff suppressed because one or more lines are too long

View File

@ -226,13 +226,13 @@ function wp_default_packages_scripts( &$scripts ) {
$packages_versions = array(
'api-fetch' => '2.2.8',
'a11y' => '2.0.2',
'annotations' => '1.0.6',
'annotations' => '1.0.8',
'autop' => '2.0.2',
'blob' => '2.1.0',
'block-library' => '2.2.13',
'block-library' => '2.2.15',
'block-serialization-default-parser' => '2.0.4',
'blocks' => '6.0.5',
'components' => '7.0.6',
'components' => '7.0.8',
'compose' => '3.0.1',
'core-data' => '2.0.17',
'data' => '4.2.1',
@ -240,22 +240,22 @@ function wp_default_packages_scripts( &$scripts ) {
'deprecated' => '2.0.5',
'dom' => '2.0.8',
'dom-ready' => '2.0.2',
'edit-post' => '3.1.8',
'editor' => '9.0.8',
'edit-post' => '3.1.10',
'editor' => '9.0.10',
'element' => '2.1.9',
'escape-html' => '1.0.1',
'format-library' => '1.2.11',
'format-library' => '1.2.13',
'hooks' => '2.0.5',
'html-entities' => '2.0.4',
'i18n' => '3.1.1',
'is-shallow-equal' => '1.1.5',
'keycodes' => '2.0.6',
'list-reusable-blocks' => '1.1.19',
'list-reusable-blocks' => '1.1.21',
'notices' => '1.1.3',
'nux' => '3.0.7',
'nux' => '3.0.9',
'plugins' => '2.0.10',
'redux-routine' => '3.0.4',
'rich-text' => '3.0.5',
'rich-text' => '3.0.7',
'shortcode' => '2.0.2',
'token-list' => '1.1.0',
'url' => '2.3.3',
@ -379,7 +379,6 @@ function wp_default_packages_scripts( &$scripts ) {
'editor' => array(
'jquery',
'lodash',
'wp-tinymce-lists',
'wp-a11y',
'wp-api-fetch',
'wp-blob',

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-beta2-44710';
$wp_version = '5.1-beta2-44711';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.