New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vue-social-sharing

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-social-sharing - npm Package Compare versions

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

<a name="3.0.0-beta.2"></a>
# [3.0.0-beta.2](https://github.com/nicolasbeauvais/vue-social-sharing/compare/3.0.0-beta.1...3.0.0-beta.2) (2020-05-16)
- Fix Nuxt support
<a name="3.0.0-beta.1"></a>

@@ -2,0 +6,0 @@ # [3.0.0-beta.1](https://github.com/nicolasbeauvais/vue-social-sharing/compare/2.4.7...3.0.0-beta.1) (2020-05-15)

2

dist/vue-social-sharing.js

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

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueSocialSharing=e():t.VueSocialSharing=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(o,i,function(e){return t[e]}.bind(null,i));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=3)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t){t.exports=JSON.parse('{"email":{"sharer":"mailto:?subject=@title&body=@url%0D%0A%0D%0A@description","type":"direct"},"facebook":{"sharer":"https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description&quote=@quote&hashtag=@hashtags","type":"popup"},"line":{"sharer":"http://line.me/R/msg/text/?@description%0D%0A@url","type":"popup"},"linkedin":{"sharer":"https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description","type":"popup"},"odnoklassniki":{"sharer":"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description","type":"popup"},"pinterest":{"sharer":"https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title","type":"popup"},"reddit":{"sharer":"https://www.reddit.com/submit?url=@url&title=@title","type":"popup"},"skype":{"sharer":"https://web.skype.com/share?url=@description%0D%0A@url","type":"popup"},"telegram":{"sharer":"https://t.me/share/url?url=@url&text=@description","type":"popup"},"twitter":{"sharer":"https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser","type":"popup"},"viber":{"sharer":"viber://forward?text=@url @description","type":"direct"},"vk":{"sharer":"https://vk.com/share.php?url=@url&title=@title&description=@description&image=@media&noparse=true","type":"popup"},"weibo":{"sharer":"http://service.weibo.com/share/share.php?url=@url&title=@title","type":"popup"},"whatsapp":{"sharer":"https://api.whatsapp.com/send?text=@description%0D%0A@url","type":"popup","action":"share/whatsapp/share"},"sms":{"sharer":"sms:?body=@url%20@description","type":"direct"},"sms_ios":{"sharer":"sms:;body=@url%20@description","type":"direct"}}')},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){t.exports=r(4)},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return h}));var o=r(2),i=r.n(o),s=r(0),n=r.n(s),p=r(1),a={name:"ShareNetwork",props:{network:{type:String,required:!0},url:{type:String,required:!0},title:{type:String,default:""},description:{type:String,default:""},quote:{type:String,default:""},hashtags:{type:String,default:""},twitterUser:{type:String,default:""},media:{type:String,default:""},tag:{type:String,default:"a"}},data:function(){return{popup:{status:!1,resizable:!0,toolbar:!1,menubar:!1,scrollbars:!1,location:!1,directories:!1,width:626,height:436,top:0,left:0,window:void 0,interval:null}}},computed:{computedNetwork:function(){var t=this.network,e=navigator.userAgent.toLowerCase();return"sms"===t&&(e.indexOf("iphone")>-1||e.indexOf("ipad")>-1)&&(t+="_ios"),this.$SocialSharing.options.networks[t]},encodedHashtags:function(){return"facebook"===this.network&&this.hashtags.length?"%23"+this.hashtags.split(",")[0]:this.hashtags},sharingUrl:function(){var t=this.computedNetwork.sharer;return"twitter"===this.network&&(this.hashtags.length||t.replace("&hashtags=@hashtags",""),this.twitterUser||t.replace("@twitteruser","")),t.replace(/@url/g,encodeURIComponent(this.url)).replace(/@title/g,encodeURIComponent(this.title)).replace(/@description/g,encodeURIComponent(this.description)).replace(/@quote/g,encodeURIComponent(this.quote)).replace(/@hashtags/g,this.encodedHashtags).replace(/@media/g,encodeURIComponent(this.media)).replace(/@twitteruser/g,"&via="+encodeURIComponent(this.twitterUser))}},render:function(t){var e=this;if(!Object.prototype.hasOwnProperty.call(this.$SocialSharing.options.networks,this.network))throw new Error("Network ".concat(this.network," does not exist"));return t(this.tag,{class:"share-network-".concat(this.network),on:{click:function(){return e["popup"===e.computedNetwork.type?"share":"touch"]()}}},this.$slots.default)},methods:{share:function(){this.openSharer(),this.$root.$emit("social_shares_open",this.computedNetwork,this.url),this.$emit("open",this.computedNetwork,this.url)},touch:function(){window.open(this.sharingUrl,"_self"),this.$root.$emit("social_shares_open",this.computedNetwork,this.url),this.$emit("open",this.computedNetwork,this.url)},openSharer:function(){var t=this;this.popup.window&&this.popup.interval&&(clearInterval(this.popup.interval),this.popup.window.close(),this.$root.$emit("social_shares_change",this.computedNetwork,this.url),this.$emit("change",this.computedNetwork,this.url)),this.popup.window=window.open(this.sharingUrl,"sharer","status="+(this.popup.status?"yes":"no")+",height="+this.popup.height+",width="+this.popup.width+",resizable="+(this.popup.resizable?"yes":"no")+",left="+this.popup.left+",top="+this.popup.top+",screenX="+this.popup.left+",screenY="+this.popup.top+",toolbar="+(this.popup.toolbar?"yes":"no")+",menubar="+(this.popup.menubar?"yes":"no")+",scrollbars="+(this.popup.scrollbars?"yes":"no")+",location="+(this.popup.location?"yes":"no")+",directories="+(this.popup.directories?"yes":"no")),this.popup.window.focus(),this.popup.interval=setInterval((function(){t.popup.window&&!t.popup.window.closed||(clearInterval(t.popup.interval),t.popup.window=void 0,t.$root.$emit("social_shares_close",t.computedNetwork,t.url),t.$emit("close",t.computedNetwork,t.url))}),500)}}};function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach((function(e){n()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var h=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),n()(this,"options",{networks:p}),Object.prototype.hasOwnProperty.call(e,"networks")&&(this.options.networks=c(c({},p),e.networks))};h.install=function(t,e){var r=new h(e);t.component(a.name,a),t.prototype.$SocialSharing=r}}])}));
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueSocialSharing=e():t.VueSocialSharing=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,o){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(o,i,function(e){return t[e]}.bind(null,i));return o},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=3)}([function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t){t.exports=JSON.parse('{"email":{"sharer":"mailto:?subject=@title&body=@url%0D%0A%0D%0A@description","type":"direct"},"facebook":{"sharer":"https://www.facebook.com/sharer/sharer.php?u=@url&title=@title&description=@description&quote=@quote&hashtag=@hashtags","type":"popup"},"line":{"sharer":"http://line.me/R/msg/text/?@description%0D%0A@url","type":"popup"},"linkedin":{"sharer":"https://www.linkedin.com/shareArticle?mini=true&url=@url&title=@title&summary=@description","type":"popup"},"odnoklassniki":{"sharer":"https://connect.ok.ru/dk?st.cmd=WidgetSharePreview&st.shareUrl=@url&st.comments=@description","type":"popup"},"pinterest":{"sharer":"https://pinterest.com/pin/create/button/?url=@url&media=@media&description=@title","type":"popup"},"reddit":{"sharer":"https://www.reddit.com/submit?url=@url&title=@title","type":"popup"},"skype":{"sharer":"https://web.skype.com/share?url=@description%0D%0A@url","type":"popup"},"telegram":{"sharer":"https://t.me/share/url?url=@url&text=@description","type":"popup"},"twitter":{"sharer":"https://twitter.com/intent/tweet?text=@title&url=@url&hashtags=@hashtags@twitteruser","type":"popup"},"viber":{"sharer":"viber://forward?text=@url @description","type":"direct"},"vk":{"sharer":"https://vk.com/share.php?url=@url&title=@title&description=@description&image=@media&noparse=true","type":"popup"},"weibo":{"sharer":"http://service.weibo.com/share/share.php?url=@url&title=@title","type":"popup"},"whatsapp":{"sharer":"https://api.whatsapp.com/send?text=@description%0D%0A@url","type":"popup","action":"share/whatsapp/share"},"sms":{"sharer":"sms:?body=@url%20@description","type":"direct"},"sms_ios":{"sharer":"sms:;body=@url%20@description","type":"direct"}}')},function(t,e){t.exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){t.exports=r(4)},function(t,e,r){"use strict";r.r(e),r.d(e,"default",(function(){return d}));var o=r(2),i=r.n(o),n=r(0),s=r.n(n),p=r(1),u="undefined"!=typeof window,a=u?window:null;var c={name:"ShareNetwork",props:{network:{type:String,required:!0},url:{type:String,required:!0},title:{type:String,default:""},description:{type:String,default:""},quote:{type:String,default:""},hashtags:{type:String,default:""},twitterUser:{type:String,default:""},media:{type:String,default:""},tag:{type:String,default:"a"}},data:function(){return{popup:{status:!1,resizable:!0,toolbar:!1,menubar:!1,scrollbars:!1,location:!1,directories:!1,width:626,height:436,top:0,left:0,window:void 0,interval:null}}},mounted:function(){if(u){var t=void 0!==a.screenLeft?a.screenLeft:a.screenX,e=void 0!==a.screenTop?a.screenTop:a.screenY,r=a.innerWidth?a.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:a.screenX,o=a.innerHeight?a.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:a.screenY,i=r/a.screen.availWidth,n=(r-this.popup.width)/2/i+t,s=(o-this.popup.height)/2/i+e;this.popup.left=n,this.popup.top=s}},computed:{computedNetwork:function(){var t=this.network,e=navigator.userAgent.toLowerCase();return"sms"===t&&(e.indexOf("iphone")>-1||e.indexOf("ipad")>-1)&&(t+="_ios"),this.$SocialSharing.options.networks[t]},encodedHashtags:function(){return"facebook"===this.network&&this.hashtags.length?"%23"+this.hashtags.split(",")[0]:this.hashtags},sharingUrl:function(){var t=this.computedNetwork.sharer;return"twitter"===this.network&&(this.hashtags.length||t.replace("&hashtags=@hashtags",""),this.twitterUser||t.replace("@twitteruser","")),t.replace(/@url/g,encodeURIComponent(this.url)).replace(/@title/g,encodeURIComponent(this.title)).replace(/@description/g,encodeURIComponent(this.description)).replace(/@quote/g,encodeURIComponent(this.quote)).replace(/@hashtags/g,this.encodedHashtags).replace(/@media/g,encodeURIComponent(this.media)).replace(/@twitteruser/g,"&via="+encodeURIComponent(this.twitterUser))}},render:function(t){var e=this;if(!Object.prototype.hasOwnProperty.call(this.$SocialSharing.options.networks,this.network))throw new Error("Network ".concat(this.network," does not exist"));return t(this.tag,{class:"share-network-".concat(this.network),on:{click:function(){return e["popup"===e.computedNetwork.type?"share":"touch"]()}}},this.$slots.default)},methods:{share:function(){this.openSharer(),this.$root.$emit("share_network_open",this.computedNetwork,this.url),this.$emit("open",this.computedNetwork,this.url)},touch:function(){window.open(this.sharingUrl,"_self"),this.$root.$emit("share_network_open",this.computedNetwork,this.url),this.$emit("open",this.computedNetwork,this.url)},openSharer:function(){var t=this;this.popup.window&&this.popup.interval&&(clearInterval(this.popup.interval),this.popup.window.close(),this.$root.$emit("share_network_change",this.computedNetwork,this.url),this.$emit("change",this.computedNetwork,this.url)),this.popup.window=a.open(this.sharingUrl,"sharer","status="+(this.popup.status?"yes":"no")+",height="+this.popup.height+",width="+this.popup.width+",resizable="+(this.popup.resizable?"yes":"no")+",left="+this.popup.left+",top="+this.popup.top+",screenX="+this.popup.left+",screenY="+this.popup.top+",toolbar="+(this.popup.toolbar?"yes":"no")+",menubar="+(this.popup.menubar?"yes":"no")+",scrollbars="+(this.popup.scrollbars?"yes":"no")+",location="+(this.popup.location?"yes":"no")+",directories="+(this.popup.directories?"yes":"no")),this.popup.window.focus(),this.popup.interval=setInterval((function(){t.popup.window&&!t.popup.window.closed||(clearInterval(t.popup.interval),t.popup.window=null,t.$root.$emit("share_network_close",t.computedNetwork,t.url),t.$emit("close",t.computedNetwork,t.url))}),500)}}};function h(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?h(Object(r),!0).forEach((function(e){s()(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var d=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i()(this,t),s()(this,"options",{networks:p}),Object.prototype.hasOwnProperty.call(e,"networks")&&(this.options.networks=l(l({},p),e.networks))};d.install=function(t,e){var r=new d(e);t.component(c.name,c),t.prototype.$SocialSharing=r}}])}));
{
"name": "vue-social-sharing",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"description": "A Vue.js component for sharing links to social networks",

@@ -5,0 +5,0 @@ "author": "Nicolas Beauvais <nicolas@bvs.email>",

@@ -11,3 +11,2 @@ <h1 align="center">Vue Social Sharing</h1>

<a href="https://travis-ci.com/nicolasbeauvais/vue-social-sharing"><img src="https://img.shields.io/travis/com/nicolasbeauvais/vue-social-sharing/master.svg?style=flat-square" alt="Build Status"></a>
<a href="https://coveralls.io/github/nicolasbeauvais/vue-social-sharing?branch=master"><img src="https://img.shields.io/coveralls/nicolasbeauvais/vue-social-sharing/master.svg?style=flat-square" alt="Coverage Status"></a>
<a href="https://www.npmjs.com/package/vue-social-sharing"><img src="https://img.shields.io/npm/dt/vue-social-sharing.svg?style=flat-square" alt="Downloads"></a>

@@ -46,5 +45,2 @@ <a href="https://github.com/nicolasbeauvais/vue-social-sharing/blob/master/LICENSE"><img src="https://img.shields.io/github/license/nicolasbeauvais/vue-social-sharing.svg?style=flat-square" alt="License"></a>

npm install --save vue-social-sharing
# Bower
bower install vue-social-sharing
```

@@ -64,2 +60,10 @@

##### Nuxt
```javascript
// In your nuxt.config.js file:
modules: [
'vue-social-sharing/nuxt'
]
```
##### HTML

@@ -172,3 +176,2 @@

new Vue({

@@ -186,2 +189,18 @@ el: '#app',

## Extending the network list in Nuxt
You can extend the list of available networks directly in your `nuxt.config.js` file:
```javascript
modules: [
['vue-social-sharing/nuxt', {
networks: {
fakeblock: {
sharer: 'https://fakeblock.com/share?url=@url&title=@title',
type: 'popup'
}
}
}],
]
```
## Feature request

@@ -188,0 +207,0 @@ Feel free to open an issue to ask for a new social network support.

Sorry, the diff of this file is not supported yet

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