Socket
Socket
Sign inDemoInstall

@interactjs/offset

Package Overview
Dependencies
3
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.10.25 to 1.10.26

10

package.json
{
"name": "@interactjs/offset",
"version": "1.10.25",
"version": "1.10.26",
"main": "index",

@@ -13,7 +13,7 @@ "module": "index",

"peerDependencies": {
"@interactjs/core": "1.10.25",
"@interactjs/utils": "1.10.25"
"@interactjs/core": "1.10.26",
"@interactjs/utils": "1.10.26"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.25"
"@interactjs/interact": "1.10.26"
},

@@ -28,3 +28,3 @@ "publishConfig": {

"license": "MIT",
"gitHead": "ee3c52c4"
"gitHead": "6e7a136f"
}

@@ -1,15 +0,12 @@

"use strict";
/**
* interact.js 1.10.26
*
* Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>
* Released under the MIT License.
* https://raw.github.com/taye/interact.js/main/LICENSE
*/
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.addTotal = addTotal;
exports.applyPending = applyPending;
exports.default = void 0;
var _Interaction = require("../core/Interaction.js");
var rectUtils = _interopRequireWildcard(require("../utils/rect.js"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
;
_Interaction._ProxyMethods.offsetBy = '';
import { _ProxyMethods } from "../core/Interaction.js";
import * as rectUtils from "../utils/rect.js";
_ProxyMethods.offsetBy = '';
function addTotal(interaction) {

@@ -23,10 +20,12 @@ if (!interaction.pointerIsDown) {

}
function beforeAction({
interaction
}) {
function beforeAction(_ref) {
let {
interaction
} = _ref;
applyPending(interaction);
}
function beforeEnd({
interaction
}) {
function beforeEnd(_ref2) {
let {
interaction
} = _ref2;
const hadPending = applyPending(interaction);

@@ -40,5 +39,6 @@ if (!hadPending) return;

}
function end({
interaction
}) {
function end(_ref3) {
let {
interaction
} = _ref3;
interaction.offset.total.x = 0;

@@ -63,6 +63,7 @@ interaction.offset.total.y = 0;

}
function offsetBy({
x,
y
}) {
function offsetBy(_ref4) {
let {
x,
y
} = _ref4;
this.offset.pending.x += x;

@@ -73,9 +74,11 @@ this.offset.pending.y += y;

}
function addToCoords({
page,
client
}, {
x,
y
}) {
function addToCoords(_ref5, _ref6) {
let {
page,
client
} = _ref5;
let {
x,
y
} = _ref6;
page.x += x;

@@ -96,5 +99,6 @@ page.y += y;

listeners: {
'interactions:new': ({
interaction
}) => {
'interactions:new': _ref7 => {
let {
interaction
} = _ref7;
interaction.offset = {

@@ -111,5 +115,8 @@ total: {

},
'interactions:update-pointer': ({
interaction
}) => addTotal(interaction),
'interactions:update-pointer': _ref8 => {
let {
interaction
} = _ref8;
return addTotal(interaction);
},
'interactions:before-action-start': beforeAction,

@@ -121,3 +128,3 @@ 'interactions:before-action-move': beforeAction,

};
var _default = exports.default = offset;
//# sourceMappingURL=plugin.js.map
export { addTotal, applyPending, offset as default };
//# sourceMappingURL=plugin.js.map

@@ -1,2 +0,4 @@

Object.defineProperty(exports,"__esModule",{value:!0}),exports.addTotal=o,exports.applyPending=i,exports.default=void 0;var e=require("../core/Interaction.prod.js"),t=((e,t)=>{if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var o=n(t);if(o&&o.has(e))return o.get(e);var r={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if("default"!==f&&Object.prototype.hasOwnProperty.call(e,f)){var s=i?Object.getOwnPropertyDescriptor(e,f):null;s&&(s.get||s.set)?Object.defineProperty(r,f,s):r[f]=e[f]}return r.default=e,o&&o.set(e,r),r})(require("../utils/rect.prod.js"));function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,o=new WeakMap;return(n=e=>e?o:t)(e)}function o(e){e.pointerIsDown&&(s(e.coords.cur,e.offset.total),e.offset.pending.x=0,e.offset.pending.y=0)}function r({interaction:e}){i(e)}function i(e){if(!(e=>!(!e.offset.pending.x&&!e.offset.pending.y))(e))return!1;const{pending:n}=e.offset;return s(e.coords.cur,n),s(e.coords.delta,n),t.addEdges(e.edges,e.rect,n),n.x=0,n.y=0,!0}function f({x:e,y:t}){this.offset.pending.x+=e,this.offset.pending.y+=t,this.offset.total.x+=e,this.offset.total.y+=t}function s({page:e,client:t},{x:n,y:o}){e.x+=n,e.y+=o,t.x+=n,t.y+=o}e._ProxyMethods.offsetBy="";const a={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install(e){e.Interaction.prototype.offsetBy=f},listeners:{"interactions:new"({interaction:e}){e.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":({interaction:e})=>o(e),"interactions:before-action-start":r,"interactions:before-action-move":r,"interactions:before-action-end"({interaction:e}){if(i(e))return e.move({offset:!0}),e.end(),!1},"interactions:stop"({interaction:e}){e.offset.total.x=0,e.offset.total.y=0,e.offset.pending.x=0,e.offset.pending.y=0}}};exports.default=a;
//# sourceMappingURL=plugin.prod.js.map
/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
import{_ProxyMethods}from"../core/Interaction.prod.js";import*as rectUtils from"../utils/rect.prod.js";function addTotal(t){t.pointerIsDown&&(addToCoords(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}function beforeAction(t){let{interaction:e}=t;applyPending(e)}function beforeEnd(t){let{interaction:e}=t;if(applyPending(e))return e.move({offset:!0}),e.end(),!1}function end(t){let{interaction:e}=t;e.offset.total.x=0,e.offset.total.y=0,e.offset.pending.x=0,e.offset.pending.y=0}function applyPending(t){if(!hasPending(t))return!1;const{pending:e}=t.offset;return addToCoords(t.coords.cur,e),addToCoords(t.coords.delta,e),rectUtils.addEdges(t.edges,t.rect,e),e.x=0,e.y=0,!0}function offsetBy(t){let{x:e,y:o}=t;this.offset.pending.x+=e,this.offset.pending.y+=o,this.offset.total.x+=e,this.offset.total.y+=o}function addToCoords(t,e){let{page:o,client:n}=t,{x:i,y:f}=e;o.x+=i,o.y+=f,n.x+=i,n.y+=f}function hasPending(t){return!(!t.offset.pending.x&&!t.offset.pending.y)}_ProxyMethods.offsetBy="";const offset={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install(t){t.Interaction.prototype.offsetBy=offsetBy},listeners:{"interactions:new"(t){let{interaction:e}=t;e.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer"(t){let{interaction:e}=t;return addTotal(e)},"interactions:before-action-start":beforeAction,"interactions:before-action-move":beforeAction,"interactions:before-action-end":beforeEnd,"interactions:stop":end}};export{addTotal,applyPending,offset as default};
//# sourceMappingURL=plugin.prod.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc