@@ -294,15 +294,34 @@ Image.addStyles( blockStyles, {
294294 }
295295 return true
296296 } ,
297- selectorCallback : getAttribute => {
297+ // selectorCallback: ( getAttribute, _attributes, _clientId, props ) => {
298+ // const className = getAttribute( 'className' )
299+ // const blockStyle = getBlockStyle( variations, className )
300+ // const imageHasLink = getAttribute( 'imageHasLink' )
301+
302+ // const selector = props.selector
303+ // if ( [ 'list' ].includes( blockStyle?.name ) && imageHasLink ) {
304+ // if ( Array.isArray( selector ) ) {
305+ // return selector.map( sel =>
306+ // sel.replace( '.stk-img-wrapper', `${ itemSelector } .stk-block-posts__image-link ` )
307+ // )
308+ // }
309+ // return [ '.stk-img-wrapper', selector.replace( '.stk-img-wrapper', `${ itemSelector } .stk-block-posts__image-link` ) ]
310+ // }
311+ // return selector
312+ // },
313+ selectorCallback : ( getAttribute , _attributes , _clientId , props ) => {
298314 const className = getAttribute ( 'className' )
299315 const blockStyle = getBlockStyle ( variations , className )
300316 const imageHasLink = getAttribute ( 'imageHasLink' )
301317
318+ const selector = props . selector
302319 if ( [ 'list' ] . includes ( blockStyle ?. name ) && imageHasLink ) {
303- return `${ itemSelector } .stk-block-posts__image-link`
320+ return Array . isArray ( selector )
321+ ? [ ...selector , `${ itemSelector } .stk-block-posts__image-link` ]
322+ : [ selector , `${ itemSelector } .stk-block-posts__image-link` ]
304323 }
305- return '.stk-img-wrapper'
324+ return selector
306325 } ,
307326 widthStyleRuleCallback : getAttribute => {
308327 const className = getAttribute ( 'className' )
0 commit comments