UNPKG

@atlaskit/editor-common

Version:

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

17 lines 467 B
const activeGuidelineStyle = guideline => ({ ...guideline, active: true, show: true }); export const getGuidelinesWithHighlights = (gap, maxGap, activeGuidelineKeys, guidelines) => { if (activeGuidelineKeys.length) { return guidelines.map(guideline => { if (activeGuidelineKeys.includes(guideline.key) && gap < maxGap) { return activeGuidelineStyle(guideline); } return guideline; }); } else { return guidelines; } };