mjml-text
Advanced tools
Comparing version 3.1.1 to 3.2.0-beta.1
@@ -39,2 +39,4 @@ 'use strict'; | ||
'line-height': '22px', | ||
'letter-spacing': null, | ||
'height': null, | ||
'padding-bottom': null, | ||
@@ -56,2 +58,15 @@ 'padding-left': null, | ||
var postRender = function postRender($) { | ||
$('.mj-text-height').each(function () { | ||
var height = parseInt($(this).css('height')); | ||
$(_mjmlCore.helpers.startConditionalTag + '\n <table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td height="' + height + '" style="vertical-align:top;height:' + height + 'px;">\n ' + _mjmlCore.helpers.endConditionalTag).insertBefore($(this)); | ||
$(_mjmlCore.helpers.startConditionalTag + '\n </td></tr></table>\n ' + _mjmlCore.helpers.endConditionalTag).insertAfter($(this)); | ||
$(this).removeClass('mj-text-height').filter('[class=""]').removeAttr('class'); | ||
}); | ||
return $; | ||
}; | ||
var Text = (0, _mjmlCore.MJMLElement)(_class = function (_Component) { | ||
@@ -90,2 +105,4 @@ _inherits(Text, _Component); | ||
lineHeight: mjAttribute('line-height'), | ||
letterSpacing: defaultUnit(mjAttribute('letter-spacing'), "px"), | ||
height: defaultUnit(mjAttribute('height'), "px"), | ||
textAlign: mjAttribute('align'), | ||
@@ -100,6 +117,11 @@ textDecoration: mjAttribute('text-decoration'), | ||
value: function render() { | ||
var mjContent = this.props.mjContent; | ||
var _props2 = this.props, | ||
mjAttribute = _props2.mjAttribute, | ||
mjContent = _props2.mjContent; | ||
var classNames = mjAttribute('height') ? 'mj-text-height' : ''; | ||
return _react2.default.createElement('div', { | ||
className: classNames, | ||
dangerouslySetInnerHTML: { __html: mjContent() }, | ||
@@ -118,3 +140,4 @@ style: this.styles.div }); | ||
Text.baseStyles = baseStyles; | ||
Text.postRender = postRender; | ||
exports.default = Text; |
{ | ||
"name": "mjml-text", | ||
"description": "mjml-text", | ||
"version": "3.1.1", | ||
"version": "3.2.0-beta.1", | ||
"main": "lib/index.js", | ||
@@ -17,5 +17,5 @@ "repository": { | ||
"lodash": "^4.17.2", | ||
"mjml-core": "~3.1.1", | ||
"mjml-core": "~3.2.0-beta.1", | ||
"react": "^15.4.1" | ||
} | ||
} |
@@ -41,2 +41,4 @@ ## mjml-text | ||
line-height | px | space between the lines | 22px | ||
letter-spacing | px | letter spacing | none | ||
height | px | The height of the element | n/a | ||
text-decoration | string | underline/overline/line-through/none | n/a | ||
@@ -43,0 +45,0 @@ text-transform | string | uppercase/lowercase/capitalize | n/a |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
8437
109
52
1
+ Addedmjml-core@3.2.2(transitive)
- Removedmjml-core@3.1.1(transitive)
Updatedmjml-core@~3.2.0-beta.1