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.8.1 to 4.8.2

80

lib/index.js

@@ -10,2 +10,10 @@ "use strict";

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"));

@@ -17,34 +25,47 @@

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')
}
};
let MjText = /*#__PURE__*/function (_BodyComponent) {
(0, _inherits2.default)(MjText, _BodyComponent);
var _super = (0, _createSuper2.default)(MjText);
function MjText() {
(0, _classCallCheck2.default)(this, MjText);
return _super.apply(this, arguments);
}
renderContent() {
return `
(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 `
<div
${this.htmlAttributes({
style: 'text'
})}
style: 'text'
})}
>${this.getContent()}</div>
`;
}
render() {
const height = this.getAttribute('height');
return height ? `
}
}, {
key: "render",
value: function render() {
const height = this.getAttribute('height');
return height ? `
${(0, _conditionalTag.default)(`

@@ -58,6 +79,7 @@ <table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td height="${height}" style="vertical-align:top;height:${height};">

` : this.renderContent();
}
}
}]);
return MjText;
}(_mjmlCore.BodyComponent);
}
exports.default = MjText;

@@ -64,0 +86,0 @@ (0, _defineProperty2.default)(MjText, "componentName", 'mj-text');

{
"name": "mjml-text",
"description": "mjml-text",
"version": "4.8.1",
"version": "4.8.2",
"main": "lib/index.js",

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

"lodash": "^4.17.15",
"mjml-core": "4.8.1"
"mjml-core": "4.8.2"
},

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

},
"gitHead": "45507ebde835129ba62671d341e76bc9892552c9"
"gitHead": "67cb33b5edd2b1d80436a72c213d2e815a685cd5"
}
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