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

mjml-social

Package Overview
Dependencies
Maintainers
6
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjml-social - npm Package Compare versions

Comparing version 4.14.1 to 4.15.0

3

lib/index.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {

@@ -20,5 +19,3 @@ value: true

});
var _Social = _interopRequireDefault(require("./Social"));
var _SocialElement = _interopRequireDefault(require("./SocialElement"));
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {

@@ -9,30 +8,19 @@ value: true

exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _isNil2 = _interopRequireDefault(require("lodash/isNil"));
var _mjmlCore = require("mjml-core");
let MjSocial = /*#__PURE__*/function (_BodyComponent) {
let MjSocial = exports.default = /*#__PURE__*/function (_BodyComponent) {
(0, _inherits2.default)(MjSocial, _BodyComponent);
var _super = (0, _createSuper2.default)(MjSocial);
function MjSocial() {
(0, _classCallCheck2.default)(this, MjSocial);
return _super.apply(this, arguments);
return (0, _callSuper2.default)(this, MjSocial, arguments);
}
(0, _createClass2.default)(MjSocial, [{
key: "getStyles",
value: // eslint-disable-next-line class-methods-use-this
value:
// eslint-disable-next-line class-methods-use-this
function getStyles() {

@@ -49,7 +37,5 @@ return {

const base = {};
if (this.getAttribute('inner-padding')) {
base.padding = this.getAttribute('inner-padding');
}
return ['border-radius', 'color', 'font-family', 'font-size', 'font-weight', 'font-style', 'icon-size', 'icon-height', 'icon-padding', 'text-padding', 'line-height', 'text-decoration'].filter(e => !(0, _isNil2.default)(this.getAttribute(e))).reduce((res, attr) => {

@@ -147,4 +133,2 @@ res[attr] = this.getAttribute(attr);

}(_mjmlCore.BodyComponent);
exports.default = MjSocial;
(0, _defineProperty2.default)(MjSocial, "componentName", 'mj-social');

@@ -151,0 +135,0 @@ (0, _defineProperty2.default)(MjSocial, "allowedAttributes", {

32

lib/SocialElement.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {

@@ -9,19 +8,10 @@ value: true

exports.default = void 0;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _callSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/callSuper"));
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _each2 = _interopRequireDefault(require("lodash/each"));
var _get2 = _interopRequireDefault(require("lodash/get"));
var _mjmlCore = require("mjml-core");
const IMG_BASE_URL = 'https://www.mailjet.com/images/theme/v1/icons/ico-social/';

@@ -102,17 +92,13 @@ const defaultSocialNetworks = {

(0, _each2.default)(defaultSocialNetworks, (val, key) => {
defaultSocialNetworks[`${key}-noshare`] = { ...val,
defaultSocialNetworks[`${key}-noshare`] = {
...val,
'share-url': '[[URL]]'
};
});
let MjSocialElement = /*#__PURE__*/function (_BodyComponent) {
let MjSocialElement = exports.default = /*#__PURE__*/function (_BodyComponent) {
(0, _inherits2.default)(MjSocialElement, _BodyComponent);
var _super = (0, _createSuper2.default)(MjSocialElement);
function MjSocialElement() {
(0, _classCallCheck2.default)(this, MjSocialElement);
return _super.apply(this, arguments);
return (0, _callSuper2.default)(this, MjSocialElement, arguments);
}
(0, _createClass2.default)(MjSocialElement, [{

@@ -171,8 +157,7 @@ key: "getStyles",

let href = this.getAttribute('href');
if (href && (0, _get2.default)(socialNetwork, 'share-url')) {
href = socialNetwork['share-url'].replace('[[URL]]', href);
}
const attrs = ['icon-size', 'icon-height', 'srcset', 'sizes', 'src', 'background-color'].reduce((r, attr) => ({ ...r,
const attrs = ['icon-size', 'icon-height', 'srcset', 'sizes', 'src', 'background-color'].reduce((r, attr) => ({
...r,
[attr]: this.getAttribute(attr) || socialNetwork[attr]

@@ -267,4 +252,2 @@ }), {});

}(_mjmlCore.BodyComponent);
exports.default = MjSocialElement;
(0, _defineProperty2.default)(MjSocialElement, "componentName", 'mj-social-element');

@@ -304,2 +287,3 @@ (0, _defineProperty2.default)(MjSocialElement, "endingTag", true);

(0, _defineProperty2.default)(MjSocialElement, "defaultAttributes", {
alt: '',
align: 'left',

@@ -306,0 +290,0 @@ color: '#000',

{
"name": "mjml-social",
"description": "mjml-social",
"version": "4.14.1",
"version": "4.15.0",
"main": "lib/index.js",

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

"lodash": "^4.17.21",
"mjml-core": "4.14.1"
"mjml-core": "4.15.0"
},

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

},
"gitHead": "988819de3375867c09585d28f555166b97415200"
"gitHead": "af922bd11c16f4182057077a8a060b7a7f7cc4e3"
}

@@ -7,2 +7,8 @@ ## mj-social

<aside class="warning">
`mj-social-element`'s `name` attribute is a shortcut for some common social elements. <br />
You should avoid rely too much on this as those icons are hosted by Mailjet for their Email Builder.<br />
Use <a href="#custom-social-element">custom element syntax instead.</a>
</aside>
Displays calls-to-action for various social networks with their associated logo. You can add social networks with the `mj-social-element` tag.

@@ -22,5 +28,8 @@

</mj-social-element>
<mj-social-element name="twitter" href="https://mjml.io/">
<mj-social-element name="twitter" href="https://mjml.io/">
Twitter
</mj-social-element>
<mj-social-element name="x" href="https://mjml.io/">
X
</mj-social-element>
</mj-social>

@@ -78,3 +87,3 @@ </mj-column>

align | string | left/right/center | center
alt | string | image alt attribute | none
alt | string | image alt attribute | ''
background-color | color | icon color | Each social `name` has its own default

@@ -112,2 +121,3 @@ border-radius | px | border radius | 3px

- twitter
- x
- google

@@ -114,0 +124,0 @@ - pinterest

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