@@ -13,7 +13,7 @@ import {
1313 Image , deprecateBlockBackgroundColorOpacity , deprecateContainerBackgroundColorOpacity ,
1414 deprecateTypographyGradientColor , deprecationImageOverlayOpacity ,
1515 deprecateBlockShadowColor , deprecateContainerShadowColor , deprecateShadowColor ,
16- deprecateTypographyFontSize , deprecateBlockHeight ,
16+ deprecateTypographyFontSize , deprecateBlockHeight , deprecateImageBorderRadius ,
1717} from '~stackable/block-components'
1818
1919/**
@@ -42,6 +42,74 @@ addFilter( 'stackable.posts.title.readmore-content', 'stackable/3_0_2', addUndef
4242addFilter ( 'stackable.posts.feature-image' , 'stackable/3_6_3' , determineFeatureImage )
4343
4444const deprecated = [
45+ {
46+ // Support the change of type for border radius
47+ attributes : attributes ( '3.16.3' ) ,
48+ save : withVersion ( '3.16.3' ) ( Save ) ,
49+ isEligible : attributes => {
50+ const hasNumberBorderRadius = deprecateImageBorderRadius . isEligible ( attributes )
51+
52+ return hasNumberBorderRadius
53+ } ,
54+ migrate : attributes => {
55+ let newAttributes = {
56+ ...attributes ,
57+ version : 2 ,
58+ }
59+
60+ // We used to have an "Inner content width" which is now just the block width
61+ const hasOldInnerContentWidth = attributes . innerBlockContentWidth || attributes . innerBlockContentWidthTablet || attributes . innerBlockContentWidthMobile
62+
63+ if ( hasOldInnerContentWidth ) {
64+ newAttributes = {
65+ ...newAttributes ,
66+ innerBlockContentWidth : '' ,
67+ innerBlockContentWidthTablet : '' ,
68+ innerBlockContentWidthMobile : '' ,
69+ innerBlockContentWidthUnit : 'px' ,
70+ innerBlockContentWidthUnitTablet : '' ,
71+ innerBlockContentWidthUnitMobile : '' ,
72+ blockWidth : attributes . innerBlockContentWidth ,
73+ blockWidthTablet : attributes . innerBlockContentWidthTablet ,
74+ blockWidthMobile : attributes . innerBlockContentWidthMobile ,
75+ blockWidthUnit : attributes . innerBlockContentWidthUnit ,
76+ blockWidthUnitTablet : attributes . innerBlockContentWidthUnitTablet ,
77+ blockWidthUnitMobile : attributes . innerBlockContentWidthUnitMobile ,
78+ innerBlockAlign : '' ,
79+ innerBlockAlignTablet : '' ,
80+ innerBlockAlignMobile : '' ,
81+ blockHorizontalAlign : attributes . innerBlockAlign ,
82+ blockHorizontalAlignTablet : attributes . innerBlockAlignTablet ,
83+ blockHorizontalAlignMobile : attributes . innerBlockAlignMobile ,
84+ }
85+ }
86+
87+ newAttributes = deprecationImageOverlayOpacity . migrate ( newAttributes )
88+ newAttributes = deprecateContainerBackgroundColorOpacity . migrate ( newAttributes )
89+ newAttributes = deprecateBlockBackgroundColorOpacity . migrate ( newAttributes )
90+
91+ newAttributes = deprecateTypographyGradientColor . migrate ( 'title%s' ) ( newAttributes )
92+ newAttributes = deprecateTypographyGradientColor . migrate ( 'category%s' ) ( newAttributes )
93+ newAttributes = deprecateTypographyGradientColor . migrate ( 'excerpt%s' ) ( newAttributes )
94+ newAttributes = deprecateTypographyGradientColor . migrate ( 'meta%s' ) ( newAttributes )
95+ newAttributes = deprecateTypographyGradientColor . migrate ( 'readmore%s' ) ( newAttributes )
96+
97+ newAttributes = deprecateBlockShadowColor . migrate ( newAttributes )
98+ newAttributes = deprecateContainerShadowColor . migrate ( newAttributes )
99+ newAttributes = deprecateShadowColor . migrate ( 'image%s' ) ( newAttributes )
100+
101+ newAttributes = deprecateTypographyFontSize . migrate ( 'title%s' ) ( newAttributes )
102+ newAttributes = deprecateTypographyFontSize . migrate ( 'category%s' ) ( newAttributes )
103+ newAttributes = deprecateTypographyFontSize . migrate ( 'excerpt%s' ) ( newAttributes )
104+ newAttributes = deprecateTypographyFontSize . migrate ( 'meta%s' ) ( newAttributes )
105+ newAttributes = deprecateTypographyFontSize . migrate ( 'readmore%s' ) ( newAttributes )
106+
107+ newAttributes = deprecateBlockHeight . migrate ( newAttributes )
108+ newAttributes = deprecateImageBorderRadius . migrate ( newAttributes )
109+
110+ return newAttributes
111+ } ,
112+ } ,
45113 {
46114 // Handle the migration of shadow attributes with the change of type in 3.15.3
47115 attributes : attributes ( '3.16.2' ) ,
0 commit comments