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

advanced-cropper

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

advanced-cropper - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

2

algorithms/resizeCoordinatesAlgorithm.js
import { __assign } from 'tslib';
import { ALL_DIRECTIONS, HORIZONTAL_DIRECTIONS, VERTICAL_DIRECTIONS } from '../constants.js';
import { isRoughlyEqual } from '../utils.js';
import { applyDirections, getIntersections, ratio, getBrokenRatio } from '../service/utils.js';
import { isRoughlyEqual } from '../utils.js';
import { moveCoordinatesAlgorithm } from './moveCoordinatesAlgorithm.js';

@@ -6,0 +6,0 @@

import { __assign } from 'tslib';
import { isNumber } from '../utils.js';
import { rotatePoint, getCenter, diff, resizeToSizeRestrictions, moveToPositionRestrictions, applyMove } from '../service/utils.js';
import { isNumber } from '../utils.js';
import { mergeSizeRestrictions } from '../service/sizeRestrictions.js';

@@ -5,0 +5,0 @@ import { isInitialized, getTransformedImageSize, getSizeRestrictions, getAspectRatio, getAreaSizeRestrictions, getPositionRestrictions, getAreaPositionRestrictions } from '../service/helpers.js';

import 'tslib';
import { isNumber, isRoughlyEqual } from '../utils.js';
import { applyMove, maxScale, positionToSizeRestrictions, minScale, applyScale, moveToPositionRestrictions, mergePositionRestrictions, toLimits, getCenter, inverseMove, fitToPositionRestrictions } from '../service/utils.js';
import { isNumber, isRoughlyEqual } from '../utils.js';
import { isInitialized, getSizeRestrictions, getPositionRestrictions, getAreaSizeRestrictions, getAreaPositionRestrictions } from '../service/helpers.js';

@@ -5,0 +5,0 @@ import { copyState } from '../state/copyState.js';

import { __assign } from 'tslib';
import { isNumeric } from './utils.js';
import { rotateSize, rotatePoint, getCenter } from './service/utils.js';
import { isNumeric } from './utils.js';
import { isInitialized } from './service/helpers.js';

@@ -5,0 +5,0 @@ import { approximateSize } from './service/approximateSize.js';

import { __assign } from 'tslib';
import { isFunction } from '../utils.js';
import { positionToSizeRestrictions, ratio } from '../service/utils.js';
import { isFunction } from '../utils.js';
import { getSizeRestrictions, getPositionRestrictions } from '../service/helpers.js';

@@ -5,0 +5,0 @@ import { approximateSize } from '../service/approximateSize.js';

import 'tslib';
import { isFunction } from '../utils.js';
import { ratio } from '../service/utils.js';
import { isFunction } from '../utils.js';
import { approximateSize } from '../service/approximateSize.js';

@@ -5,0 +5,0 @@

import { __assign } from 'tslib';
import { isFunction } from '../utils.js';
import { ratio } from '../service/utils.js';
import { isFunction } from '../utils.js';
import { mergeSizeRestrictions } from '../service/sizeRestrictions.js';

@@ -5,0 +5,0 @@ import { getAreaSizeRestrictions } from '../service/helpers.js';

{
"name": "advanced-cropper",
"version": "0.5.0",
"version": "0.5.1",
"description": "The core of the advanced cropper libraries family",

@@ -5,0 +5,0 @@ "author": "Norserium",

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

import { isLower, isGreater } from '../utils.js';
import { ratio, resizeToSizeRestrictions, sizeDistance } from './utils.js';
import { isLower, isGreater } from '../utils.js';

@@ -4,0 +4,0 @@ function validateSize(params) {

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

import { isFunction, emptyCoordinates, isNumeric } from '../utils.js';
import { rotateSize } from './utils.js';
import { isFunction, emptyCoordinates, isNumeric } from '../utils.js';
import { calculateAreaSizeRestrictions, calculateSizeRestrictions } from './sizeRestrictions.js';

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

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

export { applyDirections, applyMove, applyScale, coordinatesToPositionRestrictions, diff, fitToPositionRestrictions, fitToSizeRestrictions, getBrokenRatio, getCenter, getIntersections, inverseMove, maxScale, mergePositionRestrictions, minScale, moveToPositionRestrictions, positionToSizeRestrictions, ratio, resizeToSizeRestrictions, rotatePoint, rotateSize, sizeDistance, toLimits } from './utils.js';
export { applyDirections, applyMove, applyScale, calculateAspectRatio, coordinatesToPositionRestrictions, diff, fitToPositionRestrictions, fitToSizeRestrictions, getBrokenRatio, getCenter, getIntersections, inverseMove, maxScale, mergePositionRestrictions, minScale, moveToPositionRestrictions, positionToSizeRestrictions, ratio, resizeToSizeRestrictions, rotatePoint, rotateSize, sizeDistance, toLimits } from './utils.js';
export { calculateAreaSizeRestrictions, calculateSizeRestrictions, mergeSizeRestrictions, validateSizeRestrictions } from './sizeRestrictions.js';

@@ -3,0 +3,0 @@ export { getAreaPositionRestrictions, getAreaSizeRestrictions, getAspectRatio, getCoefficient, getDefaultCoordinates, getDefaultVisibleArea, getMinimumSize, getPositionRestrictions, getSizeRestrictions, getStencilCoordinates, getTransformedImageSize, isInitialized } from './helpers.js';

import { __assign } from 'tslib';
import { isFunction, isNumeric, parseNumber } from '../utils.js';
import { ratio } from './utils.js';
import { isFunction, isNumeric, parseNumber } from '../utils.js';
import { getPositionRestrictions } from './helpers.js';

@@ -5,0 +5,0 @@

@@ -40,2 +40,7 @@ import { AspectRatio, Coordinates, Diff, Intersections, Limits, MoveDirections, Point, PositionRestrictions, ResizeDirections, Size, SizeRestrictions } from "../types";

};
export { toLimits, diff, sizeDistance, getCenter, getIntersections, applyDirections, inverseMove, applyMove, applyScale, ratio, maxScale, minScale, getBrokenRatio, fitToSizeRestrictions, resizeToSizeRestrictions, rotateSize, rotatePoint, positionToSizeRestrictions, mergePositionRestrictions, fitToPositionRestrictions, moveToPositionRestrictions, coordinatesToPositionRestrictions };
declare function calculateAspectRatio(local?: AspectRatio, global?: {
minAspectRatio?: number;
maxAspectRatio?: number;
aspectRatio?: number;
}): Required<AspectRatio>;
export { toLimits, diff, sizeDistance, getCenter, getIntersections, applyDirections, inverseMove, applyMove, applyScale, ratio, maxScale, minScale, getBrokenRatio, fitToSizeRestrictions, resizeToSizeRestrictions, rotateSize, rotatePoint, positionToSizeRestrictions, mergePositionRestrictions, fitToPositionRestrictions, moveToPositionRestrictions, coordinatesToPositionRestrictions, calculateAspectRatio };
import { __assign } from 'tslib';
import { ALL_DIRECTIONS } from '../constants.js';
import { isUndefined } from '../utils.js';

@@ -266,3 +267,19 @@ function toLimits(object) {

}
function calculateAspectRatio(local, global) {
if (local === void 0) { local = {}; }
if (global === void 0) { global = {}; }
var minAspectRatio = global.minAspectRatio, maxAspectRatio = global.maxAspectRatio, aspectRatio = global.aspectRatio;
var minimum = local.minimum, maximum = local.maximum;
if (isUndefined(minimum)) {
minimum = !isUndefined(aspectRatio) ? aspectRatio : minAspectRatio;
}
if (isUndefined(maximum)) {
maximum = !isUndefined(aspectRatio) ? aspectRatio : maxAspectRatio;
}
return {
minimum: minimum || 0,
maximum: maximum || Infinity,
};
}
export { applyDirections, applyMove, applyScale, coordinatesToPositionRestrictions, diff, fitToPositionRestrictions, fitToSizeRestrictions, getBrokenRatio, getCenter, getIntersections, inverseMove, maxScale, mergePositionRestrictions, minScale, moveToPositionRestrictions, positionToSizeRestrictions, ratio, resizeToSizeRestrictions, rotatePoint, rotateSize, sizeDistance, toLimits };
export { applyDirections, applyMove, applyScale, calculateAspectRatio, coordinatesToPositionRestrictions, diff, fitToPositionRestrictions, fitToSizeRestrictions, getBrokenRatio, getCenter, getIntersections, inverseMove, maxScale, mergePositionRestrictions, minScale, moveToPositionRestrictions, positionToSizeRestrictions, ratio, resizeToSizeRestrictions, rotatePoint, rotateSize, sizeDistance, toLimits };
import { __assign } from 'tslib';
import { emptyCoordinates, isUndefined } from '../utils.js';
import { mergePositionRestrictions, coordinatesToPositionRestrictions } from '../service/utils.js';
import { emptyCoordinates, isUndefined } from '../utils.js';
import { getAspectRatio, getSizeRestrictions, getPositionRestrictions } from '../service/helpers.js';

@@ -5,0 +5,0 @@ import { copyState } from './copyState.js';

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