Skip to content

Commit

Permalink
Merge branch 'release/1.13.2' of https://github.com/pixelgrade/nova-b…
Browse files Browse the repository at this point in the history
…locks into release/1.13.2
  • Loading branch information
razwan committed Sep 3, 2021
2 parents 9206656 + 17f71a2 commit 37e7121
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ subscribe( () => {
const updateBlock = ( block ) => {

const supports = getSupports( block.name );
const { attributes, clientId } = block;
const { colorSignal, palette, paletteVariation, useSourceColorAsReference } = attributes;

if ( supports?.novaBlocks?.colorSignal ) {
if ( supports?.novaBlocks?.colorSignal &&
typeof colorSignal !== "undefined" &&
typeof palette !== "undefined" &&
typeof paletteVariation !== "undefined" ) {
const { updateBlockAttributes } = dispatch( 'core/block-editor' );
const { attributes, clientId } = block;
const { colorSignal, paletteVariation, useSourceColorAsReference } = attributes;
const parentVariation = getParentVariation( clientId );
const absoluteVariation = getAbsoluteColorVariation( attributes );
const nextVariation = computeColorSignal( parentVariation, colorSignal, absoluteVariation );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const withContentPositionMatrixDeprecated = ( settings ) => {
return Object.assign( {}, settings, {
deprecated: [ {
attributes: {
...settings.attributes,
horizontalAlignment: {
type: "string",
default: "center"
Expand All @@ -112,11 +113,11 @@ const withContentPositionMatrixDeprecated = ( settings ) => {
isEligible( attributes ) {
return ! isUndefined( attributes.horizontalAlignment ) && ! isUndefined( attributes.verticalAlignment ) && isUndefined( attributes.contentPosition );
},
migrate( oldAttributes ) {
const { horizontalAlignment, verticalAlignment, ...attributes } = oldAttributes;
migrate( attributes ) {
const { horizontalAlignment, verticalAlignment, ...newAttributes } = attributes;

return {
...attributes,
...newAttributes,
contentPosition: `${ verticalAlignment } ${ horizontalAlignment }`
};
},
Expand Down
8 changes: 0 additions & 8 deletions packages/block-library/src/blocks/media/attributes.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@
"type": "string",
"default": "moderate"
},
"horizontalAlignment": {
"type": "string",
"default": "center"
},
"verticalAlignment": {
"type": "string",
"default": ""
},
"layoutPreset": {
"type": "string",
"default": "stable"
Expand Down

0 comments on commit 37e7121

Please sign in to comment.