Socket
Socket
Sign inDemoInstall

drag-event-service

Package Overview
Dependencies
4
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.5 to 1.1.6

12

dist/drag-event-service.cjs.js
/*!
* drag-event-service v1.1.5
* drag-event-service v1.1.6
* (c) phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -196,3 +196,3 @@ * Homepage: undefined

var onMove = function onMove() {
var onMove = function onMove(e) {
update('move', e);

@@ -205,3 +205,3 @@

var onEnd = function onEnd() {
var onEnd = function onEnd(e) {
update('end', e);

@@ -218,3 +218,3 @@

DragEventService.on(window, 'end', onEnd);
info.started = true;
trackedInfo.started = true;
};

@@ -226,7 +226,7 @@

DragEventService.off(window, 'end', onEnd);
info.started = false;
trackedInfo.started = false;
};
return {
info: info,
info: trackedInfo,
start: start,

@@ -233,0 +233,0 @@ stop: stop

/*!
* drag-event-service v1.1.5
* drag-event-service v1.1.6
* (c) phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -190,3 +190,3 @@ * Homepage: undefined

var onMove = function onMove() {
var onMove = function onMove(e) {
update('move', e);

@@ -199,3 +199,3 @@

var onEnd = function onEnd() {
var onEnd = function onEnd(e) {
update('end', e);

@@ -212,3 +212,3 @@

DragEventService.on(window, 'end', onEnd);
info.started = true;
trackedInfo.started = true;
};

@@ -220,7 +220,7 @@

DragEventService.off(window, 'end', onEnd);
info.started = false;
trackedInfo.started = false;
};
return {
info: info,
info: trackedInfo,
start: start,

@@ -227,0 +227,0 @@ stop: stop

/*!
* drag-event-service v1.1.5
* drag-event-service v1.1.6
* (c) phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -875,3 +875,3 @@ * Homepage: undefined

/*!
* helper-js v1.4.36
* helper-js v2.0.0
* (c) phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -882,6 +882,5 @@ * Homepage: undefined

function onDOM(el, name, handler) {
for (var _len6 = arguments.length, args = new Array(_len6 > 3 ? _len6 - 3 : 0), _key8 = 3; _key8 < _len6; _key8++) {
args[_key8 - 3] = arguments[_key8];
for (var _len5 = arguments.length, args = new Array(_len5 > 3 ? _len5 - 3 : 0), _key6 = 3; _key6 < _len5; _key6++) {
args[_key6 - 3] = arguments[_key6];
}

@@ -891,5 +890,6 @@

// 所有主流浏览器,除了 IE 8 及更早 IE版本
el.addEventListener.apply(el, [name, handler].concat(args));
el.addEventListener.apply(el, [name, handler].concat(args)); // @ts-ignore
} else if (el.attachEvent) {
// IE 8 及更早 IE 版本
// @ts-ignore
el.attachEvent.apply(el, ["on".concat(name), handler].concat(args));

@@ -900,4 +900,4 @@ }

function offDOM(el, name, handler) {
for (var _len7 = arguments.length, args = new Array(_len7 > 3 ? _len7 - 3 : 0), _key9 = 3; _key9 < _len7; _key9++) {
args[_key9 - 3] = arguments[_key9];
for (var _len6 = arguments.length, args = new Array(_len6 > 3 ? _len6 - 3 : 0), _key7 = 3; _key7 < _len6; _key7++) {
args[_key7 - 3] = arguments[_key7];
}

@@ -907,5 +907,6 @@

// 所有主流浏览器,除了 IE 8 及更早 IE版本
el.removeEventListener.apply(el, [name, handler].concat(args));
el.removeEventListener.apply(el, [name, handler].concat(args)); // @ts-ignore
} else if (el.detachEvent) {
// IE 8 及更早 IE 版本
// @ts-ignore
el.detachEvent.apply(el, ["on".concat(name), handler].concat(args));

@@ -1095,3 +1096,3 @@ }

var onMove = function onMove() {
var onMove = function onMove(e) {
update('move', e);

@@ -1104,3 +1105,3 @@

var onEnd = function onEnd() {
var onEnd = function onEnd(e) {
update('end', e);

@@ -1117,3 +1118,3 @@

DragEventService.on(window, 'end', onEnd);
info.started = true;
trackedInfo.started = true;
};

@@ -1125,7 +1126,7 @@

DragEventService.off(window, 'end', onEnd);
info.started = false;
trackedInfo.started = false;
};
return {
info: info,
info: trackedInfo,
start: start,

@@ -1132,0 +1133,0 @@ stop: stop

/*!
* drag-event-service v1.1.5
* drag-event-service v1.1.6
* (c) phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -7,5 +7,5 @@ * Homepage: undefined

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).dragEventService={})}(this,(function(t){"use strict";var r=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n};var n=function(t){if(Array.isArray(t))return r(t)};var o=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var i=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}};var c=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var a=function(t){return n(t)||o(t)||i(t)||c()};function u(t,e){return t(e={exports:{}},e.exports),e.exports}var s=u((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(r)}t.exports=e}));var f=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=s(t)););return t};u((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=f(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),u((function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(r,n)}t.exports=e})),u((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e})),u((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";function a(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),c=new E(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var a=w(c,r);if(a){if(a===s)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,c),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var s={};function f(){}function h(){}function l(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,y=d&&d(d(L([])));y&&y!==e&&r.call(y,o)&&(p=y);var g=l.prototype=f.prototype=Object.create(p);function v(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t,e){var n;this._invoke=function(o,i){function c(){return new e((function(n,c){!function n(o,i,c,a){var s=u(t[o],t,i);if("throw"!==s.type){var f=s.arg,h=f.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,c,a)}),(function(t){n("throw",t,c,a)})):e.resolve(h).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,a)}))}a(s.arg)}(o,i,n,c)}))}return n=n?n.then(c,c):c()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return h.prototype=g.constructor=l,l.constructor=h,l[c]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},v(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var c=new m(a(e,r,n,o),i);return t.isGeneratorFunction(r)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},v(g),g[c]="Generator",g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return c.type="throw",c.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).dragEventService={})}(this,(function(t){"use strict";var e=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n};var r=function(t){if(Array.isArray(t))return e(t)};var n=function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)};var o=function(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}};var i=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")};var c=function(t){return r(t)||n(t)||o(t)||i()};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var u=a((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(r)}t.exports=e}));var s=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=u(t)););return t};a((function(t){function e(r,n,o){return"undefined"!=typeof Reflect&&Reflect.get?t.exports=e=Reflect.get:t.exports=e=function(t,e,r){var n=s(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(r):o.value}},e(r,n,o||r)}t.exports=e})),a((function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(r,n)}t.exports=e})),a((function(t){function e(r){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}t.exports=e})),a((function(t){var e=function(t){var e=Object.prototype,r=e.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",c=n.toStringTag||"@@toStringTag";function a(t,e,r,n){var o=e&&e.prototype instanceof f?e:f,i=Object.create(o.prototype),c=new E(n||[]);return i._invoke=function(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var c=r.delegate;if(c){var a=w(c,r);if(a){if(a===s)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(t,e,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===s)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(t,r,c),i}function u(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=a;var s={};function f(){}function h(){}function l(){}var p={};p[o]=function(){return this};var d=Object.getPrototypeOf,y=d&&d(d(L([])));y&&y!==e&&r.call(y,o)&&(p=y);var g=l.prototype=f.prototype=Object.create(p);function v(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function m(t,e){var n;this._invoke=function(o,i){function c(){return new e((function(n,c){!function n(o,i,c,a){var s=u(t[o],t,i);if("throw"!==s.type){var f=s.arg,h=f.value;return h&&"object"==typeof h&&r.call(h,"__await")?e.resolve(h.__await).then((function(t){n("next",t,c,a)}),(function(t){n("throw",t,c,a)})):e.resolve(h).then((function(t){f.value=t,c(f)}),(function(t){return n("throw",t,c,a)}))}a(s.arg)}(o,i,n,c)}))}return n=n?n.then(c,c):c()}}function w(t,e){var r=t.iterator[e.method];if(void 0===r){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,w(t,e),"throw"===e.method))return s;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return s}var n=u(r,t.iterator,e.arg);if("throw"===n.type)return e.method="throw",e.arg=n.arg,e.delegate=null,s;var o=n.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,s):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,s)}function x(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(x,this),this.reset(!0)}function L(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:O}}function O(){return{value:void 0,done:!0}}return h.prototype=g.constructor=l,l.constructor=h,l[c]=h.displayName="GeneratorFunction",t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},v(m.prototype),m.prototype[i]=function(){return this},t.AsyncIterator=m,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var c=new m(a(e,r,n,o),i);return t.isGeneratorFunction(r)?c:c.next().then((function(t){return t.done?t.value:c.next()}))},v(g),g[c]="Generator",g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var e=[];for(var r in t)e.push(r);return e.reverse(),function r(){for(;e.length;){var n=e.pop();if(n in t)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=L,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return c.type="throw",c.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var c=i?i.completion:{};return c.type=t,c.arg=e,i?(this.method="next",this.next=i.finallyLoc,s):this.complete(c)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),s},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),b(r),s}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;b(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),s}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}));
/*!
* helper-js v1.4.36
* helper-js v2.0.0
* (c) phphe <phphe@outlook.com> (https://github.com/phphe)

@@ -15,2 +15,2 @@ * Homepage: undefined

*/
function h(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.addEventListener?t.addEventListener.apply(t,[e,r].concat(o)):t.attachEvent&&t.attachEvent.apply(t,["on".concat(e),r].concat(o))}function l(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.removeEventListener?t.removeEventListener.apply(t,[e,r].concat(o)):t.detachEvent&&t.detachEvent.apply(t,["on".concat(e),r].concat(o))}var p={start:["mousedown","touchstart"],move:["mousemove","touchmove"],end:["mouseup","touchend"]},d={isTouch:function(t){return t.type&&t.type.startsWith("touch")},_getStore:function(t){return t._wrapperStore||(t._wrapperStore=[]),t._wrapperStore},on:function(t,e,r,n){var o,i,c=y(n),u=c.args,s=c.mouseArgs,f=c.touchArgs,l=this._getStore(t),d=this,g=function(t){var n;if(d.isTouch(t))n={x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY,pageX:t.changedTouches[0].pageX,pageY:t.changedTouches[0].pageY,clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY,screenX:t.changedTouches[0].screenX,screenY:t.changedTouches[0].screenY};else if(n={x:t.pageX,y:t.pageY,pageX:t.pageX,pageY:t.pageY,clientX:t.clientX,clientY:t.clientY,screenX:t.screenX,screenY:t.screenY},"start"===e&&1!==t.which)return;return r.call(this,t,n)};l.push({handler:r,wrapper:g}),(o=h).call.apply(o,[null,t,p[e][0],g].concat([].concat(a(u),a(s)))),(i=h).call.apply(i,[null,t,p[e][1],g].concat([].concat(a(u),a(f))))},off:function(t,e,r,n){for(var o=y(n),i=o.args,c=o.mouseArgs,u=this._getStore(t),s=u.length-1;s>=0;s--){var f,h,d=u[s],g=d.handler,v=d.wrapper;if(r===g)(f=l).call.apply(f,[null,t,p[e][0],v].concat([].concat(a(i),a(c)))),(h=l).call.apply(h,[null,t,p[e][1],v].concat([].concat(a(i),a(c)))),u.splice(s,1)}}};function y(t){return t||(t={}),{args:t.args||[],mouseArgs:t.mouseArgs||[],touchArgs:t.touchArgs||[]}}t.default=d,t.trackMouseOrTouchPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={position:{}},n=function(t,e){var n=d.isTouch(e);n?Object.assign(r.position,{x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY,pageX:e.changedTouches[0].pageX,pageY:e.changedTouches[0].pageY,clientX:e.changedTouches[0].clientX,clientY:e.changedTouches[0].clientY,screenX:e.changedTouches[0].screenX,screenY:e.changedTouches[0].screenY}):Object.assign(r.position,{x:e.pageX,y:e.pageY,pageX:e.pageX,pageY:e.pageY,clientX:e.clientX,clientY:e.clientY,screenX:e.screenX,screenY:e.screenY}),"start"===t?r.startEvent=e:"end"===t&&(r.endEvent=e),Object.assign(r,{event:e,isTouch:n,eventType:t})},o=function(e){(d.isTouch(e)||1===e.which)&&(n("start",e),t.onStart&&t.onStart())},i=function(){n("move",e),t.onMove&&t.onMove()},c=function(){n("end",e),t.onEnd&&t.onEnd()},a=function(){d.on(document,"start",o),d.on(document,"move",i),d.on(window,"end",c),info.started=!0},u=function(){d.off(document,"start",o),d.off(document,"move",i),d.off(window,"end",c),info.started=!1};return{info:info,start:a,stop:u}},Object.defineProperty(t,"__esModule",{value:!0})}));
function f(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.addEventListener?t.addEventListener.apply(t,[e,r].concat(o)):t.attachEvent&&t.attachEvent.apply(t,["on".concat(e),r].concat(o))}function h(t,e,r){for(var n=arguments.length,o=new Array(n>3?n-3:0),i=3;i<n;i++)o[i-3]=arguments[i];t.removeEventListener?t.removeEventListener.apply(t,[e,r].concat(o)):t.detachEvent&&t.detachEvent.apply(t,["on".concat(e),r].concat(o))}var l={start:["mousedown","touchstart"],move:["mousemove","touchmove"],end:["mouseup","touchend"]},p={isTouch:function(t){return t.type&&t.type.startsWith("touch")},_getStore:function(t){return t._wrapperStore||(t._wrapperStore=[]),t._wrapperStore},on:function(t,e,r,n){var o,i,a=d(n),u=a.args,s=a.mouseArgs,h=a.touchArgs,p=this._getStore(t),y=this,g=function(t){var n;if(y.isTouch(t))n={x:t.changedTouches[0].pageX,y:t.changedTouches[0].pageY,pageX:t.changedTouches[0].pageX,pageY:t.changedTouches[0].pageY,clientX:t.changedTouches[0].clientX,clientY:t.changedTouches[0].clientY,screenX:t.changedTouches[0].screenX,screenY:t.changedTouches[0].screenY};else if(n={x:t.pageX,y:t.pageY,pageX:t.pageX,pageY:t.pageY,clientX:t.clientX,clientY:t.clientY,screenX:t.screenX,screenY:t.screenY},"start"===e&&1!==t.which)return;return r.call(this,t,n)};p.push({handler:r,wrapper:g}),(o=f).call.apply(o,[null,t,l[e][0],g].concat([].concat(c(u),c(s)))),(i=f).call.apply(i,[null,t,l[e][1],g].concat([].concat(c(u),c(h))))},off:function(t,e,r,n){for(var o=d(n),i=o.args,a=o.mouseArgs,u=this._getStore(t),s=u.length-1;s>=0;s--){var f,p,y=u[s],g=y.handler,v=y.wrapper;if(r===g)(f=h).call.apply(f,[null,t,l[e][0],v].concat([].concat(c(i),c(a)))),(p=h).call.apply(p,[null,t,l[e][1],v].concat([].concat(c(i),c(a)))),u.splice(s,1)}}};function d(t){return t||(t={}),{args:t.args||[],mouseArgs:t.mouseArgs||[],touchArgs:t.touchArgs||[]}}t.default=p,t.trackMouseOrTouchPosition=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e={position:{}},r=function(t,r){var n=p.isTouch(r);n?Object.assign(e.position,{x:r.changedTouches[0].pageX,y:r.changedTouches[0].pageY,pageX:r.changedTouches[0].pageX,pageY:r.changedTouches[0].pageY,clientX:r.changedTouches[0].clientX,clientY:r.changedTouches[0].clientY,screenX:r.changedTouches[0].screenX,screenY:r.changedTouches[0].screenY}):Object.assign(e.position,{x:r.pageX,y:r.pageY,pageX:r.pageX,pageY:r.pageY,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY}),"start"===t?e.startEvent=r:"end"===t&&(e.endEvent=r),Object.assign(e,{event:r,isTouch:n,eventType:t})},n=function(e){(p.isTouch(e)||1===e.which)&&(r("start",e),t.onStart&&t.onStart())},o=function(e){r("move",e),t.onMove&&t.onMove()},i=function(e){r("end",e),t.onEnd&&t.onEnd()},c=function(){p.on(document,"start",n),p.on(document,"move",o),p.on(window,"end",i),e.started=!0},a=function(){p.off(document,"start",n),p.off(document,"move",o),p.off(window,"end",i),e.started=!1};return{info:e,start:c,stop:a}},Object.defineProperty(t,"__esModule",{value:!0})}));
{
"name": "drag-event-service",
"version": "1.1.5",
"version": "1.1.6",
"description": "",

@@ -30,5 +30,5 @@ "main": "dist/drag-event-service.cjs.js",

"@babel/runtime": "^7.7.7",
"helper-js": "^1.4.36"
"helper-js": "^2.0.0"
},
"license": "MIT"
}

@@ -15,3 +15,3 @@ # drag-event-service

```sh
npm install drag-event-service
npm install drag-event-service --save
```

@@ -18,0 +18,0 @@ ## usage & api

@@ -35,5 +35,5 @@ const DragEventService: {

export interface Options_trackMouseOrTouchPosition{
onMove: () => void
onStart: () => void
onEnd: () => void
onMove?: () => void
onStart?: () => void
onEnd?: () => void
}

@@ -40,0 +40,0 @@ export interface TrackedInfo{

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc