mjml-text
Advanced tools
Comparing version 4.7.1 to 4.8.0
@@ -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" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7273
81
+ Addedcliui@7.0.4(transitive)
+ Addedcommander@2.20.3(transitive)
+ Addeddetect-node@2.0.4(transitive)
+ Addedescalade@3.2.0(transitive)
+ Addedhtml-minifier@4.0.0(transitive)
+ Addedmjml-core@4.8.0(transitive)
+ Addedmjml-migrate@4.8.0(transitive)
+ Addedmjml-parser-xml@4.8.0(transitive)
+ Addedmjml-validator@4.8.0(transitive)
+ Addeduglify-js@3.19.3(transitive)
+ Addedy18n@5.0.8(transitive)
+ Addedyargs@16.2.0(transitive)
+ Addedyargs-parser@20.2.9(transitive)
- Removedcamelcase@5.3.1(transitive)
- Removedcliui@6.0.0(transitive)
- Removedcommander@2.17.12.19.0(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedhtml-minifier@3.5.21(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedmjml-core@4.7.1(transitive)
- Removedmjml-migrate@4.7.1(transitive)
- Removedmjml-parser-xml@4.7.1(transitive)
- Removedmjml-validator@4.7.1(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
- Removedpath-exists@4.0.0(transitive)
- Removedrequire-main-filename@2.0.0(transitive)
- Removedset-blocking@2.0.0(transitive)
- Removeduglify-js@3.4.10(transitive)
- Removedwarning@3.0.0(transitive)
- Removedwhich-module@2.0.1(transitive)
- Removedwrap-ansi@6.2.0(transitive)
- Removedy18n@4.0.3(transitive)
- Removedyargs@15.4.1(transitive)
- Removedyargs-parser@18.1.3(transitive)
Updatedmjml-core@4.8.0