-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1302 from vektor-inc/develop
[ Change version ] 1.39.0.0
- Loading branch information
Showing
18 changed files
with
547 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
src/blocks/_pro/gridcolcard-item/deprecated/1.38.0/save.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
|
||
export default function save(props) { | ||
const { attributes } = props; | ||
const { | ||
backgroundColor, | ||
textColor, | ||
headerDisplay, | ||
footerDisplay, | ||
containerSpace, | ||
borderRadius, | ||
border, | ||
borderColor, | ||
url, | ||
urlOpenType, | ||
} = attributes; | ||
|
||
const style = { | ||
backgroundColor: null, | ||
border: null, | ||
}; | ||
if (textColor) { | ||
style.color = `${textColor}`; | ||
} | ||
if (backgroundColor) { | ||
style.backgroundColor = `${backgroundColor}`; | ||
} | ||
if (border) { | ||
style.border = `1px solid ${borderColor}`; | ||
} | ||
if (borderRadius) { | ||
style.borderRadius = `${borderRadius}`; | ||
} | ||
|
||
const containerClasses = ['vk_gridcolcard_item']; | ||
if (headerDisplay === 'delete') { | ||
containerClasses.push('vk_gridcolcard_item-noHeader'); | ||
} | ||
if (footerDisplay === 'delete') { | ||
containerClasses.push('vk_gridcolcard_item-noFooter'); | ||
} | ||
const containerClass = containerClasses.join(' '); | ||
|
||
const blockProps = useBlockProps.save({ | ||
className: `${containerClass}`, | ||
style, | ||
}); | ||
|
||
const TagName = url ? 'a' : 'div'; | ||
|
||
return ( | ||
<div {...blockProps}> | ||
<TagName | ||
className={`vk_gridcolcard_item_container`} | ||
style={{ | ||
paddingTop: containerSpace.top, | ||
paddingBottom: containerSpace.bottom, | ||
paddingLeft: containerSpace.left, | ||
paddingRight: containerSpace.right, | ||
}} | ||
href={url} | ||
target={urlOpenType ? '_blank' : undefined} | ||
rel={urlOpenType ? 'noopener noreferrer' : undefined} | ||
> | ||
<InnerBlocks.Content /> | ||
</TagName> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import save1_38_0 from './1.38.0/save'; | ||
|
||
const blockAttributes = { | ||
"editLock": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"textColor": { | ||
"type": "string" | ||
}, | ||
"backgroundColor": { | ||
"type": "string" | ||
}, | ||
"containerSpace": { | ||
"type": "object", | ||
"default": { | ||
"top": null, | ||
"left": null, | ||
"right": null, | ||
"bottom": null | ||
} | ||
}, | ||
"headerImageAspectRatio": { | ||
"type": "string", | ||
"default": "1.618/1" | ||
}, | ||
"headerImageFit": { | ||
"type": "boolean", | ||
"default": true | ||
}, | ||
"headerDisplay": { | ||
"type": "string", | ||
"default": "delete" | ||
}, | ||
"footerDisplay": { | ||
"type": "string", | ||
"default": "delete" | ||
}, | ||
"borderRadius": { | ||
"type": "string", | ||
"default": null | ||
}, | ||
"border": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"borderColor": { | ||
"type": "string", | ||
"default": "#e5e5e5" | ||
}, | ||
"url": { | ||
"type": "string" | ||
}, | ||
"urlOpenType": { | ||
"type": "Boolean", | ||
"default": false | ||
|
||
} | ||
}; | ||
|
||
const deprecated = [ | ||
{ | ||
attributes: blockAttributes, | ||
save: save1_38_0, | ||
}, | ||
]; | ||
export default deprecated; |
Oops, something went wrong.