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

svelte-gestures

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-gestures - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

4

CHANGELOG.md
# Changelog
## 1.2.1
Fixed TS types location
## 1.2.0

@@ -4,0 +8,0 @@

2

dist/index.umd.min.js

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

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).svelteGestures={})}(this,(function(t){"use strict";const n=300,e="none";function i(t,n,e){return t.addEventListener(n,e),()=>t.removeEventListener(n,e)}function o(t,n){const e=t.getBoundingClientRect(),i=Math.abs(n[0].clientX-n[1].clientX),o=Math.abs(n[0].clientY-n[1].clientY),c=Math.min(n[0].clientX,n[1].clientX)+i/2,l=Math.min(n[0].clientY,n[1].clientY)+o/2;return{x:Math.round(c-e.left),y:Math.round(l-e.top)}}function c(t,n,e,i,o){t.dispatchEvent(new CustomEvent(`${n}${o}`,{detail:{event:e,pointersCount:i.length}}))}function l(t,n,e,o,l,u="none"){n.style.touchAction=u;let r=[];const a=i(n,"pointerdown",(function(u){r.push(u),c(n,t,u,r,"down"),null==o||o(r,u);const a=u.pointerId;function s(e){a===e.pointerId&&(r=function(t,n){return n.filter((n=>t.pointerId!==n.pointerId))}(e,r),r.length||(f(),p(),h()),c(n,t,e,r,"up"),null==l||l(r,e))}const f=i(n,"pointermove",(i=>{r=r.map((t=>i.pointerId===t.pointerId?i:t)),c(n,t,i,r,"move"),null==e||e(r,i)})),p=i(n,"lostpointercapture",(t=>{s(t)})),h=i(n,"pointerup",(t=>{s(t)}))}));return{destroy:()=>{a()}}}function u(t){return Math.hypot(t[0].clientX-t[1].clientX,t[0].clientY-t[1].clientY)}function r(t){const n={left:{top:360,bottom:180},right:{top:0,bottom:180}},e=t[1].clientX-t[0].clientX,i=t[0].clientY-t[1].clientY,o=Math.atan(e/i)/(Math.PI/180),c=e>0?n.right:n.left;return o+(i>0?c.top:c.bottom)}t.DEFAULT_DELAY=n,t.DEFAULT_MIN_SWIPE_DISTANCE=60,t.DEFAULT_TOUCH_ACTION=e,t.getCenterOfTwoPoints=o,t.pan=function(t,e={delay:n}){let i;return l("pan",t,(function(n,o){if(1===n.length&&Date.now()-i>e.delay){const n=t.getBoundingClientRect(),e=Math.round(o.clientX-n.left),i=Math.round(o.clientY-n.top);e>=0&&i>=0&&e<=n.width&&i<=n.height&&t.dispatchEvent(new CustomEvent("pan",{detail:{x:e,y:i}}))}}),(function(){i=Date.now()}),null)},t.pinch=function(t){const n="pinch";let e,i=null,c=0;return l(n,t,(function(o){if(2===o.length){const l=u(o);if(null!==i&&l!==i){const i=l/c;t.dispatchEvent(new CustomEvent(n,{detail:{scale:i,center:e}}))}i=l}}),(function(n){2===n.length&&(c=u(n),e=o(t,n))}),(function(t){1===t.length&&(i=null)}))},t.rotate=function(t){const n="rotate";let e,i=null,c=0;return l(n,t,(function(o){if(2===o.length){const l=r(o);if(null!==i&&l!==i){let i=l-c;i>180&&(i-=360),t.dispatchEvent(new CustomEvent(n,{detail:{rotation:i,center:e}}))}i=l}}),(function(n){2===n.length&&(n=n.sort(((t,n)=>t.clientX-n.clientX)),e=o(t,n),c=r(n))}),(function(t){1===t.length&&(i=null)}))},t.setPointerControls=l,t.swipe=function(t,i={timeframe:n,minSwipeDistance:60,touchAction:e}){const o="swipe";let c,u,r;return l(o,t,null,(function(t,n){u=n.clientX,r=n.clientY,c=Date.now()}),(function(n,e){if(0===n.length&&Date.now()-c<i.timeframe){const n=e.clientX-u,c=e.clientY-r,l=Math.abs(n),a=Math.abs(c);let s=null;l>=2*a&&l>i.minSwipeDistance?s=n>0?"right":"left":a>=2*l&&a>i.minSwipeDistance&&(s=c>0?"bottom":"top"),s&&t.dispatchEvent(new CustomEvent(o,{detail:{direction:s}}))}}),i.touchAction)},t.tap=function(t,e={timeframe:n}){let i,o,c;return l("tap",t,null,(function(t,n){o=n.clientX,c=n.clientY,i=Date.now()}),(function(n,l){if(Math.abs(l.clientX-o)<4&&Math.abs(l.clientY-c)<4&&Date.now()-i<e.timeframe){const n=t.getBoundingClientRect(),e=Math.round(l.clientX-n.left),i=Math.round(l.clientY-n.top);t.dispatchEvent(new CustomEvent("tap",{detail:{x:e,y:i}}))}}))},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).svelteGestures={})}(this,(function(t){"use strict";const n=300,e="none";function i(t,n,e){return t.addEventListener(n,e),()=>t.removeEventListener(n,e)}function o(t,n){const e=t.getBoundingClientRect(),i=Math.abs(n[0].clientX-n[1].clientX),o=Math.abs(n[0].clientY-n[1].clientY),l=Math.min(n[0].clientX,n[1].clientX)+i/2,c=Math.min(n[0].clientY,n[1].clientY)+o/2;return{x:Math.round(l-e.left),y:Math.round(c-e.top)}}function l(t,n,e,i,o){t.dispatchEvent(new CustomEvent(`${n}${o}`,{detail:{event:e,pointersCount:i.length}}))}function c(t,n,e,o,c,u="none"){n.style.touchAction=u;let a=[];const r=i(n,"pointerdown",(function(u){a.push(u),l(n,t,u,a,"down"),null==o||o(a,u);const r=u.pointerId;function s(e){r===e.pointerId&&(a=function(t,n){return n.filter((n=>t.pointerId!==n.pointerId))}(e,a),a.length||(f(),p(),h()),l(n,t,e,a,"up"),null==c||c(a,e))}const f=i(n,"pointermove",(i=>{a=a.map((t=>i.pointerId===t.pointerId?i:t)),l(n,t,i,a,"move"),null==e||e(a,i)})),p=i(n,"lostpointercapture",(t=>{s(t)})),h=i(n,"pointerup",(t=>{s(t)}))}));return{destroy:()=>{r()}}}function u(t){return Math.hypot(t[0].clientX-t[1].clientX,t[0].clientY-t[1].clientY)}function a(t){const n={left:{top:360,bottom:180},right:{top:0,bottom:180}},e=t[1].clientX-t[0].clientX,i=t[0].clientY-t[1].clientY,o=Math.atan(e/i)/(Math.PI/180),l=e>0?n.right:n.left;return o+(i>0?l.top:l.bottom)}t.DEFAULT_DELAY=n,t.DEFAULT_MIN_SWIPE_DISTANCE=60,t.DEFAULT_TOUCH_ACTION=e,t.getCenterOfTwoPoints=o,t.pan=function(t,e={delay:n}){let i;return c("pan",t,(function(n,o){if(1===n.length&&Date.now()-i>e.delay){const n=t.getBoundingClientRect(),e=Math.round(o.clientX-n.left),i=Math.round(o.clientY-n.top);e>=0&&i>=0&&e<=n.width&&i<=n.height&&t.dispatchEvent(new CustomEvent("pan",{detail:{x:e,y:i}}))}}),(function(){i=Date.now()}),null)},t.pinch=function(t){const n="pinch";let e,i=null,l=0;return c(n,t,(function(o){if(2===o.length){const c=u(o);if(null!==i&&c!==i){const i=c/l;t.dispatchEvent(new CustomEvent(n,{detail:{scale:i,center:e}}))}i=c}}),(function(n){2===n.length&&(l=u(n),e=o(t,n))}),(function(t){1===t.length&&(i=null)}))},t.rotate=function(t){const n="rotate";let e,i=null,l=0;return c(n,t,(function(o){if(2===o.length){const c=a(o);if(null!==i&&c!==i){let i=c-l;i>180&&(i-=360),t.dispatchEvent(new CustomEvent(n,{detail:{rotation:i,center:e}}))}i=c}}),(function(n){2===n.length&&(n=n.sort(((t,n)=>t.clientX-n.clientX)),e=o(t,n),l=a(n))}),(function(t){1===t.length&&(i=null)}))},t.setPointerControls=c,t.swipe=function(t,i={timeframe:n,minSwipeDistance:60,touchAction:e}){const o="swipe";let l,u,a;return c(o,t,null,(function(t,n){u=n.clientX,a=n.clientY,l=Date.now()}),(function(n,e){if(0===n.length&&Date.now()-l<i.timeframe){const n=e.clientX-u,l=e.clientY-a,c=Math.abs(n),r=Math.abs(l);let s=null;c>=2*r&&c>i.minSwipeDistance?s=n>0?"right":"left":r>=2*c&&r>i.minSwipeDistance&&(s=l>0?"bottom":"top"),s&&t.dispatchEvent(new CustomEvent(o,{detail:{direction:s}}))}}),i.touchAction)},t.tap=function(t,e={timeframe:n}){let i,o,l;return c("tap",t,null,(function(t,n){o=n.clientX,l=n.clientY,i=Date.now()}),(function(n,c){if(Math.abs(c.clientX-o)<4&&Math.abs(c.clientY-l)<4&&Date.now()-i<e.timeframe){const n=t.getBoundingClientRect(),e=Math.round(c.clientX-n.left),i=Math.round(c.clientY-n.top);t.dispatchEvent(new CustomEvent("tap",{detail:{x:e,y:i}}))}}))},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -6,6 +6,6 @@ {

"license" : "MIT",
"version": "1.2.0",
"version": "1.2.1",
"main": "dist/index.umd.min.js",
"module": "dist/index.es.js",
"types": "dist/svelteGestures.d.ts",
"types": "dist/index.d.ts",
"files": [

@@ -12,0 +12,0 @@ "dist"

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