advanced-cropper
Advanced tools
Comparing version 0.10.2 to 0.10.3
@@ -86,12 +86,17 @@ import { __assign } from 'tslib'; | ||
var state = isFunction(modifier) ? modifier(previousData.state, settings) : modifier; | ||
var changed = ['coordinates', 'boundary', 'visibleArea', 'imageSize'].some(function (property) { | ||
var _a; | ||
return !deepCompare((_a = previousData.state) === null || _a === void 0 ? void 0 : _a[property], state === null || state === void 0 ? void 0 : state[property], state ? 1e-3 * getCoefficient(state) : 1e-3); | ||
}); | ||
var tolerance = state ? 1e-3 * getCoefficient(state) : 1e-3; | ||
var somethingChanged = !deepCompare(previousData.state, state, tolerance); | ||
var affectTransitionProperties = [ | ||
'coordinates', | ||
'boundary', | ||
'visibleArea', | ||
'imageSize', | ||
'transforms', | ||
].some(function (property) { var _a; return !deepCompare((_a = previousData.state) === null || _a === void 0 ? void 0 : _a[property], state === null || state === void 0 ? void 0 : state[property], tolerance); }); | ||
var currentData = previousData; | ||
if (changed) { | ||
if (transitions && changed) { | ||
if (somethingChanged) { | ||
if (transitions && affectTransitionProperties) { | ||
_this.disableTransitions(); | ||
} | ||
currentData = __assign(__assign({}, currentData), { state: copyState(state), transitions: transitions && changed }); | ||
currentData = __assign(__assign({}, currentData), { state: copyState(state), transitions: transitions && affectTransitionProperties }); | ||
_this.setData(currentData); | ||
@@ -98,0 +103,0 @@ runCallback(onChange, getInstance); |
@@ -90,12 +90,17 @@ 'use strict'; | ||
var state = index.isFunction(modifier) ? modifier(previousData.state, settings) : modifier; | ||
var changed = ['coordinates', 'boundary', 'visibleArea', 'imageSize'].some(function (property) { | ||
var _a; | ||
return !index.deepCompare((_a = previousData.state) === null || _a === void 0 ? void 0 : _a[property], state === null || state === void 0 ? void 0 : state[property], state ? 1e-3 * helpers.getCoefficient(state) : 1e-3); | ||
}); | ||
var tolerance = state ? 1e-3 * helpers.getCoefficient(state) : 1e-3; | ||
var somethingChanged = !index.deepCompare(previousData.state, state, tolerance); | ||
var affectTransitionProperties = [ | ||
'coordinates', | ||
'boundary', | ||
'visibleArea', | ||
'imageSize', | ||
'transforms', | ||
].some(function (property) { var _a; return !index.deepCompare((_a = previousData.state) === null || _a === void 0 ? void 0 : _a[property], state === null || state === void 0 ? void 0 : state[property], tolerance); }); | ||
var currentData = previousData; | ||
if (changed) { | ||
if (transitions && changed) { | ||
if (somethingChanged) { | ||
if (transitions && affectTransitionProperties) { | ||
_this.disableTransitions(); | ||
} | ||
currentData = tslib.__assign(tslib.__assign({}, currentData), { state: copyState.copyState(state), transitions: transitions && changed }); | ||
currentData = tslib.__assign(tslib.__assign({}, currentData), { state: copyState.copyState(state), transitions: transitions && affectTransitionProperties }); | ||
_this.setData(currentData); | ||
@@ -102,0 +107,0 @@ runCallback(onChange, getInstance); |
{ | ||
"name": "advanced-cropper", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"description": "The core of the advanced cropper libraries family", | ||
@@ -21,3 +21,3 @@ "author": "Norserium", | ||
"scripts": { | ||
"build": "npm run build:clean &&npm run build:library && npm run build:packages", | ||
"build": "npm run build:clean && npm run build:library && npm run build:packages", | ||
"build:clean": "node scripts/clean.js", | ||
@@ -32,3 +32,4 @@ "build:library": "cross-env NODE_ENV=production rollup -c", | ||
"lint:fix": "eslint --fix src/**/*.{js,vue}", | ||
"publish:dist": "npm publish dist" | ||
"prepare:dist": "npm run build", | ||
"publish:dist": "npm run prepare:dist && npm publish dist" | ||
}, | ||
@@ -35,0 +36,0 @@ "dependencies": { |
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
464230
9262