Socket
Socket
Sign inDemoInstall

mjml-text

Package Overview
Dependencies
Maintainers
6
Versions
128
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-text - npm Package Compare versions

Comparing version 4.7.1 to 4.8.0

99

lib/index.js

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

});
exports["default"] = void 0;
exports.default = void 0;
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,51 +17,50 @@

var MjText = /*#__PURE__*/function (_BodyComponent) {
(0, _inherits2["default"])(MjText, _BodyComponent);
class MjText extends _mjmlCore.BodyComponent {
getStyles() {
return {
text: {
'font-family': this.getAttribute('font-family'),
'font-size': this.getAttribute('font-size'),
'font-style': this.getAttribute('font-style'),
'font-weight': this.getAttribute('font-weight'),
'letter-spacing': this.getAttribute('letter-spacing'),
'line-height': this.getAttribute('line-height'),
'text-align': this.getAttribute('align'),
'text-decoration': this.getAttribute('text-decoration'),
'text-transform': this.getAttribute('text-transform'),
color: this.getAttribute('color'),
height: this.getAttribute('height')
}
};
}
var _super = (0, _createSuper2["default"])(MjText);
renderContent() {
return `
<div
${this.htmlAttributes({
style: 'text'
})}
>${this.getContent()}</div>
`;
}
function MjText() {
(0, _classCallCheck2["default"])(this, MjText);
return _super.apply(this, arguments);
render() {
const height = this.getAttribute('height');
return height ? `
${(0, _conditionalTag.default)(`
<table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td height="${height}" style="vertical-align:top;height:${height};">
`)}
${this.renderContent()}
${(0, _conditionalTag.default)(`
</td></tr></table>
`)}
` : this.renderContent();
}
(0, _createClass2["default"])(MjText, [{
key: "getStyles",
value: function getStyles() {
return {
text: {
'font-family': this.getAttribute('font-family'),
'font-size': this.getAttribute('font-size'),
'font-style': this.getAttribute('font-style'),
'font-weight': this.getAttribute('font-weight'),
'letter-spacing': this.getAttribute('letter-spacing'),
'line-height': this.getAttribute('line-height'),
'text-align': this.getAttribute('align'),
'text-decoration': this.getAttribute('text-decoration'),
'text-transform': this.getAttribute('text-transform'),
color: this.getAttribute('color'),
height: this.getAttribute('height')
}
};
}
}, {
key: "renderContent",
value: function renderContent() {
return "\n <div\n ".concat(this.htmlAttributes({
style: 'text'
}), "\n >").concat(this.getContent(), "</div>\n ");
}
}, {
key: "render",
value: function render() {
var height = this.getAttribute('height');
return height ? "\n ".concat((0, _conditionalTag["default"])("\n <table role=\"presentation\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td height=\"".concat(height, "\" style=\"vertical-align:top;height:").concat(height, ";\">\n ")), "\n ").concat(this.renderContent(), "\n ").concat((0, _conditionalTag["default"])("\n </td></tr></table>\n "), "\n ") : this.renderContent();
}
}]);
return MjText;
}(_mjmlCore.BodyComponent);
}
exports["default"] = MjText;
(0, _defineProperty2["default"])(MjText, "endingTag", true);
(0, _defineProperty2["default"])(MjText, "allowedAttributes", {
exports.default = MjText;
(0, _defineProperty2.default)(MjText, "componentName", 'mj-text');
(0, _defineProperty2.default)(MjText, "endingTag", true);
(0, _defineProperty2.default)(MjText, "allowedAttributes", {
align: 'enum(left,right,center,justify)',

@@ -95,3 +86,3 @@ 'background-color': 'color',

});
(0, _defineProperty2["default"])(MjText, "defaultAttributes", {
(0, _defineProperty2.default)(MjText, "defaultAttributes", {
align: 'left',

@@ -98,0 +89,0 @@ color: '#000000',

{
"name": "mjml-text",
"description": "mjml-text",
"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