Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var getSharedEventEmitter = function getSharedEventEmitter() {
if (!eventEmitter) {
eventEmitter = new EventEmitter();
['mousemove', 'mouseup', 'touchmove', 'touchend', 'touchcancel'].forEach(function (name) {
return window.addEventListener(name, function (e) {
return eventEmitter.emit([name, e]);
}, { passive: false });
});
}
return eventEmitter;
};
var isTrackedDependenciesChanged = function isTrackedDependenciesChanged(pluginHost, prevTrackedDependencies) {
var getGetterValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function (getterName) {
return pluginHost.get(getterName + 'Getter');
};
var trackedDependencies = Object.keys(prevTrackedDependencies).reduce(function (acc, getterName) {
return Object.assign(acc, defineProperty({}, getterName, getGetterValue(getterName)));
}, {});
return !shallowEqual(prevTrackedDependencies, trackedDependencies);
};
value: function shouldComponentUpdate(nextProps) {
var _getRenderingData = this.getRenderingData(nextProps),
params = _getRenderingData.params;
return !shallowEqual(params, this.params) || this.props.children !== nextProps.children;
}
}, {
function DragDropProviderCore() {
classCallCheck(this, DragDropProviderCore);
this.payload = null;
this.dragEmitter = new EventEmitter();
}
}).map(function (_ref2) {
var _ref3 = slicedToArray(_ref2, 2),
key = _ref3[0],
geometry = _ref3[1];
var animation = prevAnimations.get(key);
if (!animation) return [key, geometry];
var progress = easeOutCubic(getAnimationProgress(animation));
var left = (animation.left.to - animation.left.from) * progress + animation.left.from;
return [key, {
left: left,
right: geometry.right - (geometry.left - left)
}];
}));
return new Map([].concat(toConsumableArray(animations.entries())).map(function (_ref6) {
var _ref7 = slicedToArray(_ref6, 2),
key = _ref7[0],
animation = _ref7[1];
var progress = easeOutCubic(getAnimationProgress(animation));
var result = _extends({}, animation.style);
if (animation.left) {
var offset = (animation.left.to - animation.left.from) * (progress - 1);
result.transform = 'translateX(' + offset + 'px)';
}
return [key, result];
}));
};
function PluginHost$$1(props) {
classCallCheck(this, PluginHost$$1);
var _this = possibleConstructorReturn(this, (PluginHost$$1.__proto__ || Object.getPrototypeOf(PluginHost$$1)).call(this, props));
_this.host = new PluginHost();
return _this;
}