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

react-share

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-share - npm Package Compare versions

Comparing version 1.11.1 to 1.12.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

## 1.12.0 (Feb 25, 2017)
* Added VKShareCount
* Added Whatsapp and Telegram share buttons
## 1.11.1 (Jan 22, 2017)

@@ -2,0 +7,0 @@

@@ -37,4 +37,14 @@ 'use strict';

color: '#45668e'
},
telegram: {
icon: 'm45.90873,15.44335c-0.6901,-0.0281 -1.37668,0.14048 -1.96142,0.41265c-0.84989,0.32661 -8.63939,3.33986 -16.5237,6.39174c-3.9685,1.53296 -7.93349,3.06593 -10.98537,4.24067c-3.05012,1.1765 -5.34694,2.05098 -5.4681,2.09312c-0.80775,0.28096 -1.89996,0.63566 -2.82712,1.72788c-0.23354,0.27218 -0.46884,0.62161 -0.58825,1.10275c-0.11941,0.48114 -0.06673,1.09222 0.16682,1.5716c0.46533,0.96052 1.25376,1.35737 2.18443,1.71383c3.09051,0.99037 6.28638,1.93508 8.93263,2.8236c0.97632,3.44171 1.91401,6.89571 2.84116,10.34268c0.30554,0.69185 0.97105,0.94823 1.65764,0.95525l-0.00351,0.03512c0,0 0.53908,0.05268 1.06412,-0.07375c0.52679,-0.12292 1.18879,-0.42846 1.79109,-0.99212c0.662,-0.62161 2.45836,-2.38812 3.47683,-3.38552l7.6736,5.66477l0.06146,0.03512c0,0 0.84989,0.59703 2.09312,0.68132c0.62161,0.04214 1.4399,-0.07726 2.14229,-0.59176c0.70766,-0.51626 1.1765,-1.34683 1.396,-2.29506c0.65673,-2.86224 5.00979,-23.57745 5.75257,-27.00686l-0.02107,0.08077c0.51977,-1.93157 0.32837,-3.70159 -0.87096,-4.74991c-0.60054,-0.52152 -1.2924,-0.7498 -1.98425,-0.77965l0,0.00176zm-0.2072,3.29069c0.04741,0.0439 0.0439,0.0439 0.00351,0.04741c-0.01229,-0.00351 0.14048,0.2072 -0.15804,1.32576l-0.01229,0.04214l-0.00878,0.03863c-0.75858,3.50668 -5.15554,24.40802 -5.74203,26.96472c-0.08077,0.34417 -0.11414,0.31959 -0.09482,0.29852c-0.1756,-0.02634 -0.50045,-0.16506 -0.52679,-0.1756l-13.13468,-9.70175c4.4988,-4.33199 9.09945,-8.25307 13.744,-12.43229c0.8218,-0.41265 0.68483,-1.68573 -0.29852,-1.70681c-1.04305,0.24584 -1.92279,0.99564 -2.8798,1.47502c-5.49971,3.2626 -11.11882,6.13186 -16.55882,9.49279c-2.792,-0.97105 -5.57873,-1.77704 -8.15298,-2.57601c2.2336,-0.89555 4.00889,-1.55579 5.75608,-2.23009c3.05188,-1.1765 7.01687,-2.7042 10.98537,-4.24067c7.94051,-3.06944 15.92667,-6.16346 16.62028,-6.43037l0.05619,-0.02283l0.05268,-0.02283c0.19316,-0.0878 0.30378,-0.09658 0.35471,-0.10009c0,0 -0.01756,-0.05795 -0.00351,-0.04566l-0.00176,0zm-20.91715,22.0638l2.16687,1.60145c-0.93418,0.91311 -1.81743,1.77353 -2.45485,2.38812l0.28798,-3.98957',
mask: 'M0,0v64h64V0H0z M32,48c-1.6,0-3.1-0.2-4.5-0.7c0.6-1,1.3-2.2,1.6-3.4c0.2-0.7,1.1-4.4,1.1-4.4 c0.6,1.1,2.2,2,3.9,2c5.1,0,8.6-4.7,8.6-11c0-4.7-4-9.2-10.1-9.2c-7.6,0-11.4,5.5-11.4,10c0,2.8,1,5.2,3.3,6.1 c0.4,0.1,0.7,0,0.8-0.4c0.1-0.3,0.2-1,0.3-1.3c0.1-0.4,0.1-0.5-0.2-0.9c-0.6-0.8-1.1-1.7-1.1-3.1c0-4,3-7.7,7.9-7.7 c4.3,0,6.7,2.6,6.7,6.1c0,4.6-2,8.5-5.1,8.5c-1.7,0-2.9-1.4-2.5-3.1c0.5-2,1.4-4.2,1.4-5.7c0-1.3-0.7-2.4-2.2-2.4 c-1.7,0-3.1,1.8-3.1,4.1c0,1.5,0.5,2.5,0.5,2.5s-1.8,7.4-2.1,8.7c-0.3,1.2-0.3,2.6-0.3,3.7C19.9,44.2,16,38.6,16,32 c0-8.8,7.2-16,16-16c8.8,0,16,7.2,16,16C48,40.8,40.8,48,32,48z',
color: '#37aee2'
},
whatsapp: {
icon: 'm42.32286,33.93287c-0.5178,-0.2589 -3.04726,-1.49644 -3.52105,-1.66732c-0.4712,-0.17346 -0.81554,-0.2589 -1.15987,0.2589c-0.34175,0.51004 -1.33075,1.66474 -1.63108,2.00648c-0.30032,0.33658 -0.60064,0.36247 -1.11327,0.12945c-0.5178,-0.2589 -2.17994,-0.80259 -4.14759,-2.56312c-1.53269,-1.37217 -2.56312,-3.05503 -2.86603,-3.57283c-0.30033,-0.5178 -0.03366,-0.80259 0.22524,-1.06149c0.23301,-0.23301 0.5178,-0.59547 0.7767,-0.90616c0.25372,-0.31068 0.33657,-0.5178 0.51262,-0.85437c0.17088,-0.36246 0.08544,-0.64725 -0.04402,-0.90615c-0.12945,-0.2589 -1.15987,-2.79613 -1.58964,-3.80584c-0.41424,-1.00971 -0.84142,-0.88027 -1.15987,-0.88027c-0.29773,-0.02588 -0.64208,-0.02588 -0.98382,-0.02588c-0.34693,0 -0.90616,0.12945 -1.37736,0.62136c-0.4712,0.5178 -1.80194,1.76053 -1.80194,4.27186c0,2.51134 1.84596,4.945 2.10227,5.30747c0.2589,0.33657 3.63497,5.51458 8.80262,7.74113c1.23237,0.5178 2.1903,0.82848 2.94111,1.08738c1.23237,0.38836 2.35599,0.33657 3.24402,0.20712c0.99159,-0.15534 3.04985,-1.24272 3.47963,-2.45956c0.44013,-1.21683 0.44013,-2.22654 0.31068,-2.45955c-0.12945,-0.23301 -0.46601,-0.36247 -0.98382,-0.59548m-9.40068,12.84407l-0.02589,0c-3.05503,0 -6.08417,-0.82849 -8.72495,-2.38189l-0.62136,-0.37023l-6.47252,1.68286l1.73463,-6.29129l-0.41424,-0.64725c-1.70875,-2.71846 -2.6149,-5.85116 -2.6149,-9.07706c0,-9.39809 7.68934,-17.06155 17.15993,-17.06155c4.58253,0 8.88029,1.78642 12.11655,5.02268c3.23625,3.21036 5.02267,7.50812 5.02267,12.06476c-0.0078,9.3981 -7.69712,17.06155 -17.14699,17.06155m14.58906,-31.58846c-3.93529,-3.80584 -9.1133,-5.95471 -14.62789,-5.95471c-11.36055,0 -20.60848,9.2065 -20.61625,20.52564c0,3.61684 0.94757,7.14565 2.75211,10.26282l-2.92557,10.63564l10.93337,-2.85309c3.0136,1.63108 6.4052,2.4958 9.85634,2.49839l0.01037,0c11.36574,0 20.61884,-9.2091 20.62403,-20.53082c0,-5.48093 -2.14111,-10.64081 -6.03239,-14.51915',
mask: 'M0,0v64h64V0H0z M32,48c-1.6,0-3.1-0.2-4.5-0.7c0.6-1,1.3-2.2,1.6-3.4c0.2-0.7,1.1-4.4,1.1-4.4 c0.6,1.1,2.2,2,3.9,2c5.1,0,8.6-4.7,8.6-11c0-4.7-4-9.2-10.1-9.2c-7.6,0-11.4,5.5-11.4,10c0,2.8,1,5.2,3.3,6.1 c0.4,0.1,0.7,0,0.8-0.4c0.1-0.3,0.2-1,0.3-1.3c0.1-0.4,0.1-0.5-0.2-0.9c-0.6-0.8-1.1-1.7-1.1-3.1c0-4,3-7.7,7.9-7.7 c4.3,0,6.7,2.6,6.7,6.1c0,4.6-2,8.5-5.1,8.5c-1.7,0-2.9-1.4-2.5-3.1c0.5-2,1.4-4.2,1.4-5.7c0-1.3-0.7-2.4-2.2-2.4 c-1.7,0-3.1,1.8-3.1,4.1c0,1.5,0.5,2.5,0.5,2.5s-1.8,7.4-2.1,8.7c-0.3,1.2-0.3,2.6-0.3,3.7C19.9,44.2,16,38.6,16,32 c0-8.8,7.2-16,16-16c8.8,0,16,7.2,16,16C48,40.8,40.8,48,32,48z',
color: '#2cb742'
}
};
/* eslint-enable max-len */

29

lib/share-buttons.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.VKShareButton = exports.PinterestShareButton = exports.LinkedinShareButton = exports.GooglePlusShareButton = exports.TwitterShareButton = exports.FacebookShareButton = undefined;
exports.VKShareButton = exports.PinterestShareButton = exports.LinkedinShareButton = exports.GooglePlusShareButton = exports.WhatsappShareButton = exports.TelegramShareButton = exports.TwitterShareButton = exports.FacebookShareButton = undefined;

@@ -225,2 +225,29 @@ var _extends2 = require('babel-runtime/helpers/extends');

var TelegramShareButton = exports.TelegramShareButton = createShareButton('telegram', function (props) {
return {
title: props.title,
via: props.via
};
}, {
title: _react.PropTypes.string,
via: _react.PropTypes.string
}, {
windowWidth: 550,
windowHeight: 400
});
var WhatsappShareButton = exports.WhatsappShareButton = createShareButton('whatsapp', function (props) {
return {
title: props.title,
separator: props.separator
};
}, {
title: _react.PropTypes.string,
separator: _react.PropTypes.string
}, {
separator: ' ',
windowWidth: 550,
windowHeight: 400
});
var GooglePlusShareButton = exports.GooglePlusShareButton = createShareButton('googlePlus', undefined, undefined, {

@@ -227,0 +254,0 @@ windowWidth: 550,

@@ -6,2 +6,3 @@ 'use strict';

});
exports.getVKShareCount = undefined;

@@ -93,2 +94,27 @@ var _stringify = require('babel-runtime/core-js/json/stringify');

});
}
}
function getVKShareCount(shareUrl, callback) {
if (!window.VK) {
window.VK = {
Share: {
count: function count(index, _count) {
return window.VK.callbacks[index](_count);
}
},
callbacks: []
};
}
var url = 'https://vk.com/share.php';
var index = window.VK.callbacks.length;
window.VK.callbacks.push(callback);
return (0, _jsonp2.default)(url + (0, _utils.objectToGetParams)({
act: 'count',
index: index,
url: shareUrl
}));
}
exports.getVKShareCount = getVKShareCount;

3

lib/share-counts.js

@@ -6,3 +6,3 @@ 'use strict';

});
exports.TwitterShareCount = exports.PinterestShareCount = exports.GooglePlusShareCount = exports.LinkedinShareCount = exports.FacebookShareCount = undefined;
exports.TwitterShareCount = exports.VKShareCount = exports.PinterestShareCount = exports.GooglePlusShareCount = exports.LinkedinShareCount = exports.FacebookShareCount = undefined;

@@ -100,4 +100,5 @@ var _extends2 = require('babel-runtime/helpers/extends');

var PinterestShareCount = exports.PinterestShareCount = shareCountFactory(_shareCountGetters.getPinterestShareCount);
var VKShareCount = exports.VKShareCount = shareCountFactory(_shareCountGetters.getVKShareCount);
var TwitterShareCount = exports.TwitterShareCount = function TwitterShareCount() {
throw new Error('TwitterShareCount was removed in version 1.3.0 because' + 'the Twitter API was shut down and there is no replacement. Please ' + 'remove it from your code.');
};

@@ -8,2 +8,4 @@ 'use strict';

exports.twitter = twitter;
exports.telegram = telegram;
exports.whatsapp = whatsapp;
exports.facebook = facebook;

@@ -48,8 +50,28 @@ exports.googlePlus = googlePlus;

function facebook(url, _ref2) {
var title = _ref2.title,
description = _ref2.description,
picture = _ref2.picture,
hashtag = _ref2.hashtag;
function telegram(url, _ref2) {
var title = _ref2.title;
(0, _assert2.default)(url, 'telegram.url');
return 'https://telegram.me/share/' + (0, _utils.objectToGetParams)({
url: url,
text: title
});
}
function whatsapp(url, _ref3) {
var title = _ref3.title,
separator = _ref3.separator;
(0, _assert2.default)(url, 'whatsapp.url');
return 'whatsapp://send' + (0, _utils.objectToGetParams)({
text: title + separator + url
});
}
function facebook(url, _ref4) {
var title = _ref4.title,
description = _ref4.description,
picture = _ref4.picture,
hashtag = _ref4.hashtag;
(0, _assert2.default)(url, 'facebook.url');

@@ -72,5 +94,5 @@

function linkedin(url, _ref3) {
var title = _ref3.title,
description = _ref3.description;
function linkedin(url, _ref5) {
var title = _ref5.title,
description = _ref5.description;

@@ -86,5 +108,5 @@ (0, _assert2.default)(url, 'linkedin.url');

function pinterest(url, _ref4) {
var media = _ref4.media,
description = _ref4.description;
function pinterest(url, _ref6) {
var media = _ref6.media,
description = _ref6.description;

@@ -101,6 +123,6 @@ (0, _assert2.default)(url, 'pinterest.url');

function vk(url, _ref5) {
var title = _ref5.title,
description = _ref5.description,
image = _ref5.image;
function vk(url, _ref7) {
var title = _ref7.title,
description = _ref7.description,
image = _ref7.image;

@@ -107,0 +129,0 @@ (0, _assert2.default)(url, 'vk.url');

{
"name": "react-share",
"version": "1.11.1",
"version": "1.12.0",
"description": "Easy social media share buttons and share counts.",

@@ -5,0 +5,0 @@ "main": "./lib/react-share.js",

@@ -18,6 +18,4 @@ # react-share

#### Demos:
#### Demo
* [demos/demo0](demos/demo0): Facebook, Twitter, Google+, Linkedin, Pinterest, VK
To run demos: clone repo and run `npm install && npm run run-demos`

@@ -61,2 +59,4 @@ and open `http://localhost:8080/demo0/`.

TwitterShareButton,
TelegramShareButton,
WhatsappShareButton,
PinterestShareButton,

@@ -76,5 +76,12 @@ VKShareButton

|TwitterShareButton|-|__`title`__: Title of the shared page (string)<br/>__`via`__: (string)<br/>__`hashtags`__: (array)|
|TelegramShareButton|-|__`title`__: Title of the shared page (string)<br/>|
|WhatsappShareButton|-|__`title`__: Title of the shared page (string)<br/>__`separator`__: Separates title from the url, default: " " (string)|
|PinterestShareButton|__`media`__: An absolute link to the image that will be pinned (string)|__`description`__: Description for the shared media.|
|VKShareButton|-|__`title`__: Title of the shared page (string)<br/>__`description`__: Description of the shared page (string)<br/>__`image`__: An absolute link to the image that will be shared (string)|
##### Notes
Whatsapp share button uses `whatsapp` protocol in shared links (`whatsapp://send`).
Thus, it is meant to be used on mobile views and will not work on (all) desktop web browsers.
### Share counts

@@ -87,3 +94,4 @@

LinkedinShareCount,
PinterestShareCount
PinterestShareCount,
VKShareCount
} = ShareCounts;

@@ -118,2 +126,4 @@ ```

const TwitterIcon = generateShareIcon('twitter');
const TelegramIcon = generateShareIcon('telegram');
const WhatsappIcon = generateShareIcon('whatsapp');
const GooglePlusIcon = generateShareIcon('google');

@@ -120,0 +130,0 @@ const LinkedinIcon = generateShareIcon('linkedin');

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