Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import MjButton from 'mjml-button'
import { BodyComponent } from 'mjml-core'
import { registerDependencies } from 'mjml-validator'
registerDependencies({
'mj-column': ['mc-button'],
'mj-hero': ['mc-button'],
'mc-button': [],
});
export default class McButton extends MjButton {
static endingTag = true
static allowedAttributes = {
...MjButton.allowedAttributes,
'mc:edit': 'string',
'mc:hideable': 'string',
}
static defaultAttributes = {
...MjButton.defaultAttributes,
'mc:hideable': false
}
isHideable() {
if (this.getAttribute('mc:hideable') !== false) {
return true
}
return false
}