Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/block/columns/deprecated.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,23 @@ addFilter( 'stackable.columns.save.contentClassNames', 'stackable/3.8.0', ( clas
return classes
} )

// Column wrapping now adds the stk--column-wrap-desktop class.
addFilter( 'stackable.columns.save.contentClassNames', 'stackable/3.19.8', ( classes, props ) => {
if ( semverCompare( props.version, '<', '3.19.8' ) ) {
return classes.filter( className => {
return ! className?.[ 'stk--column-wrap-desktop' ]
} )
}

return classes
} )

const deprecated = [
{
// Support Columns blocks saved before the column wrapping marker was added.
attributes: attributes( '3.19.7' ),
save: withVersion( '3.19.7' )( Save ),
},
{
// Handle the migration of shadow attributes with the change of type in 3.15.3
attributes: attributes( '3.16.2' ),
Expand Down
4 changes: 3 additions & 1 deletion src/block/columns/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ const Edit = props => {
'stk-inner-blocks',
blockAlignmentClass,
'stk-block-content',
], getContentAlignmentClasses( props.attributes, 'column', instanceId ) )
], {
'stk--column-wrap-desktop': props.attributes.columnWrapDesktop,
}, getContentAlignmentClasses( props.attributes, 'column', instanceId ) )

// Generate the CSS styles for the block.
const blockCss = useBlockCssGenerator( {
Expand Down
3 changes: 3 additions & 0 deletions src/block/columns/save.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ export const Save = props => {
blockAlignmentClass,
'stk-block-content',
],
{
'stk--column-wrap-desktop': attributes.columnWrapDesktop,
},
getContentAlignmentClasses( props.attributes ),
], props ) )

Expand Down
2 changes: 1 addition & 1 deletion src/block/columns/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@import "common";
@import "./deprecated-style";

.stk--flex > .stk-block-column {
.stk--flex:not(.stk--column-wrap-desktop) > .stk-block-column {
width: fit-content;
flex: 0 1 auto !important;
min-width: 24px;
Expand Down
Loading