Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mjml-body

Package Overview
Dependencies
Maintainers
6
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-body - npm Package Compare versions

Comparing version 4.7.1 to 4.8.0

83

lib/index.js

@@ -8,14 +8,4 @@ "use strict";

});
exports["default"] = void 0;
exports.default = void 0;
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

@@ -25,50 +15,45 @@

var MjBody = /*#__PURE__*/function (_BodyComponent) {
(0, _inherits2["default"])(MjBody, _BodyComponent);
class MjBody extends _mjmlCore.BodyComponent {
getChildContext() {
return { ...this.context,
containerWidth: this.getAttribute('width')
};
}
var _super = (0, _createSuper2["default"])(MjBody);
getStyles() {
return {
div: {
'background-color': this.getAttribute('background-color')
}
};
}
function MjBody() {
(0, _classCallCheck2["default"])(this, MjBody);
return _super.apply(this, arguments);
render() {
const {
setBackgroundColor
} = this.context;
setBackgroundColor(this.getAttribute('background-color'));
return `
<div
${this.htmlAttributes({
class: this.getAttribute('css-class'),
style: 'div'
})}
>
${this.renderChildren()}
</div>
`;
}
(0, _createClass2["default"])(MjBody, [{
key: "getChildContext",
value: function getChildContext() {
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, this.context), {}, {
containerWidth: this.getAttribute('width')
});
}
}, {
key: "getStyles",
value: function getStyles() {
return {
div: {
'background-color': this.getAttribute('background-color')
}
};
}
}, {
key: "render",
value: function render() {
var setBackgroundColor = this.context.setBackgroundColor;
setBackgroundColor(this.getAttribute('background-color'));
return "\n <div\n ".concat(this.htmlAttributes({
"class": this.getAttribute('css-class'),
style: 'div'
}), "\n >\n ").concat(this.renderChildren(), "\n </div>\n ");
}
}]);
return MjBody;
}(_mjmlCore.BodyComponent);
}
exports["default"] = MjBody;
(0, _defineProperty2["default"])(MjBody, "allowedAttributes", {
exports.default = MjBody;
(0, _defineProperty2.default)(MjBody, "componentName", 'mj-body');
(0, _defineProperty2.default)(MjBody, "allowedAttributes", {
width: 'unit(px)',
'background-color': 'color'
});
(0, _defineProperty2["default"])(MjBody, "defaultAttributes", {
(0, _defineProperty2.default)(MjBody, "defaultAttributes", {
width: '600px'
});
module.exports = exports.default;
{
"name": "mjml-body",
"description": "mjml-body",
"version": "4.7.1",
"version": "4.8.0",
"main": "lib/index.js",

@@ -26,3 +26,3 @@ "files": [

"lodash": "^4.17.15",
"mjml-core": "4.7.1"
"mjml-core": "4.8.0"
},

@@ -33,3 +33,3 @@ "devDependencies": {

},
"gitHead": "6bb3e08efb912765d5195d35dc19ce61cdd6306a"
"gitHead": "6037a02810ea9a0cb62965ba81712fdf536b958b"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc