Block Editor: Additional package updates.
Built from https://develop.svn.wordpress.org/branches/5.1@51834 git-svn-id: http://core.svn.wordpress.org/branches/5.1@51441 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
15135a859f
commit
0fa98b27df
|
@ -16091,6 +16091,7 @@ function (_Component) {
|
|||
value: function getRecord() {
|
||||
var _this$formatToValue = this.formatToValue(this.props.value),
|
||||
formats = _this$formatToValue.formats,
|
||||
replacements = _this$formatToValue.replacements,
|
||||
text = _this$formatToValue.text;
|
||||
|
||||
var _this$state = this.state,
|
||||
|
@ -16100,7 +16101,8 @@ function (_Component) {
|
|||
formats: formats,
|
||||
text: text,
|
||||
start: start,
|
||||
end: end
|
||||
end: end,
|
||||
replacements: replacements
|
||||
};
|
||||
}
|
||||
}, {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -976,7 +976,8 @@ function normaliseFormats(_ref) {
|
|||
var formats = _ref.formats,
|
||||
text = _ref.text,
|
||||
start = _ref.start,
|
||||
end = _ref.end;
|
||||
end = _ref.end,
|
||||
replacements = _ref.replacements;
|
||||
var refs = [];
|
||||
var newFormats = formats.map(function (formatsAtIndex) {
|
||||
return formatsAtIndex.map(function (format) {
|
||||
|
@ -996,7 +997,8 @@ function normaliseFormats(_ref) {
|
|||
formats: newFormats,
|
||||
text: text,
|
||||
start: start,
|
||||
end: end
|
||||
end: end,
|
||||
replacements: replacements
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1027,7 +1029,8 @@ function applyFormat(_ref, format) {
|
|||
var formats = _ref.formats,
|
||||
text = _ref.text,
|
||||
start = _ref.start,
|
||||
end = _ref.end;
|
||||
end = _ref.end,
|
||||
replacements = _ref.replacements;
|
||||
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : start;
|
||||
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : end;
|
||||
var newFormats = formats.slice(0); // The selection is collpased.
|
||||
|
@ -1062,6 +1065,7 @@ function applyFormat(_ref, format) {
|
|||
text: text,
|
||||
start: start,
|
||||
end: end,
|
||||
replacements: replacements,
|
||||
formatPlaceholder: {
|
||||
index: startIndex,
|
||||
format: hasType ? undefined : format
|
||||
|
@ -1078,7 +1082,8 @@ function applyFormat(_ref, format) {
|
|||
formats: newFormats,
|
||||
text: text,
|
||||
start: start,
|
||||
end: end
|
||||
end: end,
|
||||
replacements: replacements
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1253,6 +1258,7 @@ var _window$Node = window.Node,
|
|||
function createEmptyValue() {
|
||||
return {
|
||||
formats: [],
|
||||
replacements: [],
|
||||
text: ''
|
||||
};
|
||||
}
|
||||
|
@ -1367,6 +1373,7 @@ function create() {
|
|||
if (typeof text === 'string' && text.length > 0) {
|
||||
return {
|
||||
formats: Array(text.length),
|
||||
replacements: Array(text.length),
|
||||
text: text
|
||||
};
|
||||
}
|
||||
|
@ -1559,6 +1566,7 @@ function createFromElement(_ref3) {
|
|||
// formats can be added.
|
||||
|
||||
accumulator.formats.length += _text.length;
|
||||
accumulator.replacements.length += _text.length;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1583,7 +1591,9 @@ function createFromElement(_ref3) {
|
|||
text: OBJECT_REPLACEMENT_CHARACTER
|
||||
};
|
||||
accumulateSelection(accumulator, node, range, _value);
|
||||
mergePair(accumulator, _value);
|
||||
accumulator.formats.length += 1;
|
||||
accumulator.replacements = accumulator.replacements.concat(_value.replacements);
|
||||
accumulator.text += OBJECT_REPLACEMENT_CHARACTER;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1591,6 +1601,7 @@ function createFromElement(_ref3) {
|
|||
accumulateSelection(accumulator, node, range, createEmptyValue());
|
||||
accumulator.text += '\n';
|
||||
accumulator.formats.length += 1;
|
||||
accumulator.replacements.length += 1;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1655,17 +1666,20 @@ function createFromElement(_ref3) {
|
|||
var formats = accumulator.formats;
|
||||
|
||||
if (format && format.attributes && text.length === 0) {
|
||||
var lastReplacement = accumulator.replacements[accumulator.replacements.length - 1];
|
||||
format.object = true;
|
||||
accumulator.text += OBJECT_REPLACEMENT_CHARACTER;
|
||||
|
||||
if (formats[start]) {
|
||||
formats[start].unshift(format);
|
||||
} else {
|
||||
formats[start] = [format];
|
||||
if (isFormatEqual(lastReplacement, format)) {
|
||||
return accumulator;
|
||||
}
|
||||
|
||||
accumulator.text += OBJECT_REPLACEMENT_CHARACTER;
|
||||
accumulator.replacements.push(format);
|
||||
accumulator.formats.length += 1;
|
||||
} else {
|
||||
accumulator.text += text;
|
||||
accumulator.formats.length += text.length;
|
||||
accumulator.replacements.length += text.length;
|
||||
var i = value.formats.length; // Optimise for speed.
|
||||
|
||||
while (i--) {
|
||||
|
@ -1688,6 +1702,10 @@ function createFromElement(_ref3) {
|
|||
formats[formatIndex] = value.formats[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (value.replacements[i]) {
|
||||
accumulator.replacements[formatIndex] = value.replacements[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1777,11 +1795,13 @@ function createFromMultilineElement(_ref4) {
|
|||
if (index !== 0 || currentWrapperTags.length > 0) {
|
||||
var formats = currentWrapperTags.length > 0 ? [currentWrapperTags] : [,];
|
||||
accumulator.formats = accumulator.formats.concat(formats);
|
||||
accumulator.replacements.length += 1;
|
||||
accumulator.text += LINE_SEPARATOR;
|
||||
}
|
||||
|
||||
accumulateSelection(accumulator, node, range, value);
|
||||
accumulator.formats = accumulator.formats.concat(value.formats);
|
||||
accumulator.replacements = accumulator.replacements.concat(value.replacements);
|
||||
accumulator.text += value.text;
|
||||
}
|
||||
|
||||
|
@ -2190,7 +2210,8 @@ function removeFormat(_ref, formatType) {
|
|||
var formats = _ref.formats,
|
||||
text = _ref.text,
|
||||
start = _ref.start,
|
||||
end = _ref.end;
|
||||
end = _ref.end,
|
||||
replacements = _ref.replacements;
|
||||
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : start;
|
||||
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : end;
|
||||
var newFormats = formats.slice(0); // If the selection is collapsed, expand start and end to the edges of the
|
||||
|
@ -2224,7 +2245,8 @@ function removeFormat(_ref, formatType) {
|
|||
formats: newFormats,
|
||||
text: text,
|
||||
start: start,
|
||||
end: end
|
||||
end: end,
|
||||
replacements: replacements
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2265,7 +2287,8 @@ function insert(_ref, valueToInsert) {
|
|||
var formats = _ref.formats,
|
||||
text = _ref.text,
|
||||
start = _ref.start,
|
||||
end = _ref.end;
|
||||
end = _ref.end,
|
||||
replacements = _ref.replacements;
|
||||
var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : start;
|
||||
var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : end;
|
||||
|
||||
|
@ -2279,6 +2302,7 @@ function insert(_ref, valueToInsert) {
|
|||
return normaliseFormats({
|
||||
formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)),
|
||||
text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex),
|
||||
replacements: replacements.slice(0, startIndex).concat(valueToInsert.replacements, replacements.slice(endIndex)),
|
||||
start: index,
|
||||
end: index
|
||||
});
|
||||
|
@ -2333,7 +2357,8 @@ function replace(_ref, pattern, replacement) {
|
|||
var formats = _ref.formats,
|
||||
text = _ref.text,
|
||||
start = _ref.start,
|
||||
end = _ref.end;
|
||||
end = _ref.end,
|
||||
replacements = _ref.replacements;
|
||||
text = text.replace(pattern, function (match) {
|
||||
for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
rest[_key - 1] = arguments[_key];
|
||||
|
@ -2342,6 +2367,7 @@ function replace(_ref, pattern, replacement) {
|
|||
var offset = rest[rest.length - 2];
|
||||
var newText = replacement;
|
||||
var newFormats;
|
||||
var newReplacements;
|
||||
|
||||
if (typeof newText === 'function') {
|
||||
newText = replacement.apply(void 0, [match].concat(rest));
|
||||
|
@ -2349,9 +2375,11 @@ function replace(_ref, pattern, replacement) {
|
|||
|
||||
if (Object(esm_typeof["a" /* default */])(newText) === 'object') {
|
||||
newFormats = newText.formats;
|
||||
newReplacements = newText.replacements;
|
||||
newText = newText.text;
|
||||
} else {
|
||||
newFormats = Array(newText.length);
|
||||
newReplacements = Array(newText.length);
|
||||
|
||||
if (formats[offset]) {
|
||||
newFormats = newFormats.fill(formats[offset]);
|
||||
|
@ -2359,6 +2387,7 @@ function replace(_ref, pattern, replacement) {
|
|||
}
|
||||
|
||||
formats = formats.slice(0, offset).concat(newFormats, formats.slice(offset + match.length));
|
||||
replacements = replacements.slice(0, offset).concat(newReplacements, replacements.slice(offset + match.length));
|
||||
|
||||
if (start) {
|
||||
start = end = offset + newText.length;
|
||||
|
@ -2368,6 +2397,7 @@ function replace(_ref, pattern, replacement) {
|
|||
});
|
||||
return normaliseFormats({
|
||||
formats: formats,
|
||||
replacements: replacements,
|
||||
text: text,
|
||||
start: start,
|
||||
end: end
|
||||
|
@ -2407,6 +2437,7 @@ function insertLineSeparator(value) {
|
|||
|
||||
var valueToInsert = {
|
||||
formats: formats,
|
||||
replacements: [,],
|
||||
text: LINE_SEPARATOR
|
||||
};
|
||||
return insert(value, valueToInsert, startIndex, endIndex);
|
||||
|
@ -2436,9 +2467,10 @@ var insert_object_OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
|
|||
function insertObject(value, formatToInsert, startIndex, endIndex) {
|
||||
var valueToInsert = {
|
||||
text: insert_object_OBJECT_REPLACEMENT_CHARACTER,
|
||||
formats: [[Object(objectSpread["a" /* default */])({}, formatToInsert, {
|
||||
replacements: [Object(objectSpread["a" /* default */])({}, formatToInsert, {
|
||||
object: true
|
||||
})]]
|
||||
})],
|
||||
formats: [,]
|
||||
};
|
||||
return insert(value, valueToInsert, startIndex, endIndex);
|
||||
}
|
||||
|
@ -2459,19 +2491,22 @@ function slice(_ref) {
|
|||
var formats = _ref.formats,
|
||||
text = _ref.text,
|
||||
start = _ref.start,
|
||||
end = _ref.end;
|
||||
end = _ref.end,
|
||||
replacements = _ref.replacements;
|
||||
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
|
||||
var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : end;
|
||||
|
||||
if (startIndex === undefined || endIndex === undefined) {
|
||||
return {
|
||||
formats: formats,
|
||||
text: text
|
||||
text: text,
|
||||
replacements: replacements
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
formats: formats.slice(startIndex, endIndex),
|
||||
replacements: replacements.slice(startIndex, endIndex),
|
||||
text: text.slice(startIndex, endIndex)
|
||||
};
|
||||
}
|
||||
|
@ -2497,7 +2532,8 @@ function split(_ref, string) {
|
|||
var formats = _ref.formats,
|
||||
text = _ref.text,
|
||||
start = _ref.start,
|
||||
end = _ref.end;
|
||||
end = _ref.end,
|
||||
replacements = _ref.replacements;
|
||||
|
||||
if (typeof string !== 'string') {
|
||||
return splitAtSelection.apply(void 0, arguments);
|
||||
|
@ -2508,6 +2544,7 @@ function split(_ref, string) {
|
|||
var startIndex = nextStart;
|
||||
var value = {
|
||||
formats: formats.slice(startIndex, startIndex + substring.length),
|
||||
replacements: replacements.slice(startIndex, startIndex + substring.length),
|
||||
text: substring
|
||||
};
|
||||
nextStart += string.length + substring.length;
|
||||
|
@ -2534,15 +2571,18 @@ function splitAtSelection(_ref2) {
|
|||
var formats = _ref2.formats,
|
||||
text = _ref2.text,
|
||||
start = _ref2.start,
|
||||
end = _ref2.end;
|
||||
end = _ref2.end,
|
||||
replacements = _ref2.replacements;
|
||||
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
|
||||
var endIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : end;
|
||||
var before = {
|
||||
formats: formats.slice(0, startIndex),
|
||||
replacements: replacements.slice(0, startIndex),
|
||||
text: text.slice(0, startIndex)
|
||||
};
|
||||
var after = {
|
||||
formats: formats.slice(endIndex),
|
||||
replacements: replacements.slice(endIndex),
|
||||
text: text.slice(endIndex),
|
||||
start: 0,
|
||||
end: 0
|
||||
|
@ -2661,7 +2701,8 @@ function toTree(_ref2) {
|
|||
text = value.text,
|
||||
start = value.start,
|
||||
end = value.end,
|
||||
formatPlaceholder = value.formatPlaceholder;
|
||||
formatPlaceholder = value.formatPlaceholder,
|
||||
replacements = value.replacements;
|
||||
var formatsLength = formats.length + 1;
|
||||
var tree = createEmpty();
|
||||
var multilineFormat = {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -226,36 +226,36 @@ function wp_default_packages_scripts( &$scripts ) {
|
|||
$packages_versions = array(
|
||||
'api-fetch' => '2.2.8',
|
||||
'a11y' => '2.0.2',
|
||||
'annotations' => '1.0.8',
|
||||
'annotations' => '1.0.10',
|
||||
'autop' => '2.0.2',
|
||||
'blob' => '2.1.0',
|
||||
'block-library' => '2.2.18',
|
||||
'block-library' => '2.2.20',
|
||||
'block-serialization-default-parser' => '2.0.5',
|
||||
'blocks' => '6.0.6',
|
||||
'components' => '7.0.8',
|
||||
'blocks' => '6.0.8',
|
||||
'components' => '7.0.10',
|
||||
'compose' => '3.0.1',
|
||||
'core-data' => '2.0.17',
|
||||
'data' => '4.2.1',
|
||||
'date' => '3.0.1',
|
||||
'deprecated' => '2.0.5',
|
||||
'dom' => '2.0.8',
|
||||
'dom' => '2.0.9',
|
||||
'dom-ready' => '2.0.2',
|
||||
'edit-post' => '3.1.11',
|
||||
'editor' => '9.0.11',
|
||||
'edit-post' => '3.1.13',
|
||||
'editor' => '9.0.13',
|
||||
'element' => '2.1.9',
|
||||
'escape-html' => '1.0.1',
|
||||
'format-library' => '1.2.14',
|
||||
'format-library' => '1.2.16',
|
||||
'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.21',
|
||||
'list-reusable-blocks' => '1.1.23',
|
||||
'notices' => '1.1.3',
|
||||
'nux' => '3.0.9',
|
||||
'plugins' => '2.0.10',
|
||||
'nux' => '3.0.11',
|
||||
'plugins' => '2.0.11',
|
||||
'redux-routine' => '3.0.4',
|
||||
'rich-text' => '3.0.7',
|
||||
'rich-text' => '3.0.9',
|
||||
'shortcode' => '2.0.2',
|
||||
'token-list' => '1.1.0',
|
||||
'url' => '2.3.3',
|
||||
|
|
Loading…
Reference in New Issue