Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@interactjs/modifiers

Package Overview
Dependencies
Maintainers
2
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interactjs/modifiers - npm Package Compare versions

Comparing version 1.10.13 to 1.10.14

2

all.js

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

/* eslint-disable node/no-extraneous-import, import/no-unresolved */
/* eslint-disable n/no-extraneous-import, import/no-unresolved */
import aspectRatio from "./aspectRatio.js";

@@ -3,0 +3,0 @@ import avoid from "./avoid/avoid.js";

@@ -34,3 +34,6 @@ /**

xIsPrimaryAxis: boolean;
edgeSign: 1 | -1;
edgeSign: {
x: number;
y: number;
};
subModification: Modification;

@@ -37,0 +40,0 @@ }>;

@@ -55,6 +55,12 @@ /**

if (state.equalDelta) {
state.edgeSign = (linkedEdges.left ? 1 : -1) * (linkedEdges.top ? 1 : -1);
const sign = (linkedEdges.left ? 1 : -1) * (linkedEdges.top ? 1 : -1);
state.edgeSign = {
x: sign,
y: sign
};
} else {
const negativeSecondaryEdge = state.xIsPrimaryAxis ? linkedEdges.top : linkedEdges.left;
state.edgeSign = negativeSecondaryEdge ? -1 : 1;
state.edgeSign = {
x: linkedEdges.left ? -1 : 1,
y: linkedEdges.top ? -1 : 1
};
}

@@ -125,5 +131,5 @@

if (xIsPrimaryAxis) {
coords.y = startCoords.y + (coords.x - startCoords.x) * edgeSign;
coords.y = startCoords.y + (coords.x - startCoords.x) * edgeSign.y;
} else {
coords.x = startCoords.x + (coords.y - startCoords.y) * edgeSign;
coords.x = startCoords.x + (coords.y - startCoords.y) * edgeSign.x;
}

@@ -140,6 +146,6 @@ }

const newHeight = rect.width / ratio;
coords.y = startCoords.y + (newHeight - startRect.height) * edgeSign;
coords.y = startCoords.y + (newHeight - startRect.height) * edgeSign.y;
} else {
const newWidth = rect.height * ratio;
coords.x = startCoords.x + (newWidth - startRect.width) * edgeSign;
coords.x = startCoords.x + (newWidth - startRect.width) * edgeSign.x;
}

@@ -146,0 +152,0 @@ }

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

import t from"../utils/extend.prod.js";import{addEdges as e}from"../utils/rect.prod.js";import o from"./Modification.prod.js";import{makeModifier as r}from"./base.prod.js";const s={start(e){const{state:r,rect:s,edges:i,pageCoords:a}=e;let{ratio:n}=r.options;const{equalDelta:d,modifiers:l}=r.options;"preserve"===n&&(n=s.width/s.height),r.startCoords=t({},a),r.startRect=t({},s),r.ratio=n,r.equalDelta=d;const c=r.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(r.xIsPrimaryAxis=!(!i.left&&!i.right),r.equalDelta)r.edgeSign=(c.left?1:-1)*(c.top?1:-1);else{const t=r.xIsPrimaryAxis?c.top:c.left;r.edgeSign=t?-1:1}if(t(e.edges,c),!l||!l.length)return;const p=new o(e.interaction);p.copyFrom(e.interaction.modification),p.prepareStates(l),r.subModification=p,p.startAll({...e})},set(o){const{state:r,rect:s,coords:n}=o,d=t({},n),l=r.equalDelta?i:a;if(l(r,r.xIsPrimaryAxis,n,s),!r.subModification)return null;const c=t({},s);e(r.linkedEdges,c,{x:n.x-d.x,y:n.y-d.y});const p=r.subModification.setAll({...o,rect:c,edges:r.linkedEdges,pageCoords:n,prevCoords:n,prevRect:c}),{delta:f}=p;return p.changed&&(l(r,Math.abs(f.x)>Math.abs(f.y),p.coords,p.rect),t(n,p.coords)),p.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function i({startCoords:t,edgeSign:e},o,r){o?r.y=t.y+(r.x-t.x)*e:r.x=t.x+(r.y-t.y)*e}function a({startRect:t,startCoords:e,ratio:o,edgeSign:r},s,i,a){if(s){const s=a.width/o;i.y=e.y+(s-t.height)*r}else{const s=a.height*o;i.x=e.x+(s-t.width)*r}}export default r(s,"aspectRatio");export{s as aspectRatio};
import t from"../utils/extend.prod.js";import{addEdges as e}from"../utils/rect.prod.js";import o from"./Modification.prod.js";import{makeModifier as r}from"./base.prod.js";const s={start(e){const{state:r,rect:s,edges:i,pageCoords:a}=e;let{ratio:n}=r.options;const{equalDelta:d,modifiers:l}=r.options;"preserve"===n&&(n=s.width/s.height),r.startCoords=t({},a),r.startRect=t({},s),r.ratio=n,r.equalDelta=d;const c=r.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(r.xIsPrimaryAxis=!(!i.left&&!i.right),r.equalDelta){const t=(c.left?1:-1)*(c.top?1:-1);r.edgeSign={x:t,y:t}}else r.edgeSign={x:c.left?-1:1,y:c.top?-1:1};if(t(e.edges,c),!l||!l.length)return;const p=new o(e.interaction);p.copyFrom(e.interaction.modification),p.prepareStates(l),r.subModification=p,p.startAll({...e})},set(o){const{state:r,rect:s,coords:n}=o,d=t({},n),l=r.equalDelta?i:a;if(l(r,r.xIsPrimaryAxis,n,s),!r.subModification)return null;const c=t({},s);e(r.linkedEdges,c,{x:n.x-d.x,y:n.y-d.y});const p=r.subModification.setAll({...o,rect:c,edges:r.linkedEdges,pageCoords:n,prevCoords:n,prevRect:c}),{delta:f}=p;return p.changed&&(l(r,Math.abs(f.x)>Math.abs(f.y),p.coords,p.rect),t(n,p.coords)),p.eventProps},defaults:{ratio:"preserve",equalDelta:!1,modifiers:[],enabled:!1}};function i({startCoords:t,edgeSign:e},o,r){o?r.y=t.y+(r.x-t.x)*e.y:r.x=t.x+(r.y-t.y)*e.x}function a({startRect:t,startCoords:e,ratio:o,edgeSign:r},s,i,a){if(s){const s=a.width/o;i.y=e.y+(s-t.height)*r.y}else{const s=a.height*o;i.x=e.x+(s-t.width)*r.x}}export default r(s,"aspectRatio");export{s as aspectRatio};
//# sourceMappingURL=aspectRatio.prod.js.map
{
"name": "@interactjs/modifiers",
"version": "1.10.13",
"version": "1.10.14",
"main": "index",

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

"dependencies": {
"@interactjs/snappers": "1.10.13"
"@interactjs/snappers": "1.10.14"
},
"peerDependencies": {
"@interactjs/core": "1.10.13",
"@interactjs/utils": "1.10.13"
"@interactjs/core": "1.10.14",
"@interactjs/utils": "1.10.14"
},
"optionalDependencies": {
"@interactjs/interact": "1.10.13"
"@interactjs/interact": "1.10.14"
},

@@ -22,0 +22,0 @@ "publishConfig": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc