diff --git a/src/block/carousel/deprecated.js b/src/block/carousel/deprecated.js index fe7527728..2a532425d 100644 --- a/src/block/carousel/deprecated.js +++ b/src/block/carousel/deprecated.js @@ -22,6 +22,24 @@ addFilter( 'stackable.carousel.save.slider-props', 'stackable/3.19.0', ( sliderP } ) const deprecated = [ + { + // Handle the migration for adding tabIndex + // add anchor in the attributes to fix block validation error for blocks with anchors + attributes: { + ...attributes( '3.18.1' ), + anchor: { + attribute: 'id', + selector: '*', + source: 'attribute', + type: 'string', + }, + }, + // dev note: using withVersion HOC still results to a block validation error so we manually add the version here + save: ( props => { + props.version = '3.18.1' + return Save( props ) + } ), + }, { // Handle the migration of shadow attributes with the change of type in 3.15.3 attributes: attributes( '3.16.2' ), diff --git a/src/block/horizontal-scroller/deprecated.js b/src/block/horizontal-scroller/deprecated.js index 7ee69a61f..66b194513 100644 --- a/src/block/horizontal-scroller/deprecated.js +++ b/src/block/horizontal-scroller/deprecated.js @@ -34,6 +34,24 @@ addFilter( 'stackable.horizontal-scroller.save.contentClassNames', 'stackable/3_ } ) const deprecated = [ + { + // Handle the migration for adding tabIndex + // add anchor in the attributes to fix block validation error for blocks with anchors + attributes: { + ...attributes( '3.18.1' ), + anchor: { + attribute: 'id', + selector: '*', + source: 'attribute', + type: 'string', + }, + }, + // dev note: using withVersion HOC still results to a block validation error so we manually add the version here + save: ( props => { + props.version = '3.18.1' + return Save( props ) + } ), + }, { // Handle the migration of shadow attributes with the change of type in 3.15.3 attributes: attributes( '3.16.2' ), diff --git a/src/block/notification/deprecated.js b/src/block/notification/deprecated.js index 52bf4acb5..4ad344762 100644 --- a/src/block/notification/deprecated.js +++ b/src/block/notification/deprecated.js @@ -50,6 +50,24 @@ addFilter( 'stackable.notification.save.innerClassNames', 'stackable/3.8.0', ( o } ) const deprecated = [ + { + // Trigger the migration for adding aria-label + // add anchor in the attributes to fix block validation error for blocks with anchors + attributes: { + ...attributes( '3.18.1' ), + anchor: { + attribute: 'id', + selector: '*', + source: 'attribute', + type: 'string', + }, + }, + // dev note: using withVersion HOC still results to a block validation error so we manually add the version here + save: ( props => { + props.version = '3.18.1' + return Save( props ) + } ), + }, { // Handle the migration of shadow attributes with the change of type in 3.15.3 attributes: attributes( '3.16.2' ), diff --git a/src/block/posts/deprecated.js b/src/block/posts/deprecated.js index 45fb5d0a4..d1ff36b7b 100644 --- a/src/block/posts/deprecated.js +++ b/src/block/posts/deprecated.js @@ -68,6 +68,24 @@ addFilter( 'stackable.posts.feature-image', 'stackable/3_6_3', determineFeatureI addFilter( 'stackable.posts.meta', 'stackable/3.19.0', fixMetaAccessibility ) const deprecated = [ + { + // Handle the migration for changing the HTML tag of meta props for accessibility + // add anchor in the attributes to fix block validation error for blocks with anchors + attributes: { + ...attributes( '3.18.1' ), + anchor: { + attribute: 'id', + selector: '*', + source: 'attribute', + type: 'string', + }, + }, + // dev note: using withVersion HOC still results to a block validation error so we manually add the version here + save: ( props => { + props.version = '3.18.1' + return Save( props ) + } ), + }, { // Support the change of type for border radius attributes: attributes( '3.16.3' ), diff --git a/src/block/progress-bar/deprecated.js b/src/block/progress-bar/deprecated.js index 0f904cca4..d4882ff16 100644 --- a/src/block/progress-bar/deprecated.js +++ b/src/block/progress-bar/deprecated.js @@ -25,6 +25,24 @@ const addAriaLabel = ( divProps, props ) => { addFilter( 'stackable.progress-bar.div-props', 'stackable/3.19.0', addAriaLabel ) const deprecated = [ + { + // Trigger the migration for adding aria-label + // add anchor in the attributes to fix block validation error for blocks with anchors + attributes: { + ...attributes( '3.18.1' ), + anchor: { + attribute: 'id', + selector: '*', + source: 'attribute', + type: 'string', + }, + }, + // dev note: using withVersion HOC still results to a block validation error so we manually add the version here + save: ( props => { + props.version = '3.18.1' + return Save( props ) + } ), + }, { // Handle the migration of shadow attributes with the change of type in 3.15.3 attributes: attributes( '3.16.2' ), diff --git a/src/block/progress-circle/deprecated.js b/src/block/progress-circle/deprecated.js index 59a2ec82a..9bedc1e42 100644 --- a/src/block/progress-circle/deprecated.js +++ b/src/block/progress-circle/deprecated.js @@ -27,7 +27,16 @@ addFilter( 'stackable.progress-circle.div-props', 'stackable/3.19.0', addAriaLab const deprecated = [ { // Trigger the migration for adding aria-label - attributes: attributes( '3.18.1' ), + // add anchor in the attributes to fix block validation error for blocks with anchors + attributes: { + ...attributes( '3.18.1' ), + anchor: { + attribute: 'id', + selector: '*', + source: 'attribute', + type: 'string', + }, + }, // dev note: using withVersion HOC still results to a block validation error so we manually add the version here save: ( props => { props.version = '3.18.1'