Block Editor: Upgrade the `@wordpress/` packages.

This brings the block editor in core up to date with the Gutenberg 4.8 plugin release.

Props aduth, gziolo, youknowriad, mkaz, jorgefilipecosta, swissspidy, iseulde, soean, noisysocks, joen, brentswisher, dekervit, dimadin, zebulan, johnny5, nosolosw, netweb, ryelle, etoledom, mzorz, desrosj, mmtr86, tinkerbelly, ocean90, earnjam, ajitbohra, talldanwp, notnownikki, mcsf, afercia, adamsilverstein, gutendev, naoki0h, miyauchi, aldavigdis.
Fixes #45885.


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


git-svn-id: http://core.svn.wordpress.org/trunk@44364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2019-01-10 01:54:56 +00:00
parent da77cad30f
commit 14c44ad703
18 changed files with 254 additions and 179 deletions

View File

@ -404,13 +404,35 @@ body.is-fullscreen-mode .components-notice-list {
margin: auto 20px; }
.edit-post-layout__content {
position: relative;
display: flex;
min-height: 100%;
flex-direction: column;
min-height: 100%;
position: relative;
padding-bottom: 50vh;
overflow-y: auto;
-webkit-overflow-scrolling: touch; }
@media (min-width: 782px) {
.edit-post-layout__content {
position: fixed;
bottom: 0;
right: 0;
left: 0;
top: 88px;
min-height: calc(100% - 88px);
height: auto;
margin-right: 160px; }
body.auto-fold .edit-post-layout__content {
margin-right: 36px; } }
@media (min-width: 782px) and (min-width: 960px) {
body.auto-fold .edit-post-layout__content {
margin-right: 160px; } }
@media (min-width: 782px) {
body.folded .edit-post-layout__content {
margin-right: 36px; }
body.is-fullscreen-mode .edit-post-layout__content {
margin-right: 0 !important;
position: relative;
top: inherit; } }
@media (min-width: 600px) {
.edit-post-layout__content {
padding-bottom: 0; } }
@ -418,7 +440,7 @@ body.is-fullscreen-mode .components-notice-list {
.edit-post-layout__content {
overscroll-behavior-y: none; } }
.edit-post-layout__content .edit-post-visual-editor {
flex-grow: 1; }
flex: 1 1 auto; }
@supports ((position: -webkit-sticky) or (position: sticky)) {
.edit-post-layout__content .edit-post-visual-editor {
flex-basis: 100%; } }

File diff suppressed because one or more lines are too long

View File

@ -404,13 +404,35 @@ body.is-fullscreen-mode .components-notice-list {
margin: auto 20px; }
.edit-post-layout__content {
position: relative;
display: flex;
min-height: 100%;
flex-direction: column;
min-height: 100%;
position: relative;
padding-bottom: 50vh;
overflow-y: auto;
-webkit-overflow-scrolling: touch; }
@media (min-width: 782px) {
.edit-post-layout__content {
position: fixed;
bottom: 0;
left: 0;
right: 0;
top: 88px;
min-height: calc(100% - 88px);
height: auto;
margin-left: 160px; }
body.auto-fold .edit-post-layout__content {
margin-left: 36px; } }
@media (min-width: 782px) and (min-width: 960px) {
body.auto-fold .edit-post-layout__content {
margin-left: 160px; } }
@media (min-width: 782px) {
body.folded .edit-post-layout__content {
margin-left: 36px; }
body.is-fullscreen-mode .edit-post-layout__content {
margin-left: 0 !important;
position: relative;
top: inherit; } }
@media (min-width: 600px) {
.edit-post-layout__content {
padding-bottom: 0; } }
@ -418,7 +440,7 @@ body.is-fullscreen-mode .components-notice-list {
.edit-post-layout__content {
overscroll-behavior-y: none; } }
.edit-post-layout__content .edit-post-visual-editor {
flex-grow: 1; }
flex: 1 1 auto; }
@supports ((position: -webkit-sticky) or (position: sticky)) {
.edit-post-layout__content .edit-post-visual-editor {
flex-basis: 100%; } }

File diff suppressed because one or more lines are too long

View File

@ -988,6 +988,13 @@ function _defineProperty(obj, key, value) {
/***/ }),
/***/ 16:
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/***/ 17:
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@ -1043,13 +1050,6 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
}());
/***/ }),
/***/ 17:
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/***/ 18:
@ -1440,7 +1440,7 @@ var objectSpread = __webpack_require__(8);
var external_this_wp_element_ = __webpack_require__(0);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(16);
var classnames = __webpack_require__(17);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: external "lodash"
@ -2882,9 +2882,12 @@ function (_Component) {
Object(createClass["a" /* default */])(ImageEdit, [{
key: "componentDidMount",
value: function componentDidMount() {
var _this2 = this;
var _this$props = this.props,
attributes = _this$props.attributes,
setAttributes = _this$props.setAttributes;
setAttributes = _this$props.setAttributes,
noticeOperations = _this$props.noticeOperations;
var id = attributes.id,
_attributes$url = attributes.url,
url = _attributes$url === void 0 ? '' : _attributes$url;
@ -2901,7 +2904,14 @@ function (_Component) {
setAttributes(edit_pickRelevantMediaFiles(image));
},
allowedTypes: ALLOWED_MEDIA_TYPES
allowedTypes: ALLOWED_MEDIA_TYPES,
onError: function onError(message) {
noticeOperations.createErrorNotice(message);
_this2.setState({
isEditing: true
});
}
});
}
}
@ -3109,12 +3119,12 @@ function (_Component) {
}, {
key: "updateDimensions",
value: function updateDimensions() {
var _this2 = this;
var _this3 = this;
var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
return function () {
_this2.props.setAttributes({
_this3.props.setAttributes({
width: width,
height: height
});
@ -3177,7 +3187,7 @@ function (_Component) {
}, {
key: "render",
value: function render() {
var _this3 = this;
var _this4 = this;
var isEditing = this.state.isEditing;
var _this$props3 = this.props,
@ -3269,13 +3279,13 @@ function (_Component) {
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextareaControl"], {
label: Object(external_this_wp_i18n_["__"])('Alt Text (Alternative Text)'),
value: alt,
onChange: _this3.updateAlt,
onChange: _this4.updateAlt,
help: Object(external_this_wp_i18n_["__"])('Alternative text describes your image to people who cant see it. Add a short description with its key details.')
}), !Object(external_lodash_["isEmpty"])(imageSizeOptions) && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SelectControl"], {
label: Object(external_this_wp_i18n_["__"])('Image Size'),
value: url,
options: imageSizeOptions,
onChange: _this3.updateImageURL
onChange: _this4.updateImageURL
}), isResizable && Object(external_this_wp_element_["createElement"])("div", {
className: "block-library-image__dimensions"
}, Object(external_this_wp_element_["createElement"])("p", {
@ -3289,7 +3299,7 @@ function (_Component) {
value: width !== undefined ? width : '',
placeholder: imageWidth,
min: 1,
onChange: _this3.updateWidth
onChange: _this4.updateWidth
}), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
type: "number",
className: "block-library-image__dimensions__height",
@ -3297,7 +3307,7 @@ function (_Component) {
value: height !== undefined ? height : '',
placeholder: imageHeight,
min: 1,
onChange: _this3.updateHeight
onChange: _this4.updateHeight
})), Object(external_this_wp_element_["createElement"])("div", {
className: "block-library-image__dimensions__row"
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ButtonGroup"], {
@ -3311,36 +3321,36 @@ function (_Component) {
isSmall: true,
isPrimary: isCurrent,
"aria-pressed": isCurrent,
onClick: _this3.updateDimensions(scaledWidth, scaledHeight)
onClick: _this4.updateDimensions(scaledWidth, scaledHeight)
}, scale, "%");
})), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Button"], {
isSmall: true,
onClick: _this3.updateDimensions()
onClick: _this4.updateDimensions()
}, Object(external_this_wp_i18n_["__"])('Reset'))))), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["PanelBody"], {
title: Object(external_this_wp_i18n_["__"])('Link Settings')
}, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["SelectControl"], {
label: Object(external_this_wp_i18n_["__"])('Link To'),
value: linkDestination,
options: _this3.getLinkDestinationOptions(),
onChange: _this3.onSetLinkDestination
options: _this4.getLinkDestinationOptions(),
onChange: _this4.onSetLinkDestination
}), linkDestination !== LINK_DESTINATION_NONE && Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
label: Object(external_this_wp_i18n_["__"])('Link URL'),
value: href || '',
onChange: _this3.onSetCustomHref,
onChange: _this4.onSetCustomHref,
placeholder: !isLinkURLInputReadOnly ? 'https://' : undefined,
readOnly: isLinkURLInputReadOnly
}), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["ToggleControl"], {
label: Object(external_this_wp_i18n_["__"])('Open in New Tab'),
onChange: _this3.onSetNewTab,
onChange: _this4.onSetNewTab,
checked: linkTarget === '_blank'
}), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
label: Object(external_this_wp_i18n_["__"])('Link CSS Class'),
value: linkClass || '',
onChange: _this3.onSetLinkClass
onChange: _this4.onSetLinkClass
}), Object(external_this_wp_element_["createElement"])(external_this_wp_components_["TextControl"], {
label: Object(external_this_wp_i18n_["__"])('Link Rel'),
value: rel || '',
onChange: _this3.onSetLinkRel
onChange: _this4.onSetLinkRel
}))));
}; // Disable reason: Each block can be selected by clicking on it
@ -3358,7 +3368,7 @@ function (_Component) {
imageWidth = sizes.imageWidth,
imageHeight = sizes.imageHeight;
var filename = _this3.getFilename(url);
var filename = _this4.getFilename(url);
var defaultedAlt;
@ -3377,9 +3387,9 @@ function (_Component) {
Object(external_this_wp_element_["createElement"])(external_this_wp_element_["Fragment"], null, Object(external_this_wp_element_["createElement"])("img", {
src: url,
alt: defaultedAlt,
onClick: _this3.onImageClick,
onClick: _this4.onImageClick,
onError: function onError() {
return _this3.onImageError(url);
return _this4.onImageError(url);
}
}), Object(external_this_wp_blob_["isBlobURL"])(url) && Object(external_this_wp_element_["createElement"])(external_this_wp_components_["Spinner"], null))
/* eslint-enable jsx-a11y/no-noninteractive-element-interactions */
@ -4636,7 +4646,7 @@ var quote_settings = {
};
// EXTERNAL MODULE: external {"this":["wp","keycodes"]}
var external_this_wp_keycodes_ = __webpack_require__(17);
var external_this_wp_keycodes_ = __webpack_require__(16);
// CONCATENATED MODULE: ./node_modules/@wordpress/block-library/build-module/gallery/gallery-image.js
@ -5276,13 +5286,15 @@ var gallery_settings = {
isMultiBlock: true,
blocks: ['core/image'],
transform: function transform(attributes) {
// Init the align attribute from the first item which may be either the placeholder or an image.
var align = attributes[0].align; // Loop through all the images and check if they have the same align.
align = Object(external_lodash_["every"])(attributes, ['align', align]) ? align : undefined;
var validImages = Object(external_lodash_["filter"])(attributes, function (_ref) {
var id = _ref.id,
url = _ref.url;
return id && url;
});
if (validImages.length > 0) {
return Object(external_this_wp_blocks_["createBlock"])('core/gallery', {
images: validImages.map(function (_ref2) {
var id = _ref2.id,
@ -5299,12 +5311,10 @@ var gallery_settings = {
ids: validImages.map(function (_ref3) {
var id = _ref3.id;
return id;
})
}),
align: align
});
}
return Object(external_this_wp_blocks_["createBlock"])('core/gallery');
}
}, {
type: 'shortcode',
tag: 'gallery',
@ -5378,7 +5388,8 @@ var gallery_settings = {
type: 'block',
blocks: ['core/image'],
transform: function transform(_ref8) {
var images = _ref8.images;
var images = _ref8.images,
align = _ref8.align;
if (images.length > 0) {
return images.map(function (_ref9) {
@ -5390,12 +5401,15 @@ var gallery_settings = {
id: id,
url: url,
alt: alt,
caption: caption
caption: caption,
align: align
});
});
}
return Object(external_this_wp_blocks_["createBlock"])('core/image');
return Object(external_this_wp_blocks_["createBlock"])('core/image', {
align: align
});
}
}]
},
@ -7794,7 +7808,7 @@ var embed_preview_EmbedPreview = function EmbedPreview(props) {
href: url
}, url)), Object(external_this_wp_element_["createElement"])("p", {
className: "components-placeholder__error"
}, Object(external_this_wp_i18n_["__"])('Previews for this are unavailable in the editor, sorry!'))) : embedWrapper, (!external_this_wp_editor_["RichText"].isEmpty(caption) || isSelected) && Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["RichText"], {
}, Object(external_this_wp_i18n_["__"])('Sorry, we cannot preview this embedded content in the editor.'))) : embedWrapper, (!external_this_wp_editor_["RichText"].isEmpty(caption) || isSelected) && Object(external_this_wp_element_["createElement"])(external_this_wp_editor_["RichText"], {
tagName: "figcaption",
placeholder: Object(external_this_wp_i18n_["__"])('Write caption…'),
value: caption,
@ -8580,7 +8594,8 @@ function (_Component) {
text: href,
className: "".concat(className, "__copy-url-button"),
onCopy: this.confirmCopyURL,
onFinishCopy: this.resetCopyConfirmation
onFinishCopy: this.resetCopyConfirmation,
disabled: Object(external_this_wp_blob_["isBlobURL"])(href)
}, showCopyConfirmation ? Object(external_this_wp_i18n_["__"])('Copied!') : Object(external_this_wp_i18n_["__"])('Copy URL'))));
}
}]);

File diff suppressed because one or more lines are too long

View File

@ -275,6 +275,12 @@ function _defineProperty(obj, key, value) {
/***/ }),
/* 16 */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@ -330,12 +336,6 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
}());
/***/ }),
/* 17 */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/* 18 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
@ -23068,14 +23068,14 @@ var assertThisInitialized = __webpack_require__(3);
var toConsumableArray = __webpack_require__(19);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(16);
var classnames = __webpack_require__(17);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: external "lodash"
var external_lodash_ = __webpack_require__(2);
// EXTERNAL MODULE: external {"this":["wp","keycodes"]}
var external_this_wp_keycodes_ = __webpack_require__(17);
var external_this_wp_keycodes_ = __webpack_require__(16);
// EXTERNAL MODULE: external {"this":["wp","i18n"]}
var external_this_wp_i18n_ = __webpack_require__(1);
@ -35129,14 +35129,9 @@ function ToolbarButton(_ref) {
// CONCATENATED MODULE: ./node_modules/@wordpress/components/build-module/toolbar/toolbar-container.js
/**
* External dependencies
*/
var toolbar_container_ToolbarContainer = function ToolbarContainer(props) {
return Object(external_this_wp_element_["createElement"])("div", {
className: classnames_default()('components-toolbar', props.className)
className: props.className
}, props.children);
};

File diff suppressed because one or more lines are too long

View File

@ -218,6 +218,13 @@ function _defineProperty(obj, key, value) {
/***/ }),
/***/ 16:
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/***/ 17:
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@ -273,13 +280,6 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
}());
/***/ }),
/***/ 17:
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/***/ 18:
@ -1066,7 +1066,7 @@ function CopyContentMenuItem(_ref) {
}))(CopyContentMenuItem));
// EXTERNAL MODULE: external {"this":["wp","keycodes"]}
var external_this_wp_keycodes_ = __webpack_require__(17);
var external_this_wp_keycodes_ = __webpack_require__(16);
// CONCATENATED MODULE: ./node_modules/@wordpress/edit-post/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js
@ -2036,7 +2036,7 @@ var effects = {
window.tinyMCE.triggerSave();
}
var state = store.getState(); // Additional data needed for backwards compatibility.
var state = store.getState(); // Additional data needed for backward compatibility.
// If we do not provide this data, the post will be overridden with the default values.
var post = Object(external_this_wp_data_["select"])('core/editor').getCurrentPost(state);
@ -2251,7 +2251,7 @@ store_store.dispatch({
});
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(16);
var classnames = __webpack_require__(17);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: external {"this":["wp","url"]}
@ -5743,7 +5743,15 @@ function reinitializeEditor(postType, postId, target, settings, initialEdits) {
function initializeEditor(id, postType, postId, settings, initialEdits) {
var target = document.getElementById(id);
var reboot = reinitializeEditor.bind(null, postType, postId, target, settings, initialEdits);
Object(external_this_wp_blockLibrary_["registerCoreBlocks"])();
Object(external_this_wp_blockLibrary_["registerCoreBlocks"])(); // Show a console log warning if the browser is not in Standards rendering mode.
var documentMode = document.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';
if (documentMode !== 'Standards') {
// eslint-disable-next-line no-console
console.warn("Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.");
}
Object(external_this_wp_data_["dispatch"])('core/nux').triggerGuide(['core/editor.inserter', 'core/editor.settings', 'core/editor.preview', 'core/editor.publish']);
Object(external_this_wp_element_["render"])(Object(external_this_wp_element_["createElement"])(editor, {
settings: settings,

File diff suppressed because one or more lines are too long

View File

@ -290,6 +290,12 @@ function _defineProperty(obj, key, value) {
/***/ }),
/* 16 */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@ -345,12 +351,6 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
}());
/***/ }),
/* 17 */
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/* 18 */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
@ -14069,7 +14069,7 @@ var esm_extends = __webpack_require__(18);
var external_this_wp_element_ = __webpack_require__(0);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(16);
var classnames = __webpack_require__(17);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: external {"this":["wp","compose"]}
@ -14878,7 +14878,7 @@ BlockFormatControls.Slot = block_format_controls_Slot;
/* harmony default export */ var block_format_controls = (BlockFormatControls);
// EXTERNAL MODULE: external {"this":["wp","keycodes"]}
var external_this_wp_keycodes_ = __webpack_require__(17);
var external_this_wp_keycodes_ = __webpack_require__(16);
// CONCATENATED MODULE: ./node_modules/@wordpress/editor/build-module/components/block-navigation/index.js
@ -23239,7 +23239,7 @@ function (_Component) {
if (this.state.selectedSuggestion !== null) {
this.selectLink(post); // Announce a link has been selected when tabbing away from the input field.
this.props.speak(Object(external_this_wp_i18n_["__"])('Link selected'));
this.props.speak(Object(external_this_wp_i18n_["__"])('Link selected.'));
}
break;

File diff suppressed because one or more lines are too long

View File

@ -182,6 +182,13 @@ function _inherits(subClass, superClass) {
/***/ }),
/***/ 16:
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/***/ 17:
/***/ (function(module, exports, __webpack_require__) {
var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
@ -237,13 +244,6 @@ var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
}());
/***/ }),
/***/ 17:
/***/ (function(module, exports) {
(function() { module.exports = this["wp"]["keycodes"]; }());
/***/ }),
/***/ 2:
@ -638,11 +638,11 @@ var italic = {
var external_this_wp_url_ = __webpack_require__(24);
// EXTERNAL MODULE: ./node_modules/classnames/index.js
var classnames = __webpack_require__(16);
var classnames = __webpack_require__(17);
var classnames_default = /*#__PURE__*/__webpack_require__.n(classnames);
// EXTERNAL MODULE: external {"this":["wp","keycodes"]}
var external_this_wp_keycodes_ = __webpack_require__(17);
var external_this_wp_keycodes_ = __webpack_require__(16);
// EXTERNAL MODULE: external {"this":["wp","dom"]}
var external_this_wp_dom_ = __webpack_require__(22);
@ -1061,7 +1061,7 @@ function (_Component) {
} else if (isActive) {
speak(Object(external_this_wp_i18n_["__"])('Link edited.'), 'assertive');
} else {
speak(Object(external_this_wp_i18n_["__"])('Link inserted'), 'assertive');
speak(Object(external_this_wp_i18n_["__"])('Link inserted.'), 'assertive');
}
}
}, {

File diff suppressed because one or more lines are too long

View File

@ -106,11 +106,11 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
not_json: /[^j]/,
text: /^[^\x25]+/,
modulo: /^\x25{2}/,
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
key: /^([a-z_][a-z_\d]*)/i,
key_access: /^\.([a-z_][a-z_\d]*)/i,
index_access: /^\[(\d+)\]/,
sign: /^[\+\-]/
sign: /^[+-]/
}
function sprintf(key) {
@ -123,42 +123,42 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
}
function sprintf_format(parse_tree, argv) {
var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, match, pad, pad_character, pad_length, is_positive, sign
var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign
for (i = 0; i < tree_length; i++) {
if (typeof parse_tree[i] === 'string') {
output += parse_tree[i]
}
else if (Array.isArray(parse_tree[i])) {
match = parse_tree[i] // convenience purposes only
if (match[2]) { // keyword argument
else if (typeof parse_tree[i] === 'object') {
ph = parse_tree[i] // convenience purposes only
if (ph.keys) { // keyword argument
arg = argv[cursor]
for (k = 0; k < match[2].length; k++) {
if (!arg.hasOwnProperty(match[2][k])) {
throw new Error(sprintf('[sprintf] property "%s" does not exist', match[2][k]))
for (k = 0; k < ph.keys.length; k++) {
if (arg == undefined) {
throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1]))
}
arg = arg[match[2][k]]
arg = arg[ph.keys[k]]
}
}
else if (match[1]) { // positional argument (explicit)
arg = argv[match[1]]
else if (ph.param_no) { // positional argument (explicit)
arg = argv[ph.param_no]
}
else { // positional argument (implicit)
arg = argv[cursor++]
}
if (re.not_type.test(match[8]) && re.not_primitive.test(match[8]) && arg instanceof Function) {
if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
arg = arg()
}
if (re.numeric_arg.test(match[8]) && (typeof arg !== 'number' && isNaN(arg))) {
if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
}
if (re.number.test(match[8])) {
if (re.number.test(ph.type)) {
is_positive = arg >= 0
}
switch (match[8]) {
switch (ph.type) {
case 'b':
arg = parseInt(arg, 10).toString(2)
break
@ -170,38 +170,38 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
arg = parseInt(arg, 10)
break
case 'j':
arg = JSON.stringify(arg, null, match[6] ? parseInt(match[6]) : 0)
arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)
break
case 'e':
arg = match[7] ? parseFloat(arg).toExponential(match[7]) : parseFloat(arg).toExponential()
arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()
break
case 'f':
arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg)
arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)
break
case 'g':
arg = match[7] ? String(Number(arg.toPrecision(match[7]))) : parseFloat(arg)
arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)
break
case 'o':
arg = (parseInt(arg, 10) >>> 0).toString(8)
break
case 's':
arg = String(arg)
arg = (match[7] ? arg.substring(0, match[7]) : arg)
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
break
case 't':
arg = String(!!arg)
arg = (match[7] ? arg.substring(0, match[7]) : arg)
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
break
case 'T':
arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()
arg = (match[7] ? arg.substring(0, match[7]) : arg)
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
break
case 'u':
arg = parseInt(arg, 10) >>> 0
break
case 'v':
arg = arg.valueOf()
arg = (match[7] ? arg.substring(0, match[7]) : arg)
arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
break
case 'x':
arg = (parseInt(arg, 10) >>> 0).toString(16)
@ -210,21 +210,21 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()
break
}
if (re.json.test(match[8])) {
if (re.json.test(ph.type)) {
output += arg
}
else {
if (re.number.test(match[8]) && (!is_positive || match[3])) {
if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
sign = is_positive ? '+' : '-'
arg = arg.toString().replace(re.sign, '')
}
else {
sign = ''
}
pad_character = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' '
pad_length = match[6] - (sign + arg).length
pad = match[6] ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''
output += match[5] ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)
pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '
pad_length = ph.width - (sign + arg).length
pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''
output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)
}
}
}
@ -275,7 +275,20 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
if (arg_names === 3) {
throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')
}
parse_tree.push(match)
parse_tree.push(
{
placeholder: match[0],
param_no: match[1],
keys: match[2],
sign: match[3],
pad_char: match[4],
align: match[5],
width: match[6],
precision: match[7],
type: match[8]
}
)
}
else {
throw new SyntaxError('[sprintf] unexpected placeholder')
@ -308,7 +321,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
}
}
/* eslint-enable quote-props */
}()
}(); // eslint-disable-line
/***/ }),

File diff suppressed because one or more lines are too long

View File

@ -224,42 +224,42 @@ function wp_default_packages_scripts( &$scripts ) {
$suffix = wp_scripts_get_suffix();
$packages_versions = array(
'api-fetch' => '2.2.7',
'api-fetch' => '2.2.8',
'a11y' => '2.0.2',
'annotations' => '1.0.5',
'annotations' => '1.0.6',
'autop' => '2.0.2',
'blob' => '2.1.0',
'block-library' => '2.2.12',
'block-serialization-default-parser' => '2.0.3',
'block-library' => '2.2.13',
'block-serialization-default-parser' => '2.0.4',
'blocks' => '6.0.5',
'components' => '7.0.5',
'compose' => '3.0.0',
'core-data' => '2.0.16',
'data' => '4.2.0',
'components' => '7.0.6',
'compose' => '3.0.1',
'core-data' => '2.0.17',
'data' => '4.2.1',
'date' => '3.0.1',
'deprecated' => '2.0.4',
'deprecated' => '2.0.5',
'dom' => '2.0.8',
'dom-ready' => '2.0.2',
'edit-post' => '3.1.7',
'editor' => '9.0.7',
'element' => '2.1.8',
'edit-post' => '3.1.8',
'editor' => '9.0.8',
'element' => '2.1.9',
'escape-html' => '1.0.1',
'format-library' => '1.2.10',
'hooks' => '2.0.4',
'format-library' => '1.2.11',
'hooks' => '2.0.5',
'html-entities' => '2.0.4',
'i18n' => '3.1.0',
'is-shallow-equal' => '1.1.4',
'keycodes' => '2.0.5',
'list-reusable-blocks' => '1.1.18',
'notices' => '1.1.2',
'nux' => '3.0.6',
'i18n' => '3.1.1',
'is-shallow-equal' => '1.1.5',
'keycodes' => '2.0.6',
'list-reusable-blocks' => '1.1.19',
'notices' => '1.1.3',
'nux' => '3.0.7',
'plugins' => '2.0.10',
'redux-routine' => '3.0.3',
'rich-text' => '3.0.4',
'redux-routine' => '3.0.4',
'rich-text' => '3.0.5',
'shortcode' => '2.0.2',
'token-list' => '1.1.0',
'url' => '2.3.3',
'viewport' => '2.1.0',
'viewport' => '2.1.1',
'wordcount' => '2.0.3',
);

View File

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