@interactjs/offset
Advanced tools
Comparing version 1.10.2 to 1.10.3
{ | ||
"name": "@interactjs/offset", | ||
"version": "1.10.2", | ||
"version": "1.10.3", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"@interactjs/core": "1.10.2", | ||
"@interactjs/utils": "1.10.2" | ||
"@interactjs/core": "1.10.3", | ||
"@interactjs/utils": "1.10.3" | ||
}, | ||
"optionalDependencies": { | ||
"@interactjs/interact": "1.10.2" | ||
"@interactjs/interact": "1.10.3" | ||
}, | ||
@@ -12,0 +12,0 @@ "publishConfig": { |
@@ -1,3 +0,4 @@ | ||
import Interaction, { _ProxyMethods } from "../core/Interaction.js"; | ||
import { _ProxyMethods } from "../core/Interaction.js"; | ||
import * as rectUtils from "../utils/rect.js"; | ||
; | ||
_ProxyMethods.offsetBy = ''; | ||
@@ -24,7 +25,3 @@ export function addTotal(interaction) { | ||
const hadPending = applyPending(interaction); | ||
if (!hadPending) { | ||
return; | ||
} | ||
if (!hadPending) return; | ||
interaction.move({ | ||
@@ -31,0 +28,0 @@ offset: true |
@@ -1,2 +0,2 @@ | ||
import t,{_ProxyMethods as e}from"../core/Interaction.prod.js";import*as n from"../utils/rect.prod.js";e.offsetBy="";export function addTotal(t){t.pointerIsDown&&(f(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}function o({interaction:t}){applyPending(t)}export function applyPending(t){if(!(t=>!(!t.offset.pending.x&&!t.offset.pending.y))(t))return!1;const{pending:e}=t.offset;return f(t.coords.cur,e),f(t.coords.delta,e),n.addEdges(t.edges,t.rect,e),e.x=0,e.y=0,!0}function i({x:t,y:e}){this.offset.pending.x+=t,this.offset.pending.y+=e,this.offset.total.x+=t,this.offset.total.y+=e}function f({page:t,client:e},{x:n,y:o}){t.x+=n,t.y+=o,e.x+=n,e.y+=o}const s={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install(t){t.Interaction.prototype.offsetBy=i},listeners:{"interactions:new"({interaction:t}){t.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":({interaction:t})=>addTotal(t),"interactions:before-action-start":o,"interactions:before-action-move":o,"interactions:before-action-end"({interaction:t}){if(applyPending(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop"({interaction:t}){t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}};export default s; | ||
import{_ProxyMethods as t}from"../core/Interaction.prod.js";import*as e from"../utils/rect.prod.js";t.offsetBy="";export function addTotal(t){t.pointerIsDown&&(i(t.coords.cur,t.offset.total),t.offset.pending.x=0,t.offset.pending.y=0)}function n({interaction:t}){applyPending(t)}export function applyPending(t){if(!(t=>!(!t.offset.pending.x&&!t.offset.pending.y))(t))return!1;const{pending:n}=t.offset;return i(t.coords.cur,n),i(t.coords.delta,n),e.addEdges(t.edges,t.rect,n),n.x=0,n.y=0,!0}function o({x:t,y:e}){this.offset.pending.x+=t,this.offset.pending.y+=e,this.offset.total.x+=t,this.offset.total.y+=e}function i({page:t,client:e},{x:n,y:o}){t.x+=n,t.y+=o,e.x+=n,e.y+=o}const f={id:"offset",before:["modifiers","pointer-events","actions","inertia"],install(t){t.Interaction.prototype.offsetBy=o},listeners:{"interactions:new"({interaction:t}){t.offset={total:{x:0,y:0},pending:{x:0,y:0}}},"interactions:update-pointer":({interaction:t})=>addTotal(t),"interactions:before-action-start":n,"interactions:before-action-move":n,"interactions:before-action-end"({interaction:t}){if(applyPending(t))return t.move({offset:!0}),t.end(),!1},"interactions:stop"({interaction:t}){t.offset.total.x=0,t.offset.total.y=0,t.offset.pending.x=0,t.offset.pending.y=0}}};export default f; | ||
//# 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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16408
110