Socket
Socket
Sign inDemoInstall

@interactjs/modifiers

Package Overview
Dependencies
4
Maintainers
2
Versions
136
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.10.26 to 1.10.27

2

all.js
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import aspectRatio from"./aspectRatio.prod.js";import restrictEdges from"./restrict/edges.prod.js";import restrict from"./restrict/pointer.prod.js";import restrictRect from"./restrict/rect.prod.js";import restrictSize from"./restrict/size.prod.js";import snapEdges from"./snap/edges.prod.js";import snap from"./snap/pointer.prod.js";import snapSize from"./snap/size.prod.js";import noop from"./noop.prod.js";import"../utils/extend.prod.js";import"../utils/rect.prod.js";import"./base.prod.js";import"./Modification.prod.js";import"../utils/clone.prod.js";import"../utils/is.prod.js";import"../utils/getOriginXY.prod.js";import"../utils/hypot.prod.js";var all={aspectRatio:aspectRatio,restrictEdges:restrictEdges,restrict:restrict,restrictRect:restrictRect,restrictSize:restrictSize,snapEdges:snapEdges,snap:snap,snapSize:snapSize,spring:noop,avoid:noop,transform:noop,rubberband:noop};export{all as default};
//# sourceMappingURL=all.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import extend from"../utils/extend.prod.js";import{addEdges}from"../utils/rect.prod.js";import{makeModifier}from"./base.prod.js";import{Modification}from"./Modification.prod.js";import"../utils/clone.prod.js";const aspectRatio={start(t){const{state:e,rect:o,edges:i,pageCoords:s}=t;let{ratio:a,enabled:r}=e.options;const{equalDelta:d,modifiers:n}=e.options;"preserve"===a&&(a=o.width/o.height),e.startCoords=extend({},s),e.startRect=extend({},o),e.ratio=a,e.equalDelta=d;const l=e.linkedEdges={top:i.top||i.left&&!i.bottom,left:i.left||i.top&&!i.right,bottom:i.bottom||i.right&&!i.top,right:i.right||i.bottom&&!i.left};if(e.xIsPrimaryAxis=!(!i.left&&!i.right),e.equalDelta){const t=(l.left?1:-1)*(l.top?1:-1);e.edgeSign={x:t,y:t}}else e.edgeSign={x:l.left?-1:1,y:l.top?-1:1};if(!1!==r&&extend(i,l),null==n||!n.length)return;const c=new Modification(t.interaction);c.copyFrom(t.interaction.modification),c.prepareStates(n),e.subModification=c,c.startAll({...t})},set(t){const{state:e,rect:o,coords:i}=t,{linkedEdges:s}=e,a=extend({},i),r=e.equalDelta?setEqualDelta:setRatio;if(extend(t.edges,s),r(e,e.xIsPrimaryAxis,i,o),!e.subModification)return null;const d=extend({},o);addEdges(s,d,{x:i.x-a.x,y:i.y-a.y});const n=e.subModification.setAll({...t,rect:d,edges:s,pageCoords:i,prevCoords:i,prevRect:d}),{delta:l}=n;if(n.changed){r(e,Math.abs(l.x)>Math.abs(l.y),n.coords,n.rect),extend(i,n.coords)}return n.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function setEqualDelta(t,e,o){let{startCoords:i,edgeSign:s}=t;e?o.y=i.y+(o.x-i.x)*s.y:o.x=i.x+(o.y-i.y)*s.x}function setRatio(t,e,o,i){let{startRect:s,startCoords:a,ratio:r,edgeSign:d}=t;if(e){const t=i.width/r;o.y=a.y+(t-s.height)*d.y}else{const t=i.height*r;o.x=a.x+(t-s.width)*d.x}}var aspectRatio$1=makeModifier(aspectRatio,"aspectRatio");export{aspectRatio,aspectRatio$1 as default};
//# sourceMappingURL=aspectRatio.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=avoid.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=avoid.stub.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import{Modification}from"./Modification.prod.js";import"../utils/clone.prod.js";import"../utils/extend.prod.js";import"../utils/rect.prod.js";function makeModifier(t,e){const{defaults:i}=t,o={start:t.start,set:t.set,beforeEnd:t.beforeEnd,stop:t.stop},n=t=>{const n=t||{};n.enabled=!1!==n.enabled;for(const t in i)t in n||(n[t]=i[t]);const r={options:n,methods:o,name:e,enable(){return n.enabled=!0,r},disable(){return n.enabled=!1,r}};return r};return e&&"string"==typeof e&&(n._defaults=i,n._methods=o),n}function addEventModifiers(t){let{iEvent:e,interaction:i}=t;const o=i.modification.result;o&&(e.modifiers=o.eventProps)}const modifiersBase={id:"modifiers/base",before:["actions"],install(t){t.defaults.perAction.modifiers=[]},listeners:{"interactions:new"(t){let{interaction:e}=t;e.modification=new Modification(e)},"interactions:before-action-start"(t){const{interaction:e}=t,i=t.interaction.modification;i.start(t,e.coords.start.page),e.edges=i.edges,i.applyToInteraction(t)},"interactions:before-action-move"(t){const{interaction:e}=t,{modification:i}=e,o=i.setAndApply(t);return e.edges=i.edges,o},"interactions:before-action-end"(t){const{interaction:e}=t,{modification:i}=e,o=i.beforeEnd(t);return e.edges=i.startEdges,o},"interactions:action-start":addEventModifiers,"interactions:action-move":addEventModifiers,"interactions:action-end":addEventModifiers,"interactions:after-action-start"(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:after-action-move"(t){return t.interaction.modification.restoreInteractionCoords(t)},"interactions:stop"(t){return t.interaction.modification.stop(t)}}};export{addEventModifiers,modifiersBase as default,makeModifier};
//# sourceMappingURL=base.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import modifiers from"./plugin.prod.js";import interact from"../interact/index.prod.js";import"../snappers/plugin.prod.js";import"./all.prod.js";import"./aspectRatio.prod.js";import"../utils/extend.prod.js";import"../utils/rect.prod.js";import"./base.prod.js";import"./Modification.prod.js";import"../utils/clone.prod.js";import"./restrict/edges.prod.js";import"./restrict/pointer.prod.js";import"../utils/is.prod.js";import"./restrict/rect.prod.js";import"./restrict/size.prod.js";import"./snap/edges.prod.js";import"./snap/size.prod.js";import"./snap/pointer.prod.js";import"../utils/getOriginXY.prod.js";import"../utils/hypot.prod.js";import"./noop.prod.js";interact.use(modifiers);
//# sourceMappingURL=index.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import clone from"../utils/clone.prod.js";import extend from"../utils/extend.prod.js";import*as rectUtils from"../utils/rect.prod.js";class Modification{constructor(t){this.states=[],this.startOffset={left:0,right:0,top:0,bottom:0},this.startDelta=void 0,this.result=void 0,this.endResult=void 0,this.startEdges=void 0,this.edges=void 0,this.interaction=void 0,this.interaction=t,this.result=createResult(),this.edges={left:!1,right:!1,top:!1,bottom:!1}}start(t,e){let{phase:s}=t;const{interaction:o}=this,r=getModifierList(o);this.prepareStates(r),this.startEdges=extend({},o.edges),this.edges=extend({},this.startEdges),this.startOffset=getRectOffset(o.rect,e),this.startDelta={x:0,y:0};const i=this.fillArg({phase:s,pageCoords:e,preEnd:!1});this.result=createResult(),this.startAll(i);return this.result=this.setAll(i)}fillArg(t){const{interaction:e}=this;return t.interaction=e,t.interactable=e.interactable,t.element=e.element,t.rect||(t.rect=e.rect),t.edges||(t.edges=this.startEdges),t.startOffset=this.startOffset,t}startAll(t){for(const e of this.states)e.methods.start&&(t.state=e,e.methods.start(t))}setAll(t){const{phase:e,preEnd:s,skipModifiers:o,rect:r,edges:i}=t;t.coords=extend({},t.pageCoords),t.rect=extend({},r),t.edges=extend({},i);const n=o?this.states.slice(o):this.states,a=createResult(t.coords,t.rect);for(const o of n){var d;const{options:r}=o,i=extend({},t.coords);let n=null;null!=(d=o.methods)&&d.set&&this.shouldDo(r,s,e)&&(t.state=o,n=o.methods.set(t),rectUtils.addEdges(t.edges,t.rect,{x:t.coords.x-i.x,y:t.coords.y-i.y})),a.eventProps.push(n)}extend(this.edges,t.edges),a.delta.x=t.coords.x-t.pageCoords.x,a.delta.y=t.coords.y-t.pageCoords.y,a.rectDelta.left=t.rect.left-r.left,a.rectDelta.right=t.rect.right-r.right,a.rectDelta.top=t.rect.top-r.top,a.rectDelta.bottom=t.rect.bottom-r.bottom;const c=this.result.coords,l=this.result.rect;if(c&&l){const t=a.rect.left!==l.left||a.rect.right!==l.right||a.rect.top!==l.top||a.rect.bottom!==l.bottom;a.changed=t||c.x!==a.coords.x||c.y!==a.coords.y}return a}applyToInteraction(t){const{interaction:e}=this,{phase:s}=t,o=e.coords.cur,r=e.coords.start,{result:i,startDelta:n}=this,a=i.delta;"start"===s&&extend(this.startDelta,i.delta);for(const[t,e]of[[r,n],[o,a]])t.page.x+=e.x,t.page.y+=e.y,t.client.x+=e.x,t.client.y+=e.y;const{rectDelta:d}=this.result,c=t.rect||e.rect;c.left+=d.left,c.right+=d.right,c.top+=d.top,c.bottom+=d.bottom,c.width=c.right-c.left,c.height=c.bottom-c.top}setAndApply(t){const{interaction:e}=this,{phase:s,preEnd:o,skipModifiers:r}=t,i=this.setAll(this.fillArg({preEnd:o,phase:s,pageCoords:t.modifiedCoords||e.coords.cur.page}));if(this.result=i,!i.changed&&(!r||r<this.states.length)&&e.interacting())return!1;if(t.modifiedCoords){const{page:s}=e.coords.cur,o={x:t.modifiedCoords.x-s.x,y:t.modifiedCoords.y-s.y};i.coords.x+=o.x,i.coords.y+=o.y,i.delta.x+=o.x,i.delta.y+=o.y}this.applyToInteraction(t)}beforeEnd(t){const{interaction:e,event:s}=t,o=this.states;if(!o||!o.length)return;let r=!1;for(const e of o){t.state=e;const{options:s,methods:o}=e,i=o.beforeEnd&&o.beforeEnd(t);if(i)return this.endResult=i,!1;r=r||!r&&this.shouldDo(s,!0,t.phase,!0)}r&&e.move({event:s,preEnd:!0})}stop(t){const{interaction:e}=t;if(!this.states||!this.states.length)return;const s=extend({states:this.states,interactable:e.interactable,element:e.element,rect:null},t);this.fillArg(s);for(const t of this.states)s.state=t,t.methods.stop&&t.methods.stop(s);this.states=null,this.endResult=null}prepareStates(t){this.states=[];for(let e=0;e<t.length;e++){const{options:s,methods:o,name:r}=t[e];this.states.push({options:s,methods:o,index:e,name:r})}return this.states}restoreInteractionCoords(t){let{interaction:{coords:e,rect:s,modification:o}}=t;if(!o.result)return;const{startDelta:r}=o,{delta:i,rectDelta:n}=o.result,a=[[e.start,r],[e.cur,i]];for(const[t,e]of a)t.page.x-=e.x,t.page.y-=e.y,t.client.x-=e.x,t.client.y-=e.y;s.left-=n.left,s.right-=n.right,s.top-=n.top,s.bottom-=n.bottom}shouldDo(t,e,s,o){return!(!t||!1===t.enabled||o&&!t.endOnly||t.endOnly&&!e||"start"===s&&!t.setStart)}copyFrom(t){this.startOffset=t.startOffset,this.startDelta=t.startDelta,this.startEdges=t.startEdges,this.edges=t.edges,this.states=t.states.map((t=>clone(t))),this.result=createResult(extend({},t.result.coords),extend({},t.result.rect))}destroy(){for(const t in this)this[t]=null}}function createResult(t,e){return{rect:e,coords:t,delta:{x:0,y:0},rectDelta:{left:0,right:0,top:0,bottom:0},eventProps:[],changed:!0}}function getModifierList(t){const e=t.interactable.options[t.prepared.name],s=e.modifiers;return s&&s.length?s:["snap","snapSize","snapEdges","restrict","restrictEdges","restrictSize"].map((t=>{const s=e[t];return s&&s.enabled&&{options:s,methods:s._methods}})).filter((t=>!!t))}function getRectOffset(t,e){return t?{left:e.x-t.left,top:e.y-t.top,right:t.right-e.x,bottom:t.bottom-e.y}:{left:0,top:0,right:0,bottom:0}}export{Modification,getRectOffset};
//# sourceMappingURL=Modification.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
const noop=()=>{};noop._defaults={};export{noop as default};
//# sourceMappingURL=noop.prod.js.map
{
"name": "@interactjs/modifiers",
"version": "1.10.26",
"version": "1.10.27",
"main": "index",

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

"dependencies": {
"@interactjs/snappers": "1.10.26"
"@interactjs/snappers": "1.10.27"
},
"peerDependencies": {
"@interactjs/core": "1.10.26",
"@interactjs/utils": "1.10.26"
"@interactjs/core": "1.10.27",
"@interactjs/utils": "1.10.27"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.26"
"@interactjs/interact": "1.10.27"
},

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

"license": "MIT",
"gitHead": "6e7a136f"
"gitHead": "3ace1cad"
}
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import snappers from"../snappers/plugin.prod.js";import all from"./all.prod.js";import modifiersBase from"./base.prod.js";import"./aspectRatio.prod.js";import"../utils/extend.prod.js";import"../utils/rect.prod.js";import"./Modification.prod.js";import"../utils/clone.prod.js";import"./restrict/edges.prod.js";import"./restrict/pointer.prod.js";import"../utils/is.prod.js";import"./restrict/rect.prod.js";import"./restrict/size.prod.js";import"./snap/edges.prod.js";import"./snap/size.prod.js";import"./snap/pointer.prod.js";import"../utils/getOriginXY.prod.js";import"../utils/hypot.prod.js";import"./noop.prod.js";const modifiers={id:"modifiers",install(r){const{interactStatic:o}=r;r.usePlugin(modifiersBase),r.usePlugin(snappers),o.modifiers=all;for(const o in all){const{_defaults:s,_methods:i}=all[o];s._methods=i,r.defaults.perAction[o]=s}}};export{modifiers as default};
//# sourceMappingURL=plugin.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import extend from"../../utils/extend.prod.js";import*as rectUtils from"../../utils/rect.prod.js";import{makeModifier}from"../base.prod.js";import{getRestrictionRect}from"./pointer.prod.js";import"../Modification.prod.js";import"../../utils/clone.prod.js";import"../../utils/is.prod.js";const noInner={top:1/0,left:1/0,bottom:-1/0,right:-1/0},noOuter={top:-1/0,left:-1/0,bottom:1/0,right:1/0};function start(t){let{interaction:o,startOffset:e,state:r}=t;const{options:i}=r;let s;if(i){const t=getRestrictionRect(i.offset,o,o.coords.start.page);s=rectUtils.rectToXY(t)}s=s||{x:0,y:0},r.offset={top:s.y+e.top,left:s.x+e.left,bottom:s.y-e.bottom,right:s.x-e.right}}function set(t){let{coords:o,edges:e,interaction:r,state:i}=t;const{offset:s,options:n}=i;if(!e)return;const f=extend({},o),c=getRestrictionRect(n.inner,r,f)||{},a=getRestrictionRect(n.outer,r,f)||{};fixRect(c,noInner),fixRect(a,noOuter),e.top?o.y=Math.min(Math.max(a.top+s.top,f.y),c.top+s.top):e.bottom&&(o.y=Math.max(Math.min(a.bottom+s.bottom,f.y),c.bottom+s.bottom)),e.left?o.x=Math.min(Math.max(a.left+s.left,f.x),c.left+s.left):e.right&&(o.x=Math.max(Math.min(a.right+s.right,f.x),c.right+s.right))}function fixRect(t,o){for(const e of["top","left","bottom","right"])e in t||(t[e]=o[e]);return t}const defaults={inner:null,outer:null,offset:null,endOnly:!1,enabled:!1},restrictEdges={noInner:noInner,noOuter:noOuter,start:start,set:set,defaults:defaults};var restrictEdges$1=makeModifier(restrictEdges,"restrictEdges");export{restrictEdges$1 as default,restrictEdges};
//# sourceMappingURL=edges.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import extend from"../../utils/extend.prod.js";import is from"../../utils/is.prod.js";import*as rectUtils from"../../utils/rect.prod.js";import{makeModifier}from"../base.prod.js";import"../Modification.prod.js";import"../../utils/clone.prod.js";function start(t){let{rect:e,startOffset:o,state:i,interaction:r,pageCoords:s}=t;const{options:n}=i,{elementRect:c}=n,l=extend({left:0,top:0,right:0,bottom:0},n.offset||{});if(e&&c){const t=getRestrictionRect(n.restriction,r,s);if(t){const o=t.right-t.left-e.width,i=t.bottom-t.top-e.height;o<0&&(l.left+=o,l.right+=o),i<0&&(l.top+=i,l.bottom+=i)}l.left+=o.left-e.width*c.left,l.top+=o.top-e.height*c.top,l.right+=o.right-e.width*(1-c.right),l.bottom+=o.bottom-e.height*(1-c.bottom)}i.offset=l}function set(t){let{coords:e,interaction:o,state:i}=t;const{options:r,offset:s}=i,n=getRestrictionRect(r.restriction,o,e);if(!n)return;const c=rectUtils.xywhToTlbr(n);e.x=Math.max(Math.min(c.right-s.right,e.x),c.left+s.left),e.y=Math.max(Math.min(c.bottom-s.bottom,e.y),c.top+s.top)}function getRestrictionRect(t,e,o){return is.func(t)?rectUtils.resolveRectLike(t,e.interactable,e.element,[o.x,o.y,e]):rectUtils.resolveRectLike(t,e.interactable,e.element)}const defaults={restriction:null,elementRect:null,offset:null,endOnly:!1,enabled:!1},restrict={start:start,set:set,defaults:defaults};var restrict$1=makeModifier(restrict,"restrict");export{restrict$1 as default,getRestrictionRect,restrict};
//# sourceMappingURL=pointer.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import extend from"../../utils/extend.prod.js";import{makeModifier}from"../base.prod.js";import{restrict}from"./pointer.prod.js";import"../Modification.prod.js";import"../../utils/clone.prod.js";import"../../utils/rect.prod.js";import"../../utils/is.prod.js";const defaults=extend({get elementRect(){return{top:0,left:0,bottom:1,right:1}},set elementRect(t){}},restrict.defaults),restrictRect={start:restrict.start,set:restrict.set,defaults:defaults};var restrictRect$1=makeModifier(restrictRect,"restrictRect");export{restrictRect$1 as default,restrictRect};
//# sourceMappingURL=rect.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import extend from"../../utils/extend.prod.js";import*as rectUtils from"../../utils/rect.prod.js";import{makeModifier}from"../base.prod.js";import{restrictEdges}from"./edges.prod.js";import{getRestrictionRect}from"./pointer.prod.js";import"../Modification.prod.js";import"../../utils/clone.prod.js";import"../../utils/is.prod.js";const noMin={width:-1/0,height:-1/0},noMax={width:1/0,height:1/0};function start(t){return restrictEdges.start(t)}function set(t){const{interaction:e,state:o,rect:i,edges:r}=t,{options:s}=o;if(!r)return;const n=rectUtils.tlbrToXywh(getRestrictionRect(s.min,e,t.coords))||noMin,d=rectUtils.tlbrToXywh(getRestrictionRect(s.max,e,t.coords))||noMax;o.options={endOnly:s.endOnly,inner:extend({},restrictEdges.noInner),outer:extend({},restrictEdges.noOuter)},r.top?(o.options.inner.top=i.bottom-n.height,o.options.outer.top=i.bottom-d.height):r.bottom&&(o.options.inner.bottom=i.top+n.height,o.options.outer.bottom=i.top+d.height),r.left?(o.options.inner.left=i.right-n.width,o.options.outer.left=i.right-d.width):r.right&&(o.options.inner.right=i.left+n.width,o.options.outer.right=i.left+d.width),restrictEdges.set(t),o.options=s}const defaults={min:null,max:null,endOnly:!1,enabled:!1},restrictSize={start:start,set:set,defaults:defaults};var restrictSize$1=makeModifier(restrictSize,"restrictSize");export{restrictSize$1 as default,restrictSize};
//# sourceMappingURL=size.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=rubberband.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=rubberband.stub.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import clone from"../../utils/clone.prod.js";import extend from"../../utils/extend.prod.js";import{makeModifier}from"../base.prod.js";import{snapSize}from"./size.prod.js";import"../Modification.prod.js";import"../../utils/rect.prod.js";import"../../utils/is.prod.js";import"./pointer.prod.js";import"../../utils/getOriginXY.prod.js";import"../../utils/hypot.prod.js";function start(t){const{edges:s}=t;return s?(t.state.targetFields=t.state.targetFields||[[s.left?"left":"right",s.top?"top":"bottom"]],snapSize.start(t)):null}const snapEdges={start:start,set:snapSize.set,defaults:extend(clone(snapSize.defaults),{targets:void 0,range:void 0,offset:{x:0,y:0}})};var snapEdges$1=makeModifier(snapEdges,"snapEdges");export{snapEdges$1 as default,snapEdges};
//# sourceMappingURL=edges.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import extend from"../../utils/extend.prod.js";import getOriginXY from"../../utils/getOriginXY.prod.js";import hypot from"../../utils/hypot.prod.js";import is from"../../utils/is.prod.js";import{resolveRectLike,rectToXY}from"../../utils/rect.prod.js";import{makeModifier}from"../base.prod.js";import"../Modification.prod.js";import"../../utils/clone.prod.js";function start(t){const{interaction:e,interactable:n,element:r,rect:i,state:o,startOffset:s}=t,{options:a}=o,l=a.offsetWithOrigin?getOrigin(t):{x:0,y:0};let g;if("startCoords"===a.offset)g={x:e.coords.start.page.x,y:e.coords.start.page.y};else{const t=resolveRectLike(a.offset,n,r,[e]);g=rectToXY(t)||{x:0,y:0},g.x+=l.x,g.y+=l.y}const{relativePoints:f}=a;o.offsets=i&&f&&f.length?f.map(((t,e)=>({index:e,relativePoint:t,x:s.left-i.width*t.x+g.x,y:s.top-i.height*t.y+g.y}))):[{index:0,relativePoint:null,x:g.x,y:g.y}]}function set(t){const{interaction:e,coords:n,state:r}=t,{options:i,offsets:o}=r,s=getOriginXY(e.interactable,e.element,e.prepared.name),a=extend({},n),l=[];i.offsetWithOrigin||(a.x-=s.x,a.y-=s.y);for(const t of o){const n=a.x-t.x,r=a.y-t.y;for(let o=0,s=i.targets.length;o<s;o++){const s=i.targets[o];let a;a=is.func(s)?s(n,r,e._proxy,t,o):s,a&&l.push({x:(is.number(a.x)?a.x:n)+t.x,y:(is.number(a.y)?a.y:r)+t.y,range:is.number(a.range)?a.range:i.range,source:s,index:o,offset:t})}}const g={target:null,inRange:!1,distance:0,range:0,delta:{x:0,y:0}};for(const t of l){const e=t.range,n=t.x-a.x,r=t.y-a.y,i=hypot(n,r);let o=i<=e;e===1/0&&g.inRange&&g.range!==1/0&&(o=!1),g.target&&!(o?g.inRange&&e!==1/0?i/e<g.distance/g.range:e===1/0&&g.range!==1/0||i<g.distance:!g.inRange&&i<g.distance)||(g.target=t,g.distance=i,g.range=e,g.inRange=o,g.delta.x=n,g.delta.y=r)}return g.inRange&&(n.x=g.target.x,n.y=g.target.y),r.closest=g,g}function getOrigin(t){const{element:e}=t.interaction;return rectToXY(resolveRectLike(t.state.options.origin,null,null,[e]))||getOriginXY(t.interactable,e,t.interaction.prepared.name)}const defaults={range:1/0,targets:null,offset:null,offsetWithOrigin:!0,origin:null,relativePoints:null,endOnly:!1,enabled:!1},snap={start:start,set:set,defaults:defaults};var snap$1=makeModifier(snap,"snap");export{snap$1 as default,snap};
//# sourceMappingURL=pointer.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
import extend from"../../utils/extend.prod.js";import is from"../../utils/is.prod.js";import{makeModifier}from"../base.prod.js";import{snap}from"./pointer.prod.js";import"../Modification.prod.js";import"../../utils/clone.prod.js";import"../../utils/rect.prod.js";import"../../utils/getOriginXY.prod.js";import"../../utils/hypot.prod.js";function start(t){const{state:s,edges:e}=t,{options:o}=s;if(!e)return null;t.state={options:{targets:null,relativePoints:[{x:e.left?0:1,y:e.top?0:1}],offset:o.offset||"self",origin:{x:0,y:0},range:o.range}},s.targetFields=s.targetFields||[["width","height"],["x","y"]],snap.start(t),s.offsets=t.state.offsets,t.state=s}function set(t){const{interaction:s,state:e,coords:o}=t,{options:i,offsets:r}=e,n={x:o.x-r[0].x,y:o.y-r[0].y};e.options=extend({},i),e.options.targets=[];for(const t of i.targets||[]){let o;if(o=is.func(t)?t(n.x,n.y,s):t,o){for(const[t,s]of e.targetFields)if(t in o||s in o){o.x=o[t],o.y=o[s];break}e.options.targets.push(o)}}const a=snap.set(t);return e.options=i,a}const defaults={range:1/0,targets:null,offset:null,endOnly:!1,enabled:!1},snapSize={start:start,set:set,defaults:defaults};var snapSize$1=makeModifier(snapSize,"snapSize");export{snapSize$1 as default,snapSize};
//# sourceMappingURL=size.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=spring.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=spring.stub.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=transform.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
export{default}from"../noop.prod.js";
//# sourceMappingURL=transform.stub.prod.js.map
/**
* interact.js 1.10.26
* interact.js 1.10.27
*

@@ -4,0 +4,0 @@ * Copyright (c) 2012-present Taye Adeyemi <dev@taye.me>

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

/* interact.js 1.10.26 | https://raw.github.com/taye/interact.js/main/LICENSE */
/* interact.js 1.10.27 | https://raw.github.com/taye/interact.js/main/LICENSE */
//# sourceMappingURL=types.prod.js.map
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