UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

12 lines 396 B
export var snapTo = function snapTo(target, points) { return points.length === 0 ? // extreme last case if there are no points somehow target : points.reduce(function (point, closest) { return Math.abs(closest - target) < Math.abs(point - target) ? closest : point; }); }; export var handleSides = ['left', 'right']; export var imageAlignmentMap = { left: 'start', right: 'end' };