@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
20 lines • 551 B
JavaScript
const activeGuidelineStyle = guideline => ({
...guideline,
active: true,
show: true
});
export const getGuidelinesWithHighlights = (gap, maxGap, activeGuidelineKeys, guidelines
// Ignored via go/ees005
// eslint-disable-next-line @typescript-eslint/max-params
) => {
if (activeGuidelineKeys.length) {
return guidelines.map(guideline => {
if (activeGuidelineKeys.includes(guideline.key) && gap < maxGap) {
return activeGuidelineStyle(guideline);
}
return guideline;
});
} else {
return guidelines;
}
};