Block Editor: Update packages to the ones slated for WP5.2.2
- Fix the template validation notice - Fix for focus jumps when typing in meta attributes Packages updated: - @wordpress/block-editor@2.0.3 - @wordpress/block-library@2.4.6 - @wordpress/e2e-tests@1.1.6 - @wordpress/edit-post@3.3.6 - @wordpress/editor@9.2.6 - @wordpress/format-library@1.4.6 Props aduth, desrosj. Merges [45481] to the 5.2 branch. Fixes #47429. Built from https://develop.svn.wordpress.org/branches/5.2@45482 git-svn-id: http://core.svn.wordpress.org/branches/5.2@45293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
51fa88c742
commit
3b810cf2a3
|
@ -12208,20 +12208,42 @@ function (_Component) {
|
|||
}
|
||||
}, {
|
||||
key: "setAttributes",
|
||||
value: function setAttributes(attributes) {
|
||||
value: function setAttributes(newAttributes) {
|
||||
var _this$props = this.props,
|
||||
clientId = _this$props.clientId,
|
||||
name = _this$props.name,
|
||||
onChange = _this$props.onChange;
|
||||
var type = Object(external_this_wp_blocks_["getBlockType"])(name);
|
||||
onChange(clientId, attributes);
|
||||
var metaAttributes = Object(external_lodash_["reduce"])(attributes, function (result, value, key) {
|
||||
if (Object(external_lodash_["get"])(type, ['attributes', key, 'source']) === 'meta') {
|
||||
result[type.attributes[key].meta] = value;
|
||||
|
||||
function isMetaAttribute(key) {
|
||||
return Object(external_lodash_["get"])(type, ['attributes', key, 'source']) === 'meta';
|
||||
} // Partition new attributes to delegate update behavior by source.
|
||||
//
|
||||
// TODO: A consolidated approach to external attributes sourcing
|
||||
// should be devised to avoid specific handling for meta, enable
|
||||
// additional attributes sources.
|
||||
//
|
||||
// See: https://github.com/WordPress/gutenberg/issues/2759
|
||||
|
||||
|
||||
var _reduce = Object(external_lodash_["reduce"])(newAttributes, function (result, value, key) {
|
||||
if (isMetaAttribute(key)) {
|
||||
result.metaAttributes[type.attributes[key].meta] = value;
|
||||
} else {
|
||||
result.blockAttributes[key] = value;
|
||||
}
|
||||
|
||||
return result;
|
||||
}, {});
|
||||
}, {
|
||||
blockAttributes: {},
|
||||
metaAttributes: {}
|
||||
}),
|
||||
blockAttributes = _reduce.blockAttributes,
|
||||
metaAttributes = _reduce.metaAttributes;
|
||||
|
||||
if (Object(external_lodash_["size"])(blockAttributes)) {
|
||||
onChange(clientId, blockAttributes);
|
||||
}
|
||||
|
||||
if (Object(external_lodash_["size"])(metaAttributes)) {
|
||||
this.props.onMetaChange(metaAttributes);
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -14945,7 +14945,7 @@ function (_Component) {
|
|||
Object(createClass["a" /* default */])(EditorProvider, [{
|
||||
key: "getBlockEditorSettings",
|
||||
value: function getBlockEditorSettings(settings, meta, onMetaChange, reusableBlocks) {
|
||||
return Object(objectSpread["a" /* default */])({}, Object(external_lodash_["pick"])(settings, ['alignWide', 'allowedBlockTypes', 'availableLegacyWidgets', 'bodyPlaceholder', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'focusMode', 'fontSizes', 'hasFixedToolbar', 'hasPermissionsToManageWidgets', 'imageSizes', 'isRTL', 'maxWidth', 'styles', 'templateLock', 'titlePlaceholder']), {
|
||||
return Object(objectSpread["a" /* default */])({}, Object(external_lodash_["pick"])(settings, ['alignWide', 'allowedBlockTypes', 'availableLegacyWidgets', 'bodyPlaceholder', 'colors', 'disableCustomColors', 'disableCustomFontSizes', 'focusMode', 'fontSizes', 'hasFixedToolbar', 'hasPermissionsToManageWidgets', 'imageSizes', 'isRTL', 'maxWidth', 'styles', 'template', 'templateLock', 'titlePlaceholder']), {
|
||||
__experimentalMetaSource: {
|
||||
value: meta,
|
||||
onChange: onMetaChange
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -229,8 +229,8 @@ function wp_default_packages_scripts( &$scripts ) {
|
|||
'api-fetch' => '3.1.2',
|
||||
'autop' => '2.0.0',
|
||||
'blob' => '2.3.0',
|
||||
'block-editor' => '2.0.2',
|
||||
'block-library' => '2.4.5',
|
||||
'block-editor' => '2.0.3',
|
||||
'block-library' => '2.4.6',
|
||||
'block-serialization-default-parser' => '3.1.0',
|
||||
'blocks' => '6.2.5',
|
||||
'components' => '7.3.2',
|
||||
|
@ -241,11 +241,11 @@ function wp_default_packages_scripts( &$scripts ) {
|
|||
'deprecated' => '2.2.0',
|
||||
'dom' => '2.2.5',
|
||||
'dom-ready' => '2.2.0',
|
||||
'edit-post' => '3.3.5',
|
||||
'editor' => '9.2.5',
|
||||
'edit-post' => '3.3.6',
|
||||
'editor' => '9.2.6',
|
||||
'element' => '2.3.0',
|
||||
'escape-html' => '1.2.0',
|
||||
'format-library' => '1.4.5',
|
||||
'format-library' => '1.4.6',
|
||||
'hooks' => '2.2.0',
|
||||
'html-entities' => '2.2.0',
|
||||
'i18n' => '3.3.0',
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '5.2.2-alpha-45374';
|
||||
$wp_version = '5.2.2-alpha-45482';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
Loading…
Reference in New Issue