@@ -18,6 +18,7 @@ import { semverCompare } from '~stackable/util'
1818import {
1919 deprecateBlockBackgroundColorOpacity , deprecateContainerBackgroundColorOpacity ,
2020 deprecateBlockShadowColor , deprecateContainerShadowColor , deprecateBlockHeight ,
21+ deprecateInnerBlockRowGapAndContainerHeight ,
2122} from '~stackable/block-components'
2223
2324// Version 3.8 added horizontal flex, we changed the stk--block-orientation-* to stk--block-horizontal-flex.
@@ -76,13 +77,14 @@ addFilter( 'stackable.column.save.blockClassNames', 'stackable/3.8.0', ( output,
7677
7778const deprecated = [
7879 {
79- // Support the change of type for block height
80+ // Support the change of type for block height, innerBlockRowGap and containerHeight
8081 attributes : attributes ( '3.15.2' ) ,
8182 save : withVersion ( '3.15.2' ) ( Save ) ,
8283 isEligible : attributes => {
83- const isNotV4 = attributes . version < 2 || typeof attributes . version === 'undefined'
8484 const hasNumberBlockHeight = deprecateBlockHeight . isEligible ( attributes )
85- return isNotV4 || hasNumberBlockHeight
85+ const hasNumberInnerBlockRowGapAndContainerHeight = deprecateInnerBlockRowGapAndContainerHeight . isEligible ( '%s' ) ( attributes )
86+
87+ return hasNumberBlockHeight || hasNumberInnerBlockRowGapAndContainerHeight
8688 } ,
8789 migrate : ( attributes , innerBlocks ) => {
8890 const isNotV4 = attributes . version < 4 || typeof attributes . version === 'undefined'
@@ -144,6 +146,7 @@ const deprecated = [
144146 newAttributes = deprecateBlockShadowColor . migrate ( newAttributes )
145147 newAttributes = deprecateContainerShadowColor . migrate ( newAttributes )
146148 newAttributes = deprecateBlockHeight . migrate ( newAttributes )
149+ newAttributes = deprecateInnerBlockRowGapAndContainerHeight . migrate ( '%s' ) ( newAttributes )
147150
148151 return [ newAttributes , innerBlocks ]
149152 } ,
@@ -155,9 +158,8 @@ const deprecated = [
155158 isEligible : attributes => {
156159 const hasBlockShadow = deprecateBlockShadowColor . isEligible ( attributes )
157160 const hasContainerShadow = deprecateContainerShadowColor . isEligible ( attributes )
158- const isNotV4 = attributes . version < 4 || typeof attributes . version === 'undefined'
159161
160- return hasBlockShadow || hasContainerShadow || isNotV4
162+ return hasBlockShadow || hasContainerShadow
161163 } ,
162164 migrate : ( attributes , innerBlocks ) => {
163165 const isNotV4 = attributes . version < 4 || typeof attributes . version === 'undefined'
@@ -229,9 +231,8 @@ const deprecated = [
229231 isEligible : attributes => {
230232 const hasContainerOpacity = deprecateContainerBackgroundColorOpacity . isEligible ( attributes )
231233 const hasBlockOpacity = deprecateBlockBackgroundColorOpacity . isEligible ( attributes )
232- const isNotV4 = attributes . version < 4 || typeof attributes . version === 'undefined'
233234
234- return hasContainerOpacity || hasBlockOpacity || isNotV4
235+ return hasContainerOpacity || hasBlockOpacity
235236 } ,
236237 migrate : ( attributes , innerBlocks ) => {
237238 const isNotV4 = attributes . version < 4 || typeof attributes . version === 'undefined'
@@ -301,11 +302,6 @@ const deprecated = [
301302 // layout & containers work.
302303 attributes : attributes ( '3.7.9' ) ,
303304 save : withVersion ( '3.7.9' ) ( Save ) ,
304- isEligible : attributes => {
305- const isNotV4 = attributes . version < 4 || typeof attributes . version === 'undefined'
306-
307- return isNotV4
308- } ,
309305 migrate : ( attributes , innerBlocks ) => {
310306 let newAttributes = {
311307 ...attributes ,
0 commit comments